[Haskell-cafe] Re: Numeric type classes

Ashley Yakeley ashley at semantic.org
Wed Sep 13 18:43:28 EDT 2006


Aaron Denney wrote:

> I know of no good way to express that a given data type obeys the
> same interface two (or more) ways.

The best approach here is to use data structures instead of classes:

data Monoid a = MkMonoid
{
   monoidNull :: a,
   monoidFunc :: a -> a -> a
}

-- 
Ashley Yakeley



More information about the Haskell-Cafe mailing list