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

Have @composed assign its Possibility to the function name #13

Closed
jariji opened this issue Feb 25, 2024 · 3 comments
Closed

Have @composed assign its Possibility to the function name #13

jariji opened this issue Feb 25, 2024 · 3 comments
Labels
UX Issues relating to UX

Comments

@jariji
Copy link
Contributor

jariji commented Feb 25, 2024

gen_f = @composed function f(x=Data.Floats{Float64}())
  x
end

Here we give two different names f and gen_f. What is the benefit of separating them out like this? Why not just use f?

@Seelengrab Seelengrab changed the title Are the two names in gen_f = @composed function f(...) really necessary? Have @composed assign its Possibility to the function name Feb 25, 2024
@Seelengrab Seelengrab added the UX Issues relating to UX label Feb 25, 2024
@Seelengrab
Copy link
Owner

Please formulate feature requests with some actionable description instead of as a question - I'm going to look into Github Discussions and/or a zulip channel for general discussion around design decisions.


There isn't too big of a reason, other than @composed being a slightly more fancy Map, defining a new type for dispatch. It makes sense to have this type be the name of the function used for composing, but I guess this can be an implementation detail too.

@jariji
Copy link
Contributor Author

jariji commented Feb 25, 2024

Maybe it's better to keep them separate, so I can still call f(0.0) with a normal float instead of a Possibility.

@Seelengrab
Copy link
Owner

That doesn't currently work, but could be made to work 🤔 This definitely requires having the function name be distinct from the generator.

Seelengrab added a commit that referenced this issue Mar 2, 2024
This reworks `@composed`, allowing the function to be called
like any other function, similar to how `@check` allows it.
In addition, this fixes the `Data.postype` bug of `@composed` when
used in a local scope.

Fixes #13
Seelengrab added a commit that referenced this issue Mar 2, 2024
This reworks `@composed`, allowing the function to be called
like any other function, similar to how `@check` allows it.
In addition, this fixes the `Data.postype` bug of `@composed` when
used in a local scope.

Fixes #13
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
UX Issues relating to UX
Projects
None yet
Development

No branches or pull requests

2 participants