
21 Apr
2014
21 Apr
'14
6:23 p.m.
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,