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 |
Documentation
A handy wrapper to help distinguish points from vectors at the type level
P (f a) |
Unbox (f a) => Vector Vector (Point f a) Source # | |
basicUnsafeFreeze :: PrimMonad m => Mutable Vector (PrimState m) (Point f a) -> m (Vector (Point f a)) # basicUnsafeThaw :: PrimMonad m => Vector (Point f a) -> m (Mutable Vector (PrimState m) (Point f a)) # basicLength :: Vector (Point f a) -> Int # basicUnsafeSlice :: Int -> Int -> Vector (Point f a) -> Vector (Point f a) # basicUnsafeIndexM :: Monad m => Vector (Point f a) -> Int -> m (Point f a) # basicUnsafeCopy :: PrimMonad m => Mutable Vector (PrimState m) (Point f a) -> Vector (Point f a) -> m () # | |
Unbox (f a) => MVector MVector (Point f a) Source # | |
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 :: PrimMonad m => Int -> m (MVector (PrimState m) (Point f a)) # basicInitialize :: PrimMonad m => MVector (PrimState m) (Point f a) -> m () # basicUnsafeReplicate :: PrimMonad m => Int -> Point f a -> m (MVector (PrimState m) (Point f a)) # basicUnsafeRead :: PrimMonad m => MVector (PrimState m) (Point f a) -> Int -> m (Point f a) # basicUnsafeWrite :: PrimMonad m => MVector (PrimState m) (Point f a) -> Int -> Point f a -> m () # basicClear :: PrimMonad m => MVector (PrimState m) (Point f a) -> m () # basicSet :: PrimMonad m => MVector (PrimState m) (Point f a) -> Point f a -> m () # basicUnsafeCopy :: PrimMonad m => MVector (PrimState m) (Point f a) -> MVector (PrimState m) (Point f a) -> m () # basicUnsafeMove :: PrimMonad m => MVector (PrimState m) (Point f a) -> MVector (PrimState m) (Point f a) -> m () # basicUnsafeGrow :: PrimMonad m => MVector (PrimState m) (Point f a) -> Int -> m (MVector (PrimState m) (Point f a)) # | |
Monad f => Monad (Point f) Source # | |
Functor f => Functor (Point f) Source # | |
Applicative f => Applicative (Point f) Source # | |
Foldable f => Foldable (Point f) Source # | |
fold :: Monoid m => Point f m -> m # foldMap :: Monoid m => (a -> m) -> Point f a -> m # foldr :: (a -> b -> b) -> b -> Point f a -> b # foldr' :: (a -> b -> b) -> b -> Point f a -> b # foldl :: (b -> a -> b) -> b -> Point f a -> b # foldl' :: (b -> a -> b) -> b -> Point f a -> b # foldr1 :: (a -> a -> a) -> Point f a -> a # foldl1 :: (a -> a -> a) -> Point f a -> a # elem :: Eq a => a -> Point f a -> Bool # maximum :: Ord a => Point f a -> a # minimum :: Ord a => Point f a -> a # | |
Traversable f => Traversable (Point f) Source # | |
Generic1 * (Point f) Source # | |
Eq (f a) => Eq (Point f a) Source # | |
Fractional (f a) => Fractional (Point f a) Source # | |
(Data (f a), Typeable * a, Typeable (* -> *) f) => Data (Point f a) Source # | |
gfoldl :: (forall d b. Data d => c (d -> b) -> d -> c b) -> (forall g. g -> c g) -> Point f a -> c (Point f a) # gunfold :: (forall b r. Data b => c (b -> r) -> c r) -> (forall r. r -> c r) -> Constr -> c (Point f a) # toConstr :: Point f a -> Constr # dataTypeOf :: Point f a -> DataType # dataCast1 :: Typeable (* -> *) t => (forall d. Data d => c (t d)) -> Maybe (c (Point f a)) # dataCast2 :: Typeable (* -> * -> *) t => (forall d e. (Data d, Data e) => c (t d e)) -> Maybe (c (Point f a)) # gmapT :: (forall b. Data b => b -> b) -> Point f a -> Point f a # gmapQl :: (r -> r' -> r) -> r -> (forall d. Data d => d -> r') -> Point f a -> r # gmapQr :: (r' -> r -> r) -> r -> (forall d. Data d => d -> r') -> Point f a -> r # gmapQ :: (forall d. Data d => d -> u) -> Point f a -> [u] # gmapQi :: Int -> (forall d. Data d => d -> u) -> Point f a -> u # gmapM :: Monad m => (forall d. Data d => d -> m d) -> Point f a -> m (Point f a) # gmapMp :: MonadPlus m => (forall d. Data d => d -> m d) -> Point f a -> m (Point f a) # gmapMo :: MonadPlus m => (forall d. Data d => d -> m d) -> Point f a -> m (Point f a) # | |
Num (f a) => Num (Point f a) Source # | |
Ord (f a) => Ord (Point f a) Source # | |
Read (f a) => Read (Point f a) Source # | |
Show (f a) => Show (Point f a) Source # | |
Ix (f a) => Ix (Point f a) Source # | |
range :: (Point f a, Point f a) -> [Point f a] # index :: (Point f a, Point f a) -> Point f a -> Int # unsafeIndex :: (Point f a, Point f a) -> Point f a -> Int inRange :: (Point f a, Point f a) -> Point f a -> Bool # rangeSize :: (Point f a, Point f a) -> Int # unsafeRangeSize :: (Point f a, Point f a) -> Int | |
Generic (Point f a) Source # | |
Storable (f a) => Storable (Point f a) Source # | |
Unbox (f a) => Unbox (Point f a) Source # | |
data MVector s (Point f a) Source # | |
type Rep1 * (Point f) Source # | |
type Rep (Point f a) Source # | |
data Vector (Point f a) Source # | |
A 2-dimensional vector
>>>
pure 1 :: V2 Int
V2 1 1
>>>
V2 1 2 + V2 3 4
V2 4 6
>>>
V2 1 2 * V2 3 4
V2 3 8
>>>
sum (V2 1 2)
3
V2 !a !a |
Monad V2 Source # | |
Functor V2 Source # | |
MonadFix V2 Source # | |
Applicative V2 Source # | |
Foldable V2 Source # | |
fold :: Monoid m => V2 m -> m # foldMap :: Monoid m => (a -> m) -> V2 a -> m # foldr :: (a -> b -> b) -> b -> V2 a -> b # foldr' :: (a -> b -> b) -> b -> V2 a -> b # foldl :: (b -> a -> b) -> b -> V2 a -> b # foldl' :: (b -> a -> b) -> b -> V2 a -> b # foldr1 :: (a -> a -> a) -> V2 a -> a # foldl1 :: (a -> a -> a) -> V2 a -> a # elem :: Eq a => a -> V2 a -> Bool # maximum :: Ord a => V2 a -> a # | |
Traversable V2 Source # | |
MonadZip V2 Source # | |
Unbox a => Vector Vector (V2 a) Source # | |
basicUnsafeFreeze :: PrimMonad m => Mutable Vector (PrimState m) (V2 a) -> m (Vector (V2 a)) # basicUnsafeThaw :: PrimMonad m => Vector (V2 a) -> m (Mutable Vector (PrimState m) (V2 a)) # basicLength :: Vector (V2 a) -> Int # basicUnsafeSlice :: Int -> Int -> Vector (V2 a) -> Vector (V2 a) # basicUnsafeIndexM :: Monad m => Vector (V2 a) -> Int -> m (V2 a) # basicUnsafeCopy :: PrimMonad m => Mutable Vector (PrimState m) (V2 a) -> Vector (V2 a) -> m () # | |
Unbox a => MVector MVector (V2 a) Source # | |
basicLength :: MVector s (V2 a) -> Int # basicUnsafeSlice :: Int -> Int -> MVector s (V2 a) -> MVector s (V2 a) # basicOverlaps :: MVector s (V2 a) -> MVector s (V2 a) -> Bool # basicUnsafeNew :: PrimMonad m => Int -> m (MVector (PrimState m) (V2 a)) # basicInitialize :: PrimMonad m => MVector (PrimState m) (V2 a) -> m () # basicUnsafeReplicate :: PrimMonad m => Int -> V2 a -> m (MVector (PrimState m) (V2 a)) # basicUnsafeRead :: PrimMonad m => MVector (PrimState m) (V2 a) -> Int -> m (V2 a) # basicUnsafeWrite :: PrimMonad m => MVector (PrimState m) (V2 a) -> Int -> V2 a -> m () # basicClear :: PrimMonad m => MVector (PrimState m) (V2 a) -> m () # basicSet :: PrimMonad m => MVector (PrimState m) (V2 a) -> V2 a -> m () # basicUnsafeCopy :: PrimMonad m => MVector (PrimState m) (V2 a) -> MVector (PrimState m) (V2 a) -> m () # basicUnsafeMove :: PrimMonad m => MVector (PrimState m) (V2 a) -> MVector (PrimState m) (V2 a) -> m () # basicUnsafeGrow :: PrimMonad m => MVector (PrimState m) (V2 a) -> Int -> m (MVector (PrimState m) (V2 a)) # | |
Bounded a => Bounded (V2 a) Source # | |
Eq a => Eq (V2 a) Source # | |
Floating a => Floating (V2 a) Source # | |
Fractional a => Fractional (V2 a) Source # | |
Data a => Data (V2 a) Source # | |
gfoldl :: (forall d b. Data d => c (d -> b) -> d -> c b) -> (forall g. g -> c g) -> V2 a -> c (V2 a) # gunfold :: (forall b r. Data b => c (b -> r) -> c r) -> (forall r. r -> c r) -> Constr -> c (V2 a) # dataTypeOf :: V2 a -> DataType # dataCast1 :: Typeable (* -> *) t => (forall d. Data d => c (t d)) -> Maybe (c (V2 a)) # dataCast2 :: Typeable (* -> * -> *) t => (forall d e. (Data d, Data e) => c (t d e)) -> Maybe (c (V2 a)) # gmapT :: (forall b. Data b => b -> b) -> V2 a -> V2 a # gmapQl :: (r -> r' -> r) -> r -> (forall d. Data d => d -> r') -> V2 a -> r # gmapQr :: (r' -> r -> r) -> r -> (forall d. Data d => d -> r') -> V2 a -> r # gmapQ :: (forall d. Data d => d -> u) -> V2 a -> [u] # gmapQi :: Int -> (forall d. Data d => d -> u) -> V2 a -> u # gmapM :: Monad m => (forall d. Data d => d -> m d) -> V2 a -> m (V2 a) # gmapMp :: MonadPlus m => (forall d. Data d => d -> m d) -> V2 a -> m (V2 a) # gmapMo :: MonadPlus m => (forall d. Data d => d -> m d) -> V2 a -> m (V2 a) # | |
Num a => Num (V2 a) Source # | |
Ord a => Ord (V2 a) Source # | |
Read a => Read (V2 a) Source # | |
Show a => Show (V2 a) Source # | |
Ix a => Ix (V2 a) Source # | |
Generic (V2 a) Source # | |
Storable a => Storable (V2 a) Source # | |
Unbox a => Unbox (V2 a) Source # | |
Generic1 * V2 Source # | |
data MVector s (V2 a) Source # | |
type Rep (V2 a) Source # | |
type Rep (V2 a) = D1 * (MetaData "V2" "SDL.Internal.Vect" "sdl2-2.4.1.0-GJ23ELiCVd1AQAhvhiAzSX" False) (C1 * (MetaCons "V2" PrefixI False) ((:*:) * (S1 * (MetaSel (Nothing Symbol) NoSourceUnpackedness SourceStrict DecidedStrict) (Rec0 * a)) (S1 * (MetaSel (Nothing Symbol) NoSourceUnpackedness SourceStrict DecidedStrict) (Rec0 * a)))) | |
data Vector (V2 a) Source # | |
type Rep1 * V2 Source # | |
type Rep1 * V2 = D1 * (MetaData "V2" "SDL.Internal.Vect" "sdl2-2.4.1.0-GJ23ELiCVd1AQAhvhiAzSX" False) (C1 * (MetaCons "V2" PrefixI False) ((:*:) * (S1 * (MetaSel (Nothing Symbol) NoSourceUnpackedness SourceStrict DecidedStrict) Par1) (S1 * (MetaSel (Nothing Symbol) NoSourceUnpackedness SourceStrict DecidedStrict) Par1))) |
A 3-dimensional vector
V3 !a !a !a |
A 4-dimensional vector.
V4 !a !a !a !a |