FunctionWrappers.jl defines convert for FunctionWrapper:
Base.convert(::Type{T}, obj) where {T<:FunctionWrapper} = T(obj)
Base.convert(::Type{T}, obj::T) where {T<:FunctionWrapper} = obj
This is really useful if you have, e.g., a struct with a FunctionWrapper field. You can then just provide a Function to the constructor without having to "wrap" it first (at least, I think that's how Julia works).
Can we do something similar for FunctionWrappersWrapper (we = I would submit an MR myself, but I wanted to check I'm not missing an obvious complication first)?
FunctionWrappers.jl defines
convertforFunctionWrapper:This is really useful if you have, e.g., a
structwith aFunctionWrapperfield. You can then just provide aFunctionto the constructor without having to "wrap" it first (at least, I think that's how Julia works).Can we do something similar for
FunctionWrappersWrapper(we = I would submit an MR myself, but I wanted to check I'm not missing an obvious complication first)?