module STLC.Examples where
open import STLC.Semantics
open import Data.List.Most
open import Relation.Binary.PropositionalEquality
open import Data.Integer hiding (suc)
open import Agda.Builtin.Nat hiding (_+_)
open import Data.Maybe
idexpr : Expr [] (unit ⇒ unit)
idexpr = ƛ (var (here refl))
test-idexpr : eval 2 (idexpr · unit) [] ≡ just unit
test-idexpr = refl
curry+ : Expr [] (int ⇒ (int ⇒ int))
curry+ = ƛ (ƛ (iop _+_ (var (here refl)) (var (there (here refl)))))
test-curry+ : eval 3 ((curry+ · (num (+ 1))) · (num (+ 1))) [] ≡ just (num (+ 2))
test-curry+ = refl