Skip to content
0:00 / 0:00

#haskell#type-system#type-inference

Haskell DC: A more general type for \f x → f (f x)

Galois

1.2K subscribers • 2 videos on Hallway

YouTube
  • Recommended by 2 people: 2 in engineering communities.
  • Presented by Noah Easterly

Advanced. Deep dive for people who know the field.

1.5K views6 years ago2 recommendations

Programming languagesLanguage design and type systemsFunctional programming

Noah Easterly demonstrates alternative types for a simple Haskell function literal and constructs a more general type that unifies them.

More information on the Haskell DC Meetup here: meetup.com/Haskell-DC/ Noah Easterly will give a talk titled "A More General Type For \f x → f (f x)". In Haskell, even a simple numeric literal has the polymorphic type of `Num a ⇒ a`, so it's no surprise that GHC can infer a polymorphic type for function literals like `\f x → f (f x)`. During this talk, we'll demonstrate other possible types for `\f x → f (f x)`, show that they're incompatible with the compiler inferred type, and then construct a more general type that unifies with all of these. This talk assumes only a basic knowledge of Haskell types, but will cover topics including higher-rank types, type unification/specialization, and defunctionalization.

Why it's here

2 people recommend this

What people say. Recommended as an interesting exploration of type unification, higher-rank types, and bidirectional type-checking.

u/Labbekakin r/haskell • Recommends

A more general type for \f x -> f (f x)

u/Iceland_jackin r/haskell • Recommends

On “The appeal of bidirectional type-checking”

There is a talk on youtube about this term * Haskell DC: A more general type for \f x → f (f x) * github