On Fri, Jul 10, 2009 at 10:35 AM, Wolfgang Jeltsch<g9ks1...@acme.softbase.org> wrote: > ... > Hello Cristiano, > > I fear that this instance doesn’t satisfy required laws. As far as I know, the > following equalities should hold: > > (*>) = (>>) > > f *> empty = empty > > empty <|> g = g > > This implies the following: > > (f >> empty) <|> g = g > > But this wouldn’t hold with your instance. (f >> empty) <|> g would cause the > side effects of f and of g, while g would (obviously) only cause the side > effects of g. > > If empty would be a real empty, it would have to undo the effects of previous > actions (like f above). So an Applicative instance makes sense for STM but > not for IO.
Thanks. That's an argument :) -- Cristiano _______________________________________________ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http://www.haskell.org/mailman/listinfo/haskell-cafe