Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Rename base types #19

Open
uncomputable opened this issue Apr 8, 2024 · 1 comment
Open

Rename base types #19

uncomputable opened this issue Apr 8, 2024 · 1 comment

Comments

@uncomputable
Copy link
Collaborator

TL;DR

"Base type" is a generic name that might be confusing.

Details

The Simfony type system comes with "fundamental" types: unit (), sum Either<A, B> and product (A, B).

Other Simfony types are defined as "macros": Option<A> = Either<(), A>, bool = Either<(), ()>, ...

At the moment, the Simfony type system expands all macros and works at the "fundamental" type level.

We want to pick a name for "fundamental" types that distinguishes them from "macro" types. Currently the former are called "base types".

Alternatively, we could enforce explicit casting between types. On the surface, this would make all types disjoint. Types with equal structure (Option<A>Either<(), A> etc.) would be available for casting.

@apoelstra
Copy link
Contributor

We should use the term "structural types" which is a standard term for types which are defined (solely) by their structure.

That wiki page suggests the term "nominative types" for types which have names/explicit declarations, which I hadn't heard before but which I like.

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

No branches or pull requests

2 participants