Clever API usage in Haskell