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

Add an explicit parameter builder for Symbol #25

Open
3noch opened this issue May 23, 2019 · 4 comments
Open

Add an explicit parameter builder for Symbol #25

3noch opened this issue May 23, 2019 · 4 comments

Comments

@3noch
Copy link

3noch commented May 23, 2019

If your parameter has odd characters in the string, you can't use the # syntax for overloaded labels. Instead you need an explicit builder like fn ! namedArg @"my-arg" 5.

@int-index
Copy link
Contributor

This should be addressed by GHC Proposal #40: Unrestricted Overloaded Labels.

For the time being, I believe you can use fromLabel:

fn ! fromLabel @"my-arg" 5

@3noch
Copy link
Author

3noch commented May 23, 2019

Great. Should this be in the docs somewhere?

@int-index
Copy link
Contributor

I'm not sure. It doesn't seem like something with good ergonomics, why use fromLabel @"my-arg" instead of #my_arg?

@3noch
Copy link
Author

3noch commented May 24, 2019

The docs would explain exactly this: "You may be tempted to use fancy strings for your arguments like "my-arg" because the type-level annotation allows it. But using this at the label level is not yet supported (see proposal) and requires that you do this: fromLabel @"my-arg". The idea of the doc being: Avoid people coming to GitHub and posting my question again. :)

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