
30 Nov
2005
30 Nov
'05
7:31 p.m.
Because the load function interacts with the outside world, its type involves the IO monad. You can get the result you're looking for using something like liftM parse load liftM takes an ordinary function and applies it to a monadic value (here the monad is IO), returning another monadic value. Or, if you're using ghci, you could just do s <- load parse s This is because ghci executes "in the IO monad" (maybe there are some details of this I'm missing, but that's how I think of it anyway. BTW, your load function could be equivalently written simply as load = readFile "parse.hs" -Chad Scherrer
7111
Age (days ago)
7111
Last active (days ago)
0 comments
1 participants
participants (1)
-
Chad Scherrer