Open weaversa opened 3 years ago
Here's another possibility that looks more like the explicit type annotations for functions (f (x : t) = ...
) from the syntax manual.
fibs = basecase # (drop`{BaseCaseSize} recurrence)
where
(basecase : [BaseCaseSize]_) = [0, 1]
recurrence@i = fibs@(i-1) + fibs@(i-2)
This seems somewhat related to #814, but at the type level instead of the value level.
Is it possible to define a type variable (or a relationship between types) without explicitly creating a new variable?
For example:
It would be nice to be able to use the size of the basecase in the
drop
statement, without having to give the size. Something like this?Cryptol used to accept something like:
I just don't know how to give this type a name without specifying the concrete value
2
.