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

Refactor builtin Sig into TypeRepr #250

Merged
merged 1 commit into from
Oct 5, 2020

Conversation

jaspervdj-luminal
Copy link
Member

We used to have two indications of a builtins type:

  • Sig i o, which just provided the arity
  • BuiltinType i, which is a closure that checks the type

However, since Sig just indicates the arity, it doesn't give us quite enough
information to render the capabilities doc as described in #224.

In this refactor, I extended Sig to TypeRepr and made it hold more
information: an actual deep embedding of the types. I also moved this new type
into BuiltinType (which is now a record). This allows convenient construction
of both TypeRepr and the checker closure using 🡒 and out.

We used to have two indications of a builtins type:

 -  `Sig i o`, which just provided the arity
 -  `BuiltinType i`, which is a closure that checks the type

However, since `Sig` just indicates the arity, it doesn't give us quite enough
information to render the capabilities doc as described in #224.

In this refactor, I extended `Sig` to `TypeRepr` and made it hold more
information: an actual deep embedding of the types.  I also moved this new type
into `BuiltinType` (which is now a record).  This allows convenient construction
of _both_ `TypeRepr` and the checker closure using `🡒` and `out`.
@jaspervdj-luminal jaspervdj-luminal merged commit 880789c into master Oct 5, 2020
@jaspervdj-luminal jaspervdj-luminal deleted the refactor-typerepr-sig branch October 5, 2020 11:59
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