We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
Is your feature request related to a problem? Please describe.
I want to write a dummy implementation of a value of an unknown type and not throw an exception.
I can not do that with undefined because Swarm is not lazy. It would have to be wrapped in either a function or delay.
undefined
Describe the solution you'd like
I would like to have a new keyword default : forall a. a, which will provide a default value of that type:
default : forall a. a
0: Int
"": Text
noop: Cmd t
inl default: (t1 + t2)
\_. default: t0 -> t1
Describe alternatives you've considered
I can write a definition like this:
def implementation_except_for_value = \value. [value=value, ...]
And provide some default at the call site, but this is not ergonomic.
Additional context
Admittedly, when #495 is implemented, I will not need dummy values as often.
The text was updated successfully, but these errors were encountered:
No branches or pull requests
Is your feature request related to a problem? Please describe.
I want to write a dummy implementation of a value of an unknown type and not throw an exception.
I can not do that with
undefined
because Swarm is not lazy. It would have to be wrapped in either a function or delay.Describe the solution you'd like
I would like to have a new keyword
default : forall a. a
, which will provide a default value of that type:0: Int
"": Text
noop: Cmd t
inl default: (t1 + t2)
\_. default: t0 -> t1
Describe alternatives you've considered
I can write a definition like this:
And provide some default at the call site, but this is not ergonomic.
Additional context
Admittedly, when #495 is implemented, I will not need dummy values as often.
The text was updated successfully, but these errors were encountered: