alan
alan copied to clipboard
Interfaces (AKA Type Types)
Restoring interfaces to Alan blocks a lot of the standard library from being trimmed down significantly.
It's very similar to generic functions both conceptually and by implementation, except the checking and casting of a function into an actual function happens during function dispatch, checking if the provided type matches the interface, so the function call does not require explicit generic types when calling it in those cases, but it can only derive its behavior on the inputs, while generic functions can handle situations beyond that.
This should mix cleanly with generic functions, where the generic function declares a generic type or types for some things and an interface type or types for others: this would first construct the scope for the generic types to resolve them, offering up a new function which has interface arguments, which it would then confirm match the types of the values being provided.
This will require a new function type enum, probably.