[Haskell] Swapping parameters and type classes