Inheritance is great 1- the simplest, purest for thereof is prototype inheritance; but if your language only offers classes, this happens at the metalevel only. 2- classes are fine; but if your language only offers typeclasses, this happens at the metalevel only, with no state.
At heart, prototype inheritance is composing functions of which you'll later find a fixpoint. See the implementation in two functions the Nix standard library. Or in under a hundred characters of Scheme.
-
-
To define a "class", refine the prototype for the class descriptor. No need for a fancy type system here; your prototypes can be monomorphic... at the meta-level. You may still want simple row polymorphism at the object level.
-
To properly type non-trivial prototype inheritance at the base level, with lazy slots and delicious cake patterns, though, you'll need advanced row polymorphism with associative-commutative row variables, as found only in Ur/web or in Ermine (AFAICT).
End of conversation
New conversation -
Loading seems to be taking a while.
Twitter may be over capacity or experiencing a momentary hiccup. Try again or visit Twitter Status for more information.
Read my blog!