linear-1.23.2: Linear Algebra

Copyright | (C) 2012-2015 Edward Kmett
License | BSD-style (see the file LICENSE)
Maintainer | Edward Kmett <ekmett@gmail.com>
Stability | experimental
Portability | non-portable
Safe Haskell | Trustworthy
Language | Haskell2010

Linear.V

Description

n-D Vectors

Synopsis

- newtype V (n :: k) a = V {
  - toVector :: Vector a
  }
- int :: Int -> TypeQ
- dim :: forall {k} (n :: k) a. Dim n => V n a -> Int
- class Dim (n :: k) where
  - reflectDim :: p n -> Int
- reifyDim :: Int -> (forall n. Dim n => Proxy n -> r) -> r
- reifyVector :: Vector a -> (forall n. Dim n => V n a -> r) -> r
- reifyDimNat :: Int -> (forall (n :: Nat). KnownNat n => Proxy n -> r) -> r
- reifyVectorNat :: Vector a -> (forall (n :: Nat). KnownNat n => V n a -> r) -> r
- fromVector :: forall {k} (n :: k) a. Dim n => Vector a -> Maybe (V n a)
- class Finite (v :: Type -> Type) where
  - type Size (v :: Type -> Type) :: Nat
  - toV :: v a -> V (Size v) a
  - fromV :: V (Size v) a -> v a
- _V :: forall (u :: Type -> Type) (v :: Type -> Type) a b. (Finite u, Finite v) => Iso (V (Size u) a) (V (Size v) b) (u a) (v b)
- _V' :: forall (v :: Type -> Type) a b. Finite v => Iso (V (Size v) a) (V (Size v) b) (v a) (v b)

# Documentation

newtype V (n :: k) a Source #

Constructors

V |

Fields

- toVector :: Vector a

#### Instances

Instances details

Generic1 (V n :: Type -> Type) Source # |

Instance details

Defined in Linear.V

Associated Types

type Rep1 (V n :: Type -> Type) |
Instance details Defined in Linear.V type Rep1 (V n :: Type -> Type) = D1 ('MetaData "V" "Linear.V" "linear-1.23.2-5AqyVb8sK1m3MfzHCRCQd3" 'True) (C1 ('MetaCons "V" 'PrefixI 'True) (S1 ('MetaSel ('Just "toVector") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec1 Vector)))

Methods

from1 :: V n a -> Rep1 (V n) a Source #

to1 :: Rep1 (V n) a -> V n a Source #

FoldableWithIndex Int (V n) Source # |

Instance details

Defined in Linear.V

Methods

ifoldMap :: Monoid m => (Int -> a -> m) -> V n a -> m Source #

ifoldMap' :: Monoid m => (Int -> a -> m) -> V n a -> m Source #

ifoldr :: (Int -> a -> b -> b) -> b -> V n a -> b Source #

ifoldl :: (Int -> b -> a -> b) -> b -> V n a -> b Source #

ifoldr' :: (Int -> a -> b -> b) -> b -> V n a -> b Source #

ifoldl' :: (Int -> b -> a -> b) -> b -> V n a -> b Source #

FunctorWithIndex Int (V n) Source # |
Instance details Defined in Linear.V Methods imap :: (Int -> a -> b) -> V n a -> V n b Source #
TraversableWithIndex Int (V n) Source # |
Instance details Defined in Linear.V Methods itraverse :: Applicative f => (Int -> a -> f b) -> V n a -> f (V n b) Source #
Dim n => Dim (V n a :: Type) Source # |
Instance details Defined in Linear.V Methods reflectDim :: p (V n a) -> Int Source #
(Dim n, Unbox a) => Vector Vector (V n a) Source # |

Instance details

Defined in Linear.V

Methods

basicUnsafeFreeze :: Mutable Vector s (V n a) -> ST s (Vector (V n a))

basicUnsafeThaw :: Vector (V n a) -> ST s (Mutable Vector s (V n a))

basicLength :: Vector (V n a) -> Int

basicUnsafeSlice :: Int -> Int -> Vector (V n a) -> Vector (V n a)

basicUnsafeIndexM :: Vector (V n a) -> Int -> Box (V n a)

basicUnsafeCopy :: Mutable Vector s (V n a) -> Vector (V n a) -> ST s ()

elemseq :: Vector (V n a) -> V n a -> b -> b

(Dim n, Unbox a) => MVector MVector (V n a) Source # |

Instance details

Defined in Linear.V

Methods

basicLength :: MVector s (V n a) -> Int

basicUnsafeSlice :: Int -> Int -> MVector s (V n a) -> MVector s (V n a)

basicOverlaps :: MVector s (V n a) -> MVector s (V n a) -> Bool

basicUnsafeNew :: Int -> ST s (MVector s (V n a))

basicInitialize :: MVector s (V n a) -> ST s ()

basicUnsafeReplicate :: Int -> V n a -> ST s (MVector s (V n a))

basicUnsafeRead :: MVector s (V n a) -> Int -> ST s (V n a)

basicUnsafeWrite :: MVector s (V n a) -> Int -> V n a -> ST s ()

basicClear :: MVector s (V n a) -> ST s ()

basicSet :: MVector s (V n a) -> V n a -> ST s ()

basicUnsafeCopy :: MVector s (V n a) -> MVector s (V n a) -> ST s ()

basicUnsafeMove :: MVector s (V n a) -> MVector s (V n a) -> ST s ()

basicUnsafeGrow :: MVector s (V n a) -> Int -> ST s (MVector s (V n a))

Dim n => Representable (V n) Source # |

Instance details

Defined in Linear.V

Associated Types

type Rep (V n) |
Instance details Defined in Linear.V type Rep (V n) = Int

Methods

tabulate :: (Rep (V n) -> a) -> V n a Source #

index :: V n a -> Rep (V n) -> a Source #

Dim n => MonadZip (V n) Source # |
Instance details Defined in Linear.V Methods mzip :: V n a -> V n b -> V n (a, b) Source # mzipWith :: (a -> b -> c) -> V n a -> V n b -> V n c Source # munzip :: V n (a, b) -> (V n a, V n b) Source #
Eq1 (V n) Source # |
Instance details Defined in Linear.V Methods liftEq :: (a -> b -> Bool) -> V n a -> V n b -> Bool Source #
Ord1 (V n) Source # |
Instance details Defined in Linear.V Methods liftCompare :: (a -> b -> Ordering) -> V n a -> V n b -> Ordering Source #
Dim n => Read1 (V n) Source # |
Instance details Defined in Linear.V Methods liftReadsPrec :: (Int -> ReadS a) -> ReadS [a] -> Int -> ReadS (V n a) Source # liftReadList :: (Int -> ReadS a) -> ReadS [a] -> ReadS [V n a] Source # liftReadPrec :: ReadPrec a -> ReadPrec [a] -> ReadPrec (V n a) Source # liftReadListPrec :: ReadPrec a -> ReadPrec [a] -> ReadPrec [V n a] Source #
Show1 (V n) Source # |
Instance details Defined in Linear.V Methods liftShowsPrec :: (Int -> a -> ShowS) -> ([a] -> ShowS) -> Int -> V n a -> ShowS Source # liftShowList :: (Int -> a -> ShowS) -> ([a] -> ShowS) -> [V n a] -> ShowS Source #
Dim n => Serial1 (V n) Source # |
Instance details Defined in Linear.V Methods serializeWith :: MonadPut m => (a -> m ()) -> V n a -> m () Source # deserializeWith :: MonadGet m => m a -> m (V n a) Source #
Dim n => Distributive (V n) Source # |
Instance details Defined in Linear.V Methods distribute :: Functor f => f (V n a) -> V n (f a) Source # collect :: Functor f => (a -> V n b) -> f a -> V n (f b) Source # distributeM :: Monad m => m (V n a) -> V n (m a) Source # collectM :: Monad m => (a -> V n b) -> m a -> V n (m b) Source #
Dim n => Applicative (V n) Source # |
Instance details Defined in Linear.V Methods pure :: a -> V n a Source # (<*>) :: V n (a -> b) -> V n a -> V n b Source # liftA2 :: (a -> b -> c) -> V n a -> V n b -> V n c Source # (*>) :: V n a -> V n b -> V n b Source # (<*) :: V n a -> V n b -> V n a Source #
Functor (V n) Source # |
Instance details Defined in Linear.V Methods fmap :: (a -> b) -> V n a -> V n b Source # (<$) :: a -> V n b -> V n a Source #
Dim n => Monad (V n) Source # |
Instance details Defined in Linear.V Methods (>>=) :: V n a -> (a -> V n b) -> V n b Source # (>>) :: V n a -> V n b -> V n b Source # return :: a -> V n a Source #
Dim n => MonadFix (V n) Source # |
Instance details Defined in Linear.V Methods mfix :: (a -> V n a) -> V n a Source #
Foldable (V n) Source # |

Instance details

Defined in Linear.V

Methods

fold :: Monoid m => V n m -> m Source #

foldMap :: Monoid m => (a -> m) -> V n a -> m Source #

foldMap' :: Monoid m => (a -> m) -> V n a -> m Source #

foldr :: (a -> b -> b) -> b -> V n a -> b Source #

foldr' :: (a -> b -> b) -> b -> V n a -> b Source #

foldl :: (b -> a -> b) -> b -> V n a -> b Source #

foldl' :: (b -> a -> b) -> b -> V n a -> b Source #

foldr1 :: (a -> a -> a) -> V n a -> a Source #

foldl1 :: (a -> a -> a) -> V n a -> a Source #

toList :: V n a -> [a] Source #

null :: V n a -> Bool Source #

length :: V n a -> Int Source #

elem :: Eq a => a -> V n a -> Bool Source #

maximum :: Ord a => V n a -> a Source #

minimum :: Ord a => V n a -> a Source #

sum :: Num a => V n a -> a Source #

product :: Num a => V n a -> a Source #

Traversable (V n) Source # |
Instance details Defined in Linear.V Methods traverse :: Applicative f => (a -> f b) -> V n a -> f (V n b) Source # sequenceA :: Applicative f => V n (f a) -> f (V n a) Source # mapM :: Monad m => (a -> m b) -> V n a -> m (V n b) Source # sequence :: Monad m => V n (m a) -> m (V n a) Source #
Dim n => Hashable1 (V n) Source # |
Instance details Defined in Linear.V Methods liftHashWithSalt :: (Int -> a -> Int) -> Int -> V n a -> Int Source #
Dim n => Affine (V n) Source # |

Instance details

Defined in Linear.Affine

Associated Types

type Diff (V n) |
Instance details Defined in Linear.Affine type Diff (V n) = V n

Methods

(.-.) :: Num a => V n a -> V n a -> Diff (V n) a Source #

(.+^) :: Num a => V n a -> Diff (V n) a -> V n a Source #

(.-^) :: Num a => V n a -> Diff (V n) a -> V n a Source #

Dim n => Metric (V n) Source # |
Instance details Defined in Linear.V Methods dot :: Num a => V n a -> V n a -> a Source # quadrance :: Num a => V n a -> a Source # qd :: Num a => V n a -> V n a -> a Source # distance :: Floating a => V n a -> V n a -> a Source # norm :: Floating a => V n a -> a Source # signorm :: Floating a => V n a -> V n a Source #
Dim n => Trace (V n) Source # |
Instance details Defined in Linear.Trace Methods trace :: Num a => V n (V n a) -> a Source # diagonal :: V n (V n a) -> V n a Source #
Finite (V n) Source # |

Instance details

Defined in Linear.V

Associated Types

type Size (V n) |
Instance details Defined in Linear.V type Size (V n) = n

Methods

toV :: V n a -> V (Size (V n)) a Source #

fromV :: V (Size (V n)) a -> V n a Source #

Dim n => Additive (V n) Source # |
Instance details Defined in Linear.V Methods zero :: Num a => V n a Source # (^+^) :: Num a => V n a -> V n a -> V n a Source # (^-^) :: Num a => V n a -> V n a -> V n a Source # lerp :: Num a => a -> V n a -> V n a -> V n a Source # liftU2 :: (a -> a -> a) -> V n a -> V n a -> V n a Source # liftI2 :: (a -> b -> c) -> V n a -> V n b -> V n c Source #
Apply (V n) Source # |
Instance details Defined in Linear.V Methods (<.>) :: V n (a -> b) -> V n a -> V n b Source # (.>) :: V n a -> V n b -> V n b Source # (<.) :: V n a -> V n b -> V n a Source # liftF2 :: (a -> b -> c) -> V n a -> V n b -> V n c Source #
Bind (V n) Source # |
Instance details Defined in Linear.V Methods (>>-) :: V n a -> (a -> V n b) -> V n b Source # join :: V n (V n a) -> V n a Source #
(Dim n, Binary a) => Binary (V n a) Source # |
Instance details Defined in Linear.V Methods put :: V n a -> Put Source # get :: Get (V n a) Source # putList :: [V n a] -> Put Source #
(Dim n, Serial a) => Serial (V n a) Source # |
Instance details Defined in Linear.V Methods serialize :: MonadPut m => V n a -> m () Source # deserialize :: MonadGet m => m (V n a) Source #
(Dim n, Serialize a) => Serialize (V n a) Source # |
Instance details Defined in Linear.V Methods put :: Putter (V n a) Source # get :: Get (V n a) Source #
NFData a => NFData (V n a) Source # |
Instance details Defined in Linear.V Methods rnf :: V n a -> () Source #
(Dim n, Monoid a) => Monoid (V n a) Source # |
Instance details Defined in Linear.V Methods mempty :: V n a Source # mappend :: V n a -> V n a -> V n a Source # mconcat :: [V n a] -> V n a Source #
(Dim n, Semigroup a) => Semigroup (V n a) Source # |
Instance details Defined in Linear.V Methods (<>) :: V n a -> V n a -> V n a Source # sconcat :: NonEmpty (V n a) -> V n a Source # stimes :: Integral b => b -> V n a -> V n a Source #
(Typeable (V n), Typeable (V n a), Dim n, Data a) => Data (V n a) Source # |

Instance details

Defined in Linear.V

Methods

gfoldl :: (forall d b. Data d => c (d -> b) -> d -> c b) -> (forall g. g -> c g) -> V n a -> c (V n a) Source #

gunfold :: (forall b r. Data b => c (b -> r) -> c r) -> (forall r. r -> c r) -> Constr -> c (V n a) Source #

toConstr :: V n a -> Constr Source #

dataTypeOf :: V n a -> DataType Source #

dataCast1 :: Typeable t => (forall d. Data d => c (t d)) -> Maybe (c (V n a)) Source #

dataCast2 :: Typeable t => (forall d e. (Data d, Data e) => c (t d e)) -> Maybe (c (V n a)) Source #

gmapT :: (forall b. Data b => b -> b) -> V n a -> V n a Source #

gmapQl :: (r -> r' -> r) -> r -> (forall d. Data d => d -> r') -> V n a -> r Source #

gmapQr :: forall r r'. (r' -> r -> r) -> r -> (forall d. Data d => d -> r') -> V n a -> r Source #

gmapQ :: (forall d. Data d => d -> u) -> V n a -> [u] Source #

gmapQi :: Int -> (forall d. Data d => d -> u) -> V n a -> u Source #

gmapM :: Monad m => (forall d. Data d => d -> m d) -> V n a -> m (V n a) Source #

gmapMp :: MonadPlus m => (forall d. Data d => d -> m d) -> V n a -> m (V n a) Source #

gmapMo :: MonadPlus m => (forall d. Data d => d -> m d) -> V n a -> m (V n a) Source #

(Bounded a, Dim n) => Bounded (V n a) Source # |
Instance details Defined in Linear.V Methods minBound :: V n a Source # maxBound :: V n a Source #
(Dim n, Floating a) => Floating (V n a) Source # |

Instance details

Defined in Linear.V

Methods

pi :: V n a Source #

exp :: V n a -> V n a Source #

log :: V n a -> V n a Source #

sqrt :: V n a -> V n a Source #

(**) :: V n a -> V n a -> V n a Source #

logBase :: V n a -> V n a -> V n a Source #

sin :: V n a -> V n a Source #

cos :: V n a -> V n a Source #

tan :: V n a -> V n a Source #

asin :: V n a -> V n a Source #

acos :: V n a -> V n a Source #

atan :: V n a -> V n a Source #

sinh :: V n a -> V n a Source #

cosh :: V n a -> V n a Source #

tanh :: V n a -> V n a Source #

asinh :: V n a -> V n a Source #

acosh :: V n a -> V n a Source #

atanh :: V n a -> V n a Source #

log1p :: V n a -> V n a Source #

expm1 :: V n a -> V n a Source #

log1pexp :: V n a -> V n a Source #

log1mexp :: V n a -> V n a Source #

(Dim n, Storable a) => Storable (V n a) Source # |

Instance details

Defined in Linear.V

Methods

sizeOf :: V n a -> Int Source #

alignment :: V n a -> Int Source #

peekElemOff :: Ptr (V n a) -> Int -> IO (V n a) Source #

pokeElemOff :: Ptr (V n a) -> Int -> V n a -> IO () Source #

peekByteOff :: Ptr b -> Int -> IO (V n a) Source #

pokeByteOff :: Ptr b -> Int -> V n a -> IO () Source #

peek :: Ptr (V n a) -> IO (V n a) Source #

poke :: Ptr (V n a) -> V n a -> IO () Source #

Generic (V n a) Source # |

Instance details

Defined in Linear.V

Associated Types

type Rep (V n a) |
Instance details Defined in Linear.V type Rep (V n a) = D1 ('MetaData "V" "Linear.V" "linear-1.23.2-5AqyVb8sK1m3MfzHCRCQd3" 'True) (C1 ('MetaCons "V" 'PrefixI 'True) (S1 ('MetaSel ('Just "toVector") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 (Vector a))))

Methods

from :: V n a -> Rep (V n a) x Source #

to :: Rep (V n a) x -> V n a Source #

(Dim n, Num a) => Num (V n a) Source # |
Instance details Defined in Linear.V Methods (+) :: V n a -> V n a -> V n a Source # (-) :: V n a -> V n a -> V n a Source # (*) :: V n a -> V n a -> V n a Source # negate :: V n a -> V n a Source # abs :: V n a -> V n a Source # signum :: V n a -> V n a Source # fromInteger :: Integer -> V n a Source #
Read a => Read (V n a) Source # |
Instance details Defined in Linear.V Methods readsPrec :: Int -> ReadS (V n a) Source # readList :: ReadS [V n a] Source # readPrec :: ReadPrec (V n a) Source # readListPrec :: ReadPrec [V n a] Source #
(Dim n, Fractional a) => Fractional (V n a) Source # |
Instance details Defined in Linear.V Methods (/) :: V n a -> V n a -> V n a Source # recip :: V n a -> V n a Source # fromRational :: Rational -> V n a Source #
Show a => Show (V n a) Source # |
Instance details Defined in Linear.V Methods showsPrec :: Int -> V n a -> ShowS Source # show :: V n a -> String Source # showList :: [V n a] -> ShowS Source #
Eq a => Eq (V n a) Source # |
Instance details Defined in Linear.V Methods (==) :: V n a -> V n a -> Bool Source # (/=) :: V n a -> V n a -> Bool Source #
Ord a => Ord (V n a) Source # |
Instance details Defined in Linear.V Methods compare :: V n a -> V n a -> Ordering Source # (<) :: V n a -> V n a -> Bool Source # (<=) :: V n a -> V n a -> Bool Source # (>) :: V n a -> V n a -> Bool Source # (>=) :: V n a -> V n a -> Bool Source # max :: V n a -> V n a -> V n a Source # min :: V n a -> V n a -> V n a Source #
Hashable a => Hashable (V n a) Source # |
Instance details Defined in Linear.V Methods hashWithSalt :: Int -> V n a -> Int Source # hash :: V n a -> Int Source #
Ixed (V n a) Source # |
Instance details Defined in Linear.V Methods ix :: Index (V n a) -> Traversal' (V n a) (IxValue (V n a)) Source #
(Dim n, Epsilon a) => Epsilon (V n a) Source # |
Instance details Defined in Linear.V Methods nearZero :: V n a -> Bool Source #
(Dim n, Random a) => Random (V n a) Source # |
Instance details Defined in Linear.V Methods randomR :: RandomGen g => (V n a, V n a) -> g -> (V n a, g) Source # random :: RandomGen g => g -> (V n a, g) Source # randomRs :: RandomGen g => (V n a, V n a) -> g -> [V n a] Source # randoms :: RandomGen g => g -> [V n a] Source #
(Dim n, Uniform a) => Uniform (V n a) Source # |
Instance details Defined in Linear.V Methods uniformM :: StatefulGen g m => g -> m (V n a) Source #
(Dim n, UniformRange a) => UniformRange (V n a) Source # |
Instance details Defined in Linear.V Methods uniformRM :: StatefulGen g m => (V n a, V n a) -> g -> m (V n a) Source #
(Dim n, Unbox a) => Unbox (V n a) Source # |
Instance details Defined in Linear.V
Each (V n a) (V n b) a b Source # |
Instance details Defined in Linear.V Methods each :: Traversal (V n a) (V n b) a b Source #
1 <= n => Field1 (V n a) (V n a) a a Source # |
Instance details Defined in Linear.V Methods _1 :: Lens (V n a) (V n a) a a Source #
10 <= n => Field10 (V n a) (V n a) a a Source # |
Instance details Defined in Linear.V Methods _10 :: Lens (V n a) (V n a) a a Source #
11 <= n => Field11 (V n a) (V n a) a a Source # |
Instance details Defined in Linear.V Methods _11 :: Lens (V n a) (V n a) a a Source #
12 <= n => Field12 (V n a) (V n a) a a Source # |
Instance details Defined in Linear.V Methods _12 :: Lens (V n a) (V n a) a a Source #
13 <= n => Field13 (V n a) (V n a) a a Source # |
Instance details Defined in Linear.V Methods _13 :: Lens (V n a) (V n a) a a Source #
14 <= n => Field14 (V n a) (V n a) a a Source # |
Instance details Defined in Linear.V Methods _14 :: Lens (V n a) (V n a) a a Source #
15 <= n => Field15 (V n a) (V n a) a a Source # |
Instance details Defined in Linear.V Methods _15 :: Lens (V n a) (V n a) a a Source #
16 <= n => Field16 (V n a) (V n a) a a Source # |
Instance details Defined in Linear.V Methods _16 :: Lens (V n a) (V n a) a a Source #
17 <= n => Field17 (V n a) (V n a) a a Source # |
Instance details Defined in Linear.V Methods _17 :: Lens (V n a) (V n a) a a Source #
18 <= n => Field18 (V n a) (V n a) a a Source # |
Instance details Defined in Linear.V Methods _18 :: Lens (V n a) (V n a) a a Source #
19 <= n => Field19 (V n a) (V n a) a a Source # |
Instance details Defined in Linear.V Methods _19 :: Lens (V n a) (V n a) a a Source #
2 <= n => Field2 (V n a) (V n a) a a Source # |
Instance details Defined in Linear.V Methods _2 :: Lens (V n a) (V n a) a a Source #
3 <= n => Field3 (V n a) (V n a) a a Source # |
Instance details Defined in Linear.V Methods _3 :: Lens (V n a) (V n a) a a Source #
4 <= n => Field4 (V n a) (V n a) a a Source # |
Instance details Defined in Linear.V Methods _4 :: Lens (V n a) (V n a) a a Source #
5 <= n => Field5 (V n a) (V n a) a a Source # |
Instance details Defined in Linear.V Methods _5 :: Lens (V n a) (V n a) a a Source #
6 <= n => Field6 (V n a) (V n a) a a Source # |
Instance details Defined in Linear.V Methods _6 :: Lens (V n a) (V n a) a a Source #
7 <= n => Field7 (V n a) (V n a) a a Source # |
Instance details Defined in Linear.V Methods _7 :: Lens (V n a) (V n a) a a Source #
8 <= n => Field8 (V n a) (V n a) a a Source # |
Instance details Defined in Linear.V Methods _8 :: Lens (V n a) (V n a) a a Source #
9 <= n => Field9 (V n a) (V n a) a a Source # |
Instance details Defined in Linear.V Methods _9 :: Lens (V n a) (V n a) a a Source #
type Rep1 (V n :: Type -> Type) Source # |
Instance details Defined in Linear.V type Rep1 (V n :: Type -> Type) = D1 ('MetaData "V" "Linear.V" "linear-1.23.2-5AqyVb8sK1m3MfzHCRCQd3" 'True) (C1 ('MetaCons "V" 'PrefixI 'True) (S1 ('MetaSel ('Just "toVector") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec1 Vector)))
data MVector s (V n a) Source # |
Instance details Defined in Linear.V data MVector s (V n a) = MV_VN !Int !(MVector s a)
type Rep (V n) Source # |
Instance details Defined in Linear.V type Rep (V n) = Int
type Diff (V n) Source # |
Instance details Defined in Linear.Affine type Diff (V n) = V n
type Size (V n) Source # |
Instance details Defined in Linear.V type Size (V n) = n
type Rep (V n a) Source # |
Instance details Defined in Linear.V type Rep (V n a) = D1 ('MetaData "V" "Linear.V" "linear-1.23.2-5AqyVb8sK1m3MfzHCRCQd3" 'True) (C1 ('MetaCons "V" 'PrefixI 'True) (S1 ('MetaSel ('Just "toVector") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 (Vector a))))
type Index (V n a) Source # |
Instance details Defined in Linear.V type Index (V n a) = Int
type IxValue (V n a) Source # |
Instance details Defined in Linear.V type IxValue (V n a) = a
data Vector (V n a) Source # |
Instance details Defined in Linear.V data Vector (V n a) = V_VN !Int !(Vector a)

int :: Int -> TypeQ Source #

This can be used to generate a template haskell splice for a type level version of a given `int`.

This does not use GHC TypeLits, instead it generates a numeric type by hand similar to the ones used in the "Functional Pearl: Implicit Configurations" paper by Oleg Kiselyov and Chung-Chieh Shan.

`instance Num (Q Exp)` provided in this package allows writing `$(3)` instead of `$(int 3)`.

dim :: forall {k} (n :: k) a. Dim n => V n a -> Int Source #

class Dim (n :: k) where Source #

Methods

reflectDim :: p n -> Int Source #

#### Instances

Instances details

KnownNat n => Dim (n :: Nat) Source # |
Instance details Defined in Linear.V Methods reflectDim :: p n -> Int Source #
Dim n => Dim (V n a :: Type) Source # |
Instance details Defined in Linear.V Methods reflectDim :: p (V n a) -> Int Source #

reifyDim :: Int -> (forall n. Dim n => Proxy n -> r) -> r Source #

reifyVector :: Vector a -> (forall n. Dim n => V n a -> r) -> r Source #

reifyDimNat :: Int -> (forall (n :: Nat). KnownNat n => Proxy n -> r) -> r Source #

reifyVectorNat :: Vector a -> (forall (n :: Nat). KnownNat n => V n a -> r) -> r Source #

fromVector :: forall {k} (n :: k) a. Dim n => Vector a -> Maybe (V n a) Source #

class Finite (v :: Type -> Type) where Source #

Minimal complete definition

fromV

Associated Types

type Size (v :: Type -> Type) :: Nat Source #

Methods

toV :: v a -> V (Size v) a Source #

default toV :: Foldable v => v a -> V (Size v) a Source #

fromV :: V (Size v) a -> v a Source #

#### Instances

Instances details

Finite Complex Source # |

Instance details

Defined in Linear.V

Associated Types

type Size Complex |
Instance details Defined in Linear.V type Size Complex = 2

Methods

toV :: Complex a -> V (Size Complex) a Source #

fromV :: V (Size Complex) a -> Complex a Source #

Finite Plucker Source # |

Instance details

Defined in Linear.Plucker

Associated Types

type Size Plucker |
Instance details Defined in Linear.Plucker type Size Plucker = 6

Methods

toV :: Plucker a -> V (Size Plucker) a Source #

fromV :: V (Size Plucker) a -> Plucker a Source #

Finite Quaternion Source # |

Instance details

Defined in Linear.Quaternion

Associated Types

type Size Quaternion |
Instance details Defined in Linear.Quaternion type Size Quaternion = 4

Methods

toV :: Quaternion a -> V (Size Quaternion) a Source #

fromV :: V (Size Quaternion) a -> Quaternion a Source #

Finite V0 Source # |

Instance details

Defined in Linear.V0

Associated Types

type Size V0 |
Instance details Defined in Linear.V0 type Size V0 = 0

Methods

toV :: V0 a -> V (Size V0) a Source #

fromV :: V (Size V0) a -> V0 a Source #

Finite V1 Source # |

Instance details

Defined in Linear.V1

Associated Types

type Size V1 |
Instance details Defined in Linear.V1 type Size V1 = 1

Methods

toV :: V1 a -> V (Size V1) a Source #

fromV :: V (Size V1) a -> V1 a Source #

Finite V2 Source # |

Instance details

Defined in Linear.V2

Associated Types

type Size V2 |
Instance details Defined in Linear.V2 type Size V2 = 2

Methods

toV :: V2 a -> V (Size V2) a Source #

fromV :: V (Size V2) a -> V2 a Source #

Finite V3 Source # |

Instance details

Defined in Linear.V3

Associated Types

type Size V3 |
Instance details Defined in Linear.V3 type Size V3 = 3

Methods

toV :: V3 a -> V (Size V3) a Source #

fromV :: V (Size V3) a -> V3 a Source #

Finite V4 Source # |

Instance details

Defined in Linear.V4

Associated Types

type Size V4 |
Instance details Defined in Linear.V4 type Size V4 = 4

Methods

toV :: V4 a -> V (Size V4) a Source #

fromV :: V (Size V4) a -> V4 a Source #

Finite f => Finite (Point f) Source # |

Instance details

Defined in Linear.Affine

Associated Types

type Size (Point f) |
Instance details Defined in Linear.Affine type Size (Point f) = Size f

Methods

toV :: Point f a -> V (Size (Point f)) a Source #

fromV :: V (Size (Point f)) a -> Point f a Source #

Finite (V n) Source # |

Instance details

Defined in Linear.V

Associated Types

type Size (V n) |
Instance details Defined in Linear.V type Size (V n) = n

Methods

toV :: V n a -> V (Size (V n)) a Source #

fromV :: V (Size (V n)) a -> V n a Source #

_V :: forall (u :: Type -> Type) (v :: Type -> Type) a b. (Finite u, Finite v) => Iso (V (Size u) a) (V (Size v) b) (u a) (v b) Source #

_V' :: forall (v :: Type -> Type) a b. Finite v => Iso (V (Size v) a) (V (Size v) b) (v a) (v b) Source #