linear-1.23.2: Linear Algebra

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

Linear.Affine

Description

Operations on affine spaces.

Synopsis

- class Additive (Diff p) => Affine (p :: Type -> Type) where
  - type Diff (p :: Type -> Type) :: Type -> Type
  - (.-.) :: Num a => p a -> p a -> Diff p a
  - (.+^) :: Num a => p a -> Diff p a -> p a
  - (.-^) :: Num a => p a -> Diff p a -> p a
- qdA :: (Affine p, Foldable (Diff p), Num a) => p a -> p a -> a
- distanceA :: (Floating a, Foldable (Diff p), Affine p) => p a -> p a -> a
- newtype Point (f :: Type -> Type) a = P (f a)
- lensP :: forall f1 a g b f2. Functor f2 => (f1 a -> f2 (g b)) -> Point f1 a -> f2 (Point g b)
- _Point :: forall f1 a g b p f2. (Profunctor p, Functor f2) => p (f1 a) (f2 (g b)) -> p (Point f1 a) (f2 (Point g b))
- (.#) :: Coercible b a => (b -> c) -> (a -> b) -> a -> c
- (#.) :: Coercible c b => (b -> c) -> (a -> b) -> a -> c
- unP :: Point f a -> f a
- origin :: forall (f :: Type -> Type) a. (Additive f, Num a) => Point f a
- relative :: forall (f :: Type -> Type) a. (Additive f, Num a) => Point f a -> Iso' (Point f a) (f a)

# Documentation

class Additive (Diff p) => Affine (p :: Type -> Type) where Source #

An affine space is roughly a vector space in which we have forgotten or at least pretend to have forgotten the origin.

    a .+^ (b .-. a)  =  b@
    (a .+^ u) .+^ v  =  a .+^ (u ^+^ v)@
    (a .-. b) ^+^ v  =  (a .+^ v) .-. q@

Minimal complete definition

(.-.), (.+^)

Associated Types

type Diff (p :: Type -> Type) :: Type -> Type Source #

Methods

(.-.) :: Num a => p a -> p a -> Diff p a infixl 6 Source #

Get the difference between two points as a vector offset.

(.+^) :: Num a => p a -> Diff p a -> p a infixl 6 Source #

Add a vector offset to a point.

(.-^) :: Num a => p a -> Diff p a -> p a infixl 6 Source #

Subtract a vector offset from a point.

#### Instances

Instances details

Affine Complex Source # |

Instance details

Defined in Linear.Affine

Associated Types

type Diff Complex |
Instance details Defined in Linear.Affine type Diff Complex = Complex

Methods

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

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

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

Affine IntMap Source # |

Instance details

Defined in Linear.Affine

Associated Types

type Diff IntMap |
Instance details Defined in Linear.Affine type Diff IntMap = IntMap

Methods

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

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

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

Affine Identity Source # |

Instance details

Defined in Linear.Affine

Associated Types

type Diff Identity |
Instance details Defined in Linear.Affine type Diff Identity = Identity

Methods

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

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

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

Affine ZipList Source # |

Instance details

Defined in Linear.Affine

Associated Types

type Diff ZipList |
Instance details Defined in Linear.Affine type Diff ZipList = ZipList

Methods

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

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

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

Affine Plucker Source # |

Instance details

Defined in Linear.Affine

Associated Types

type Diff Plucker |
Instance details Defined in Linear.Affine type Diff Plucker = Plucker

Methods

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

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

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

Affine Quaternion Source # |

Instance details

Defined in Linear.Affine

Associated Types

type Diff Quaternion |
Instance details Defined in Linear.Affine type Diff Quaternion = Quaternion

Methods

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

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

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

Affine V0 Source # |

Instance details

Defined in Linear.Affine

Associated Types

type Diff V0 |
Instance details Defined in Linear.Affine type Diff V0 = V0

Methods

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

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

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

Affine V1 Source # |

Instance details

Defined in Linear.Affine

Associated Types

type Diff V1 |
Instance details Defined in Linear.Affine type Diff V1 = V1

Methods

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

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

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

Affine V2 Source # |

Instance details

Defined in Linear.Affine

Associated Types

type Diff V2 |
Instance details Defined in Linear.Affine type Diff V2 = V2

Methods

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

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

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

Affine V3 Source # |

Instance details

Defined in Linear.Affine

Associated Types

type Diff V3 |
Instance details Defined in Linear.Affine type Diff V3 = V3

Methods

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

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

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

Affine V4 Source # |

Instance details

Defined in Linear.Affine

Associated Types

type Diff V4 |
Instance details Defined in Linear.Affine type Diff V4 = V4

Methods

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

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

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

Affine Vector Source # |

Instance details

Defined in Linear.Affine

Associated Types

type Diff Vector |
Instance details Defined in Linear.Affine type Diff Vector = Vector

Methods

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

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

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

Affine Maybe Source # |

Instance details

Defined in Linear.Affine

Associated Types

type Diff Maybe |
Instance details Defined in Linear.Affine type Diff Maybe = Maybe

Methods

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

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

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

Affine [] Source # |

Instance details

Defined in Linear.Affine

Associated Types

type Diff [] |
Instance details Defined in Linear.Affine type Diff [] = []

Methods

(.-.) :: Num a => [a] -> [a] -> Diff [] a Source #

(.+^) :: Num a => [a] -> Diff [] a -> [a] Source #

(.-^) :: Num a => [a] -> Diff [] a -> [a] Source #

Ord k => Affine (Map k) Source # |

Instance details

Defined in Linear.Affine

Associated Types

type Diff (Map k) |
Instance details Defined in Linear.Affine type Diff (Map k) = Map k

Methods

(.-.) :: Num a => Map k a -> Map k a -> Diff (Map k) a Source #

(.+^) :: Num a => Map k a -> Diff (Map k) a -> Map k a Source #

(.-^) :: Num a => Map k a -> Diff (Map k) a -> Map k a Source #

Additive f => Affine (Point f) Source # |

Instance details

Defined in Linear.Affine

Associated Types

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

Methods

(.-.) :: Num a => Point f a -> Point f a -> Diff (Point f) a Source #

(.+^) :: Num a => Point f a -> Diff (Point f) a -> Point f a Source #

(.-^) :: Num a => Point f a -> Diff (Point f) a -> Point f a Source #

(Eq k, Hashable k) => Affine (HashMap k) Source # |

Instance details

Defined in Linear.Affine

Associated Types

type Diff (HashMap k) |
Instance details Defined in Linear.Affine type Diff (HashMap k) = HashMap k

Methods

(.-.) :: Num a => HashMap k a -> HashMap k a -> Diff (HashMap k) a Source #

(.+^) :: Num a => HashMap k a -> Diff (HashMap k) a -> HashMap k a Source #

(.-^) :: Num a => HashMap k a -> Diff (HashMap k) a -> HashMap k a 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 #

(Affine f, Affine g) => Affine (Product f g) Source # |

Instance details

Defined in Linear.Affine

Associated Types

type Diff (Product f g) |
Instance details Defined in Linear.Affine type Diff (Product f g) = Product (Diff f) (Diff g)

Methods

(.-.) :: Num a => Product f g a -> Product f g a -> Diff (Product f g) a Source #

(.+^) :: Num a => Product f g a -> Diff (Product f g) a -> Product f g a Source #

(.-^) :: Num a => Product f g a -> Diff (Product f g) a -> Product f g a Source #

Affine ((->) b) Source # |

Instance details

Defined in Linear.Affine

Associated Types

type Diff ((->) b) |
Instance details Defined in Linear.Affine type Diff ((->) b) = (->) b

Methods

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

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

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

qdA :: (Affine p, Foldable (Diff p), Num a) => p a -> p a -> a Source #

Compute the quadrance of the difference (the square of the distance)

distanceA :: (Floating a, Foldable (Diff p), Affine p) => p a -> p a -> a Source #

Distance between two points in an affine space

newtype Point (f :: Type -> Type) a Source #

A handy wrapper to help distinguish points from vectors at the type level

Constructors

P (f a) |

#### Instances

Instances details

Generic1 (Point f :: Type -> Type) Source # |

Instance details

Defined in Linear.Affine

Associated Types

type Rep1 (Point f :: Type -> Type) |
Instance details Defined in Linear.Affine type Rep1 (Point f :: Type -> Type) = D1 ('MetaData "Point" "Linear.Affine" "linear-1.23.2-5AqyVb8sK1m3MfzHCRCQd3" 'True) (C1 ('MetaCons "P" 'PrefixI 'False) (S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec1 f)))

Methods

from1 :: Point f a -> Rep1 (Point f) a Source #

to1 :: Rep1 (Point f) a -> Point f a Source #

Unbox (f a) => Vector Vector (Point f a) Source # |

Instance details

Defined in Linear.Affine

Methods

basicUnsafeFreeze :: Mutable Vector s (Point f a) -> ST s (Vector (Point f a))

basicUnsafeThaw :: Vector (Point f a) -> ST s (Mutable Vector s (Point f a))

basicLength :: Vector (Point f a) -> Int

basicUnsafeSlice :: Int -> Int -> Vector (Point f a) -> Vector (Point f a)

basicUnsafeIndexM :: Vector (Point f a) -> Int -> Box (Point f a)

basicUnsafeCopy :: Mutable Vector s (Point f a) -> Vector (Point f a) -> ST s ()

elemseq :: Vector (Point f a) -> Point f a -> b -> b

Unbox (f a) => MVector MVector (Point f a) Source # |

Instance details

Defined in Linear.Affine

Methods

basicLength :: MVector s (Point f a) -> Int

basicUnsafeSlice :: Int -> Int -> MVector s (Point f a) -> MVector s (Point f a)

basicOverlaps :: MVector s (Point f a) -> MVector s (Point f a) -> Bool

basicUnsafeNew :: Int -> ST s (MVector s (Point f a))

basicInitialize :: MVector s (Point f a) -> ST s ()

basicUnsafeReplicate :: Int -> Point f a -> ST s (MVector s (Point f a))

basicUnsafeRead :: MVector s (Point f a) -> Int -> ST s (Point f a)

basicUnsafeWrite :: MVector s (Point f a) -> Int -> Point f a -> ST s ()

basicClear :: MVector s (Point f a) -> ST s ()

basicSet :: MVector s (Point f a) -> Point f a -> ST s ()

basicUnsafeCopy :: MVector s (Point f a) -> MVector s (Point f a) -> ST s ()

basicUnsafeMove :: MVector s (Point f a) -> MVector s (Point f a) -> ST s ()

basicUnsafeGrow :: MVector s (Point f a) -> Int -> ST s (MVector s (Point f a))

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

Instance details

Defined in Linear.Affine

Associated Types

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

Methods

tabulate :: (Rep (Point f) -> a) -> Point f a Source #

index :: Point f a -> Rep (Point f) -> a Source #

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

Instance details

Defined in Linear.Affine

Methods

fold :: Monoid m => Point f m -> m Source #

foldMap :: Monoid m => (a -> m) -> Point f a -> m Source #

foldMap' :: Monoid m => (a -> m) -> Point f a -> m Source #

foldr :: (a -> b -> b) -> b -> Point f a -> b Source #

foldr' :: (a -> b -> b) -> b -> Point f a -> b Source #

foldl :: (b -> a -> b) -> b -> Point f a -> b Source #

foldl' :: (b -> a -> b) -> b -> Point f a -> b Source #

foldr1 :: (a -> a -> a) -> Point f a -> a Source #

foldl1 :: (a -> a -> a) -> Point f a -> a Source #

toList :: Point f a -> [a] Source #

null :: Point f a -> Bool Source #

length :: Point f a -> Int Source #

elem :: Eq a => a -> Point f a -> Bool Source #

maximum :: Ord a => Point f a -> a Source #

minimum :: Ord a => Point f a -> a Source #

sum :: Num a => Point f a -> a Source #

product :: Num a => Point f a -> a Source #

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

Instance details

Defined in Linear.Affine

Associated Types

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

Methods

(.-.) :: Num a => Point f a -> Point f a -> Diff (Point f) a Source #

(.+^) :: Num a => Point f a -> Diff (Point f) a -> Point f a Source #

(.-^) :: Num a => Point f a -> Diff (Point f) a -> Point f a Source #

Metric f => Metric (Point f) Source # |
Instance details Defined in Linear.Affine Methods dot :: Num a => Point f a -> Point f a -> a Source # quadrance :: Num a => Point f a -> a Source # qd :: Num a => Point f a -> Point f a -> a Source # distance :: Floating a => Point f a -> Point f a -> a Source # norm :: Floating a => Point f a -> a Source # signorm :: Floating a => Point f a -> Point f 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 #

R1 f => R1 (Point f) Source # |
Instance details Defined in Linear.Affine Methods _x :: Lens' (Point f a) a Source #
R2 f => R2 (Point f) Source # |
Instance details Defined in Linear.Affine Methods _y :: Lens' (Point f a) a Source # _xy :: Lens' (Point f a) (V2 a) Source #
R3 f => R3 (Point f) Source # |
Instance details Defined in Linear.Affine Methods _z :: Lens' (Point f a) a Source # _xyz :: Lens' (Point f a) (V3 a) Source #
R4 f => R4 (Point f) Source # |
Instance details Defined in Linear.Affine Methods _w :: Lens' (Point f a) a Source # _xyzw :: Lens' (Point f a) (V4 a) Source #
Additive f => Additive (Point f) Source # |

Instance details

Defined in Linear.Affine

Methods

zero :: Num a => Point f a Source #

(^+^) :: Num a => Point f a -> Point f a -> Point f a Source #

(^-^) :: Num a => Point f a -> Point f a -> Point f a Source #

lerp :: Num a => a -> Point f a -> Point f a -> Point f a Source #

liftU2 :: (a -> a -> a) -> Point f a -> Point f a -> Point f a Source #

liftI2 :: (a -> b -> c) -> Point f a -> Point f b -> Point f c Source #

Apply f => Apply (Point f) Source # |
Instance details Defined in Linear.Affine Methods (<.>) :: Point f (a -> b) -> Point f a -> Point f b Source # (.>) :: Point f a -> Point f b -> Point f b Source # (<.) :: Point f a -> Point f b -> Point f a Source # liftF2 :: (a -> b -> c) -> Point f a -> Point f b -> Point f c Source #
Bind f => Bind (Point f) Source # |
Instance details Defined in Linear.Affine Methods (>>-) :: Point f a -> (a -> Point f b) -> Point f b Source # join :: Point f (Point f a) -> Point f a Source #
Binary (f a) => Binary (Point f a) Source # |
Instance details Defined in Linear.Affine Methods put :: Point f a -> Put Source # get :: Get (Point f a) Source # putList :: [Point f a] -> Put Source #
Serial (f a) => Serial (Point f a) Source # |
Instance details Defined in Linear.Affine Methods serialize :: MonadPut m => Point f a -> m () Source # deserialize :: MonadGet m => m (Point f a) Source #
Serialize (f a) => Serialize (Point f a) Source # |
Instance details Defined in Linear.Affine Methods put :: Putter (Point f a) Source # get :: Get (Point f a) Source #
NFData (f a) => NFData (Point f a) Source # |
Instance details Defined in Linear.Affine Methods rnf :: Point f a -> () Source #
Monoid (f a) => Monoid (Point f a) Source # |
Instance details Defined in Linear.Affine Methods mempty :: Point f a Source # mappend :: Point f a -> Point f a -> Point f a Source # mconcat :: [Point f a] -> Point f a Source #
Semigroup (f a) => Semigroup (Point f a) Source # |
Instance details Defined in Linear.Affine Methods (<>) :: Point f a -> Point f a -> Point f a Source # sconcat :: NonEmpty (Point f a) -> Point f a Source # stimes :: Integral b => b -> Point f a -> Point f a Source #
(Typeable f, Typeable a, Data (f a)) => Data (Point f a) Source # |

Instance details

Defined in Linear.Affine

Methods

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

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

toConstr :: Point f a -> Constr Source #

dataTypeOf :: Point f a -> DataType Source #

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

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

gmapT :: (forall b. Data b => b -> b) -> Point f a -> Point f a Source #

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

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

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

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

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

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

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

Storable (f a) => Storable (Point f a) Source # |

Instance details

Defined in Linear.Affine

Methods

sizeOf :: Point f a -> Int Source #

alignment :: Point f a -> Int Source #

peekElemOff :: Ptr (Point f a) -> Int -> IO (Point f a) Source #

pokeElemOff :: Ptr (Point f a) -> Int -> Point f a -> IO () Source #

peekByteOff :: Ptr b -> Int -> IO (Point f a) Source #

pokeByteOff :: Ptr b -> Int -> Point f a -> IO () Source #

peek :: Ptr (Point f a) -> IO (Point f a) Source #

poke :: Ptr (Point f a) -> Point f a -> IO () Source #

Generic (Point f a) Source # |

Instance details

Defined in Linear.Affine

Associated Types

type Rep (Point f a) |
Instance details Defined in Linear.Affine type Rep (Point f a) = D1 ('MetaData "Point" "Linear.Affine" "linear-1.23.2-5AqyVb8sK1m3MfzHCRCQd3" 'True) (C1 ('MetaCons "P" 'PrefixI 'False) (S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 (f a))))

Methods

from :: Point f a -> Rep (Point f a) x Source #

to :: Rep (Point f a) x -> Point f a Source #

Ix (f a) => Ix (Point f a) Source # |

Instance details

Defined in Linear.Affine

Methods

range :: (Point f a, Point f a) -> [Point f a] Source #

index :: (Point f a, Point f a) -> Point f a -> Int Source #

unsafeIndex :: (Point f a, Point f a) -> Point f a -> Int Source #

inRange :: (Point f a, Point f a) -> Point f a -> Bool Source #

rangeSize :: (Point f a, Point f a) -> Int Source #

unsafeRangeSize :: (Point f a, Point f a) -> Int Source #

Num (f a) => Num (Point f a) Source # |
Instance details Defined in Linear.Affine Methods (+) :: Point f a -> Point f a -> Point f a Source # (-) :: Point f a -> Point f a -> Point f a Source # (*) :: Point f a -> Point f a -> Point f a Source # negate :: Point f a -> Point f a Source # abs :: Point f a -> Point f a Source # signum :: Point f a -> Point f a Source # fromInteger :: Integer -> Point f a Source #
Read (f a) => Read (Point f a) Source # |
Instance details Defined in Linear.Affine Methods readsPrec :: Int -> ReadS (Point f a) Source # readList :: ReadS [Point f a] Source # readPrec :: ReadPrec (Point f a) Source # readListPrec :: ReadPrec [Point f a] Source #
Fractional (f a) => Fractional (Point f a) Source # |
Instance details Defined in Linear.Affine Methods (/) :: Point f a -> Point f a -> Point f a Source # recip :: Point f a -> Point f a Source # fromRational :: Rational -> Point f a Source #
Show (f a) => Show (Point f a) Source # |
Instance details Defined in Linear.Affine Methods showsPrec :: Int -> Point f a -> ShowS Source # show :: Point f a -> String Source # showList :: [Point f a] -> ShowS Source #
Eq (f a) => Eq (Point f a) Source # |
Instance details Defined in Linear.Affine Methods (==) :: Point f a -> Point f a -> Bool Source # (/=) :: Point f a -> Point f a -> Bool Source #
Ord (f a) => Ord (Point f a) Source # |
Instance details Defined in Linear.Affine Methods compare :: Point f a -> Point f a -> Ordering Source # (<) :: Point f a -> Point f a -> Bool Source # (<=) :: Point f a -> Point f a -> Bool Source # (>) :: Point f a -> Point f a -> Bool Source # (>=) :: Point f a -> Point f a -> Bool Source # max :: Point f a -> Point f a -> Point f a Source # min :: Point f a -> Point f a -> Point f a Source #
Hashable (f a) => Hashable (Point f a) Source # |
Instance details Defined in Linear.Affine Methods hashWithSalt :: Int -> Point f a -> Int Source # hash :: Point f a -> Int Source #
Ixed (f a) => Ixed (Point f a) Source # |
Instance details Defined in Linear.Affine Methods ix :: Index (Point f a) -> Traversal' (Point f a) (IxValue (Point f a)) Source #
Wrapped (Point f a) Source # |

Instance details

Defined in Linear.Affine

Associated Types

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

Methods

_Wrapped' :: Iso' (Point f a) (Unwrapped (Point f a)) Source #

Epsilon (f a) => Epsilon (Point f a) Source # |
Instance details Defined in Linear.Affine Methods nearZero :: Point f a -> Bool Source #
Random (f a) => Random (Point f a) Source # |
Instance details Defined in Linear.Affine Methods randomR :: RandomGen g => (Point f a, Point f a) -> g -> (Point f a, g) Source # random :: RandomGen g => g -> (Point f a, g) Source # randomRs :: RandomGen g => (Point f a, Point f a) -> g -> [Point f a] Source # randoms :: RandomGen g => g -> [Point f a] Source #
Unbox (f a) => Unbox (Point f a) Source # |
Instance details Defined in Linear.Affine
t ~ Point g b => Rewrapped (Point f a) t Source # |
Instance details Defined in Linear.Affine
Traversable f => Each (Point f a) (Point f b) a b Source # |
Instance details Defined in Linear.Affine Methods each :: Traversal (Point f a) (Point f b) a b Source #
type Rep1 (Point f :: Type -> Type) Source # |
Instance details Defined in Linear.Affine type Rep1 (Point f :: Type -> Type) = D1 ('MetaData "Point" "Linear.Affine" "linear-1.23.2-5AqyVb8sK1m3MfzHCRCQd3" 'True) (C1 ('MetaCons "P" 'PrefixI 'False) (S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec1 f)))
newtype MVector s (Point f a) Source # |
Instance details Defined in Linear.Affine newtype MVector s (Point f a) = MV_P (MVector s (f a))
type Rep (Point f) Source # |
Instance details Defined in Linear.Affine type Rep (Point f) = Rep f
type Diff (Point f) Source # |
Instance details Defined in Linear.Affine type Diff (Point f) = f
type Size (Point f) Source # |
Instance details Defined in Linear.Affine type Size (Point f) = Size f
type Rep (Point f a) Source # |
Instance details Defined in Linear.Affine type Rep (Point f a) = D1 ('MetaData "Point" "Linear.Affine" "linear-1.23.2-5AqyVb8sK1m3MfzHCRCQd3" 'True) (C1 ('MetaCons "P" 'PrefixI 'False) (S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 (f a))))
type Index (Point f a) Source # |
Instance details Defined in Linear.Affine type Index (Point f a) = Index (f a)
type IxValue (Point f a) Source # |
Instance details Defined in Linear.Affine type IxValue (Point f a) = IxValue (f a)
type Unwrapped (Point f a) Source # |
Instance details Defined in Linear.Affine type Unwrapped (Point f a) = f a
newtype Vector (Point f a) Source # |
Instance details Defined in Linear.Affine newtype Vector (Point f a) = V_P (Vector (f a))

lensP :: forall f1 a g b f2. Functor f2 => (f1 a -> f2 (g b)) -> Point f1 a -> f2 (Point g b) Source #

_Point :: forall f1 a g b p f2. (Profunctor p, Functor f2) => p (f1 a) (f2 (g b)) -> p (Point f1 a) (f2 (Point g b)) Source #

(.#) :: Coercible b a => (b -> c) -> (a -> b) -> a -> c Source #

(#.) :: Coercible c b => (b -> c) -> (a -> b) -> a -> c Source #

unP :: Point f a -> f a Source #

origin :: forall (f :: Type -> Type) a. (Additive f, Num a) => Point f a Source #

Vector spaces have origins.

relative :: forall (f :: Type -> Type) a. (Additive f, Num a) => Point f a -> Iso' (Point f a) (f a) Source #

An isomorphism between points and vectors, given a reference point.