hgeometry-0.8.0.0: Geometric Algorithms, Data structures, and Data types.

Safe HaskellNone
LanguageHaskell2010

Data.Geometry.Vector.VectorFamilyPeano

Contents

Synopsis

Natural number stuff

type One = S Z Source #

type Two = S One Source #

type Three = S Two Source #

type Many d = S (S (S (S (S d)))) Source #

type family FromPeano (d :: PeanoNum) :: Nat where ... Source #

Equations

FromPeano Z = 0 
FromPeano (S d) = 1 + FromPeano d 

data SingPeano (d :: PeanoNum) where Source #

Constructors

SZ :: SingPeano Z 
SS :: !(SingPeano d) -> SingPeano (S d) 

d dimensional Vectors

newtype VectorFamily (d :: PeanoNum) (r :: *) Source #

Datatype representing d dimensional vectors. The default implementation is based n VectorFixed. However, for small vectors we automatically select a more efficient representation.

Constructors

VectorFamily 

Fields

Instances
ImplicitArity d => Functor (VectorFamily d) Source # 
Instance details

Defined in Data.Geometry.Vector.VectorFamilyPeano

Methods

fmap :: (a -> b) -> VectorFamily d a -> VectorFamily d b #

(<$) :: a -> VectorFamily d b -> VectorFamily d a #

ImplicitArity d => Applicative (VectorFamily d) Source # 
Instance details

Defined in Data.Geometry.Vector.VectorFamilyPeano

Methods

pure :: a -> VectorFamily d a #

(<*>) :: VectorFamily d (a -> b) -> VectorFamily d a -> VectorFamily d b #

liftA2 :: (a -> b -> c) -> VectorFamily d a -> VectorFamily d b -> VectorFamily d c #

(*>) :: VectorFamily d a -> VectorFamily d b -> VectorFamily d b #

(<*) :: VectorFamily d a -> VectorFamily d b -> VectorFamily d a #

ImplicitArity d => Foldable (VectorFamily d) Source # 
Instance details

Defined in Data.Geometry.Vector.VectorFamilyPeano

Methods

fold :: Monoid m => VectorFamily d m -> m #

foldMap :: Monoid m => (a -> m) -> VectorFamily d a -> m #

foldr :: (a -> b -> b) -> b -> VectorFamily d a -> b #

foldr' :: (a -> b -> b) -> b -> VectorFamily d a -> b #

foldl :: (b -> a -> b) -> b -> VectorFamily d a -> b #

foldl' :: (b -> a -> b) -> b -> VectorFamily d a -> b #

foldr1 :: (a -> a -> a) -> VectorFamily d a -> a #

foldl1 :: (a -> a -> a) -> VectorFamily d a -> a #

toList :: VectorFamily d a -> [a] #

null :: VectorFamily d a -> Bool #

length :: VectorFamily d a -> Int #

elem :: Eq a => a -> VectorFamily d a -> Bool #

maximum :: Ord a => VectorFamily d a -> a #

minimum :: Ord a => VectorFamily d a -> a #

sum :: Num a => VectorFamily d a -> a #

product :: Num a => VectorFamily d a -> a #

ImplicitArity d => Traversable (VectorFamily d) Source # 
Instance details

Defined in Data.Geometry.Vector.VectorFamilyPeano

Methods

traverse :: Applicative f => (a -> f b) -> VectorFamily d a -> f (VectorFamily d b) #

sequenceA :: Applicative f => VectorFamily d (f a) -> f (VectorFamily d a) #

mapM :: Monad m => (a -> m b) -> VectorFamily d a -> m (VectorFamily d b) #

sequence :: Monad m => VectorFamily d (m a) -> m (VectorFamily d a) #

ImplicitArity d => Affine (VectorFamily d) Source # 
Instance details

Defined in Data.Geometry.Vector.VectorFamilyPeano

Associated Types

type Diff (VectorFamily d) :: Type -> Type #

Methods

(.-.) :: Num a => VectorFamily d a -> VectorFamily d a -> Diff (VectorFamily d) a #

(.+^) :: Num a => VectorFamily d a -> Diff (VectorFamily d) a -> VectorFamily d a #

(.-^) :: Num a => VectorFamily d a -> Diff (VectorFamily d) a -> VectorFamily d a #

ImplicitArity d => Metric (VectorFamily d) Source # 
Instance details

Defined in Data.Geometry.Vector.VectorFamilyPeano

Methods

dot :: Num a => VectorFamily d a -> VectorFamily d a -> a #

quadrance :: Num a => VectorFamily d a -> a #

qd :: Num a => VectorFamily d a -> VectorFamily d a -> a #

distance :: Floating a => VectorFamily d a -> VectorFamily d a -> a #

norm :: Floating a => VectorFamily d a -> a #

signorm :: Floating a => VectorFamily d a -> VectorFamily d a #

ImplicitArity d => Additive (VectorFamily d) Source # 
Instance details

Defined in Data.Geometry.Vector.VectorFamilyPeano

Methods

zero :: Num a => VectorFamily d a #

(^+^) :: Num a => VectorFamily d a -> VectorFamily d a -> VectorFamily d a #

(^-^) :: Num a => VectorFamily d a -> VectorFamily d a -> VectorFamily d a #

lerp :: Num a => a -> VectorFamily d a -> VectorFamily d a -> VectorFamily d a #

liftU2 :: (a -> a -> a) -> VectorFamily d a -> VectorFamily d a -> VectorFamily d a #

liftI2 :: (a -> b -> c) -> VectorFamily d a -> VectorFamily d b -> VectorFamily d c #

ImplicitArity d => Vector (VectorFamily d) r Source # 
Instance details

Defined in Data.Geometry.Vector.VectorFamilyPeano

Methods

construct :: Fun (Peano (Dim (VectorFamily d))) r (VectorFamily d r) #

inspect :: VectorFamily d r -> Fun (Peano (Dim (VectorFamily d))) r b -> b #

basicIndex :: VectorFamily d r -> Int -> r #

(Eq r, ImplicitArity d) => Eq (VectorFamily d r) Source # 
Instance details

Defined in Data.Geometry.Vector.VectorFamilyPeano

Methods

(==) :: VectorFamily d r -> VectorFamily d r -> Bool #

(/=) :: VectorFamily d r -> VectorFamily d r -> Bool #

(Ord r, ImplicitArity d) => Ord (VectorFamily d r) Source # 
Instance details

Defined in Data.Geometry.Vector.VectorFamilyPeano

(ImplicitArity d, Show r) => Show (VectorFamily d r) Source # 
Instance details

Defined in Data.Geometry.Vector.VectorFamilyPeano

(ToJSON r, ImplicitArity d) => ToJSON (VectorFamily d r) Source # 
Instance details

Defined in Data.Geometry.Vector.VectorFamilyPeano

(FromJSON r, ImplicitArity d) => FromJSON (VectorFamily d r) Source # 
Instance details

Defined in Data.Geometry.Vector.VectorFamilyPeano

(NFData r, ImplicitArity d) => NFData (VectorFamily d r) Source # 
Instance details

Defined in Data.Geometry.Vector.VectorFamilyPeano

Methods

rnf :: VectorFamily d r -> () #

ImplicitArity d => Ixed (VectorFamily d r) Source # 
Instance details

Defined in Data.Geometry.Vector.VectorFamilyPeano

type Dim (VectorFamily d) Source # 
Instance details

Defined in Data.Geometry.Vector.VectorFamilyPeano

type Diff (VectorFamily d) Source # 
Instance details

Defined in Data.Geometry.Vector.VectorFamilyPeano

type Index (VectorFamily d r) Source # 
Instance details

Defined in Data.Geometry.Vector.VectorFamilyPeano

type Index (VectorFamily d r) = Int
type IxValue (VectorFamily d r) Source # 
Instance details

Defined in Data.Geometry.Vector.VectorFamilyPeano

type IxValue (VectorFamily d r) = r

type family VectorFamilyF (d :: PeanoNum) :: * -> * where ... Source #

Mapping between the implementation type, and the actual implementation.

element' :: forall d r. ImplicitArity d => Int -> Traversal' (VectorFamily d r) r Source #

destruct :: (ImplicitArity d, ImplicitArity (S d)) => VectorFamily (S d) r -> (r, VectorFamily d r) Source #

Get the head and tail of a vector

snoc :: (ImplicitArity d, ImplicitArity (S d), (1 + FromPeano d) ~ (FromPeano d + 1)) => VectorFamily d r -> r -> VectorFamily (S d) r Source #