[英]haskell “invalid type signature error”
I defined the function NewLine
我定义了函数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. 它给了我一个无效的类型签名错误,但我不明白为什么。
Functions can't begin with uppercase letters in Haskell. 函数不能以Haskell中的大写字母开头。 Uppercase letters denote a data constructor. 大写字母表示数据构造函数。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.