v0.9.5
Libtask v0.9.5
Added a new Libtask.@might_produce macro, which generates a superset of the Libtask.might_produce methods needed for a function f that might contain a call to Libtask.produce. For example, for a function
function f(x::Int, y::Int)
produce(x + y)
endinstead of writing
Libtask.might_produce(::Type{<:Tuple{typeof(f),Int,Int}}) = trueyou can just write
Libtask.@might_produce(f)The main benefit of this is that it applies to functions with multiple methods and keyword arguments. The drawback is performance: marking all methods of f as produceable may lead to performance degradation if there are some methods of f which do not need to be thus marked. In such cases, you should use the might_produce function directly.
Merged pull requests:
- Add
@might_producemacro (#198) (@penelopeysm)