In SciLean, I need an unified interface to deal with functions, arrays(fixed sized) and structs. This can be done with a variant of Indexed which has dependent types. I call it StructType
I'm really not sure if there should be separate dependently typed version of Indexed or not. On one hand, dealing with dependent types is annoying and most of the time not necessary. On the other hand, having variant of Indexed just duplicates code.
A crucial difference of StructType from Indexed is that the index type is not marked outParam. This allows you to index for example the type Nat × ArrayN Nat n with Unit ⊕ Unit or Unit ⊕ Fin n. In SciLean, this is a crucial feature when doing automatic differentiation.
In SciLean, I need an unified interface to deal with functions, arrays(fixed sized) and structs. This can be done with a variant of
Indexedwhich has dependent types. I call itStructTypeI'm really not sure if there should be separate dependently typed version of
Indexedor not. On one hand, dealing with dependent types is annoying and most of the time not necessary. On the other hand, having variant ofIndexedjust duplicates code.A crucial difference of
StructTypefromIndexedis that the index type is not markedoutParam. This allows you to index for example the typeNat × ArrayN Nat nwithUnit ⊕ UnitorUnit ⊕ Fin n. In SciLean, this is a crucial feature when doing automatic differentiation.