-
Notifications
You must be signed in to change notification settings - Fork 24
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
Typed transformations #19
Comments
I'm wondering if our earlier attempt at having |
Perhaps something like this would work... type TypedTransformation{OutType,IntermediateType,InType,WrappedTrans}
wrapped::WrappedTrans
end
function (trans::TypedTransformation{OutType,IntermediateType,InType}){OutType,IntermediateType,InType}(x::InType)
OutType(trans.wrapped(IntermediateType(x)))
end
function compose{Out,Intermed,InOut,In}(t1::TypedTransformation{Out,Intermed,InOut}, t2::TypedTransformation{InOut,Intermed,In})
TypedTransformation{Out,Intermed,In}(ComposedTransformation(t1, t2))
end |
Hmmm... interesting. The
All very interesting! Can you see this working for nonlinear transformations? (I.e. things which aren't wrapped |
For generic differential geometry you're probably transforming between different coordinate systems (for a shared patch of a manifold), and probably want a single coordinate type say If we then chose to specially name a particular subset of coordinate systems for convenience or type safety, we lift some information into the type domain. To me this is quite generic and shouldn't be restricted to affine transformations. To be more concrete, I'd say this is exactly what we're doing with the motivation behind this (ie, defining NED, ENU frames etc): we've chosen to bless certain of the coordinate system information available to us by putting it in the type system. |
Sorry... how does immutable PointCoord{T <: Tuple}
data::T
end where |
All I'm getting at is something like I chose the naming |
Back in #1 we decided that
Transformation
was agnostic about input and output coordinate types. I still think this was the right thing, but sometimes you may want a bit more checking of the input and output types. This is perfectly possible when creating a customTransformation
functor, but it would be nice to be able to reuse the composition and inverse rules of existing types likeAffineMap
andLinearMap
.The text was updated successfully, but these errors were encountered: