-- Hoogle documentation, generated by Haddock -- See Hoogle, http://www.haskell.org/hoogle/ -- | Fancy type system stuff for AC-Vector -- -- Adds various type system tricks to AC-Vector. (Requires several -- language extensions, including type families.) @package AC-Vector-Fancy @version 2.0.0 -- | Types denoting coordinate axies. module Data.Vector.Axis data AxisX AxisX :: AxisX data AxisY AxisY :: AxisY data AxisZ AxisZ :: AxisZ data AxisW AxisW :: AxisW instance Show AxisW instance Show AxisZ instance Show AxisY instance Show AxisX -- | Various facilities for dealing with vectors generically. module Data.Vector.Fancy -- | Class for generically reading/writing vector coordinates. class VectorAxis vector axis get_coord :: (VectorAxis vector axis) => axis -> vector -> Scalar set_coord :: (VectorAxis vector axis) => axis -> Scalar -> vector -> vector -- | This class relates two vector types having consecutive sizes. class Project lo hi orthographic_down :: (Project lo hi) => hi -> (lo, Scalar) orthographic_up :: (Project lo hi) => (lo, Scalar) -> hi perspective_down :: (Project lo hi) => hi -> (lo, Scalar) perspective_up :: (Project lo hi) => (lo, Scalar) -> hi instance Project Vector3 Vector4 instance Project Vector2 Vector3 instance Project Vector1 Vector2 instance VectorAxis Vector4 AxisW instance VectorAxis Vector4 AxisZ instance VectorAxis Vector3 AxisZ instance VectorAxis Vector4 AxisY instance VectorAxis Vector3 AxisY instance VectorAxis Vector2 AxisY instance VectorAxis Vector4 AxisX instance VectorAxis Vector3 AxisX instance VectorAxis Vector2 AxisX instance VectorAxis Vector1 AxisX -- | Generically handle transforms, and things that are transformable. module Data.Vector.Transform.Fancy -- | Class for transforms. class Transform t where { type family Point t :: *; } transformP :: (Transform t) => t -> Point t -> Point t translateT :: (Transform t) => Point t -> t scaleT :: (Transform t) => Point t -> t scaleT_ :: (Transform t) => Scalar -> t -- | Class for performing rotationes. (The rotations that exist vary with -- the number of spatial dimensions available.) class (Transform t) => Rotate t axis1 axis2 rotateT :: (Rotate t axis1 axis2, Angle a) => axis1 -> axis2 -> a Scalar -> t -- | Class for things that can be transformed (by a specific type of -- transform). class (Transform t) => Transformable t x transform :: (Transformable t x) => t -> x -> x instance Rotate Transform4 AxisZ AxisW instance Rotate Transform4 AxisY AxisW instance Rotate Transform4 AxisY AxisZ instance Rotate Transform4 AxisX AxisW instance Rotate Transform4 AxisX AxisZ instance Rotate Transform4 AxisX AxisY instance Rotate Transform3 AxisY AxisZ instance Rotate Transform3 AxisX AxisZ instance Rotate Transform3 AxisX AxisY instance Rotate Transform2 AxisX AxisY instance Transformable Transform4 Vector4 instance Transformable Transform3 Vector3 instance Transformable Transform2 Vector2 instance Transformable Transform1 Vector1 instance Transform Transform4 instance Transform Transform3 instance Transform Transform2 instance Transform Transform1