this repo has no description www.jonmsterling.com/01HC/
dependent-types proof-assistant swift
at pattern-unification 26 lines 760 B view raw
1// For pedagogical reasons it can be nice to explicitly apply introduction rules. 2exampleVerbose : (A : Type) (x : A) -> {tp: Type; elt: tp} 3exampleVerbose <= intro 4exampleVerbose A <= intro 5exampleVerbose A x <= intro 6exampleVerbose A x .tp => A 7exampleVerbose A x .elt => x 8 9singleton : (X : Type) (x : X) -> Type 10singleton X x => {fst : X; snd : x = fst} 11 12reflExample : (X : Type) (x : X) -> singleton X x 13reflExample X x <= intro 14reflExample X x .fst => x 15reflExample X x .snd => refl 16 17reflExample (X : Type) (x : X) : singleton X x 18reflExample X x => ? 19 20// But we can also have these applied automatically. 21example : (A : Type) (x : A) -> {tp: Type; elt: tp} 22example A x .tp => A 23example A x .elt => x 24 25foo : Type -> {tp : Type; elt : tp} 26foo A => ?