Skip to content

Interfaces (AKA Type Types) #749

Description

@dfellis

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.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions