Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

haskell "invalid type signature error"

Tags:

haskell

I defined the function NewLine

NewLine :: String -> String
NewLine (x:xs)=if (x=='\n') then xs else NewLine xs

It gives me an invalid type signature error, but I don't see why.

like image 239
Jay Avatar asked Oct 01 '10 18:10

Jay


1 Answers

Functions can't begin with uppercase letters in Haskell. Uppercase letters denote a data constructor.

like image 162
mipadi Avatar answered Sep 28 '22 04:09

mipadi