Haskell No Parse

时间:2016-04-04 16:46:10

标签: haskell

I'm getting a "no parse" error when I test these functions (with input of ordinary integers) and I don't know why. What am I doing wrong here?

lastLetter :: String -> String
lastLetter (l:[]) = [l]
lastLetter (l:ls) = lastLetter(ls)

lastDigit :: Integer -> Integer
lastDigit = read . lastLetter . show

0 个答案:

没有答案