various haskell code