简单的问题,这个有什么问题吗?
(get) :: [a] -> Int -> a -- <- line 21
(x:xs) get 0 = x
(x:xs) get (n+1) = xs get n
当我尝试加载包含该代码的文件时,ghci会出现这个错误。
Prelude> :load ch6.hs
[1 of 1] Compiling Main ( ch6.hs, interpreted )
ch6.hs:21:0: Invalid type signature
Failed, modules loaded: none.
我试图创建一个中缀运算符。