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

Rebindable do syntax? #1

Open
jackfirth opened this issue Nov 12, 2015 · 1 comment
Open

Rebindable do syntax? #1

jackfirth opened this issue Nov 12, 2015 · 1 comment

Comments

@jackfirth
Copy link

Haskell has an extension named Rebindable Syntax that allows reuse of do notation for non-monadic operations, by changing what operations a <- b and return expand to. This blog post has a very good explanation of what this is useful for. Would it make sense to add this to this library? It seems doable by adding syntax parameters for the operations do expands to, which default to monad operations.

@tonyg
Copy link
Owner

tonyg commented Nov 29, 2015

Sounds no less useless than monads-for-racket to begin with :-)

return should be able to be handled by simple rebinding, but <- is a problem because it lexically refers to the bind in main.rkt. For that, a syntax-parameter might be necessary. None of the uses in the blog post you linked leapt out at me as must-haves, though, so I'm a bit lukewarm on the idea. Nonetheless, if you felt like having a stab at it, I'd probably take the patch!

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