You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Now that there's some support for inductive families (#133), it would be cool if we could support definitions like the following:
typeVectornawhereNil:VectorZeroaCons:foralln.a->Vectorna->Vector (Succn) a
Note that there's no Ptr on the tail of the Cons, meaning that this is an inductive definition of a flat vector. To get there, we can use pattern-matching on indices in the generated size-computing function for Vector. That function should be something like:
VectorZero a = unitTypeRep
Vector (Succ n) a = productTypeRep a (Vector n a)
This also relies on adopting detagging (a la Edwin Brady) to remove the need for constructor tags (since we know what constructor we have just from the n index) and doing forcing to remove the n argument to the Cons constructor (since it can be recovered from the index).
The text was updated successfully, but these errors were encountered:
Now that there's some support for inductive families (#133), it would be cool if we could support definitions like the following:
Note that there's no
Ptr
on the tail of theCons
, meaning that this is an inductive definition of a flat vector. To get there, we can use pattern-matching on indices in the generated size-computing function forVector
. That function should be something like:This also relies on adopting detagging (a la Edwin Brady) to remove the need for constructor tags (since we know what constructor we have just from the
n
index) and doing forcing to remove then
argument to theCons
constructor (since it can be recovered from the index).The text was updated successfully, but these errors were encountered: