[Haskell-cafe] I miss OO
Patrick.Browne at comp.dit.ie
Wed Nov 25 17:34:54 EST 2009
Luke Palmer <lrpalmer at gmail.com> wrote
> I feel like this should be qualified. Type classes are not for name
> punning ; you wouldn't use a type class for the method bark on types
> Tree and Dog. But if you have a well-defined *structure* that many
> types follow, then a type class is how you capture that. It sounds
> like you do have this structure in your example.
Is there any way that type classes can manage name spaces to
disambiguate functions like bark on types Tree and Dog?
If constants are considered as unary functions, can we use constants in
type classes and/or instances? How are local class specific constants,
such as tank in Army/tank in Fish, bank in River/bank in Finance, handled?
More information about the Haskell-Cafe