There isn’t a more exhaustive description yet, we’ll be working on such things soon.
If I were to model the current type system in Haskell, it would pretty much be this:
type family Dispatch (target :: *) (name :: Symbol) = (result :: *)
With that any object in Luna can be understood as a standard Haskell datatype, with every method definition defining an instance of this family. E.g. if you have
def succ: ... inside class
Int, that would translate into an instance like
type instance Dispatch Int "succ" = Int
Later, when you define a function like:
def foo a: a.succ
it would get the type
a -> Dispatch a "succ".
This gets a bit more complicated with argument-taking methods – you’d need to another family for function applications, so that things like
def foo a b: a.add b get typed as something along the lines of
a -> b -> Apply (Dispatch a "add") b. It’s not this straightforward now, as the
Apply rule may introduce some equality constraints on
b, but that’s the basic idea.
We’re prepared to have some dependent-typed features in the compiler, so that’s where the metaphor falls apart, but for the current state of affairs this is a good model.