cur icon indicating copy to clipboard operation
cur copied to clipboard

Typeclass constraints?

Open wilbowma opened this issue 9 years ago • 1 comments

Typeclass constraints would really improve your typeclasses.

wilbowma avatar Sep 10 '15 16:09 wilbowma

Current typeclass implementation is stupid. Here is a better design:

Export a => form for typeclass constraints. It should cooperate with lambda/application to check that arguments satisfy the constraint. This will require more support from lambda/application to enable cooperation.

Each typeclass should export an identifier with associate properties about how it must be implemented. These should be associated with the identifier, much like Racket struct properties, not stored in a hashtable as currently implemented. This should enable typeclasses based on abstract types and return types.

Each implementation should attach properties, like above, to the identifier for the type being implemented.

The latter two properties may be impossible in the current design of Cur, as identifiers aren't real.

wilbowma avatar Jan 22 '16 17:01 wilbowma