
Is there a standard class that looks something like this: class (Monoid m) => MonoidBreak m where mbreak::a->m a->(m a,m a) and it should follow some law like: m == uncurry mappend $ mbreak x m -Alex-

On 6/7/07, Alex Jacobson
Is there a standard class that looks something like this:
class (Monoid m) => MonoidBreak m where mbreak::a->m a->(m a,m a)
I think you have some kind of kind issue going on here. If m is a Monoid I'm not sure what m a means. Looks like you're trying to factor elements of monoids in some way. Maybe you mean class (Monoid m) => MonoidBreak m where mbreak::a->m->(m,m) Though I'm not sure what the relationship between m and a is intended to be.

Ok how about this class: class (Monoid m) => MonoidBreak m where mbreak::m->m->m And the condition is mappend (mbreak y z) y == z -Alex- Dan Piponi wrote:
On 6/7/07, Alex Jacobson
wrote: Is there a standard class that looks something like this:
class (Monoid m) => MonoidBreak m where mbreak::a->m a->(m a,m a)
I think you have some kind of kind issue going on here. If m is a Monoid I'm not sure what m a means. Looks like you're trying to factor elements of monoids in some way. Maybe you mean
class (Monoid m) => MonoidBreak m where mbreak::a->m->(m,m)
Though I'm not sure what the relationship between m and a is intended to be.

On Fri, Jun 08, 2007 at 07:24:09AM -0700, Alex Jacobson wrote:
Dan Piponi wrote:
On 6/7/07, Alex Jacobson
wrote: Is there a standard class that looks something like this:
class (Monoid m) => MonoidBreak m where mbreak::a->m a->(m a,m a)
I think you have some kind of kind issue going on here. If m is a Monoid I'm not sure what m a means. Looks like you're trying to factor elements of monoids in some way. Maybe you mean
class (Monoid m) => MonoidBreak m where mbreak::a->m->(m,m)
Though I'm not sure what the relationship between m and a is intended to be.
Ok how about this class:
class (Monoid m) => MonoidBreak m where mbreak::m->m->m
And the condition is
mappend (mbreak y z) y == z
Consider baz x = mbreak x mempty now: baz x `mappend` x = mappend (mbreak x mempty) x = mempty Thus, baz is a left-inverse operator, and (m, mappend, mempty, baz) forms a group. Going the other way using a hypothetical Group class: instance Group m => MonoidBreak m where mbreak n p = p `mappend` negate n satisfies your law. Stefan
participants (3)
-
Alex Jacobson
-
Dan Piponi
-
Stefan O'Rear