misc haskell code