3 ms·
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 ) Definate
by Datsundere 13y ago
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.
- ben0x539 13y agoblah :: 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.