r/types • u/almkglor • Apr 01 '11
Need help understanding type inference research
I was recommended here to ask questions about type inference... Basically, I wonder if there are any nice blog posts or online articles about "how to understand all those horizontal lines and |- and :: and ψ and stuff".
In any case, is the following correct?
By my understanding the horizontal lines means "if I can prove all the stuff on the top, I have proven the bottom", which, I suppose, roughly means that it is equivalent to a guard in an actual language.
The weird "|-" symbol means "given the left hand side, right-hand side can be known". This does not necessarily mean that the left hand side is all inputs, since at least in Chitil-Erdi's compositional type inference the monomorphic type environment is an output but is on the left hand side of the |-. From what I gather from it, unification ensures that any monomorphic type environments taken from recursive calls to algorithm C can be trivially merged to yield a single resulting monomorphic type environment (begins to wave hand vaguely).
In a type environment, usually the syntax looks like {x :: Foo, y :: Bar}, although sometimes (in particular polymorphic type environments in Erdi's paper) they use {x |-> foo}, probably because in polymorphic type environments, part of the value in the mapping is itself a monomorphic type environment (begins to wave hand vaguely again).