| > Ah! This rule will only match if the LHS is
| >
| > f (WriterT w Identity) ($fMonadWriterT w Identity dm
| > $fMonadIdentity)
| >
| > So it's a nested pattern match. That makes the LHS match less often;
| namely only when the dictionary argument to 'f' is an application of
| $fMonadWr
's the LHS pattern.
>
>
> So I hope that explains better what is happening. If anyone can think of
> better behaviour, I'm open to suggestions!
>
> Simon
>
>
> | -Original Message-
> | From: glasgow-haskell-users-boun...@haskell.org [mailto:glasgow-
&g
ter what is happening. If anyone can think of
better behaviour, I'm open to suggestions!
Simon
| -Original Message-
| From: glasgow-haskell-users-boun...@haskell.org [mailto:glasgow-
| haskell-users-boun...@haskell.org] On Behalf Of Tsuyoshi Ito
| Sent: 11 July 2012 04:40
| To: glasgow-ha
Hello,
Why does GHC 7.4.1 reject the rewrite rule in the following code?
> module Test where
>
> import Data.Monoid
> import Control.Monad.Writer.Strict
>
> f :: Monad m => a -> m a
> f = return
>
> g :: Monoid w => a -> Writer w a
> g = return
>
> {-# RULES
> "f->g" f = g
> #-}
On the line co