Type-based modeling

Design of DSLs

A simple (non-monadic) DSL for integers and booleans expressions

An EDSL implementation

code

A EDSL with type-aware combinators

code

Enter GADTs

code

Existential types

Singleton types

Implementing type inference

Type checking and evaluation

Summary