solutions to http://www.haskell.org/haskellwiki/99_questions