-
Notifications
You must be signed in to change notification settings - Fork 2
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
Softtype as an instance or a type, T vs T() #577
Comments
I'd suggest only the |
its also easy to just do |
Hi Johan, how do you feel about this? const InstanceType{T} = Union{Type{<:T},T} |
I don't know how that will help. You need something like this discouraged pattern in the style guide:
EDIT: Ok, I see how you use it in RoME. I was thinking of From a user side,
For now, my vote would be to just follow the style guide :
|
I'm also in the camp of using the type, but I don't know how this influences type stability. I'm assuming |
I came across this thread https://discourse.julialang.org/t/singleton-types-vs-instances-as-type-parameters/2802/11 Maybe it can be a tie breaker. |
Softtype is now a singleton type and to avoid confusion we have to decide whether it will be used as an instance or a type.
for example:
getManifolds(::Type{Pose2}) vs getManifolds(::Pose2)
For compatibility, I used an instance where @dehann used type
getManifolds(vartype::Type{LinearConditional}) = (:Euclid,)
It doesn't seem to make a performance difference.
The text was updated successfully, but these errors were encountered: