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

combine Type values #245

Open
gelisam opened this issue Jun 25, 2024 · 1 comment
Open

combine Type values #245

gelisam opened this issue Jun 25, 2024 · 1 comment
Labels
enhancement New feature or request

Comments

@gelisam
Copy link
Owner

gelisam commented Jun 25, 2024

It is possible to have a value of type Type containing the type constructor Maybe, and another value of type Type containing the type Integer. We should define an operation which combines them into a value of type Type containing the type (Maybe Integer).

Since this can fail (e.g. (Integer Maybe) should be rejected), this must be a macro action.

(>>= (apply-type (the-type Maybe) (the-type Integer))
  (lambda (maybe-integer)
    (case maybe-integer
      [(Maybe Integer) 'success])))
@gelisam
Copy link
Owner Author

gelisam commented Jun 25, 2024

@david-christiansen if failure is the only reason for apply-type to have type (-> Type Type (Macro Type)), would it perhaps make more sense for it to have type (-> Type Type (Maybe Type)) instead, like funResultTy in Haskell?

@gelisam gelisam added the enhancement New feature or request label Jun 25, 2024
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

1 participant