named
named copied to clipboard
Add an explicit parameter builder for `Symbol`
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.
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
Great. Should this be in the docs somewhere?
I'm not sure. It doesn't seem like something with good ergonomics, why use fromLabel @"my-arg" instead of #my_arg?
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. :)