7 Jun 2012 14:44
adding array bounds
I'm trying to figure out how to deal with this:
fun join[T, N, M] (x:array[T, N]) (y:array[T, M]):array[T, _flatten(N + M)] = {
This doesn't work at the moment. Here's the model:
Flx_btype.t =
...
| BTYP_sum of t list
| BTYP_unitsum of int
| BTYP_array of t * t
| BTYP_type_var of bid_t * t
noting:
BTYP_tuple [] is the type unit of value ().
BTYP_unitsum n is () + () + () + () ... n times, the BTYP_sum of n units.
BTYP_array (T,N) is an array, but Felix only allows N to be a BTYP_unitsum.
The type 2 is an example of a unit sum, this one is named "bool", it just
means "2 cases".
Finally we must not that type summation is NOT associative.
1 + 2 is NOT 3
although they're isomorphic. This is just the dual of the more familiar fact that
(Continue reading)
RSS Feed