Get the latest tech news

Making my life easier with GADTs


In which I showcase one concrete example where dependent types allow me to turn the handling of different but similar compiler targets into a breeze of fresh air.

In which I showcase one concrete example where dependent types — and more precisely, Generalized Algebraic Datatypes (GADTs) — allow me to turn the handling of different but similar compiler targets into a breeze of fresh air. So a function in the environment stores its expression body — a LamBox.Term — and a datatype declaration tells which constructors come with it, and their respective number of arguments. I’m not breaking new grounds here, but I feel like the world is missing short and sweet practical examples in which sprinkles of dependent types help you avoid mistakes — for free!

Get the Android app

Or read this on Hacker News

Read more on:

Photo of Life

Life

Photo of GADTs

GADTs

Related news:

News photo

Open Socrates by Agnes Callard review – a design for life

News photo

Sitting in the mud with David Lynch: what his life is still teaching me about games and everything else

News photo

Life in Another Light, 2024 Infrared-Photography-Contest Winners