在GHCi版本8.6.3(https://repl.it/languages/haskell)中,我想知道如何找出运算符“ +”的类型。我想看看它的类型是num a, b,c => a -> b -> c还是num a, b,c => (a,b) -> c。
但是我找不到它的类型。它还以未知方式影响下一个表达式。为什么我失败了,我该怎么办?
:type +
:type not
<interactive>:1:1: error: parse error on input ‘+’
:type not
not :: Bool -> Bool
=> "12"
Run Code Online (Sandbox Code Playgroud)
这条路:
> :type (+)
(+) :: Num a => a -> a -> a
Run Code Online (Sandbox Code Playgroud)
并且
> :t (+) 4
(+) 4 :: Num a => a -> a
> :t (+) 4 3
(+) 4 3 :: Num a => a
Run Code Online (Sandbox Code Playgroud)