I'm just learning Haskell and I was trying to write a simple program to eliminate the first n characters from a String. This is what I got:
cutString :: (Num n, String str) => n -> str -> str
cutString n str = case n of
0 -> tail str
n -> cutString (n-1) (tail str)
GHC gives me this error though, and I can't figure out why:
`String' is applied to too many type arguments
In the type signature for `cutString':
cutString :: (Num n, String str) => n -> str -> str
cutString = GHC.List.drop- viviancutStringwould also requireEqin the context since it uses a literal pattern match. - Ben Millwood