I'm wondering if there's a way to emulate Haskell's typeclasses
in Common Lisp.
Generic functions allow overloading
, and it's possible to define types using deftype
(which could be defined by membership to some list of instances, for example).
But I can't dispatch
on a type. Is there a way to make a class a subclass(and a subtype) of some other class after its definition(e.g. making the cons
class a subclass of a sequence
class, without redefining cons
)?
Thanks.