[...]
> And what about algebraic simplification? Say,
> {-# rules
>     "+assoc"  AddSemigroup a => (x+y)+z = x+(y+z)
>     "0"       AddMonoid a    => x+zeroG = x,  
>     "neg"     AddGroup a     => x+(negate x) = zeroG,  
> #-}
> may do the algebraic simplification, like
>                               map ((x+1)+) [1,-1,-1-x] -->
> [x+2,x,0].
[...]

Ther same applies to our beloved monads.  The compiler could be told about the monad 
laws.

Carsten

---
Carsten Schultz, Fachbereich Mathematik, FU Berlin
"To match the silent eloquence of the created world 
 I have had to learn to speak."  Jeanette Winterson

Reply via email to