[Haskell-cafe] Does this typeclass have a name?
sjoerd at w3future.com
Mon Apr 21 22:09:23 UTC 2014
Just for completeness another option: http://hackage.haskell.org/package/reducers-3.10.2/docs/Data-Semigroup-Reducer.html
But this probably has the same problem, as it requires a Semigroup.
On 21 Apr 2014, at 20:23, Bardur Arantsson <spam at scientician.net> wrote:
> On 2014-04-21 15:46, Andras Slemmer wrote:
>> I think what you're looking for are monoid actions:
>> 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 at haskell.org
More information about the Haskell-Cafe