Domain Specific Language Implementation With Dependent Types
Domain Specific Language Implementation With Dependent Types
University of St Andrews
FFLunch, October 26th 2009
data Ve
t : # -> Nat -> # where -- List with size (ve
tor).
VNil : Ve
t a O
| VCons : a -> Ve
t a k -> Ve
t a (S k);
data Ve
t : # -> Nat -> # where -- List with size (ve
tor).
VNil : Ve
t a O
| (::) : a -> Ve
t a k -> Ve
t a (S k);
Syntax:
But. . .
Idris reports:
Can't unify Binary (S k) and Binary (S (plus j j))
The ?= indictes that the indices of the left and right are
different. [hSe℄ and [hSo℄ are lemmas to be proved.
[demo: interp.idr]
Control structures
Recursive definitions
Code duplication