Written by ettolrach, 2025-12-23.

Most commonly-used programming languages don’t use a well-known algorithm for their type inference. A few languages use Hindley-Milner type inference, such as Rust, Haskell, and F#.

Another algorithm which isn’t used by any popular languages (to my knowledge) is called bidirectional type inference. In contrast to Hindley-Milner, it’s supposed to be easier to implement and gives better error messages with the drawback of being more difficult to understand and to start with.

[Update 2025-12-30: I’ve since been shown that Swift uses a bidirectional algorithm! So I stand corrected.]

There aren’t a lot of tutorials out there, especially ones that are designed for someone who d…

Similar Posts

Loading similar posts...

Keyboard Shortcuts

Navigation
Next / previous item
j/k
Open post
oorEnter
Preview post
v
Post Actions
Love post
a
Like post
l
Dislike post
d
Undo reaction
u
Recommendations
Add interest / feed
Enter
Not interested
x
Go to
Home
gh
Interests
gi
Feeds
gf
Likes
gl
History
gy
Changelog
gc
Settings
gs
Browse
gb
Search
/
General
Show this help
?
Submit feedback
!
Close modal / unfocus
Esc

Press ? anytime to show this help