fixed-vector-hetero-0.6.1.1: Library for working with product types generically
Safe HaskellNone
LanguageHaskell2010

Data.Vector.HFixed.Class

Synopsis

Types and type classes

N-ary functions

type family Fn (f :: α -> *) (as :: [α]) b where ... Source #

Type family for N-ary function. Types of function parameters are encoded as the list of types.

Equations

Fn f '[] b = b 
Fn f (a ': as) b = f a -> Fn f as b 

type Fun = TFun Identity Source #

Newtype wrapper to work around of type families' lack of injectivity.

newtype TFun f as b Source #

Newtype wrapper for function where all type parameters have same type constructor. This type is required for writing function which works with monads, appicatives etc.

Constructors

TFun 

Fields

Instances

Instances details
Arity xs => Monad (TFun f xs) Source # 
Instance details

Defined in Data.Vector.HFixed.Class

Methods

(>>=) :: TFun f xs a -> (a -> TFun f xs b) -> TFun f xs b #

(>>) :: TFun f xs a -> TFun f xs b -> TFun f xs b #

return :: a -> TFun f xs a #

Arity xs => Functor (TFun f xs) Source # 
Instance details

Defined in Data.Vector.HFixed.Class

Methods

fmap :: (a -> b) -> TFun f xs a -> TFun f xs b #

(<$) :: a -> TFun f xs b -> TFun f xs a #

Arity xs => Applicative (TFun f xs) Source # 
Instance details

Defined in Data.Vector.HFixed.Class

Methods

pure :: a -> TFun f xs a #

(<*>) :: TFun f xs (a -> b) -> TFun f xs a -> TFun f xs b #

liftA2 :: (a -> b -> c) -> TFun f xs a -> TFun f xs b -> TFun f xs c #

(*>) :: TFun f xs a -> TFun f xs b -> TFun f xs b #

(<*) :: TFun f xs a -> TFun f xs b -> TFun f xs a #

Type functions

data Proxy (t :: k) #

Proxy is a type that holds no data, but has a phantom parameter of arbitrary type (or even kind). Its use is to provide type information, even though there is no value available of that type (or it may be too costly to create one).

Historically, Proxy :: Proxy a is a safer alternative to the undefined :: a idiom.

>>> Proxy :: Proxy (Void, Int -> Int)
Proxy

Proxy can even hold types of higher kinds,

>>> Proxy :: Proxy Either
Proxy
>>> Proxy :: Proxy Functor
Proxy
>>> Proxy :: Proxy complicatedStructure
Proxy

Constructors

Proxy 

Instances

Instances details
Generic1 (Proxy :: k -> Type)

Since: base-4.6.0.0

Instance details

Defined in GHC.Generics

Associated Types

type Rep1 Proxy :: k -> Type #

Methods

from1 :: forall (a :: k0). Proxy a -> Rep1 Proxy a #

to1 :: forall (a :: k0). Rep1 Proxy a -> Proxy a #

Monad (Proxy :: Type -> Type)

Since: base-4.7.0.0

Instance details

Defined in Data.Proxy

Methods

(>>=) :: Proxy a -> (a -> Proxy b) -> Proxy b #

(>>) :: Proxy a -> Proxy b -> Proxy b #

return :: a -> Proxy a #

Functor (Proxy :: Type -> Type)

Since: base-4.7.0.0

Instance details

Defined in Data.Proxy

Methods

fmap :: (a -> b) -> Proxy a -> Proxy b #

(<$) :: a -> Proxy b -> Proxy a #

Applicative (Proxy :: Type -> Type)

Since: base-4.7.0.0

Instance details

Defined in Data.Proxy

Methods

pure :: a -> Proxy a #

(<*>) :: Proxy (a -> b) -> Proxy a -> Proxy b #

liftA2 :: (a -> b -> c) -> Proxy a -> Proxy b -> Proxy c #

(*>) :: Proxy a -> Proxy b -> Proxy b #

(<*) :: Proxy a -> Proxy b -> Proxy a #

Foldable (Proxy :: Type -> Type)

Since: base-4.7.0.0

Instance details

Defined in Data.Foldable

Methods

fold :: Monoid m => Proxy m -> m #

foldMap :: Monoid m => (a -> m) -> Proxy a -> m #

foldMap' :: Monoid m => (a -> m) -> Proxy a -> m #

foldr :: (a -> b -> b) -> b -> Proxy a -> b #

foldr' :: (a -> b -> b) -> b -> Proxy a -> b #

foldl :: (b -> a -> b) -> b -> Proxy a -> b #

foldl' :: (b -> a -> b) -> b -> Proxy a -> b #

foldr1 :: (a -> a -> a) -> Proxy a -> a #

foldl1 :: (a -> a -> a) -> Proxy a -> a #

toList :: Proxy a -> [a] #

null :: Proxy a -> Bool #

length :: Proxy a -> Int #

elem :: Eq a => a -> Proxy a -> Bool #

maximum :: Ord a => Proxy a -> a #

minimum :: Ord a => Proxy a -> a #

sum :: Num a => Proxy a -> a #

product :: Num a => Proxy a -> a #

Traversable (Proxy :: Type -> Type)

Since: base-4.7.0.0

Instance details

Defined in Data.Traversable

Methods

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

sequenceA :: Applicative f => Proxy (f a) -> f (Proxy a) #

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

sequence :: Monad m => Proxy (m a) -> m (Proxy a) #

Eq1 (Proxy :: Type -> Type)

Since: base-4.9.0.0

Instance details

Defined in Data.Functor.Classes

Methods

liftEq :: (a -> b -> Bool) -> Proxy a -> Proxy b -> Bool #

Ord1 (Proxy :: Type -> Type)

Since: base-4.9.0.0

Instance details

Defined in Data.Functor.Classes

Methods

liftCompare :: (a -> b -> Ordering) -> Proxy a -> Proxy b -> Ordering #

Read1 (Proxy :: Type -> Type)

Since: base-4.9.0.0

Instance details

Defined in Data.Functor.Classes

Methods

liftReadsPrec :: (Int -> ReadS a) -> ReadS [a] -> Int -> ReadS (Proxy a) #

liftReadList :: (Int -> ReadS a) -> ReadS [a] -> ReadS [Proxy a] #

liftReadPrec :: ReadPrec a -> ReadPrec [a] -> ReadPrec (Proxy a) #

liftReadListPrec :: ReadPrec a -> ReadPrec [a] -> ReadPrec [Proxy a] #

Show1 (Proxy :: Type -> Type)

Since: base-4.9.0.0

Instance details

Defined in Data.Functor.Classes

Methods

liftShowsPrec :: (Int -> a -> ShowS) -> ([a] -> ShowS) -> Int -> Proxy a -> ShowS #

liftShowList :: (Int -> a -> ShowS) -> ([a] -> ShowS) -> [Proxy a] -> ShowS #

Alternative (Proxy :: Type -> Type)

Since: base-4.9.0.0

Instance details

Defined in Data.Proxy

Methods

empty :: Proxy a #

(<|>) :: Proxy a -> Proxy a -> Proxy a #

some :: Proxy a -> Proxy [a] #

many :: Proxy a -> Proxy [a] #

MonadPlus (Proxy :: Type -> Type)

Since: base-4.9.0.0

Instance details

Defined in Data.Proxy

Methods

mzero :: Proxy a #

mplus :: Proxy a -> Proxy a -> Proxy a #

NFData1 (Proxy :: Type -> Type)

Since: deepseq-1.4.3.0

Instance details

Defined in Control.DeepSeq

Methods

liftRnf :: (a -> ()) -> Proxy a -> () #

Vector (Proxy :: Type -> Type) a 
Instance details

Defined in Data.Vector.Fixed.Cont

Methods

construct :: Fun (Peano (Dim Proxy)) a (Proxy a) #

inspect :: Proxy a -> Fun (Peano (Dim Proxy)) a b -> b #

basicIndex :: Proxy a -> Int -> a #

Bounded (Proxy t)

Since: base-4.7.0.0

Instance details

Defined in Data.Proxy

Methods

minBound :: Proxy t #

maxBound :: Proxy t #

Enum (Proxy s)

Since: base-4.7.0.0

Instance details

Defined in Data.Proxy

Methods

succ :: Proxy s -> Proxy s #

pred :: Proxy s -> Proxy s #

toEnum :: Int -> Proxy s #

fromEnum :: Proxy s -> Int #

enumFrom :: Proxy s -> [Proxy s] #

enumFromThen :: Proxy s -> Proxy s -> [Proxy s] #

enumFromTo :: Proxy s -> Proxy s -> [Proxy s] #

enumFromThenTo :: Proxy s -> Proxy s -> Proxy s -> [Proxy s] #

Eq (Proxy s)

Since: base-4.7.0.0

Instance details

Defined in Data.Proxy

Methods

(==) :: Proxy s -> Proxy s -> Bool #

(/=) :: Proxy s -> Proxy s -> Bool #

Ord (Proxy s)

Since: base-4.7.0.0

Instance details

Defined in Data.Proxy

Methods

compare :: Proxy s -> Proxy s -> Ordering #

(<) :: Proxy s -> Proxy s -> Bool #

(<=) :: Proxy s -> Proxy s -> Bool #

(>) :: Proxy s -> Proxy s -> Bool #

(>=) :: Proxy s -> Proxy s -> Bool #

max :: Proxy s -> Proxy s -> Proxy s #

min :: Proxy s -> Proxy s -> Proxy s #

Read (Proxy t)

Since: base-4.7.0.0

Instance details

Defined in Data.Proxy

Show (Proxy s)

Since: base-4.7.0.0

Instance details

Defined in Data.Proxy

Methods

showsPrec :: Int -> Proxy s -> ShowS #

show :: Proxy s -> String #

showList :: [Proxy s] -> ShowS #

Ix (Proxy s)

Since: base-4.7.0.0

Instance details

Defined in Data.Proxy

Methods

range :: (Proxy s, Proxy s) -> [Proxy s] #

index :: (Proxy s, Proxy s) -> Proxy s -> Int #

unsafeIndex :: (Proxy s, Proxy s) -> Proxy s -> Int #

inRange :: (Proxy s, Proxy s) -> Proxy s -> Bool #

rangeSize :: (Proxy s, Proxy s) -> Int #

unsafeRangeSize :: (Proxy s, Proxy s) -> Int #

Generic (Proxy t)

Since: base-4.6.0.0

Instance details

Defined in GHC.Generics

Associated Types

type Rep (Proxy t) :: Type -> Type #

Methods

from :: Proxy t -> Rep (Proxy t) x #

to :: Rep (Proxy t) x -> Proxy t #

Semigroup (Proxy s)

Since: base-4.9.0.0

Instance details

Defined in Data.Proxy

Methods

(<>) :: Proxy s -> Proxy s -> Proxy s #

sconcat :: NonEmpty (Proxy s) -> Proxy s #

stimes :: Integral b => b -> Proxy s -> Proxy s #

Monoid (Proxy s)

Since: base-4.7.0.0

Instance details

Defined in Data.Proxy

Methods

mempty :: Proxy s #

mappend :: Proxy s -> Proxy s -> Proxy s #

mconcat :: [Proxy s] -> Proxy s #

NFData (Proxy a)

Since: deepseq-1.4.0.0

Instance details

Defined in Control.DeepSeq

Methods

rnf :: Proxy a -> () #

type Rep1 (Proxy :: k -> Type) 
Instance details

Defined in GHC.Generics

type Rep1 (Proxy :: k -> Type) = D1 ('MetaData "Proxy" "Data.Proxy" "base" 'False) (C1 ('MetaCons "Proxy" 'PrefixI 'False) (U1 :: k -> Type))
type Dim (Proxy :: Type -> Type) 
Instance details

Defined in Data.Vector.Fixed.Cont

type Dim (Proxy :: Type -> Type) = 0
type Rep (Proxy t) 
Instance details

Defined in GHC.Generics

type Rep (Proxy t) = D1 ('MetaData "Proxy" "Data.Proxy" "base" 'False) (C1 ('MetaCons "Proxy" 'PrefixI 'False) (U1 :: Type -> Type))

type family (xs :: [α]) ++ (ys :: [α]) :: [α] where ... Source #

Concaternation of type level lists.

Equations

'[] ++ ys = ys 
(x ': xs) ++ ys = x ': (xs ++ ys) 

type family Len (xs :: [α]) :: PeanoNum where ... Source #

Length of type list expressed as type level naturals from fixed-vector.

Equations

Len '[] = 'Z 
Len (x ': xs) = 'S (Len xs) 

type family HomList (n :: PeanoNum) (a :: α) :: [α] where ... Source #

Homogeneous type list with length n and element of type a. It uses type level natural defined in fixed-vector.

Equations

HomList 'Z a = '[] 
HomList ('S n) a = a ': HomList n a 

Type classes

class Arity (xs :: [α]) where Source #

Type class for dealing with N-ary function in generic way. Both accum and apply work with accumulator data types which are polymorphic. So it's only possible to write functions which rearrange elements in vector using plain ADT. It's possible to get around it by using GADT as accumulator (See ArityC and function which use it)

This is also somewhat a kitchen sink module. It contains witnesses which could be used to prove type equalities or to bring instance in scope.

Methods

accum Source #

Arguments

:: (forall a as. t (a ': as) -> f a -> t as)

Step function. Applies element to accumulator.

-> (t '[] -> b)

Extract value from accumulator.

-> t xs

Initial state.

-> TFun f xs b 

Fold over N elements exposed as N-ary function.

apply Source #

Arguments

:: (forall a as. t (a ': as) -> (f a, t as))

Extract value to be applied to function.

-> t xs

Initial state.

-> ContVecF xs f 

Apply values to N-ary function

arity :: p xs -> Int Source #

Size of type list as integer.

Instances

Instances details
Arity ('[] :: [α]) Source # 
Instance details

Defined in Data.Vector.HFixed.Class

Methods

accum :: (forall (a :: α0) (as :: [α0]). t (a ': as) -> f a -> t as) -> (t '[] -> b) -> t '[] -> TFun f '[] b Source #

apply :: (forall (a :: α0) (as :: [α0]). t (a ': as) -> (f a, t as)) -> t '[] -> ContVecF '[] f Source #

arity :: p '[] -> Int Source #

Arity xs => Arity (x ': xs :: [α]) Source # 
Instance details

Defined in Data.Vector.HFixed.Class

Methods

accum :: (forall (a :: α0) (as :: [α0]). t (a ': as) -> f a -> t as) -> (t '[] -> b) -> t (x ': xs) -> TFun f (x ': xs) b Source #

apply :: (forall (a :: α0) (as :: [α0]). t (a ': as) -> (f a, t as)) -> t (x ': xs) -> ContVecF (x ': xs) f Source #

arity :: p (x ': xs) -> Int Source #

class Arity xs => ArityC c xs where Source #

Methods

accumC Source #

Arguments

:: proxy c 
-> (forall a as. c a => t (a ': as) -> f a -> t as)

Step function. Applies element to accumulator.

-> (t '[] -> b)

Extract value from accumulator.

-> t xs

Initial state.

-> TFun f xs b 

applyC Source #

Arguments

:: proxy c 
-> (forall a as. c a => t (a ': as) -> (f a, t as))

Extract value to be applied to function.

-> t xs

Initial state.

-> ContVecF xs f 

Apply values to N-ary function

Instances

Instances details
ArityC (c :: α -> Constraint) ('[] :: [α]) Source # 
Instance details

Defined in Data.Vector.HFixed.Class

Methods

accumC :: proxy c -> (forall (a :: α0) (as :: [α0]). c a => t (a ': as) -> f a -> t as) -> (t '[] -> b) -> t '[] -> TFun f '[] b Source #

applyC :: proxy c -> (forall (a :: α0) (as :: [α0]). c a => t (a ': as) -> (f a, t as)) -> t '[] -> ContVecF '[] f Source #

(c x, ArityC c xs) => ArityC (c :: a -> Constraint) (x ': xs :: [a]) Source # 
Instance details

Defined in Data.Vector.HFixed.Class

Methods

accumC :: proxy c -> (forall (a0 :: α) (as :: [α]). c a0 => t (a0 ': as) -> f a0 -> t as) -> (t '[] -> b) -> t (x ': xs) -> TFun f (x ': xs) b Source #

applyC :: proxy c -> (forall (a0 :: α) (as :: [α]). c a0 => t (a0 ': as) -> (f a0, t as)) -> t (x ': xs) -> ContVecF (x ': xs) f Source #

class (c1 a, c2 a) => (c1 :&&: c2) a Source #

Type class for combining two constraint constructors. Those are required for ArityC type class.

Instances

Instances details
(c1 a, c2 a) => ((c1 :: k -> Constraint) :&&: (c2 :: k -> Constraint)) (a :: k) Source # 
Instance details

Defined in Data.Vector.HFixed.Class

class Arity (Elems v) => HVector v where Source #

Type class for product type. Any product type could have instance of this type. Its methods describe how to construct and deconstruct data type. For example instance for simple data type with two fields could be written as:

data A a = A Int a

instance HVector (A a) where
  type Elems (A a) = '[Int,a]
  construct = TFun $ \i a -> A i a
  inspect (A i a) (TFun f) = f i a

Another equivalent description of this type class is descibes isomorphism between data type and ContVec, where constuct implements ContVec → a (see vector) and inspect implements a → ContVec (see cvec)

Istances should satisfy one law:

inspect v construct = v

Default implementation which uses Generic is provided.

Minimal complete definition

Nothing

Associated Types

type Elems v :: [*] Source #

type Elems v = GElems (Rep v)

Methods

construct :: Fun (Elems v) v Source #

Function for constructing vector

default construct :: (Generic v, GHVector (Rep v), GElems (Rep v) ~ Elems v) => Fun (Elems v) v Source #

inspect :: v -> Fun (Elems v) a -> a Source #

Function for deconstruction of vector. It applies vector's elements to N-ary function.

default inspect :: (Generic v, GHVector (Rep v), GElems (Rep v) ~ Elems v) => v -> Fun (Elems v) a -> a Source #

Instances

Instances details
HVector () Source #

Unit is empty heterogeneous vector

Instance details

Defined in Data.Vector.HFixed.Class

Associated Types

type Elems () :: [Type] Source #

Methods

construct :: Fun (Elems ()) () Source #

inspect :: () -> Fun (Elems ()) a -> a Source #

HVector (Complex a) Source # 
Instance details

Defined in Data.Vector.HFixed.Class

Associated Types

type Elems (Complex a) :: [Type] Source #

Methods

construct :: Fun (Elems (Complex a)) (Complex a) Source #

inspect :: Complex a -> Fun (Elems (Complex a)) a0 -> a0 Source #

Arity xs => HVector (VecList xs) Source # 
Instance details

Defined in Data.Vector.HFixed.Cont

Associated Types

type Elems (VecList xs) :: [Type] Source #

Methods

construct :: Fun (Elems (VecList xs)) (VecList xs) Source #

inspect :: VecList xs -> Fun (Elems (VecList xs)) a -> a Source #

Arity xs => HVector (HVec xs) Source # 
Instance details

Defined in Data.Vector.HFixed.HVec

Associated Types

type Elems (HVec xs) :: [Type] Source #

Methods

construct :: Fun (Elems (HVec xs)) (HVec xs) Source #

inspect :: HVec xs -> Fun (Elems (HVec xs)) a -> a Source #

HVector (a, b) Source # 
Instance details

Defined in Data.Vector.HFixed.Class

Associated Types

type Elems (a, b) :: [Type] Source #

Methods

construct :: Fun (Elems (a, b)) (a, b) Source #

inspect :: (a, b) -> Fun (Elems (a, b)) a0 -> a0 Source #

(Unbox n a, HomArity (Peano n) a, KnownNat n, Peano (n + 1) ~ 'S (Peano n)) => HVector (Vec n a) Source # 
Instance details

Defined in Data.Vector.HFixed.Class

Associated Types

type Elems (Vec n a) :: [Type] Source #

Methods

construct :: Fun (Elems (Vec n a)) (Vec n a) Source #

inspect :: Vec n a -> Fun (Elems (Vec n a)) a0 -> a0 Source #

(Storable a, HomArity (Peano n) a, KnownNat n, Peano (n + 1) ~ 'S (Peano n)) => HVector (Vec n a) Source # 
Instance details

Defined in Data.Vector.HFixed.Class

Associated Types

type Elems (Vec n a) :: [Type] Source #

Methods

construct :: Fun (Elems (Vec n a)) (Vec n a) Source #

inspect :: Vec n a -> Fun (Elems (Vec n a)) a0 -> a0 Source #

(Prim a, HomArity (Peano n) a, KnownNat n, Peano (n + 1) ~ 'S (Peano n)) => HVector (Vec n a) Source # 
Instance details

Defined in Data.Vector.HFixed.Class

Associated Types

type Elems (Vec n a) :: [Type] Source #

Methods

construct :: Fun (Elems (Vec n a)) (Vec n a) Source #

inspect :: Vec n a -> Fun (Elems (Vec n a)) a0 -> a0 Source #

(HomArity (Peano n) a, KnownNat n, Peano (n + 1) ~ 'S (Peano n)) => HVector (Vec n a) Source # 
Instance details

Defined in Data.Vector.HFixed.Class

Associated Types

type Elems (Vec n a) :: [Type] Source #

Methods

construct :: Fun (Elems (Vec n a)) (Vec n a) Source #

inspect :: Vec n a -> Fun (Elems (Vec n a)) a0 -> a0 Source #

HVector (a, b, c) Source # 
Instance details

Defined in Data.Vector.HFixed.Class

Associated Types

type Elems (a, b, c) :: [Type] Source #

Methods

construct :: Fun (Elems (a, b, c)) (a, b, c) Source #

inspect :: (a, b, c) -> Fun (Elems (a, b, c)) a0 -> a0 Source #

Arity xs => HVector (ContVecF xs Identity) Source # 
Instance details

Defined in Data.Vector.HFixed.Class

Associated Types

type Elems (ContVecF xs Identity) :: [Type] Source #

HVector (a, b, c, d) Source # 
Instance details

Defined in Data.Vector.HFixed.Class

Associated Types

type Elems (a, b, c, d) :: [Type] Source #

Methods

construct :: Fun (Elems (a, b, c, d)) (a, b, c, d) Source #

inspect :: (a, b, c, d) -> Fun (Elems (a, b, c, d)) a0 -> a0 Source #

HVector (a, b, c, d, e) Source # 
Instance details

Defined in Data.Vector.HFixed.Class

Associated Types

type Elems (a, b, c, d, e) :: [Type] Source #

Methods

construct :: Fun (Elems (a, b, c, d, e)) (a, b, c, d, e) Source #

inspect :: (a, b, c, d, e) -> Fun (Elems (a, b, c, d, e)) a0 -> a0 Source #

HVector (a, b, c, d, e, f) Source # 
Instance details

Defined in Data.Vector.HFixed.Class

Associated Types

type Elems (a, b, c, d, e, f) :: [Type] Source #

Methods

construct :: Fun (Elems (a, b, c, d, e, f)) (a, b, c, d, e, f) Source #

inspect :: (a, b, c, d, e, f) -> Fun (Elems (a, b, c, d, e, f)) a0 -> a0 Source #

HVector (a, b, c, d, e, f, g) Source # 
Instance details

Defined in Data.Vector.HFixed.Class

Associated Types

type Elems (a, b, c, d, e, f, g) :: [Type] Source #

Methods

construct :: Fun (Elems (a, b, c, d, e, f, g)) (a, b, c, d, e, f, g) Source #

inspect :: (a, b, c, d, e, f, g) -> Fun (Elems (a, b, c, d, e, f, g)) a0 -> a0 Source #

HVector (a, b, c, d, e, f, g, h) Source # 
Instance details

Defined in Data.Vector.HFixed.Class

Associated Types

type Elems (a, b, c, d, e, f, g, h) :: [Type] Source #

Methods

construct :: Fun (Elems (a, b, c, d, e, f, g, h)) (a, b, c, d, e, f, g, h) Source #

inspect :: (a, b, c, d, e, f, g, h) -> Fun (Elems (a, b, c, d, e, f, g, h)) a0 -> a0 Source #

HVector (a, b, c, d, e, f, g, h, i) Source # 
Instance details

Defined in Data.Vector.HFixed.Class

Associated Types

type Elems (a, b, c, d, e, f, g, h, i) :: [Type] Source #

Methods

construct :: Fun (Elems (a, b, c, d, e, f, g, h, i)) (a, b, c, d, e, f, g, h, i) Source #

inspect :: (a, b, c, d, e, f, g, h, i) -> Fun (Elems (a, b, c, d, e, f, g, h, i)) a0 -> a0 Source #

HVector (a, b, c, d, e, f, g, h, i, j) Source # 
Instance details

Defined in Data.Vector.HFixed.Class

Associated Types

type Elems (a, b, c, d, e, f, g, h, i, j) :: [Type] Source #

Methods

construct :: Fun (Elems (a, b, c, d, e, f, g, h, i, j)) (a, b, c, d, e, f, g, h, i, j) Source #

inspect :: (a, b, c, d, e, f, g, h, i, j) -> Fun (Elems (a, b, c, d, e, f, g, h, i, j)) a0 -> a0 Source #

HVector (a, b, c, d, e, f, g, h, i, j, k) Source # 
Instance details

Defined in Data.Vector.HFixed.Class

Associated Types

type Elems (a, b, c, d, e, f, g, h, i, j, k) :: [Type] Source #

Methods

construct :: Fun (Elems (a, b, c, d, e, f, g, h, i, j, k)) (a, b, c, d, e, f, g, h, i, j, k) Source #

inspect :: (a, b, c, d, e, f, g, h, i, j, k) -> Fun (Elems (a, b, c, d, e, f, g, h, i, j, k)) a0 -> a0 Source #

HVector (a, b, c, d, e, f, g, h, i, j, k, l) Source # 
Instance details

Defined in Data.Vector.HFixed.Class

Associated Types

type Elems (a, b, c, d, e, f, g, h, i, j, k, l) :: [Type] Source #

Methods

construct :: Fun (Elems (a, b, c, d, e, f, g, h, i, j, k, l)) (a, b, c, d, e, f, g, h, i, j, k, l) Source #

inspect :: (a, b, c, d, e, f, g, h, i, j, k, l) -> Fun (Elems (a, b, c, d, e, f, g, h, i, j, k, l)) a0 -> a0 Source #

HVector (a, b, c, d, e, f, g, h, i, j, k, l, m) Source # 
Instance details

Defined in Data.Vector.HFixed.Class

Associated Types

type Elems (a, b, c, d, e, f, g, h, i, j, k, l, m) :: [Type] Source #

Methods

construct :: Fun (Elems (a, b, c, d, e, f, g, h, i, j, k, l, m)) (a, b, c, d, e, f, g, h, i, j, k, l, m) Source #

inspect :: (a, b, c, d, e, f, g, h, i, j, k, l, m) -> Fun (Elems (a, b, c, d, e, f, g, h, i, j, k, l, m)) a0 -> a0 Source #

HVector (a, b, c, d, e, f, g, h, i, j, k, l, m, n) Source # 
Instance details

Defined in Data.Vector.HFixed.Class

Associated Types

type Elems (a, b, c, d, e, f, g, h, i, j, k, l, m, n) :: [Type] Source #

Methods

construct :: Fun (Elems (a, b, c, d, e, f, g, h, i, j, k, l, m, n)) (a, b, c, d, e, f, g, h, i, j, k, l, m, n) Source #

inspect :: (a, b, c, d, e, f, g, h, i, j, k, l, m, n) -> Fun (Elems (a, b, c, d, e, f, g, h, i, j, k, l, m, n)) a0 -> a0 Source #

HVector (a, b, c, d, e, f, g, h, i, j, k, l, m, n, o) Source # 
Instance details

Defined in Data.Vector.HFixed.Class

Associated Types

type Elems (a, b, c, d, e, f, g, h, i, j, k, l, m, n, o) :: [Type] Source #

Methods

construct :: Fun (Elems (a, b, c, d, e, f, g, h, i, j, k, l, m, n, o)) (a, b, c, d, e, f, g, h, i, j, k, l, m, n, o) Source #

inspect :: (a, b, c, d, e, f, g, h, i, j, k, l, m, n, o) -> Fun (Elems (a, b, c, d, e, f, g, h, i, j, k, l, m, n, o)) a0 -> a0 Source #

HVector (a, b, c, d, e, f, g, h, i, j, k, l, m, n, o, p) Source # 
Instance details

Defined in Data.Vector.HFixed.Class

Associated Types

type Elems (a, b, c, d, e, f, g, h, i, j, k, l, m, n, o, p) :: [Type] Source #

Methods

construct :: Fun (Elems (a, b, c, d, e, f, g, h, i, j, k, l, m, n, o, p)) (a, b, c, d, e, f, g, h, i, j, k, l, m, n, o, p) Source #

inspect :: (a, b, c, d, e, f, g, h, i, j, k, l, m, n, o, p) -> Fun (Elems (a, b, c, d, e, f, g, h, i, j, k, l, m, n, o, p)) a0 -> a0 Source #

HVector (a, b, c, d, e, f, g, h, i, j, k, l, m, n, o, p, q) Source # 
Instance details

Defined in Data.Vector.HFixed.Class

Associated Types

type Elems (a, b, c, d, e, f, g, h, i, j, k, l, m, n, o, p, q) :: [Type] Source #

Methods

construct :: Fun (Elems (a, b, c, d, e, f, g, h, i, j, k, l, m, n, o, p, q)) (a, b, c, d, e, f, g, h, i, j, k, l, m, n, o, p, q) Source #

inspect :: (a, b, c, d, e, f, g, h, i, j, k, l, m, n, o, p, q) -> Fun (Elems (a, b, c, d, e, f, g, h, i, j, k, l, m, n, o, p, q)) a0 -> a0 Source #

HVector (a, b, c, d, e, f, g, h, i, j, k, l, m, n, o, p, q, r) Source # 
Instance details

Defined in Data.Vector.HFixed.Class

Associated Types

type Elems (a, b, c, d, e, f, g, h, i, j, k, l, m, n, o, p, q, r) :: [Type] Source #

Methods

construct :: Fun (Elems (a, b, c, d, e, f, g, h, i, j, k, l, m, n, o, p, q, r)) (a, b, c, d, e, f, g, h, i, j, k, l, m, n, o, p, q, r) Source #

inspect :: (a, b, c, d, e, f, g, h, i, j, k, l, m, n, o, p, q, r) -> Fun (Elems (a, b, c, d, e, f, g, h, i, j, k, l, m, n, o, p, q, r)) a0 -> a0 Source #

HVector (a, b, c, d, e, f, g, h, i, j, k, l, m, n, o, p, q, r, s) Source # 
Instance details

Defined in Data.Vector.HFixed.Class

Associated Types

type Elems (a, b, c, d, e, f, g, h, i, j, k, l, m, n, o, p, q, r, s) :: [Type] Source #

Methods

construct :: Fun (Elems (a, b, c, d, e, f, g, h, i, j, k, l, m, n, o, p, q, r, s)) (a, b, c, d, e, f, g, h, i, j, k, l, m, n, o, p, q, r, s) Source #

inspect :: (a, b, c, d, e, f, g, h, i, j, k, l, m, n, o, p, q, r, s) -> Fun (Elems (a, b, c, d, e, f, g, h, i, j, k, l, m, n, o, p, q, r, s)) a0 -> a0 Source #

HVector (a, b, c, d, e, f, g, h, i, j, k, l, m, n, o, p, q, r, s, t) Source # 
Instance details

Defined in Data.Vector.HFixed.Class

Associated Types

type Elems (a, b, c, d, e, f, g, h, i, j, k, l, m, n, o, p, q, r, s, t) :: [Type] Source #

Methods

construct :: Fun (Elems (a, b, c, d, e, f, g, h, i, j, k, l, m, n, o, p, q, r, s, t)) (a, b, c, d, e, f, g, h, i, j, k, l, m, n, o, p, q, r, s, t) Source #

inspect :: (a, b, c, d, e, f, g, h, i, j, k, l, m, n, o, p, q, r, s, t) -> Fun (Elems (a, b, c, d, e, f, g, h, i, j, k, l, m, n, o, p, q, r, s, t)) a0 -> a0 Source #

HVector (a, b, c, d, e, f, g, h, i, j, k, l, m, n, o, p, q, r, s, t, u) Source # 
Instance details

Defined in Data.Vector.HFixed.Class

Associated Types

type Elems (a, b, c, d, e, f, g, h, i, j, k, l, m, n, o, p, q, r, s, t, u) :: [Type] Source #

Methods

construct :: Fun (Elems (a, b, c, d, e, f, g, h, i, j, k, l, m, n, o, p, q, r, s, t, u)) (a, b, c, d, e, f, g, h, i, j, k, l, m, n, o, p, q, r, s, t, u) Source #

inspect :: (a, b, c, d, e, f, g, h, i, j, k, l, m, n, o, p, q, r, s, t, u) -> Fun (Elems (a, b, c, d, e, f, g, h, i, j, k, l, m, n, o, p, q, r, s, t, u)) a0 -> a0 Source #

HVector (a, b, c, d, e, f, g, h, i, j, k, l, m, n, o, p, q, r, s, t, u, v) Source # 
Instance details

Defined in Data.Vector.HFixed.Class

Associated Types

type Elems (a, b, c, d, e, f, g, h, i, j, k, l, m, n, o, p, q, r, s, t, u, v) :: [Type] Source #

Methods

construct :: Fun (Elems (a, b, c, d, e, f, g, h, i, j, k, l, m, n, o, p, q, r, s, t, u, v)) (a, b, c, d, e, f, g, h, i, j, k, l, m, n, o, p, q, r, s, t, u, v) Source #

inspect :: (a, b, c, d, e, f, g, h, i, j, k, l, m, n, o, p, q, r, s, t, u, v) -> Fun (Elems (a, b, c, d, e, f, g, h, i, j, k, l, m, n, o, p, q, r, s, t, u, v)) a0 -> a0 Source #

HVector (a, b, c, d, e, f, g, h, i, j, k, l, m, n, o, p, q, r, s, t, u, v, w) Source # 
Instance details

Defined in Data.Vector.HFixed.Class

Associated Types

type Elems (a, b, c, d, e, f, g, h, i, j, k, l, m, n, o, p, q, r, s, t, u, v, w) :: [Type] Source #

Methods

construct :: Fun (Elems (a, b, c, d, e, f, g, h, i, j, k, l, m, n, o, p, q, r, s, t, u, v, w)) (a, b, c, d, e, f, g, h, i, j, k, l, m, n, o, p, q, r, s, t, u, v, w) Source #

inspect :: (a, b, c, d, e, f, g, h, i, j, k, l, m, n, o, p, q, r, s, t, u, v, w) -> Fun (Elems (a, b, c, d, e, f, g, h, i, j, k, l, m, n, o, p, q, r, s, t, u, v, w)) a0 -> a0 Source #

HVector (a, b, c, d, e, f, g, h, i, j, k, l, m, n, o, p, q, r, s, t, u, v, w, x) Source # 
Instance details

Defined in Data.Vector.HFixed.Class

Associated Types

type Elems (a, b, c, d, e, f, g, h, i, j, k, l, m, n, o, p, q, r, s, t, u, v, w, x) :: [Type] Source #

Methods

construct :: Fun (Elems (a, b, c, d, e, f, g, h, i, j, k, l, m, n, o, p, q, r, s, t, u, v, w, x)) (a, b, c, d, e, f, g, h, i, j, k, l, m, n, o, p, q, r, s, t, u, v, w, x) Source #

inspect :: (a, b, c, d, e, f, g, h, i, j, k, l, m, n, o, p, q, r, s, t, u, v, w, x) -> Fun (Elems (a, b, c, d, e, f, g, h, i, j, k, l, m, n, o, p, q, r, s, t, u, v, w, x)) a0 -> a0 Source #

HVector (a, b, c, d, e, f, g, h, i, j, k, l, m, n, o, p, q, r, s, t, u, v, w, x, y) Source # 
Instance details

Defined in Data.Vector.HFixed.Class

Associated Types

type Elems (a, b, c, d, e, f, g, h, i, j, k, l, m, n, o, p, q, r, s, t, u, v, w, x, y) :: [Type] Source #

Methods

construct :: Fun (Elems (a, b, c, d, e, f, g, h, i, j, k, l, m, n, o, p, q, r, s, t, u, v, w, x, y)) (a, b, c, d, e, f, g, h, i, j, k, l, m, n, o, p, q, r, s, t, u, v, w, x, y) Source #

inspect :: (a, b, c, d, e, f, g, h, i, j, k, l, m, n, o, p, q, r, s, t, u, v, w, x, y) -> Fun (Elems (a, b, c, d, e, f, g, h, i, j, k, l, m, n, o, p, q, r, s, t, u, v, w, x, y)) a0 -> a0 Source #

HVector (a, b, c, d, e, f, g, h, i, j, k, l, m, n, o, p, q, r, s, t, u, v, w, x, y, z) Source # 
Instance details

Defined in Data.Vector.HFixed.Class

Associated Types

type Elems (a, b, c, d, e, f, g, h, i, j, k, l, m, n, o, p, q, r, s, t, u, v, w, x, y, z) :: [Type] Source #

Methods

construct :: Fun (Elems (a, b, c, d, e, f, g, h, i, j, k, l, m, n, o, p, q, r, s, t, u, v, w, x, y, z)) (a, b, c, d, e, f, g, h, i, j, k, l, m, n, o, p, q, r, s, t, u, v, w, x, y, z) Source #

inspect :: (a, b, c, d, e, f, g, h, i, j, k, l, m, n, o, p, q, r, s, t, u, v, w, x, y, z) -> Fun (Elems (a, b, c, d, e, f, g, h, i, j, k, l, m, n, o, p, q, r, s, t, u, v, w, x, y, z)) a0 -> a0 Source #

HVector (a, b, c, d, e, f, g, h, i, j, k, l, m, n, o, p, q, r, s, t, u, v, w, x, y, z, a') Source # 
Instance details

Defined in Data.Vector.HFixed.Class

Associated Types

type Elems (a, b, c, d, e, f, g, h, i, j, k, l, m, n, o, p, q, r, s, t, u, v, w, x, y, z, a') :: [Type] Source #

Methods

construct :: Fun (Elems (a, b, c, d, e, f, g, h, i, j, k, l, m, n, o, p, q, r, s, t, u, v, w, x, y, z, a')) (a, b, c, d, e, f, g, h, i, j, k, l, m, n, o, p, q, r, s, t, u, v, w, x, y, z, a') Source #

inspect :: (a, b, c, d, e, f, g, h, i, j, k, l, m, n, o, p, q, r, s, t, u, v, w, x, y, z, a') -> Fun (Elems (a, b, c, d, e, f, g, h, i, j, k, l, m, n, o, p, q, r, s, t, u, v, w, x, y, z, a')) a0 -> a0 Source #

HVector (a, b, c, d, e, f, g, h, i, j, k, l, m, n, o, p, q, r, s, t, u, v, w, x, y, z, a', b') Source # 
Instance details

Defined in Data.Vector.HFixed.Class

Associated Types

type Elems (a, b, c, d, e, f, g, h, i, j, k, l, m, n, o, p, q, r, s, t, u, v, w, x, y, z, a', b') :: [Type] Source #

Methods

construct :: Fun (Elems (a, b, c, d, e, f, g, h, i, j, k, l, m, n, o, p, q, r, s, t, u, v, w, x, y, z, a', b')) (a, b, c, d, e, f, g, h, i, j, k, l, m, n, o, p, q, r, s, t, u, v, w, x, y, z, a', b') Source #

inspect :: (a, b, c, d, e, f, g, h, i, j, k, l, m, n, o, p, q, r, s, t, u, v, w, x, y, z, a', b') -> Fun (Elems (a, b, c, d, e, f, g, h, i, j, k, l, m, n, o, p, q, r, s, t, u, v, w, x, y, z, a', b')) a0 -> a0 Source #

HVector (a, b, c, d, e, f, g, h, i, j, k, l, m, n, o, p, q, r, s, t, u, v, w, x, y, z, a', b', c') Source # 
Instance details

Defined in Data.Vector.HFixed.Class

Associated Types

type Elems (a, b, c, d, e, f, g, h, i, j, k, l, m, n, o, p, q, r, s, t, u, v, w, x, y, z, a', b', c') :: [Type] Source #

Methods

construct :: Fun (Elems (a, b, c, d, e, f, g, h, i, j, k, l, m, n, o, p, q, r, s, t, u, v, w, x, y, z, a', b', c')) (a, b, c, d, e, f, g, h, i, j, k, l, m, n, o, p, q, r, s, t, u, v, w, x, y, z, a', b', c') Source #

inspect :: (a, b, c, d, e, f, g, h, i, j, k, l, m, n, o, p, q, r, s, t, u, v, w, x, y, z, a', b', c') -> Fun (Elems (a, b, c, d, e, f, g, h, i, j, k, l, m, n, o, p, q, r, s, t, u, v, w, x, y, z, a', b', c')) a0 -> a0 Source #

HVector (a, b, c, d, e, f, g, h, i, j, k, l, m, n, o, p, q, r, s, t, u, v, w, x, y, z, a', b', c', d') Source # 
Instance details

Defined in Data.Vector.HFixed.Class

Associated Types

type Elems (a, b, c, d, e, f, g, h, i, j, k, l, m, n, o, p, q, r, s, t, u, v, w, x, y, z, a', b', c', d') :: [Type] Source #

Methods

construct :: Fun (Elems (a, b, c, d, e, f, g, h, i, j, k, l, m, n, o, p, q, r, s, t, u, v, w, x, y, z, a', b', c', d')) (a, b, c, d, e, f, g, h, i, j, k, l, m, n, o, p, q, r, s, t, u, v, w, x, y, z, a', b', c', d') Source #

inspect :: (a, b, c, d, e, f, g, h, i, j, k, l, m, n, o, p, q, r, s, t, u, v, w, x, y, z, a', b', c', d') -> Fun (Elems (a, b, c, d, e, f, g, h, i, j, k, l, m, n, o, p, q, r, s, t, u, v, w, x, y, z, a', b', c', d')) a0 -> a0 Source #

HVector (a, b, c, d, e, f, g, h, i, j, k, l, m, n, o, p, q, r, s, t, u, v, w, x, y, z, a', b', c', d', e') Source # 
Instance details

Defined in Data.Vector.HFixed.Class

Associated Types

type Elems (a, b, c, d, e, f, g, h, i, j, k, l, m, n, o, p, q, r, s, t, u, v, w, x, y, z, a', b', c', d', e') :: [Type] Source #

Methods

construct :: Fun (Elems (a, b, c, d, e, f, g, h, i, j, k, l, m, n, o, p, q, r, s, t, u, v, w, x, y, z, a', b', c', d', e')) (a, b, c, d, e, f, g, h, i, j, k, l, m, n, o, p, q, r, s, t, u, v, w, x, y, z, a', b', c', d', e') Source #

inspect :: (a, b, c, d, e, f, g, h, i, j, k, l, m, n, o, p, q, r, s, t, u, v, w, x, y, z, a', b', c', d', e') -> Fun (Elems (a, b, c, d, e, f, g, h, i, j, k, l, m, n, o, p, q, r, s, t, u, v, w, x, y, z, a', b', c', d', e')) a0 -> a0 Source #

HVector (a, b, c, d, e, f, g, h, i, j, k, l, m, n, o, p, q, r, s, t, u, v, w, x, y, z, a', b', c', d', e', f') Source # 
Instance details

Defined in Data.Vector.HFixed.Class

Associated Types

type Elems (a, b, c, d, e, f, g, h, i, j, k, l, m, n, o, p, q, r, s, t, u, v, w, x, y, z, a', b', c', d', e', f') :: [Type] Source #

Methods

construct :: Fun (Elems (a, b, c, d, e, f, g, h, i, j, k, l, m, n, o, p, q, r, s, t, u, v, w, x, y, z, a', b', c', d', e', f')) (a, b, c, d, e, f, g, h, i, j, k, l, m, n, o, p, q, r, s, t, u, v, w, x, y, z, a', b', c', d', e', f') Source #

inspect :: (a, b, c, d, e, f, g, h, i, j, k, l, m, n, o, p, q, r, s, t, u, v, w, x, y, z, a', b', c', d', e', f') -> Fun (Elems (a, b, c, d, e, f, g, h, i, j, k, l, m, n, o, p, q, r, s, t, u, v, w, x, y, z, a', b', c', d', e', f')) a0 -> a0 Source #

tupleSize :: forall v proxy. HVector v => proxy v -> Int Source #

Number of elements in product type

class Arity (ElemsF v) => HVectorF (v :: (α -> *) -> *) where Source #

Type class for partially homogeneous vector where every element in the vector have same type constructor. Vector itself is parametrized by that constructor

Associated Types

type ElemsF v :: [α] Source #

Elements of the vector without type constructors

Methods

inspectF :: v f -> TFun f (ElemsF v) a -> a Source #

constructF :: TFun f (ElemsF v) (v f) Source #

Instances

Instances details
Arity xs => HVectorF (ContVecF xs :: (α -> Type) -> Type) Source # 
Instance details

Defined in Data.Vector.HFixed.Class

Associated Types

type ElemsF (ContVecF xs) :: [α] Source #

Methods

inspectF :: forall (f :: α0 -> Type) a. ContVecF xs f -> TFun f (ElemsF (ContVecF xs)) a -> a Source #

constructF :: forall (f :: α0 -> Type). TFun f (ElemsF (ContVecF xs)) (ContVecF xs f) Source #

Arity xs => HVectorF (VecListF xs :: (α -> Type) -> Type) Source # 
Instance details

Defined in Data.Vector.HFixed.Cont

Associated Types

type ElemsF (VecListF xs) :: [α] Source #

Methods

inspectF :: forall (f :: α0 -> Type) a. VecListF xs f -> TFun f (ElemsF (VecListF xs)) a -> a Source #

constructF :: forall (f :: α0 -> Type). TFun f (ElemsF (VecListF xs)) (VecListF xs f) Source #

Arity xs => HVectorF (HVecF xs :: (Type -> Type) -> Type) Source # 
Instance details

Defined in Data.Vector.HFixed.HVec

Associated Types

type ElemsF (HVecF xs) :: [α] Source #

Methods

inspectF :: forall (f :: α -> Type) a. HVecF xs f -> TFun f (ElemsF (HVecF xs)) a -> a Source #

constructF :: forall (f :: α -> Type). TFun f (ElemsF (HVecF xs)) (HVecF xs f) Source #

tupleSizeF :: forall v f proxy. HVectorF v => proxy (v f) -> Int Source #

Number of elements in parametrized product type

Lookup in vector

class ArityPeano n => Index (n :: PeanoNum) (xs :: [*]) where Source #

Indexing of vectors

Associated Types

type ValueAt n xs :: * Source #

Type at position n

type NewElems n xs a :: [*] Source #

List of types with n'th element replaced by a.

Methods

getF :: proxy n -> Fun xs (ValueAt n xs) Source #

Getter function for vectors

putF :: proxy n -> ValueAt n xs -> Fun xs r -> Fun xs r Source #

Putter function. It applies value x to nth parameter of function.

lensF :: (Functor f, v ~ ValueAt n xs) => proxy n -> (v -> f v) -> Fun xs r -> Fun xs (f r) Source #

Helper for implementation of lens

lensChF :: Functor f => proxy n -> (ValueAt n xs -> f a) -> Fun (NewElems n xs a) r -> Fun xs (f r) Source #

Helper for type-changing lens

Instances

Instances details
Arity xs => Index 'Z (x ': xs) Source # 
Instance details

Defined in Data.Vector.HFixed.Class

Associated Types

type ValueAt 'Z (x ': xs) Source #

type NewElems 'Z (x ': xs) a :: [Type] Source #

Methods

getF :: proxy 'Z -> Fun (x ': xs) (ValueAt 'Z (x ': xs)) Source #

putF :: proxy 'Z -> ValueAt 'Z (x ': xs) -> Fun (x ': xs) r -> Fun (x ': xs) r Source #

lensF :: (Functor f, v ~ ValueAt 'Z (x ': xs)) => proxy 'Z -> (v -> f v) -> Fun (x ': xs) r -> Fun (x ': xs) (f r) Source #

lensChF :: Functor f => proxy 'Z -> (ValueAt 'Z (x ': xs) -> f a) -> Fun (NewElems 'Z (x ': xs) a) r -> Fun (x ': xs) (f r) Source #

Index n xs => Index ('S n) (x ': xs) Source # 
Instance details

Defined in Data.Vector.HFixed.Class

Associated Types

type ValueAt ('S n) (x ': xs) Source #

type NewElems ('S n) (x ': xs) a :: [Type] Source #

Methods

getF :: proxy ('S n) -> Fun (x ': xs) (ValueAt ('S n) (x ': xs)) Source #

putF :: proxy ('S n) -> ValueAt ('S n) (x ': xs) -> Fun (x ': xs) r -> Fun (x ': xs) r Source #

lensF :: (Functor f, v ~ ValueAt ('S n) (x ': xs)) => proxy ('S n) -> (v -> f v) -> Fun (x ': xs) r -> Fun (x ': xs) (f r) Source #

lensChF :: Functor f => proxy ('S n) -> (ValueAt ('S n) (x ': xs) -> f a) -> Fun (NewElems ('S n) (x ': xs) a) r -> Fun (x ': xs) (f r) Source #

class Arity xs => TyLookup x xs where Source #

Type class to supporty looking up value in product type by its type. Latter must not contain two elements of type x.

Methods

lookupTFun :: TFun f xs (f x) Source #

Instances

Instances details
(TypeError ('Text "Cannot find type: " :$$: 'ShowType a) :: Constraint) => TyLookup (a :: α) ('[] :: [α]) Source # 
Instance details

Defined in Data.Vector.HFixed.Class

Methods

lookupTFun :: TFun f '[] (f a) Source #

(Arity xs, TyLookupCase (a2 == x) a2 (x ': xs)) => TyLookup (a2 :: a1) (x ': xs :: [a1]) Source # 
Instance details

Defined in Data.Vector.HFixed.Class

Methods

lookupTFun :: TFun f (x ': xs) (f a2) Source #

CPS-encoded vector

type ContVec xs = ContVecF xs Identity Source #

CPS-encoded heterogeneous vector.

newtype ContVecF (xs :: [α]) (f :: α -> *) Source #

CPS-encoded partially heterogeneous vector.

Constructors

ContVecF 

Fields

Instances

Instances details
Arity xs => HVectorF (ContVecF xs :: (α -> Type) -> Type) Source # 
Instance details

Defined in Data.Vector.HFixed.Class

Associated Types

type ElemsF (ContVecF xs) :: [α] Source #

Methods

inspectF :: forall (f :: α0 -> Type) a. ContVecF xs f -> TFun f (ElemsF (ContVecF xs)) a -> a Source #

constructF :: forall (f :: α0 -> Type). TFun f (ElemsF (ContVecF xs)) (ContVecF xs f) Source #

Arity xs => HVector (ContVecF xs Identity) Source # 
Instance details

Defined in Data.Vector.HFixed.Class

Associated Types

type Elems (ContVecF xs Identity) :: [Type] Source #

type ElemsF (ContVecF xs :: (α -> Type) -> Type) Source # 
Instance details

Defined in Data.Vector.HFixed.Class

type ElemsF (ContVecF xs :: (α -> Type) -> Type) = xs
type Elems (ContVecF xs Identity) Source # 
Instance details

Defined in Data.Vector.HFixed.Class

type Elems (ContVecF xs Identity) = xs

cons :: x -> ContVec xs -> ContVec (x ': xs) Source #

Cons element to the vector

consF :: f x -> ContVecF xs f -> ContVecF (x ': xs) f Source #

Cons element to the vector

Interop with homogeneous vectors

class (ArityPeano n, Arity (HomList n a)) => HomArity n a where Source #

Conversion between homogeneous and heterogeneous N-ary functions.

Methods

toHeterogeneous :: Fun n a r -> Fun (HomList n a) r Source #

Convert n-ary homogeneous function to heterogeneous.

toHomogeneous :: Fun (HomList n a) r -> Fun n a r Source #

Convert heterogeneous n-ary function to homogeneous.

Instances

Instances details
HomArity 'Z a Source # 
Instance details

Defined in Data.Vector.HFixed.Class

Methods

toHeterogeneous :: Fun 'Z a r -> Fun (HomList 'Z a) r Source #

toHomogeneous :: Fun (HomList 'Z a) r -> Fun 'Z a r Source #

HomArity n a => HomArity ('S n) a Source # 
Instance details

Defined in Data.Vector.HFixed.Class

Methods

toHeterogeneous :: Fun ('S n) a r -> Fun (HomList ('S n) a) r Source #

toHomogeneous :: Fun (HomList ('S n) a) r -> Fun ('S n) a r Source #

homInspect :: (Vector v a, HomArity (Peano (Dim v)) a) => v a -> Fun (HomList (Peano (Dim v)) a) r -> r Source #

Default implementation of inspect for homogeneous vector.

homConstruct :: forall v a. (Vector v a, HomArity (Peano (Dim v)) a) => Fun (HomList (Peano (Dim v)) a) (v a) Source #

Default implementation of construct for homogeneous vector.

Operations of Fun

Primitives for Fun

curryFun :: Fun (x ': xs) r -> x -> Fun xs r Source #

Apply single parameter to function

uncurryFun :: (x -> Fun xs r) -> Fun (x ': xs) r Source #

Uncurry N-ary function.

uncurryMany :: forall xs ys r. Arity xs => Fun xs (Fun ys r) -> Fun (xs ++ ys) r Source #

Conversion function

curryMany :: forall xs ys r. Arity xs => Fun (xs ++ ys) r -> Fun xs (Fun ys r) Source #

Curry first n arguments of N-ary function.

constFun :: Fun xs r -> Fun (x ': xs) r Source #

Add one parameter to function which is ignored.

Primitives for TFun

constTFun :: TFun f xs r -> TFun f (x ': xs) r Source #

Add one parameter to function which is ignored.

curryTFun :: TFun f (x ': xs) r -> f x -> TFun f xs r Source #

Apply single parameter to function

uncurryTFun :: (f x -> TFun f xs r) -> TFun f (x ': xs) r Source #

Uncurry single parameter

shuffleTF :: forall f x xs r. Arity xs => (x -> TFun f xs r) -> TFun f xs (x -> r) Source #

Move first argument of function to its result. This function is useful for implementation of lens.

stepTFun :: (TFun f xs a -> TFun f ys b) -> TFun f (x ': xs) a -> TFun f (x ': ys) b Source #

Transform function but leave outermost parameter untouched.

More complicated functions

concatF :: (Arity xs, Arity ys) => (a -> b -> c) -> Fun xs a -> Fun ys b -> Fun (xs ++ ys) c Source #

Concatenate n-ary functions. This function combine results of both N-ary functions and merge their parameters into single list.

lensWorkerF :: forall f r x y xs. (Functor f, Arity xs) => (x -> f y) -> Fun (y ': xs) r -> Fun (x ': xs) (f r) Source #

Helper for lens implementation.

lensWorkerTF :: forall f g r x y xs. (Functor f, Arity xs) => (g x -> f (g y)) -> TFun g (y ': xs) r -> TFun g (x ': xs) (f r) Source #

Helper for lens implementation.

Lens

type Lens s t a b = forall f. Functor f => (a -> f b) -> s -> f t Source #

Copy of lens type definition from lens package

type Lens' s a = Lens s s a a Source #

Copy of type preserving lens definition from lens package