Skip to content

Instantly share code, notes, and snippets.

@aradarbel10
aradarbel10 / Main.hs
Created December 6, 2022 15:40
A minimalistic example of bidirectional type checking for system F
{-# LANGUAGE StrictData, DerivingVia, OverloadedRecordDot #-}
{-
(compiled with GHC 9.4.2)
-}
{-
HEADS UP
this is an example implementation of a non-trivial type system using bidirectional type checking.
it is...
@takahisa
takahisa / extensible_interpreter_with_algebraic_effects.ml.ml
Last active August 24, 2024 11:14
Extensible Interpreter with Algebraic Effects
type 'a expr = ..
type 'a expr +=
| Int: int -> int expr
| Add: int expr * int expr -> int expr
| Sub: int expr * int expr -> int expr
effect Extension: 'a expr -> 'a
let rec eval1: type a. a expr -> a = function
| Int n0 -> n0