You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
alga does not unify computations between two distinct types. Such unification rules would be very application-specific. So alga won't cover this use-case. Perhaps it will be supported in the future when specialization is possible in Rust in order to allow users to specialize their own unification rules whenever the default one provided by alga does not fit.
So right now your only option is to implement Add for your types and add a trait bound:
fnadd<T:Real + Add<U>,U:Real>(x:T,y:U) -> T::Output{
x + y
}
Given:
I'd like to fill the
???
with eitherT
orU
, depending which one is wider. What's the alga way of unifyingReal
s in computations?The text was updated successfully, but these errors were encountered: