Skip to content

[WIP] Open types, and type extension - #26

Draft
dorchard wants to merge 3 commits into
mainfrom
open-types
Draft

[WIP] Open types, and type extension#26
dorchard wants to merge 3 commits into
mainfrom
open-types

Conversation

@dorchard

@dorchard dorchard commented Jul 20, 2026

Copy link
Copy Markdown
Member

I think that we essentially want some types to be defined as being 'open' which means more constructors can be added freely at other points in the program, e.g., to allow:

M : UnitBase = Constructor("metres")
S : UnitBase = Constructor("seconds")

y : Float[Unit[M]] = 2.0
x : Float[Unit[M]] = 1.0
t : Float[Unit[S]] = 4.0

The intention with 'Constructor' it is a 'constructor for constructors' and can load up some fixed metadata associated with data constructors; for now I'm just designing these as strings but later this can be a dictionary.

This PR enables such definitions, extending the type environment as we go.

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant