[Haskell-cafe] fmap vs. liftM
Felipe Lessa
felipe.lessa at gmail.com
Tue Feb 5 16:51:18 EST 2008
On Feb 5, 2008 6:06 PM, Dan Weston <westondan at imageworks.com> wrote:
> Can you do this with a GHC rule? Something like:
>
> {-# RULES
> "join_dot_fmap_return/id" forall x . join (fmap return x) = x
> #-}
>
> Dan
I guess this would make use of the rule (otherwise the transformation
would change the code's semantic) but would not enforce that the rule
itself is valid (which is undecidable).
Cheers,
--
Felipe.
More information about the Haskell-Cafe
mailing list