
Just for completeness another option: http://hackage.haskell.org/package/reducers-3.10.2/docs/Data-Semigroup-Reduc...
But this probably has the same problem, as it requires a Semigroup.
Sjoerd
On 21 Apr 2014, at 20:23, Bardur Arantsson
On 2014-04-21 15:46, Andras Slemmer wrote:
I think what you're looking for are monoid actions: http://hackage.haskell.org/package/monoid-extras-0.2.2.0/docs/Data-Monoid-Ac... And the laws the typeclass should satisfy: foo bar = id foo f . foo g = foo (f `mappend` g)
The identity law is optional, in whihc case your 'e' would be a semigroup without a default 'bar'
Ah, yes, thanks. That looks about right, but unfortunately I have even less structure in that I don't have a monoid -- I had previously looked at group actions, but those have various extra laws.
Maybe I should just call it "Action", but avoid the monoid bits.
Thanks all,
_______________________________________________ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http://www.haskell.org/mailman/listinfo/haskell-cafe