|
|
|
|
|
| Description |
Homogeneous lists with the length encoded in the type.
This can be considered as a different implementation of Data.Tup.Tup
(one which also scales for vectors/tuples longer than 9 elements)
|
|
| Synopsis |
|
| class (Functor v, Applicative v, Foldable v, Traversable v) => Vec v where | | | | type Vec0 = Empty | | | type Vec1 = Cons Vec0 | | | type Vec2 = Cons Vec1 | | | type Vec3 = Cons Vec2 | | | type Vec4 = Cons Vec3 | | | type Vec5 = Cons Vec4 | | | type Vec6 = Cons Vec5 | | | type Vec7 = Cons Vec6 | | | type Vec8 = Cons Vec7 | | | type Vec9 = Cons Vec8 | | | data Empty a = Empty | | | data Cons v a = Cons a (v a) | | | consUndefTail :: Vec v => Cons v a -> v a | | | maybeVecFromList :: Vec f => [a] -> Maybe (f a) | | | transposeVec :: (Vec f, Vec g) => f (g a) -> g (f a) | | | maybeVecConcat :: (Vec f, Vec g, Vec h) => f a -> g a -> Maybe (h a) | | | unsafeVecConcat :: (Vec f, Vec g, Vec h) => f a -> g a -> h a | | | class (Vec u, Vec v, Vec w) => VecConcat u v w | u v -> w where | | | | zipVecWith :: Applicative f => (a -> b -> c) -> f a -> f b -> f c | | | zipVecWith3 :: Applicative f => (a -> b -> c -> d) -> f a -> f b -> f c -> f d | | | zipVecWith4 :: Applicative f => (a -> b -> c -> d -> e) -> f a -> f b -> f c -> f d -> f e | | | zipVec :: Applicative f => f a -> f b -> f (a, b) | | | zipVec3 :: Applicative f => f a -> f b -> f c -> f (a, b, c) | | | zipVec4 :: Applicative f => f a -> f b -> f c -> f d -> f (a, b, c, d) | | | vec0 :: Vec0 a | | | vec1 :: a -> Vec1 a | | | vec2 :: a -> a -> Vec2 a | | | vec3 :: a -> a -> a -> Vec3 a | | | vec4 :: a -> a -> a -> a -> Vec4 a | | | vec5 :: a -> a -> a -> a -> a -> Vec5 a | | | vec6 :: a -> a -> a -> a -> a -> a -> Vec6 a | | | vec7 :: a -> a -> a -> a -> a -> a -> a -> Vec7 a | | | vec8 :: a -> a -> a -> a -> a -> a -> a -> a -> Vec8 a | | | vec9 :: a -> a -> a -> a -> a -> a -> a -> a -> a -> Vec9 a | | | vecVec :: Applicative f => f a -> f a -> f (Vec2 a) | | | vecVec3 :: Applicative f => f a -> f a -> f a -> f (Vec3 a) | | | vecVec4 :: Applicative f => f a -> f a -> f a -> f a -> f (Vec4 a) | | | vecVec5 :: Applicative f => f a -> f a -> f a -> f a -> f a -> f (Vec5 a) |
|
|
|
| The Vec type class
|
|
|
| | Methods | | | | | | vecFromList :: [a] -> v a | Source |
| | | | |
| | Instances | |
|
|
| Type abbreviations for short vectors
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| The constructor types
|
|
|
| Constructors | | Instances | |
|
|
|
| Constructors | | Instances | | Functor v => Functor (Cons v) | | Applicative v => Applicative (Cons v) | | Foldable v => Foldable (Cons v) | | Traversable v => Traversable (Cons v) | | Vec v => Vec (Cons v) | | (Vec u, Vec v, VecConcat u v w) => VecConcat (Cons u) v (Cons w) | | (Eq a, Eq (v a)) => Eq (Cons v a) | | (Fractional a, Fractional (v a), Vec v) => Fractional (Cons v a) | | (Num a, Num (v a), Vec v) => Num (Cons v a) | | (Ord a, Ord (v a)) => Ord (Cons v a) | | (Show a, Vec v) => Show (Cons v a) | | (Monoid a, Monoid (v a), Vec v) => Monoid (Cons v a) | | (Storable a, Storable (v a), Vec v) => Storable (Cons v a) |
|
|
|
|
|
| Misc
|
|
|
| Safe version of vecFromList.
|
|
|
| Transpose a Vec of Vecs.
|
|
| Concatenation
|
|
|
| safe concatenation
|
|
|
| unsafe concatenation
|
|
|
| concatenation with type class
| | | Methods | | vecConcat :: u a -> v a -> w a | Source |
|
| | Instances | |
|
|
| Zipping
|
|
|
|
|
|
| zipVecWith4 :: Applicative f => (a -> b -> c -> d -> e) -> f a -> f b -> f c -> f d -> f e | Source |
|
|
|
|
|
|
|
|
| Short constructor functions
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| vec6 :: a -> a -> a -> a -> a -> a -> Vec6 a | Source |
|
|
| vec7 :: a -> a -> a -> a -> a -> a -> a -> Vec7 a | Source |
|
|
| vec8 :: a -> a -> a -> a -> a -> a -> a -> a -> Vec8 a | Source |
|
|
| vec9 :: a -> a -> a -> a -> a -> a -> a -> a -> a -> Vec9 a | Source |
|
|
| "veccing"
|
|
|
|
|
|
|
|
|
|
| Produced by Haddock version 2.6.1 |