that is exact the way, how i had learned about the state monads like IO and Maybe. that was even before i understood the [] monad, folding and using Random; i don't remember when that was... ghc-5.xx age.
in my opinion, unsafePerformIO is a good learning tool, as soon as you use it
tricky to analyze and discover "new worlds you have never been before".
like this:
blah = unsafePerformIO $ do
putStrLn "I'm here: blah!"
return blub
this way, it may be even more important than undefined:
undef s = unsafePerformIO $ do
putStrLn "whops, this shouldn't happen"
putStrLn s
return undefined
well, this is my unpure way of learning to think in new languages.
i used ways like this in c++ to analyze OOP and to discover the world before
and after int main().
greetings
- marc
Am Donnerstag, 26. April 2007 20:15 schrieb Johannes Waldmann:
>
> > import System.IO.Unsafe (unsafePerformIO,unsafeInterleaveIO)
>
> Whoa! I'd be very cautious recommending these for newbies ...
> _______________________________________________
> Haskell mailing list
> [email protected]
> http://www.haskell.org/mailman/listinfo/haskell
>
pgplUz9AtQiK4.pgp
Description: PGP signature
_______________________________________________ Haskell mailing list [email protected] http://www.haskell.org/mailman/listinfo/haskell
