PDA

View Full Version : I don't know why Haskell won't compile this


Shmen
03-20-2004, 01:43 AM
I'm not sure why Haskell doesn't compile this sections of code.

Could some help me make sense of the logic to make this work

the error haskell gives is " parse error on input = " for the code below


engTeenNumbers:: Int -> String
engTeenNumbers number
| (head number) == 1 && (tail number) >= 4 = english number ++ "teen"

Smerdyakov
03-20-2004, 09:43 PM
You can't generally make new definitions directly in an interactive Haskell environment. Instead, save them in a file and load them in the way specific to the environment you are using.

jemfinch
03-23-2004, 07:15 PM
You also can't take the head or tail of an Int.

Jeremy

Shmen
05-17-2004, 08:42 AM
Thanks Jermey
=)