module Scheme where
open import Agda.Builtin.List
open import Agda.Builtin.Nat
open import Agda.Builtin.Bool
open import Agda.Builtin.Equality
length : {A : Set} → List A → Nat
length [] = 0
length (_ ∷ xs) = suc (length xs)
data Eq {A : Set} (x : A) : A -> Prop where
rfl : Eq x x
record Σ (A : Set) (B : A → Prop) : Set where
constructor _,_
field
fst : A
snd : B fst
Σ-syntax : (A : Set) (B : A → Prop) → Set
Σ-syntax = Σ
syntax Σ-syntax A (λ x → B) = [ x ∈ A ∣ B ]
Arrow : (A B : Set) → Set
Arrow A B = A → B
ListAlias : Set → Set
ListAlias = List
ListAlias' : Set → Set
ListAlias' A = List A
Vec : (A : Set) → Nat → Set
Vec A n = [ xs ∈ List A ∣ Eq (length xs) n ]
Bad : Bool → Set
Bad false = Nat
Bad true = Bool
testVec : Vec Nat 1
testVec = (42 ∷ []) , rfl
head : ∀ {A n} → Vec A (suc n) → A
head ((x ∷ _) , _) = x
test : Bad false
test = head testVec
{-# COMPILE AGDA2LAMBOX test #-}
Debug λ☐ Rocq ↪
WASM C OCaml CakeML Rust Elm