[Haskell-cafe] Does this typeclass have a name?
Sjoerd Visscher
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.
Sjoerd
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:
>> http://hackage.haskell.org/package/monoid-extras-0.2.2.0/docs/Data-Monoid-Action.html
>> 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
> http://www.haskell.org/mailman/listinfo/haskell-cafe
More information about the Haskell-Cafe
mailing list