factor funcs in haskell