The Practical Guide to Levitation
By Ahmad Salim Al-Sibahi Supervisors:
- Dr. Peter Sestoft
The Practical Guide to Levitation By Ahmad Salim Al-Sibahi - - PowerPoint PPT Presentation
The Practical Guide to Levitation By Ahmad Salim Al-Sibahi Supervisors: Dr. Peter Sestoft David R. Christiansen A Practical Guide to Levitation http://wordswithoutborders.org/article/a- practical-guide-to-levitation Excellent, but
2
3
4
5
6
7
8
9
data data Vec : (a : Type) -> Nat -> Type where where Nil : Vec a Z Cons : {n : Nat} -> a -> Vec a n -> Vec a (S n)
So : Bool -> Type So True = () So False = _|_
stillnot1984 : 2 + 2 = 4 Stillnot1984 = Refl
10
12
data data Vec : (a : Type) -> Nat -> Type where where Nil : Vec a Z Cons : {n : Nat} -> a -> Vec a n -> Vec a (S n) t y p e c
s t r u c t
13
data data Nat : Type where where Zero : Nat Succ : Nat -> Nat NatDesc : Desc NatDesc = Arg Bool (\isZero => if if isZero then then Ret else else Rec Ret)
14
data data List : (a : Type) -> Type where where Nil : List a Cons : a -> List a -> List a ListDesc : (a : Type) -> Desc ListDesc a = Arg Bool (\isNil => if if isNil then then Ret else else Arg a (\x => Rec Ret))
15
16
17
data data Vec : (a : Type) -> Nat -> Type where where Nil : Vec a Z Cons : {n : Nat} -> a -> Vec a n -> Vec a (S n) VecDesc : (a : Type) -> Desc Nat VecDesc a = Arg CLabel (\l=> Arg (Tag l [ “Nil” , “Cons” ]) ((switchDesc switchDesc (Ret Z , (Arg Nat (\n=> Arg a (\x=> Rec n (Ret (S n)))) , () ) )) l))
18
19
20
21
22
23
24
25
26
27
28
data data Data__Vec_Int : Nat -> Type where where Con : Synthesise (VecD Int) Data__Vec_Int i -> Data d i
29
30
31
32
33
34
35
36
37
38
39
40