[email protected]
[Top] [All Lists]

[Haskell-cafe] Alternatives to type classes.

Subject: [Haskell-cafe] Alternatives to type classes.
From: Jason Dusek
Date: Tue, 29 Dec 2009 17:22:15 -0800
  Consider the real numbers. They "are" a group. We have an
  identity element `0', inverses and closure under the associative
  operation `+'.

    Group+ = (+, 0, -1 * _)

  They are another group, too -- the group with `*':

    Group* = (*, 1, 1 / _)

  This seems like a real problem with the whole notion of
  typeclasses -- we can't really say a set/type "is" its
  extension with some new operations.

  One road to go on this is to make every extension of the set
  with new ops a different type; but that seems really horribly
  inconvenient. I wonder what approaches have been tried here?

Jason Dusek
Haskell-Cafe mailing list
[email protected]

<Prev in Thread] Current Thread [Next in Thread>