Hacker News new | past | comments | ask | show | jobs | submit login

I got stuck in the first exercise #2. I'm trying to read 2 args, cast them to int and add them.

putStrLn( read (args!!0)::Int + read(args!!1)::Int )

Definately need to do learnyouahaskell before reading this tutorial which is what I'm about to do. The link to how read is implemented doens't make any sense to me (coming from a procedural language background).

I suggest adding answers to the exercises or asking questions that are self contained in the tutorial.




blah :: Type + blah :: Type is gonna get parsed as blah :: (Type + blah :: Type), just add more parens there. Also, you need to convert the result back to a string before calling putStrLn.




Consider applying for YC's Spring batch! Applications are open till Feb 11.

Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: