- 01
- 02
- 03
- 04
- 05
- 06
- 07
- 08
- 09
- 10
- 11
- 12
- 13
- 14
- 15
- 16
- 17
- 18
- 19
- 20
- 21
- 22
- 23
- 24
open System
let inline un激辛カレー<'a> (f:obj) (tuple:obj) =
match tuple with
| :? ('a * 'a * 'a) as tuple ->
let a , b , c = tuple
match f with
| :? ('a -> 'a -> 'a -> 'a) as f -> f a b c
| _ -> failwith "type did not matched! 3"
| :? ('a * 'a) as tuple ->
let a,b = tuple
match f with
| :? ('a -> 'a -> 'a) as f -> f a b
| _ -> failwith "type did not matched! 2"
| :? 'a as tuple ->
let a = tuple
match f with
| :? ('a -> 'a) as f -> f a
| _ -> failwith "type did not matched! 1"
| _ -> failwith "type did not matched! tuple"
printfn"%A"<| un激辛カレー<float> (fun x->x + 1.) 2.
printfn"%A"<| un激辛カレー<int> (+) (10,10)
printfn"%A"<| un激辛カレー<string> (fun (x:string) y z->x + y + z) ("How ","are ","you?")
HaskellGovno 03.05.2014 04:19 # 0
wvxvw 03.05.2014 09:03 # +2
HaskellGovno 03.05.2014 10:56 # 0
WGH 03.05.2014 15:55 # +2
Тонко.
laMer007 03.05.2014 16:07 # 0