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

type-equality primitive #155

Open
gelisam opened this issue Aug 6, 2022 · 1 comment
Open

type-equality primitive #155

gelisam opened this issue Aug 6, 2022 · 1 comment
Labels
enhancement New feature or request

Comments

@gelisam
Copy link
Owner

gelisam commented Aug 6, 2022

It is possible to write a macro which checks whether types like (-> Integer String) are equal, but for types like (-> (Maybe Integer) String), this is harder because the user can later introduce more datatypes which the macro doesn't know about.

I propose to provide a primitive macro which determines whether two types are known to be equal, or known to be apart. If the answer depends on what type unification variables will eventually resolve to, the macro is of course stuck until enough information is available.

@gelisam gelisam added the enhancement New feature or request label Aug 6, 2022
@david-christiansen
Copy link
Collaborator

This seems like it's clearly useful. But rather than a macro, I'd make it an effect in the macro monad. That is, a type likeType -> Type -> Macro Bool rather than Syntax -> Macro Syntax, and not bound in a transformer environment.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants