Seelengrab / Supposition.jl

A Julia implementation of choice sequence based PBT, inspired by Hypothesis
https://seelengrab.github.io/Supposition.jl/
European Union Public License 1.2
46 stars 2 forks source link

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

Closed jariji closed 8 months ago

jariji commented 8 months ago
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 commented 8 months ago

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 commented 8 months ago

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 commented 8 months ago

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