Skip to content
0:00 / 0:00

#mlsub#subtyping#typeinference

03 Polymorphism, subtyping, and ytpe inference in MLsub

ICFP Video

3.8K subscribers • 33 videos on Hallway

YouTube
  • Recommended by 3 people: 3 in engineering communities.
  • Presented by Stephen Dolan

Advanced. Deep dive for people who know the field.

1.1K views11 years ago3 recommendations

Programming languagesComputer scienceLanguage design and type systemsComputation and complexityFunctional programming

Stephen Dolan presents MLsub, a type system that combines parametric polymorphism and subtyping with principal type inference.

The uploader added no description.

Why it's here

3 people recommend this

What people say. Recommended as an entertaining and enlightening introduction to algebraic subtyping and type inference.

u/Iceland_jackin r/haskell • Recommends

On “What are valid programs in the lambda calculus, that Haskell doesn't allow.”

…map :: forall a b. a -> b -> [a -> b] mapmap = map @(a -> b) @(a -> b) $ map @a @b We can type, etc. selfId :: (forall xx. xx -> xx) -> (forall a. a -> a) selfId id = id id ---- The inferred type in the **MLsub** type system (which has type inference with subtyping + ^\(*parametric*\) polymorphism) is ^\(link to this video, ^interactive\) self :: (a -> b) & a -> b self x = x x and applying `self` to itself gives a bottom type omega :: Bot omega = self self and lets us type the Y-combinator y :: (a -> a) -> a y t = (\x -> t (x x)) (\x -> t (x x))…

u/icspmocin r/ocaml • Recommends

Polymorphism, subtyping, and type inference in MLsub (Stephen Dolan, ML workshop 2015)

u/gelisamin r/haskell • Recommends

On “Why has row polymorphism not made it into Haskell?”

I didn't mention any paper, but thanks for pointing out that there is one! I found the ICFP 2015 presentation of the paper short, entertaining, and enlightening. I can now answer my own questions: > Could you summarize what's algebraic subtyping? Add union types `a ⊔ b` and intersection types `a ⊓ b`, with subtyping rules `a ≤ a ⊔ b`, `b ≤ a ⊔ b`, `a ⊓ b ≤ a`, and `a ⊓ b ≤ b`. Restrict those new types so that only input types can use `⊓` and only output types can use `⊔`, and tada! Inference becomes easy, even if you throw in parametric polymorphism. The restriction doesn't unduly restrict expressibility because it is input values which can be used in both an `a` way and a `b` way (thus…