If you want to see how it works, see the README on the repo.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| module Euclid | |
| import Syntax.PreorderReasoning | |
| %default total | |
| Divides : (divisor, dividend : Nat) -> Type | |
| Divides d n = (q : Nat ** (n = q * d)) | |
| data Direction = LTR | RTL |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| {-# LANGUAGE ConstraintKinds #-} | |
| {-# LANGUAGE DerivingStrategies #-} | |
| {-# LANGUAGE DerivingVia #-} | |
| {-# LANGUAGE FlexibleContexts #-} | |
| {-# LANGUAGE FlexibleInstances #-} | |
| {-# LANGUAGE FunctionalDependencies #-} | |
| {-# LANGUAGE GeneralizedNewtypeDeriving #-} | |
| {-# LANGUAGE KindSignatures #-} | |
| {-# LANGUAGE MultiParamTypeClasses #-} | |
| {-# LANGUAGE NoImplicitPrelude #-} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| (** Core Types *) | |
| module Syntax = | |
| struct | |
| type t = | |
| | Local of int | |
| | Hole of string | |
| | Let of string * t * t | |
| | Lam of string * t | |
| | Ap of t * t | |
| | Pair of t * t |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| {-# 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... |
OlderNewer