Open zeramorphic opened 2 years ago
Aspects and data types could be handled through the following syntax.
def Container: (T: *) -> * {
Container T = data {
value: T
}
}
This would mean that the compile-time type analysis would need to be greatly improved.
Syntactic sugar will likely be needed to simplify this, such as removing the def
keyword which will be unnecessary.
Type parameters should be actual parameters. For example,
would become something like
In line with this, higher kinded types would not be needed.
might become something like
More thought should be put into the precise syntax to make it align with category theory and intuition. For instance, the above syntax for aspects would not allow consumers to constrain what type
F
may be; currentlyimpl Functor[F]
can be used to define the value ofF
.This proposal would require reworking the type checker. De Bruijn indices would probably need to be used in types to avoid problems such as name collisions.