我只是在学习Haskell,并且试图编写一个简单的程序来消除。中的前n个字符String。这就是我得到的:
cutString :: (Num n, String str) => n -> str -> str
cutString n str = case n of
0 -> tail str
n -> cutString (n-1) (tail str)
GHC却给了我这个错误,我不知道为什么:
`String' is applied to too many type arguments
In the type signature for `cutString':
cutString :: (Num n, String str) => n -> str -> str
森栏
慕桂英546537
天涯尽头无女友