Utility function for Haskell