F# 是否有办法打印表达式的类型?
Does F# have a way to print the type of an expression?
我正在寻找 ghci
的道德等价物:
Prelude> :t 1 + 2
1 + 2 :: Num a => a
在 F# Interactive 中,每次执行后都会得到:
> (+);;
val it : (int -> int -> int) = <fun:it@1>
> 1 + 2;;
val it : int = 3
> printfn "Hi";;
Hi
val it : unit = ()
我正在寻找 ghci
的道德等价物:
Prelude> :t 1 + 2
1 + 2 :: Num a => a
在 F# Interactive 中,每次执行后都会得到:
> (+);;
val it : (int -> int -> int) = <fun:it@1>
> 1 + 2;;
val it : int = 3
> printfn "Hi";;
Hi
val it : unit = ()