我刚刚学习 Haskell,我正在尝试编写一个简单的程序来消除 a 中的前 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