tup-functor-0.3.0.0: Homogeneous tuples

Safe Haskell None Haskell98

Data.Tup.Vec

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)

Example:

vec3 1 2 3  :: Vec3 Int
{{ 1,2,3 }} :: Vec3 Int
Cons 1 (Cons 2 (Cons 3 Empty)) :: Cons (Cons (Cons Empty)) Int

Synopsis

# The constructor types

data Empty a Source

Constructors

 Empty

Instances

 Functor Empty Applicative Empty Foldable Empty Traversable Empty Tup Empty Tup v => TupConcat Empty v v Bounded (Empty a) Eq (Empty a) Fractional a => Fractional (Empty a) Num a => Num (Empty a) Ord (Empty a) Show a => Show (Empty a) Storable a => Storable (Empty a) Monoid a => Monoid (Empty a)

data Cons v a Source

Constructors

 Cons a (v a)

Instances

 Functor v => Functor (Cons v) Applicative v => Applicative (Cons v) Foldable v => Foldable (Cons v) Traversable v => Traversable (Cons v) Tup v => Tup (Cons v) (Tup u, Tup v, TupConcat u v w) => TupConcat (Cons u) v (Cons w) (Bounded a, Bounded (v a)) => Bounded (Cons v a) (Eq a, Eq (v a)) => Eq (Cons v a) (Fractional a, Fractional (v a), Tup v) => Fractional (Cons v a) (Num a, Num (v a), Tup v) => Num (Cons v a) (Ord a, Ord (v a)) => Ord (Cons v a) (Show a, Tup v) => Show (Cons v a) (Storable a, Storable (v a), Tup v) => Storable (Cons v a) (Monoid a, Monoid (v a), Tup v) => Monoid (Cons v a)

consUndefTail :: Tup v => Cons v a -> v a Source

# Short constructor functions

vec1 :: a -> Vec1 a Source

vec2 :: a -> a -> Vec2 a Source

vec3 :: a -> a -> a -> Vec3 a Source

vec4 :: a -> a -> a -> a -> Vec4 a Source

vec5 :: a -> a -> a -> a -> a -> Vec5 a Source

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"

vecVec :: Applicative f => f a -> f a -> f (Vec2 a) Source

vecVec3 :: Applicative f => f a -> f a -> f a -> f (Vec3 a) Source

vecVec4 :: Applicative f => f a -> f a -> f a -> f a -> f (Vec4 a) Source

vecVec5 :: Applicative f => f a -> f a -> f a -> f a -> f a -> f (Vec5 a) Source