-
Notifications
You must be signed in to change notification settings - Fork 11
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 case operator that gets stuck on unsolved metas (i.e. THE DREAM ACHIEVED) #53
Conversation
This is the equivalent of Racket's make-syntax-introducer and generate-temporaries.
This makes debugging much easier.
Some examples relied on this bug - it's now fixed. Fixes #48.
This commit contains the final bits of run-time and expander support for a monadic type-case operator that gets stuck on unsolved metas. The which-problem example has been updated with a demonstration that the type checker's order of traversal is independent of the availability of type information to the macro expander.
|
||
(m) | ||
|
||
(example (case (unit) | ||
((m) (true)))) | ||
|
||
(define-macros |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is so cool 😄
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We could try to imlement something like Cryptol's zero operator using this. That'd be fun :-)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Awesome!!!
@@ -15,6 +15,7 @@ dependencies: | |||
- lens | |||
- megaparsec | |||
- mtl | |||
- n-ary-functor |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
wow, you used my n-ary-functor package! I'm so proud! but... where are you using it? I don't see any import NAryFunctor
.
I used it and then unused it again - will fix!
…On Tue, May 5, 2020, 21:18 Samuel Gélineau ***@***.***> wrote:
***@***.**** commented on this pull request.
------------------------------
In package.yaml
<#53 (comment)>:
> @@ -15,6 +15,7 @@ dependencies:
- lens
- megaparsec
- mtl
+ - n-ary-functor
wow, you used my n-ary-functor package! I'm so proud! but... where are you
using it? I don't see any import NAryFunctor.
—
You are receiving this because you modified the open/close state.
Reply to this email directly, view it on GitHub
<#53 (review)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AAA4FAWQ2IZ3Q4INS766Q3LRQDQIHANCNFSM4MWQT7KQ>
.
|
This is based on #47, because of the various bug fixes and such in it. On top of #47's changes, it has the following:
expression
constructor ofProblem
has been given a primitive representation of types at the next phase as an argument (the new built-in typeType
)type-case
operator allows matching on aType
in a monadic context, getting stuck if that type is not yet determined. Type patterns are expansion positions, just like data patterns.Things to be improved over time:
type-case
never gets un-stuck, the error message is quite bad. We probably need some provenance tracking for metas to tell it where they are from, at the very least.