Hacker News new | ask | show | jobs
by mjburgess 1453 days ago
"The idea" practically, is whatever resolves the polymorphism. So context is a compiler function from syntax->semantics.

Eg., `+` is polymorphic, `1 + 1` and `"1" + "1"`... the context is whatever implicitly resolves `+` to `ADD` or to `CONCAT`.

The utility of these ideas is, in practice, just they provide a syntax for different kinds of polymorphism. Eg., for monads, we're basically just telling the compiler to change its implementation of `;`