    {-# LANGUAGE DeriveDataTypeable, CPP #-}
    --------------------------------------------------------------------------------
    -- |
    -- Module      :  Graphics.Rendering.OpenGL.GL.Tensor
    -- Copyright   :  (c) Sven Panne 2019
    -- License     :  BSD3
    --
    -- Maintainer  :  Sven Panne <svenpanne@gmail.com>
    -- Stability   :  stable
    -- Portability :  portable
    --
    -- This package contains tensor data types and their instances for some basic
    -- type classes.
    --
    --------------------------------------------------------------------------------

    module Graphics.Rendering.OpenGL.GL.Tensor (
       Vertex1(..), Vertex2(..), Vertex3(..), Vertex4(..),
       Vector1(..), Vector2(..), Vector3(..), Vector4(..)
    ) where

    #if !MIN_VERSION_base(4,8,0)
    import Control.Applicative ( Applicative(..) )
    import Data.Foldable ( Foldable(..) )
    #endif
    import Control.Monad ( ap )
    import Data.Foldable ( foldlM )
    import Data.Ix ( Ix )
    import Data.Traversable ( Traversable(..), mapAccumL )
    import Data.Typeable ( Typeable )
    import Foreign.Marshal.Array ( advancePtr )
    import Foreign.Ptr ( Ptr, plusPtr, castPtr )
    import Foreign.Storable ( Storable(..) )

    --------------------------------------------------------------------------------

    -- | A vertex with /y/=0, /z/=0 and /w/=1.
    newtype Vertex1 a = Vertex1 a
       deriving (Vertex1 a -> Vertex1 a -> Bool
    (Vertex1 a -> Vertex1 a -> Bool)
    -> (Vertex1 a -> Vertex1 a -> Bool) -> Eq (Vertex1 a)
    forall a. Eq a => Vertex1 a -> Vertex1 a -> Bool
    forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
    $c== :: forall a. Eq a => Vertex1 a -> Vertex1 a -> Bool
    == :: Vertex1 a -> Vertex1 a -> Bool
    $c/= :: forall a. Eq a => Vertex1 a -> Vertex1 a -> Bool
    /= :: Vertex1 a -> Vertex1 a -> Bool
    Eq, Eq (Vertex1 a)
    Eq (Vertex1 a) =>
    (Vertex1 a -> Vertex1 a -> Ordering)
    -> (Vertex1 a -> Vertex1 a -> Bool)
    -> (Vertex1 a -> Vertex1 a -> Bool)
    -> (Vertex1 a -> Vertex1 a -> Bool)
    -> (Vertex1 a -> Vertex1 a -> Bool)
    -> (Vertex1 a -> Vertex1 a -> Vertex1 a)
    -> (Vertex1 a -> Vertex1 a -> Vertex1 a)
    -> Ord (Vertex1 a)
    Vertex1 a -> Vertex1 a -> Bool
    Vertex1 a -> Vertex1 a -> Ordering
    Vertex1 a -> Vertex1 a -> Vertex1 a
    forall a.
    Eq a =>
    (a -> a -> Ordering)
    -> (a -> a -> Bool)
    -> (a -> a -> Bool)
    -> (a -> a -> Bool)
    -> (a -> a -> Bool)
    -> (a -> a -> a)
    -> (a -> a -> a)
    -> Ord a
    forall a. Ord a => Eq (Vertex1 a)
    forall a. Ord a => Vertex1 a -> Vertex1 a -> Bool
    forall a. Ord a => Vertex1 a -> Vertex1 a -> Ordering
    forall a. Ord a => Vertex1 a -> Vertex1 a -> Vertex1 a
    $ccompare :: forall a. Ord a => Vertex1 a -> Vertex1 a -> Ordering
    compare :: Vertex1 a -> Vertex1 a -> Ordering
    $c< :: forall a. Ord a => Vertex1 a -> Vertex1 a -> Bool
    < :: Vertex1 a -> Vertex1 a -> Bool
    $c<= :: forall a. Ord a => Vertex1 a -> Vertex1 a -> Bool
    <= :: Vertex1 a -> Vertex1 a -> Bool
    $c> :: forall a. Ord a => Vertex1 a -> Vertex1 a -> Bool
    > :: Vertex1 a -> Vertex1 a -> Bool
    $c>= :: forall a. Ord a => Vertex1 a -> Vertex1 a -> Bool
    >= :: Vertex1 a -> Vertex1 a -> Bool
    $cmax :: forall a. Ord a => Vertex1 a -> Vertex1 a -> Vertex1 a
    max :: Vertex1 a -> Vertex1 a -> Vertex1 a
    $cmin :: forall a. Ord a => Vertex1 a -> Vertex1 a -> Vertex1 a
    min :: Vertex1 a -> Vertex1 a -> Vertex1 a
    Ord, Ord (Vertex1 a)
    Ord (Vertex1 a) =>
    ((Vertex1 a, Vertex1 a) -> [Vertex1 a])
    -> ((Vertex1 a, Vertex1 a) -> Vertex1 a -> Int)
    -> ((Vertex1 a, Vertex1 a) -> Vertex1 a -> Int)
    -> ((Vertex1 a, Vertex1 a) -> Vertex1 a -> Bool)
    -> ((Vertex1 a, Vertex1 a) -> Int)
    -> ((Vertex1 a, Vertex1 a) -> Int)
    -> Ix (Vertex1 a)
    (Vertex1 a, Vertex1 a) -> Int
    (Vertex1 a, Vertex1 a) -> [Vertex1 a]
    (Vertex1 a, Vertex1 a) -> Vertex1 a -> Bool
    (Vertex1 a, Vertex1 a) -> Vertex1 a -> Int
    forall a.
    Ord a =>
    ((a, a) -> [a])
    -> ((a, a) -> a -> Int)
    -> ((a, a) -> a -> Int)
    -> ((a, a) -> a -> Bool)
    -> ((a, a) -> Int)
    -> ((a, a) -> Int)
    -> Ix a
    forall a. Ix a => Ord (Vertex1 a)
    forall a. Ix a => (Vertex1 a, Vertex1 a) -> Int
    forall a. Ix a => (Vertex1 a, Vertex1 a) -> [Vertex1 a]
    forall a. Ix a => (Vertex1 a, Vertex1 a) -> Vertex1 a -> Bool
    forall a. Ix a => (Vertex1 a, Vertex1 a) -> Vertex1 a -> Int
    $crange :: forall a. Ix a => (Vertex1 a, Vertex1 a) -> [Vertex1 a]
    range :: (Vertex1 a, Vertex1 a) -> [Vertex1 a]
    $cindex :: forall a. Ix a => (Vertex1 a, Vertex1 a) -> Vertex1 a -> Int
    index :: (Vertex1 a, Vertex1 a) -> Vertex1 a -> Int
    $cunsafeIndex :: forall a. Ix a => (Vertex1 a, Vertex1 a) -> Vertex1 a -> Int
    unsafeIndex :: (Vertex1 a, Vertex1 a) -> Vertex1 a -> Int
    $cinRange :: forall a. Ix a => (Vertex1 a, Vertex1 a) -> Vertex1 a -> Bool
    inRange :: (Vertex1 a, Vertex1 a) -> Vertex1 a -> Bool
    $crangeSize :: forall a. Ix a => (Vertex1 a, Vertex1 a) -> Int
    rangeSize :: (Vertex1 a, Vertex1 a) -> Int
    $cunsafeRangeSize :: forall a. Ix a => (Vertex1 a, Vertex1 a) -> Int
    unsafeRangeSize :: (Vertex1 a, Vertex1 a) -> Int
    Ix, Vertex1 a
    Vertex1 a -> Vertex1 a -> Bounded (Vertex1 a)
    forall a. a -> a -> Bounded a
    forall a. Bounded a => Vertex1 a
    $cminBound :: forall a. Bounded a => Vertex1 a
    minBound :: Vertex1 a
    $cmaxBound :: forall a. Bounded a => Vertex1 a
    maxBound :: Vertex1 a
    Bounded, Int -> Vertex1 a -> ShowS
    [Vertex1 a] -> ShowS
    Vertex1 a -> String
    (Int -> Vertex1 a -> ShowS)
    -> (Vertex1 a -> String)
    -> ([Vertex1 a] -> ShowS)
    -> Show (Vertex1 a)
    forall a. Show a => Int -> Vertex1 a -> ShowS
    forall a. Show a => [Vertex1 a] -> ShowS
    forall a. Show a => Vertex1 a -> String
    forall a.
    (Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
    $cshowsPrec :: forall a. Show a => Int -> Vertex1 a -> ShowS
    showsPrec :: Int -> Vertex1 a -> ShowS
    $cshow :: forall a. Show a => Vertex1 a -> String
    show :: Vertex1 a -> String
    $cshowList :: forall a. Show a => [Vertex1 a] -> ShowS
    showList :: [Vertex1 a] -> ShowS
    Show, ReadPrec [Vertex1 a]
    ReadPrec (Vertex1 a)
    Int -> ReadS (Vertex1 a)
    ReadS [Vertex1 a]
    (Int -> ReadS (Vertex1 a))
    -> ReadS [Vertex1 a]
    -> ReadPrec (Vertex1 a)
    -> ReadPrec [Vertex1 a]
    -> Read (Vertex1 a)
    forall a. Read a => ReadPrec [Vertex1 a]
    forall a. Read a => ReadPrec (Vertex1 a)
    forall a. Read a => Int -> ReadS (Vertex1 a)
    forall a. Read a => ReadS [Vertex1 a]
    forall a.
    (Int -> ReadS a)
    -> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
    $creadsPrec :: forall a. Read a => Int -> ReadS (Vertex1 a)
    readsPrec :: Int -> ReadS (Vertex1 a)
    $creadList :: forall a. Read a => ReadS [Vertex1 a]
    readList :: ReadS [Vertex1 a]
    $creadPrec :: forall a. Read a => ReadPrec (Vertex1 a)
    readPrec :: ReadPrec (Vertex1 a)
    $creadListPrec :: forall a. Read a => ReadPrec [Vertex1 a]
    readListPrec :: ReadPrec [Vertex1 a]
    Read, Typeable)

    instance Functor Vertex1 where
       fmap :: forall a b. (a -> b) -> Vertex1 a -> Vertex1 b
    fmap a -> b
    f (Vertex1 a
    x) = b -> Vertex1 b
    forall a. a -> Vertex1 a
    Vertex1 (a -> b
    f a
    x)

    instance Applicative Vertex1 where
       pure :: forall a. a -> Vertex1 a
    pure a
    a = a -> Vertex1 a
    forall a. a -> Vertex1 a
    Vertex1 a
    a
       Vertex1 a -> b
    f <*> :: forall a b. Vertex1 (a -> b) -> Vertex1 a -> Vertex1 b
    <*> Vertex1 a
    x = b -> Vertex1 b
    forall a. a -> Vertex1 a
    Vertex1 (a -> b
    f a
    x)

    instance Foldable Vertex1 where
       foldr :: forall a b. (a -> b -> b) -> b -> Vertex1 a -> b
    foldr a -> b -> b
    f b
    a (Vertex1 a
    x) = a
    x `f ` b
    a
       foldl :: forall b a. (b -> a -> b) -> b -> Vertex1 a -> b
    foldl b -> a -> b
    f b
    a (Vertex1 a
    x) = b
    a b -> a -> b
    `f` a
    x
       foldr1 :: forall a. (a -> a -> a) -> Vertex1 a -> a
    foldr1 a -> a -> a
    _ (Vertex1 a
    x) = a
    x
       foldl1 :: forall a. (a -> a -> a) -> Vertex1 a -> a
    foldl1 a -> a -> a
    _ (Vertex1 a
    x) = a
    x

    instance Traversable Vertex1 where
       traverse :: forall (f :: * -> *) a b.
    Applicative f =>
    (a -> f b) -> Vertex1 a -> f (Vertex1 b)
    traverse a -> f b
    f (Vertex1 a
    x) = (b -> Vertex1 b) -> f (b -> Vertex1 b)
    forall a. a -> f a
    forall (f :: * -> *) a. Applicative f => a -> f a
    pure b -> Vertex1 b
    forall a. a -> Vertex1 a
    Vertex1 f (b -> Vertex1 b) -> f b -> f (Vertex1 b)
    forall a b. f (a -> b) -> f a -> f b
    forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
    <*> a -> f b
    f a
    x
       sequenceA :: forall (f :: * -> *) a.
    Applicative f =>
    Vertex1 (f a) -> f (Vertex1 a)
    sequenceA (Vertex1 f a
    x) =  (a -> Vertex1 a) -> f (a -> Vertex1 a)
    forall a. a -> f a
    forall (f :: * -> *) a. Applicative f => a -> f a
    pure a -> Vertex1 a
    forall a. a -> Vertex1 a
    Vertex1 f (a -> Vertex1 a) -> f a -> f (Vertex1 a)
    forall a b. f (a -> b) -> f a -> f b
    forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
    <*> f a
    x
       mapM :: forall (m :: * -> *) a b.
    Monad m =>
    (a -> m b) -> Vertex1 a -> m (Vertex1 b)
    mapM a -> m b
    f (Vertex1 a
    x) = (b -> Vertex1 b) -> m (b -> Vertex1 b)
    forall a. a -> m a
    forall (m :: * -> *) a. Monad m => a -> m a
    return b -> Vertex1 b
    forall a. a -> Vertex1 a
    Vertex1 m (b -> Vertex1 b) -> m b -> m (Vertex1 b)
    forall (m :: * -> *) a b. Monad m => m (a -> b) -> m a -> m b
    `ap` a -> m b
    f a
    x
       sequence :: forall (m :: * -> *) a. Monad m => Vertex1 (m a) -> m (Vertex1 a)
    sequence (Vertex1 m a
    x) = (a -> Vertex1 a) -> m (a -> Vertex1 a)
    forall a. a -> m a
    forall (m :: * -> *) a. Monad m => a -> m a
    return a -> Vertex1 a
    forall a. a -> Vertex1 a
    Vertex1 m (a -> Vertex1 a) -> m a -> m (Vertex1 a)
    forall (m :: * -> *) a b. Monad m => m (a -> b) -> m a -> m b
    `ap` m a
    x

    instance Storable a => Storable (Vertex1 a) where
       sizeOf :: Vertex1 a -> Int
    sizeOf    ~(Vertex1 a
    s) = a -> Int
    forall a. Storable a => a -> Int
    sizeOf a
    s
       alignment :: Vertex1 a -> Int
    alignment ~(Vertex1 a
    s) = a -> Int
    forall a. Storable a => a -> Int
    alignment a
    s
       peek :: Ptr (Vertex1 a) -> IO (Vertex1 a)
    peek = Ptr (Vertex1 a) -> IO (Vertex1 a)
    forall (t :: * -> *) a.
    (Applicative t, Traversable t, Storable a) =>
    Ptr (t a) -> IO (t a)
    peekApplicativeTraversable
       poke :: Ptr (Vertex1 a) -> Vertex1 a -> IO ()
    poke = Ptr (Vertex1 a) -> Vertex1 a -> IO ()
    forall (t :: * -> *) a.
    (Foldable t, Storable a) =>
    Ptr (t a) -> t a -> IO ()
    pokeFoldable

    --------------------------------------------------------------------------------

    -- | A vertex with /z/=0 and /w/=1.
    data Vertex2 a = Vertex2 !a !a
       deriving (Vertex2 a -> Vertex2 a -> Bool
    (Vertex2 a -> Vertex2 a -> Bool)
    -> (Vertex2 a -> Vertex2 a -> Bool) -> Eq (Vertex2 a)
    forall a. Eq a => Vertex2 a -> Vertex2 a -> Bool
    forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
    $c== :: forall a. Eq a => Vertex2 a -> Vertex2 a -> Bool
    == :: Vertex2 a -> Vertex2 a -> Bool
    $c/= :: forall a. Eq a => Vertex2 a -> Vertex2 a -> Bool
    /= :: Vertex2 a -> Vertex2 a -> Bool
    Eq, Eq (Vertex2 a)
    Eq (Vertex2 a) =>
    (Vertex2 a -> Vertex2 a -> Ordering)
    -> (Vertex2 a -> Vertex2 a -> Bool)
    -> (Vertex2 a -> Vertex2 a -> Bool)
    -> (Vertex2 a -> Vertex2 a -> Bool)
    -> (Vertex2 a -> Vertex2 a -> Bool)
    -> (Vertex2 a -> Vertex2 a -> Vertex2 a)
    -> (Vertex2 a -> Vertex2 a -> Vertex2 a)
    -> Ord (Vertex2 a)
    Vertex2 a -> Vertex2 a -> Bool
    Vertex2 a -> Vertex2 a -> Ordering
    Vertex2 a -> Vertex2 a -> Vertex2 a
    forall a.
    Eq a =>
    (a -> a -> Ordering)
    -> (a -> a -> Bool)
    -> (a -> a -> Bool)
    -> (a -> a -> Bool)
    -> (a -> a -> Bool)
    -> (a -> a -> a)
    -> (a -> a -> a)
    -> Ord a
    forall a. Ord a => Eq (Vertex2 a)
    forall a. Ord a => Vertex2 a -> Vertex2 a -> Bool
    forall a. Ord a => Vertex2 a -> Vertex2 a -> Ordering
    forall a. Ord a => Vertex2 a -> Vertex2 a -> Vertex2 a
    $ccompare :: forall a. Ord a => Vertex2 a -> Vertex2 a -> Ordering
    compare :: Vertex2 a -> Vertex2 a -> Ordering
    $c< :: forall a. Ord a => Vertex2 a -> Vertex2 a -> Bool
    < :: Vertex2 a -> Vertex2 a -> Bool
    $c<= :: forall a. Ord a => Vertex2 a -> Vertex2 a -> Bool
    <= :: Vertex2 a -> Vertex2 a -> Bool
    $c> :: forall a. Ord a => Vertex2 a -> Vertex2 a -> Bool
    > :: Vertex2 a -> Vertex2 a -> Bool
    $c>= :: forall a. Ord a => Vertex2 a -> Vertex2 a -> Bool
    >= :: Vertex2 a -> Vertex2 a -> Bool
    $cmax :: forall a. Ord a => Vertex2 a -> Vertex2 a -> Vertex2 a
    max :: Vertex2 a -> Vertex2 a -> Vertex2 a
    $cmin :: forall a. Ord a => Vertex2 a -> Vertex2 a -> Vertex2 a
    min :: Vertex2 a -> Vertex2 a -> Vertex2 a
    Ord, Ord (Vertex2 a)
    Ord (Vertex2 a) =>
    ((Vertex2 a, Vertex2 a) -> [Vertex2 a])
    -> ((Vertex2 a, Vertex2 a) -> Vertex2 a -> Int)
    -> ((Vertex2 a, Vertex2 a) -> Vertex2 a -> Int)
    -> ((Vertex2 a, Vertex2 a) -> Vertex2 a -> Bool)
    -> ((Vertex2 a, Vertex2 a) -> Int)
    -> ((Vertex2 a, Vertex2 a) -> Int)
    -> Ix (Vertex2 a)
    (Vertex2 a, Vertex2 a) -> Int
    (Vertex2 a, Vertex2 a) -> [Vertex2 a]
    (Vertex2 a, Vertex2 a) -> Vertex2 a -> Bool
    (Vertex2 a, Vertex2 a) -> Vertex2 a -> Int
    forall a.
    Ord a =>
    ((a, a) -> [a])
    -> ((a, a) -> a -> Int)
    -> ((a, a) -> a -> Int)
    -> ((a, a) -> a -> Bool)
    -> ((a, a) -> Int)
    -> ((a, a) -> Int)
    -> Ix a
    forall a. Ix a => Ord (Vertex2 a)
    forall a. Ix a => (Vertex2 a, Vertex2 a) -> Int
    forall a. Ix a => (Vertex2 a, Vertex2 a) -> [Vertex2 a]
    forall a. Ix a => (Vertex2 a, Vertex2 a) -> Vertex2 a -> Bool
    forall a. Ix a => (Vertex2 a, Vertex2 a) -> Vertex2 a -> Int
    $crange :: forall a. Ix a => (Vertex2 a, Vertex2 a) -> [Vertex2 a]
    range :: (Vertex2 a, Vertex2 a) -> [Vertex2 a]
    $cindex :: forall a. Ix a => (Vertex2 a, Vertex2 a) -> Vertex2 a -> Int
    index :: (Vertex2 a, Vertex2 a) -> Vertex2 a -> Int
    $cunsafeIndex :: forall a. Ix a => (Vertex2 a, Vertex2 a) -> Vertex2 a -> Int
    unsafeIndex :: (Vertex2 a, Vertex2 a) -> Vertex2 a -> Int
    $cinRange :: forall a. Ix a => (Vertex2 a, Vertex2 a) -> Vertex2 a -> Bool
    inRange :: (Vertex2 a, Vertex2 a) -> Vertex2 a -> Bool
    $crangeSize :: forall a. Ix a => (Vertex2 a, Vertex2 a) -> Int
    rangeSize :: (Vertex2 a, Vertex2 a) -> Int
    $cunsafeRangeSize :: forall a. Ix a => (Vertex2 a, Vertex2 a) -> Int
    unsafeRangeSize :: (Vertex2 a, Vertex2 a) -> Int
    Ix, Vertex2 a
    Vertex2 a -> Vertex2 a -> Bounded (Vertex2 a)
    forall a. a -> a -> Bounded a
    forall a. Bounded a => Vertex2 a
    $cminBound :: forall a. Bounded a => Vertex2 a
    minBound :: Vertex2 a
    $cmaxBound :: forall a. Bounded a => Vertex2 a
    maxBound :: Vertex2 a
    Bounded, Int -> Vertex2 a -> ShowS
    [Vertex2 a] -> ShowS
    Vertex2 a -> String
    (Int -> Vertex2 a -> ShowS)
    -> (Vertex2 a -> String)
    -> ([Vertex2 a] -> ShowS)
    -> Show (Vertex2 a)
    forall a. Show a => Int -> Vertex2 a -> ShowS
    forall a. Show a => [Vertex2 a] -> ShowS
    forall a. Show a => Vertex2 a -> String
    forall a.
    (Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
    $cshowsPrec :: forall a. Show a => Int -> Vertex2 a -> ShowS
    showsPrec :: Int -> Vertex2 a -> ShowS
    $cshow :: forall a. Show a => Vertex2 a -> String
    show :: Vertex2 a -> String
    $cshowList :: forall a. Show a => [Vertex2 a] -> ShowS
    showList :: [Vertex2 a] -> ShowS
    Show, ReadPrec [Vertex2 a]
    ReadPrec (Vertex2 a)
    Int -> ReadS (Vertex2 a)
    ReadS [Vertex2 a]
    (Int -> ReadS (Vertex2 a))
    -> ReadS [Vertex2 a]
    -> ReadPrec (Vertex2 a)
    -> ReadPrec [Vertex2 a]
    -> Read (Vertex2 a)
    forall a. Read a => ReadPrec [Vertex2 a]
    forall a. Read a => ReadPrec (Vertex2 a)
    forall a. Read a => Int -> ReadS (Vertex2 a)
    forall a. Read a => ReadS [Vertex2 a]
    forall a.
    (Int -> ReadS a)
    -> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
    $creadsPrec :: forall a. Read a => Int -> ReadS (Vertex2 a)
    readsPrec :: Int -> ReadS (Vertex2 a)
    $creadList :: forall a. Read a => ReadS [Vertex2 a]
    readList :: ReadS [Vertex2 a]
    $creadPrec :: forall a. Read a => ReadPrec (Vertex2 a)
    readPrec :: ReadPrec (Vertex2 a)
    $creadListPrec :: forall a. Read a => ReadPrec [Vertex2 a]
    readListPrec :: ReadPrec [Vertex2 a]
    Read, Typeable)

    instance Functor Vertex2 where
       fmap :: forall a b. (a -> b) -> Vertex2 a -> Vertex2 b
    fmap a -> b
    f (Vertex2 a
    x a
    y) = b -> b -> Vertex2 b
    forall a. a -> a -> Vertex2 a
    Vertex2 (a -> b
    f a
    x) (a -> b
    f a
    y)

    instance Applicative Vertex2 where
       pure :: forall a. a -> Vertex2 a
    pure a
    a = a -> a -> Vertex2 a
    forall a. a -> a -> Vertex2 a
    Vertex2 a
    a a
    a
       Vertex2 a -> b
    f a -> b
    g <*> :: forall a b. Vertex2 (a -> b) -> Vertex2 a -> Vertex2 b
    <*> Vertex2 a
    x a
    y = b -> b -> Vertex2 b
    forall a. a -> a -> Vertex2 a
    Vertex2 (a -> b
    f a
    x) (a -> b
    g a
    y)

    instance Foldable Vertex2 where
       foldr :: forall a b. (a -> b -> b) -> b -> Vertex2 a -> b
    foldr a -> b -> b
    f b
    a (Vertex2 a
    x a
    y) = a
    x `f ` (a
    y a -> b -> b
    `f` b
    a)
       foldl :: forall b a. (b -> a -> b) -> b -> Vertex2 a -> b
    foldl b -> a -> b
    f b
    a (Vertex2 a
    x a
    y) = (b
    a b -> a -> b
    `f` a
    x) b -> a -> b
    `f` a
    y
       foldr1 :: forall a. (a -> a -> a) -> Vertex2 a -> a
    foldr1 a -> a -> a
    f (Vertex2 a
    x a
    y) = a
    x a -> a -> a
    `f` a
    y
       foldl1 :: forall a. (a -> a -> a) -> Vertex2 a -> a
    foldl1 a -> a -> a
    f (Vertex2 a
    x a
    y) = a
    x a -> a -> a
    `f` a
    y

    instance Traversable Vertex2 where
       traverse :: forall (f :: * -> *) a b.
    Applicative f =>
    (a -> f b) -> Vertex2 a -> f (Vertex2 b)
    traverse a -> f b
    f (Vertex2 a
    x a
    y) = (b -> b -> Vertex2 b) -> f (b -> b -> Vertex2 b)
    forall a. a -> f a
    forall (f :: * -> *) a. Applicative f => a -> f a
    pure b -> b -> Vertex2 b
    forall a. a -> a -> Vertex2 a
    Vertex2 f (b -> b -> Vertex2 b) -> f b -> f (b -> Vertex2 b)
    forall a b. f (a -> b) -> f a -> f b
    forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
    <*> a -> f b
    f a
    x f (b -> Vertex2 b) -> f b -> f (Vertex2 b)
    forall a b. f (a -> b) -> f a -> f b
    forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
    <*> a -> f b
    f a
    y
       sequenceA :: forall (f :: * -> *) a.
    Applicative f =>
    Vertex2 (f a) -> f (Vertex2 a)
    sequenceA (Vertex2 f a
    x f a
    y) =  (a -> a -> Vertex2 a) -> f (a -> a -> Vertex2 a)
    forall a. a -> f a
    forall (f :: * -> *) a. Applicative f => a -> f a
    pure a -> a -> Vertex2 a
    forall a. a -> a -> Vertex2 a
    Vertex2 f (a -> a -> Vertex2 a) -> f a -> f (a -> Vertex2 a)
    forall a b. f (a -> b) -> f a -> f b
    forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
    <*> f a
    x f (a -> Vertex2 a) -> f a -> f (Vertex2 a)
    forall a b. f (a -> b) -> f a -> f b
    forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
    <*> f a
    y
       mapM :: forall (m :: * -> *) a b.
    Monad m =>
    (a -> m b) -> Vertex2 a -> m (Vertex2 b)
    mapM a -> m b
    f (Vertex2 a
    x a
    y) = (b -> b -> Vertex2 b) -> m (b -> b -> Vertex2 b)
    forall a. a -> m a
    forall (m :: * -> *) a. Monad m => a -> m a
    return b -> b -> Vertex2 b
    forall a. a -> a -> Vertex2 a
    Vertex2 m (b -> b -> Vertex2 b) -> m b -> m (b -> Vertex2 b)
    forall (m :: * -> *) a b. Monad m => m (a -> b) -> m a -> m b
    `ap` a -> m b
    f a
    x m (b -> Vertex2 b) -> m b -> m (Vertex2 b)
    forall (m :: * -> *) a b. Monad m => m (a -> b) -> m a -> m b
    `ap` a -> m b
    f a
    y
       sequence :: forall (m :: * -> *) a. Monad m => Vertex2 (m a) -> m (Vertex2 a)
    sequence (Vertex2 m a
    x m a
    y) = (a -> a -> Vertex2 a) -> m (a -> a -> Vertex2 a)
    forall a. a -> m a
    forall (m :: * -> *) a. Monad m => a -> m a
    return a -> a -> Vertex2 a
    forall a. a -> a -> Vertex2 a
    Vertex2 m (a -> a -> Vertex2 a) -> m a -> m (a -> Vertex2 a)
    forall (m :: * -> *) a b. Monad m => m (a -> b) -> m a -> m b
    `ap` m a
    x m (a -> Vertex2 a) -> m a -> m (Vertex2 a)
    forall (m :: * -> *) a b. Monad m => m (a -> b) -> m a -> m b
    `ap` m a
    y

    instance Storable a => Storable (Vertex2 a) where
       sizeOf :: Vertex2 a -> Int
    sizeOf ~(Vertex2 a
    x a
    _) = Int
    2 Int -> Int -> Int
    forall a. Num a => a -> a -> a
    * a -> Int
    forall a. Storable a => a -> Int
    sizeOf a
    x
       alignment :: Vertex2 a -> Int
    alignment ~(Vertex2 a
    x a
    _) = a -> Int
    forall a. Storable a => a -> Int
    alignment a
    x
       peek :: Ptr (Vertex2 a) -> IO (Vertex2 a)
    peek = Ptr (Vertex2 a) -> IO (Vertex2 a)
    forall (t :: * -> *) a.
    (Applicative t, Traversable t, Storable a) =>
    Ptr (t a) -> IO (t a)
    peekApplicativeTraversable
       poke :: Ptr (Vertex2 a) -> Vertex2 a -> IO ()
    poke = Ptr (Vertex2 a) -> Vertex2 a -> IO ()
    forall (t :: * -> *) a.
    (Foldable t, Storable a) =>
    Ptr (t a) -> t a -> IO ()
    pokeFoldable

    --------------------------------------------------------------------------------

    -- | A vertex with /w/=1.
    data Vertex3 a = Vertex3 !a !a !a
       deriving (Vertex3 a -> Vertex3 a -> Bool
    (Vertex3 a -> Vertex3 a -> Bool)
    -> (Vertex3 a -> Vertex3 a -> Bool) -> Eq (Vertex3 a)
    forall a. Eq a => Vertex3 a -> Vertex3 a -> Bool
    forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
    $c== :: forall a. Eq a => Vertex3 a -> Vertex3 a -> Bool
    == :: Vertex3 a -> Vertex3 a -> Bool
    $c/= :: forall a. Eq a => Vertex3 a -> Vertex3 a -> Bool
    /= :: Vertex3 a -> Vertex3 a -> Bool
    Eq, Eq (Vertex3 a)
    Eq (Vertex3 a) =>
    (Vertex3 a -> Vertex3 a -> Ordering)
    -> (Vertex3 a -> Vertex3 a -> Bool)
    -> (Vertex3 a -> Vertex3 a -> Bool)
    -> (Vertex3 a -> Vertex3 a -> Bool)
    -> (Vertex3 a -> Vertex3 a -> Bool)
    -> (Vertex3 a -> Vertex3 a -> Vertex3 a)
    -> (Vertex3 a -> Vertex3 a -> Vertex3 a)
    -> Ord (Vertex3 a)
    Vertex3 a -> Vertex3 a -> Bool
    Vertex3 a -> Vertex3 a -> Ordering
    Vertex3 a -> Vertex3 a -> Vertex3 a
    forall a.
    Eq a =>
    (a -> a -> Ordering)
    -> (a -> a -> Bool)
    -> (a -> a -> Bool)
    -> (a -> a -> Bool)
    -> (a -> a -> Bool)
    -> (a -> a -> a)
    -> (a -> a -> a)
    -> Ord a
    forall a. Ord a => Eq (Vertex3 a)
    forall a. Ord a => Vertex3 a -> Vertex3 a -> Bool
    forall a. Ord a => Vertex3 a -> Vertex3 a -> Ordering
    forall a. Ord a => Vertex3 a -> Vertex3 a -> Vertex3 a
    $ccompare :: forall a. Ord a => Vertex3 a -> Vertex3 a -> Ordering
    compare :: Vertex3 a -> Vertex3 a -> Ordering
    $c< :: forall a. Ord a => Vertex3 a -> Vertex3 a -> Bool
    < :: Vertex3 a -> Vertex3 a -> Bool
    $c<= :: forall a. Ord a => Vertex3 a -> Vertex3 a -> Bool
    <= :: Vertex3 a -> Vertex3 a -> Bool
    $c> :: forall a. Ord a => Vertex3 a -> Vertex3 a -> Bool
    > :: Vertex3 a -> Vertex3 a -> Bool
    $c>= :: forall a. Ord a => Vertex3 a -> Vertex3 a -> Bool
    >= :: Vertex3 a -> Vertex3 a -> Bool
    $cmax :: forall a. Ord a => Vertex3 a -> Vertex3 a -> Vertex3 a
    max :: Vertex3 a -> Vertex3 a -> Vertex3 a
    $cmin :: forall a. Ord a => Vertex3 a -> Vertex3 a -> Vertex3 a
    min :: Vertex3 a -> Vertex3 a -> Vertex3 a
    Ord, Ord (Vertex3 a)
    Ord (Vertex3 a) =>
    ((Vertex3 a, Vertex3 a) -> [Vertex3 a])
    -> ((Vertex3 a, Vertex3 a) -> Vertex3 a -> Int)
    -> ((Vertex3 a, Vertex3 a) -> Vertex3 a -> Int)
    -> ((Vertex3 a, Vertex3 a) -> Vertex3 a -> Bool)
    -> ((Vertex3 a, Vertex3 a) -> Int)
    -> ((Vertex3 a, Vertex3 a) -> Int)
    -> Ix (Vertex3 a)
    (Vertex3 a, Vertex3 a) -> Int
    (Vertex3 a, Vertex3 a) -> [Vertex3 a]
    (Vertex3 a, Vertex3 a) -> Vertex3 a -> Bool
    (Vertex3 a, Vertex3 a) -> Vertex3 a -> Int
    forall a.
    Ord a =>
    ((a, a) -> [a])
    -> ((a, a) -> a -> Int)
    -> ((a, a) -> a -> Int)
    -> ((a, a) -> a -> Bool)
    -> ((a, a) -> Int)
    -> ((a, a) -> Int)
    -> Ix a
    forall a. Ix a => Ord (Vertex3 a)
    forall a. Ix a => (Vertex3 a, Vertex3 a) -> Int
    forall a. Ix a => (Vertex3 a, Vertex3 a) -> [Vertex3 a]
    forall a. Ix a => (Vertex3 a, Vertex3 a) -> Vertex3 a -> Bool
    forall a. Ix a => (Vertex3 a, Vertex3 a) -> Vertex3 a -> Int
    $crange :: forall a. Ix a => (Vertex3 a, Vertex3 a) -> [Vertex3 a]
    range :: (Vertex3 a, Vertex3 a) -> [Vertex3 a]
    $cindex :: forall a. Ix a => (Vertex3 a, Vertex3 a) -> Vertex3 a -> Int
    index :: (Vertex3 a, Vertex3 a) -> Vertex3 a -> Int
    $cunsafeIndex :: forall a. Ix a => (Vertex3 a, Vertex3 a) -> Vertex3 a -> Int
    unsafeIndex :: (Vertex3 a, Vertex3 a) -> Vertex3 a -> Int
    $cinRange :: forall a. Ix a => (Vertex3 a, Vertex3 a) -> Vertex3 a -> Bool
    inRange :: (Vertex3 a, Vertex3 a) -> Vertex3 a -> Bool
    $crangeSize :: forall a. Ix a => (Vertex3 a, Vertex3 a) -> Int
    rangeSize :: (Vertex3 a, Vertex3 a) -> Int
    $cunsafeRangeSize :: forall a. Ix a => (Vertex3 a, Vertex3 a) -> Int
    unsafeRangeSize :: (Vertex3 a, Vertex3 a) -> Int
    Ix, Vertex3 a
    Vertex3 a -> Vertex3 a -> Bounded (Vertex3 a)
    forall a. a -> a -> Bounded a
    forall a. Bounded a => Vertex3 a
    $cminBound :: forall a. Bounded a => Vertex3 a
    minBound :: Vertex3 a
    $cmaxBound :: forall a. Bounded a => Vertex3 a
    maxBound :: Vertex3 a
    Bounded, Int -> Vertex3 a -> ShowS
    [Vertex3 a] -> ShowS
    Vertex3 a -> String
    (Int -> Vertex3 a -> ShowS)
    -> (Vertex3 a -> String)
    -> ([Vertex3 a] -> ShowS)
    -> Show (Vertex3 a)
    forall a. Show a => Int -> Vertex3 a -> ShowS
    forall a. Show a => [Vertex3 a] -> ShowS
    forall a. Show a => Vertex3 a -> String
    forall a.
    (Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
    $cshowsPrec :: forall a. Show a => Int -> Vertex3 a -> ShowS
    showsPrec :: Int -> Vertex3 a -> ShowS
    $cshow :: forall a. Show a => Vertex3 a -> String
    show :: Vertex3 a -> String
    $cshowList :: forall a. Show a => [Vertex3 a] -> ShowS
    showList :: [Vertex3 a] -> ShowS
    Show, ReadPrec [Vertex3 a]
    ReadPrec (Vertex3 a)
    Int -> ReadS (Vertex3 a)
    ReadS [Vertex3 a]
    (Int -> ReadS (Vertex3 a))
    -> ReadS [Vertex3 a]
    -> ReadPrec (Vertex3 a)
    -> ReadPrec [Vertex3 a]
    -> Read (Vertex3 a)
    forall a. Read a => ReadPrec [Vertex3 a]
    forall a. Read a => ReadPrec (Vertex3 a)
    forall a. Read a => Int -> ReadS (Vertex3 a)
    forall a. Read a => ReadS [Vertex3 a]
    forall a.
    (Int -> ReadS a)
    -> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
    $creadsPrec :: forall a. Read a => Int -> ReadS (Vertex3 a)
    readsPrec :: Int -> ReadS (Vertex3 a)
    $creadList :: forall a. Read a => ReadS [Vertex3 a]
    readList :: ReadS [Vertex3 a]
    $creadPrec :: forall a. Read a => ReadPrec (Vertex3 a)
    readPrec :: ReadPrec (Vertex3 a)
    $creadListPrec :: forall a. Read a => ReadPrec [Vertex3 a]
    readListPrec :: ReadPrec [Vertex3 a]
    Read, Typeable)

    instance Functor Vertex3 where
       fmap :: forall a b. (a -> b) -> Vertex3 a -> Vertex3 b
    fmap a -> b
    f (Vertex3 a
    x a
    y a
    z) = b -> b -> b -> Vertex3 b
    forall a. a -> a -> a -> Vertex3 a
    Vertex3 (a -> b
    f a
    x) (a -> b
    f a
    y) (a -> b
    f a
    z)

    instance Applicative Vertex3 where
       pure :: forall a. a -> Vertex3 a
    pure a
    a = a -> a -> a -> Vertex3 a
    forall a. a -> a -> a -> Vertex3 a
    Vertex3 a
    a a
    a a
    a
       Vertex3 a -> b
    f a -> b
    g a -> b
    h <*> :: forall a b. Vertex3 (a -> b) -> Vertex3 a -> Vertex3 b
    <*> Vertex3 a
    x a
    y a
    z = b -> b -> b -> Vertex3 b
    forall a. a -> a -> a -> Vertex3 a
    Vertex3 (a -> b
    f a
    x) (a -> b
    g a
    y) (a -> b
    h a
    z)

    instance Foldable Vertex3 where
       foldr :: forall a b. (a -> b -> b) -> b -> Vertex3 a -> b
    foldr a -> b -> b
    f b
    a (Vertex3 a
    x a
    y a
    z) = a
    x `f ` (a
    y a -> b -> b
    `f` (a
    z a -> b -> b
    `f` b
    a))
       foldl :: forall b a. (b -> a -> b) -> b -> Vertex3 a -> b
    foldl b -> a -> b
    f b
    a (Vertex3 a
    x a
    y a
    z) = ((b
    a b -> a -> b
    `f` a
    x) b -> a -> b
    `f` a
    y) b -> a -> b
    `f` a
    z
       foldr1 :: forall a. (a -> a -> a) -> Vertex3 a -> a
    foldr1 a -> a -> a
    f (Vertex3 a
    x a
    y a
    z) = a
    x a -> a -> a
    `f` (a
    y a -> a -> a
    `f` a
    z)
       foldl1 :: forall a. (a -> a -> a) -> Vertex3 a -> a
    foldl1 a -> a -> a
    f (Vertex3 a
    x a
    y a
    z) = (a
    x a -> a -> a
    `f` a
    y) a -> a -> a
    `f` a
    z

    instance Traversable Vertex3 where
       traverse :: forall (f :: * -> *) a b.
    Applicative f =>
    (a -> f b) -> Vertex3 a -> f (Vertex3 b)
    traverse a -> f b
    f (Vertex3 a
    x a
    y a
    z) = (b -> b -> b -> Vertex3 b) -> f (b -> b -> b -> Vertex3 b)
    forall a. a -> f a
    forall (f :: * -> *) a. Applicative f => a -> f a
    pure b -> b -> b -> Vertex3 b
    forall a. a -> a -> a -> Vertex3 a
    Vertex3 f (b -> b -> b -> Vertex3 b) -> f b -> f (b -> b -> Vertex3 b)
    forall a b. f (a -> b) -> f a -> f b
    forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
    <*> a -> f b
    f a
    x f (b -> b -> Vertex3 b) -> f b -> f (b -> Vertex3 b)
    forall a b. f (a -> b) -> f a -> f b
    forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
    <*> a -> f b
    f a
    y f (b -> Vertex3 b) -> f b -> f (Vertex3 b)
    forall a b. f (a -> b) -> f a -> f b
    forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
    <*> a -> f b
    f a
    z
       sequenceA :: forall (f :: * -> *) a.
    Applicative f =>
    Vertex3 (f a) -> f (Vertex3 a)
    sequenceA (Vertex3 f a
    x f a
    y f a
    z) =  (a -> a -> a -> Vertex3 a) -> f (a -> a -> a -> Vertex3 a)
    forall a. a -> f a
    forall (f :: * -> *) a. Applicative f => a -> f a
    pure a -> a -> a -> Vertex3 a
    forall a. a -> a -> a -> Vertex3 a
    Vertex3 f (a -> a -> a -> Vertex3 a) -> f a -> f (a -> a -> Vertex3 a)
    forall a b. f (a -> b) -> f a -> f b
    forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
    <*> f a
    x f (a -> a -> Vertex3 a) -> f a -> f (a -> Vertex3 a)
    forall a b. f (a -> b) -> f a -> f b
    forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
    <*> f a
    y f (a -> Vertex3 a) -> f a -> f (Vertex3 a)
    forall a b. f (a -> b) -> f a -> f b
    forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
    <*> f a
    z
       mapM :: forall (m :: * -> *) a b.
    Monad m =>
    (a -> m b) -> Vertex3 a -> m (Vertex3 b)
    mapM a -> m b
    f (Vertex3 a
    x a
    y a
    z) = (b -> b -> b -> Vertex3 b) -> m (b -> b -> b -> Vertex3 b)
    forall a. a -> m a
    forall (m :: * -> *) a. Monad m => a -> m a
    return b -> b -> b -> Vertex3 b
    forall a. a -> a -> a -> Vertex3 a
    Vertex3 m (b -> b -> b -> Vertex3 b) -> m b -> m (b -> b -> Vertex3 b)
    forall (m :: * -> *) a b. Monad m => m (a -> b) -> m a -> m b
    `ap` a -> m b
    f a
    x m (b -> b -> Vertex3 b) -> m b -> m (b -> Vertex3 b)
    forall (m :: * -> *) a b. Monad m => m (a -> b) -> m a -> m b
    `ap` a -> m b
    f a
    y m (b -> Vertex3 b) -> m b -> m (Vertex3 b)
    forall (m :: * -> *) a b. Monad m => m (a -> b) -> m a -> m b
    `ap` a -> m b
    f a
    z
       sequence :: forall (m :: * -> *) a. Monad m => Vertex3 (m a) -> m (Vertex3 a)
    sequence (Vertex3 m a
    x m a
    y m a
    z) = (a -> a -> a -> Vertex3 a) -> m (a -> a -> a -> Vertex3 a)
    forall a. a -> m a
    forall (m :: * -> *) a. Monad m => a -> m a
    return a -> a -> a -> Vertex3 a
    forall a. a -> a -> a -> Vertex3 a
    Vertex3 m (a -> a -> a -> Vertex3 a) -> m a -> m (a -> a -> Vertex3 a)
    forall (m :: * -> *) a b. Monad m => m (a -> b) -> m a -> m b
    `ap` m a
    x m (a -> a -> Vertex3 a) -> m a -> m (a -> Vertex3 a)
    forall (m :: * -> *) a b. Monad m => m (a -> b) -> m a -> m b
    `ap` m a
    y m (a -> Vertex3 a) -> m a -> m (Vertex3 a)
    forall (m :: * -> *) a b. Monad m => m (a -> b) -> m a -> m b
    `ap` m a
    z

    instance Storable a => Storable (Vertex3 a) where
       sizeOf :: Vertex3 a -> Int
    sizeOf ~(Vertex3 a
    x a
    _ a
    _) = Int
    3 Int -> Int -> Int
    forall a. Num a => a -> a -> a
    * a -> Int
    forall a. Storable a => a -> Int
    sizeOf a
    x
       alignment :: Vertex3 a -> Int
    alignment ~(Vertex3 a
    x a
    _ a
    _) = a -> Int
    forall a. Storable a => a -> Int
    alignment a
    x
       peek :: Ptr (Vertex3 a) -> IO (Vertex3 a)
    peek = Ptr (Vertex3 a) -> IO (Vertex3 a)
    forall (t :: * -> *) a.
    (Applicative t, Traversable t, Storable a) =>
    Ptr (t a) -> IO (t a)
    peekApplicativeTraversable
       poke :: Ptr (Vertex3 a) -> Vertex3 a -> IO ()
    poke = Ptr (Vertex3 a) -> Vertex3 a -> IO ()
    forall (t :: * -> *) a.
    (Foldable t, Storable a) =>
    Ptr (t a) -> t a -> IO ()
    pokeFoldable

    --------------------------------------------------------------------------------

    -- | A fully-fledged four-dimensional vertex.
    data Vertex4 a = Vertex4 !a !a !a !a
       deriving (Vertex4 a -> Vertex4 a -> Bool
    (Vertex4 a -> Vertex4 a -> Bool)
    -> (Vertex4 a -> Vertex4 a -> Bool) -> Eq (Vertex4 a)
    forall a. Eq a => Vertex4 a -> Vertex4 a -> Bool
    forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
    $c== :: forall a. Eq a => Vertex4 a -> Vertex4 a -> Bool
    == :: Vertex4 a -> Vertex4 a -> Bool
    $c/= :: forall a. Eq a => Vertex4 a -> Vertex4 a -> Bool
    /= :: Vertex4 a -> Vertex4 a -> Bool
    Eq, Eq (Vertex4 a)
    Eq (Vertex4 a) =>
    (Vertex4 a -> Vertex4 a -> Ordering)
    -> (Vertex4 a -> Vertex4 a -> Bool)
    -> (Vertex4 a -> Vertex4 a -> Bool)
    -> (Vertex4 a -> Vertex4 a -> Bool)
    -> (Vertex4 a -> Vertex4 a -> Bool)
    -> (Vertex4 a -> Vertex4 a -> Vertex4 a)
    -> (Vertex4 a -> Vertex4 a -> Vertex4 a)
    -> Ord (Vertex4 a)
    Vertex4 a -> Vertex4 a -> Bool
    Vertex4 a -> Vertex4 a -> Ordering
    Vertex4 a -> Vertex4 a -> Vertex4 a
    forall a.
    Eq a =>
    (a -> a -> Ordering)
    -> (a -> a -> Bool)
    -> (a -> a -> Bool)
    -> (a -> a -> Bool)
    -> (a -> a -> Bool)
    -> (a -> a -> a)
    -> (a -> a -> a)
    -> Ord a
    forall a. Ord a => Eq (Vertex4 a)
    forall a. Ord a => Vertex4 a -> Vertex4 a -> Bool
    forall a. Ord a => Vertex4 a -> Vertex4 a -> Ordering
    forall a. Ord a => Vertex4 a -> Vertex4 a -> Vertex4 a
    $ccompare :: forall a. Ord a => Vertex4 a -> Vertex4 a -> Ordering
    compare :: Vertex4 a -> Vertex4 a -> Ordering
    $c< :: forall a. Ord a => Vertex4 a -> Vertex4 a -> Bool
    < :: Vertex4 a -> Vertex4 a -> Bool
    $c<= :: forall a. Ord a => Vertex4 a -> Vertex4 a -> Bool
    <= :: Vertex4 a -> Vertex4 a -> Bool
    $c> :: forall a. Ord a => Vertex4 a -> Vertex4 a -> Bool
    > :: Vertex4 a -> Vertex4 a -> Bool
    $c>= :: forall a. Ord a => Vertex4 a -> Vertex4 a -> Bool
    >= :: Vertex4 a -> Vertex4 a -> Bool
    $cmax :: forall a. Ord a => Vertex4 a -> Vertex4 a -> Vertex4 a
    max :: Vertex4 a -> Vertex4 a -> Vertex4 a
    $cmin :: forall a. Ord a => Vertex4 a -> Vertex4 a -> Vertex4 a
    min :: Vertex4 a -> Vertex4 a -> Vertex4 a
    Ord, Ord (Vertex4 a)
    Ord (Vertex4 a) =>
    ((Vertex4 a, Vertex4 a) -> [Vertex4 a])
    -> ((Vertex4 a, Vertex4 a) -> Vertex4 a -> Int)
    -> ((Vertex4 a, Vertex4 a) -> Vertex4 a -> Int)
    -> ((Vertex4 a, Vertex4 a) -> Vertex4 a -> Bool)
    -> ((Vertex4 a, Vertex4 a) -> Int)
    -> ((Vertex4 a, Vertex4 a) -> Int)
    -> Ix (Vertex4 a)
    (Vertex4 a, Vertex4 a) -> Int
    (Vertex4 a, Vertex4 a) -> [Vertex4 a]
    (Vertex4 a, Vertex4 a) -> Vertex4 a -> Bool
    (Vertex4 a, Vertex4 a) -> Vertex4 a -> Int
    forall a.
    Ord a =>
    ((a, a) -> [a])
    -> ((a, a) -> a -> Int)
    -> ((a, a) -> a -> Int)
    -> ((a, a) -> a -> Bool)
    -> ((a, a) -> Int)
    -> ((a, a) -> Int)
    -> Ix a
    forall a. Ix a => Ord (Vertex4 a)
    forall a. Ix a => (Vertex4 a, Vertex4 a) -> Int
    forall a. Ix a => (Vertex4 a, Vertex4 a) -> [Vertex4 a]
    forall a. Ix a => (Vertex4 a, Vertex4 a) -> Vertex4 a -> Bool
    forall a. Ix a => (Vertex4 a, Vertex4 a) -> Vertex4 a -> Int
    $crange :: forall a. Ix a => (Vertex4 a, Vertex4 a) -> [Vertex4 a]
    range :: (Vertex4 a, Vertex4 a) -> [Vertex4 a]
    $cindex :: forall a. Ix a => (Vertex4 a, Vertex4 a) -> Vertex4 a -> Int
    index :: (Vertex4 a, Vertex4 a) -> Vertex4 a -> Int
    $cunsafeIndex :: forall a. Ix a => (Vertex4 a, Vertex4 a) -> Vertex4 a -> Int
    unsafeIndex :: (Vertex4 a, Vertex4 a) -> Vertex4 a -> Int
    $cinRange :: forall a. Ix a => (Vertex4 a, Vertex4 a) -> Vertex4 a -> Bool
    inRange :: (Vertex4 a, Vertex4 a) -> Vertex4 a -> Bool
    $crangeSize :: forall a. Ix a => (Vertex4 a, Vertex4 a) -> Int
    rangeSize :: (Vertex4 a, Vertex4 a) -> Int
    $cunsafeRangeSize :: forall a. Ix a => (Vertex4 a, Vertex4 a) -> Int
    unsafeRangeSize :: (Vertex4 a, Vertex4 a) -> Int
    Ix, Vertex4 a
    Vertex4 a -> Vertex4 a -> Bounded (Vertex4 a)
    forall a. a -> a -> Bounded a
    forall a. Bounded a => Vertex4 a
    $cminBound :: forall a. Bounded a => Vertex4 a
    minBound :: Vertex4 a
    $cmaxBound :: forall a. Bounded a => Vertex4 a
    maxBound :: Vertex4 a
    Bounded, Int -> Vertex4 a -> ShowS
    [Vertex4 a] -> ShowS
    Vertex4 a -> String
    (Int -> Vertex4 a -> ShowS)
    -> (Vertex4 a -> String)
    -> ([Vertex4 a] -> ShowS)
    -> Show (Vertex4 a)
    forall a. Show a => Int -> Vertex4 a -> ShowS
    forall a. Show a => [Vertex4 a] -> ShowS
    forall a. Show a => Vertex4 a -> String
    forall a.
    (Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
    $cshowsPrec :: forall a. Show a => Int -> Vertex4 a -> ShowS
    showsPrec :: Int -> Vertex4 a -> ShowS
    $cshow :: forall a. Show a => Vertex4 a -> String
    show :: Vertex4 a -> String
    $cshowList :: forall a. Show a => [Vertex4 a] -> ShowS
    showList :: [Vertex4 a] -> ShowS
    Show, ReadPrec [Vertex4 a]
    ReadPrec (Vertex4 a)
    Int -> ReadS (Vertex4 a)
    ReadS [Vertex4 a]
    (Int -> ReadS (Vertex4 a))
    -> ReadS [Vertex4 a]
    -> ReadPrec (Vertex4 a)
    -> ReadPrec [Vertex4 a]
    -> Read (Vertex4 a)
    forall a. Read a => ReadPrec [Vertex4 a]
    forall a. Read a => ReadPrec (Vertex4 a)
    forall a. Read a => Int -> ReadS (Vertex4 a)
    forall a. Read a => ReadS [Vertex4 a]
    forall a.
    (Int -> ReadS a)
    -> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
    $creadsPrec :: forall a. Read a => Int -> ReadS (Vertex4 a)
    readsPrec :: Int -> ReadS (Vertex4 a)
    $creadList :: forall a. Read a => ReadS [Vertex4 a]
    readList :: ReadS [Vertex4 a]
    $creadPrec :: forall a. Read a => ReadPrec (Vertex4 a)
    readPrec :: ReadPrec (Vertex4 a)
    $creadListPrec :: forall a. Read a => ReadPrec [Vertex4 a]
    readListPrec :: ReadPrec [Vertex4 a]
    Read, Typeable)

    instance Functor Vertex4 where
       fmap :: forall a b. (a -> b) -> Vertex4 a -> Vertex4 b
    fmap a -> b
    f (Vertex4 a
    x a
    y a
    z a
    w) = b -> b -> b -> b -> Vertex4 b
    forall a. a -> a -> a -> a -> Vertex4 a
    Vertex4 (a -> b
    f a
    x) (a -> b
    f a
    y) (a -> b
    f a
    z) (a -> b
    f a
    w)

    instance Applicative Vertex4 where
       pure :: forall a. a -> Vertex4 a
    pure a
    a = a -> a -> a -> a -> Vertex4 a
    forall a. a -> a -> a -> a -> Vertex4 a
    Vertex4 a
    a a
    a a
    a a
    a
       Vertex4 a -> b
    f a -> b
    g a -> b
    h a -> b
    i <*> :: forall a b. Vertex4 (a -> b) -> Vertex4 a -> Vertex4 b
    <*> Vertex4 a
    x a
    y a
    z a
    w = b -> b -> b -> b -> Vertex4 b
    forall a. a -> a -> a -> a -> Vertex4 a
    Vertex4 (a -> b
    f a
    x) (a -> b
    g a
    y) (a -> b
    h a
    z) (a -> b
    i a
    w)

    instance Foldable Vertex4 where
       foldr :: forall a b. (a -> b -> b) -> b -> Vertex4 a -> b
    foldr a -> b -> b
    f b
    a (Vertex4 a
    x a
    y a
    z a
    w) = a
    x `f ` (a
    y a -> b -> b
    `f` (a
    z a -> b -> b
    `f` (a
    w a -> b -> b
    `f` b
    a)))
       foldl :: forall b a. (b -> a -> b) -> b -> Vertex4 a -> b
    foldl b -> a -> b
    f b
    a (Vertex4 a
    x a
    y a
    z a
    w) = (((b
    a b -> a -> b
    `f` a
    x) b -> a -> b
    `f` a
    y) b -> a -> b
    `f` a
    z) b -> a -> b
    `f` a
    w
       foldr1 :: forall a. (a -> a -> a) -> Vertex4 a -> a
    foldr1 a -> a -> a
    f (Vertex4 a
    x a
    y a
    z a
    w) = a
    x a -> a -> a
    `f` (a
    y a -> a -> a
    `f` (a
    z a -> a -> a
    `f` a
    w))
       foldl1 :: forall a. (a -> a -> a) -> Vertex4 a -> a
    foldl1 a -> a -> a
    f (Vertex4 a
    x a
    y a
    z a
    w) = ((a
    x a -> a -> a
    `f` a
    y) a -> a -> a
    `f` a
    z) a -> a -> a
    `f` a
    w

    instance Traversable Vertex4 where
       traverse :: forall (f :: * -> *) a b.
    Applicative f =>
    (a -> f b) -> Vertex4 a -> f (Vertex4 b)
    traverse a -> f b
    f (Vertex4 a
    x a
    y a
    z a
    w) = (b -> b -> b -> b -> Vertex4 b)
    -> f (b -> b -> b -> b -> Vertex4 b)
    forall a. a -> f a
    forall (f :: * -> *) a. Applicative f => a -> f a
    pure b -> b -> b -> b -> Vertex4 b
    forall a. a -> a -> a -> a -> Vertex4 a
    Vertex4 f (b -> b -> b -> b -> Vertex4 b)
    -> f b -> f (b -> b -> b -> Vertex4 b)
    forall a b. f (a -> b) -> f a -> f b
    forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
    <*> a -> f b
    f a
    x f (b -> b -> b -> Vertex4 b) -> f b -> f (b -> b -> Vertex4 b)
    forall a b. f (a -> b) -> f a -> f b
    forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
    <*> a -> f b
    f a
    y f (b -> b -> Vertex4 b) -> f b -> f (b -> Vertex4 b)
    forall a b. f (a -> b) -> f a -> f b
    forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
    <*> a -> f b
    f a
    z f (b -> Vertex4 b) -> f b -> f (Vertex4 b)
    forall a b. f (a -> b) -> f a -> f b
    forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
    <*> a -> f b
    f a
    w
       sequenceA :: forall (f :: * -> *) a.
    Applicative f =>
    Vertex4 (f a) -> f (Vertex4 a)
    sequenceA (Vertex4 f a
    x f a
    y f a
    z f a
    w) =  (a -> a -> a -> a -> Vertex4 a)
    -> f (a -> a -> a -> a -> Vertex4 a)
    forall a. a -> f a
    forall (f :: * -> *) a. Applicative f => a -> f a
    pure a -> a -> a -> a -> Vertex4 a
    forall a. a -> a -> a -> a -> Vertex4 a
    Vertex4 f (a -> a -> a -> a -> Vertex4 a)
    -> f a -> f (a -> a -> a -> Vertex4 a)
    forall a b. f (a -> b) -> f a -> f b
    forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
    <*> f a
    x f (a -> a -> a -> Vertex4 a) -> f a -> f (a -> a -> Vertex4 a)
    forall a b. f (a -> b) -> f a -> f b
    forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
    <*> f a
    y f (a -> a -> Vertex4 a) -> f a -> f (a -> Vertex4 a)
    forall a b. f (a -> b) -> f a -> f b
    forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
    <*> f a
    z f (a -> Vertex4 a) -> f a -> f (Vertex4 a)
    forall a b. f (a -> b) -> f a -> f b
    forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
    <*> f a
    w
       mapM :: forall (m :: * -> *) a b.
    Monad m =>
    (a -> m b) -> Vertex4 a -> m (Vertex4 b)
    mapM a -> m b
    f (Vertex4 a
    x a
    y a
    z a
    w) = (b -> b -> b -> b -> Vertex4 b)
    -> m (b -> b -> b -> b -> Vertex4 b)
    forall a. a -> m a
    forall (m :: * -> *) a. Monad m => a -> m a
    return b -> b -> b -> b -> Vertex4 b
    forall a. a -> a -> a -> a -> Vertex4 a
    Vertex4 m (b -> b -> b -> b -> Vertex4 b)
    -> m b -> m (b -> b -> b -> Vertex4 b)
    forall (m :: * -> *) a b. Monad m => m (a -> b) -> m a -> m b
    `ap` a -> m b
    f a
    x m (b -> b -> b -> Vertex4 b) -> m b -> m (b -> b -> Vertex4 b)
    forall (m :: * -> *) a b. Monad m => m (a -> b) -> m a -> m b
    `ap` a -> m b
    f a
    y m (b -> b -> Vertex4 b) -> m b -> m (b -> Vertex4 b)
    forall (m :: * -> *) a b. Monad m => m (a -> b) -> m a -> m b
    `ap` a -> m b
    f a
    z m (b -> Vertex4 b) -> m b -> m (Vertex4 b)
    forall (m :: * -> *) a b. Monad m => m (a -> b) -> m a -> m b
    `ap` a -> m b
    f a
    w
       sequence :: forall (m :: * -> *) a. Monad m => Vertex4 (m a) -> m (Vertex4 a)
    sequence (Vertex4 m a
    x m a
    y m a
    z m a
    w) = (a -> a -> a -> a -> Vertex4 a)
    -> m (a -> a -> a -> a -> Vertex4 a)
    forall a. a -> m a
    forall (m :: * -> *) a. Monad m => a -> m a
    return a -> a -> a -> a -> Vertex4 a
    forall a. a -> a -> a -> a -> Vertex4 a
    Vertex4 m (a -> a -> a -> a -> Vertex4 a)
    -> m a -> m (a -> a -> a -> Vertex4 a)
    forall (m :: * -> *) a b. Monad m => m (a -> b) -> m a -> m b
    `ap` m a
    x m (a -> a -> a -> Vertex4 a) -> m a -> m (a -> a -> Vertex4 a)
    forall (m :: * -> *) a b. Monad m => m (a -> b) -> m a -> m b
    `ap` m a
    y m (a -> a -> Vertex4 a) -> m a -> m (a -> Vertex4 a)
    forall (m :: * -> *) a b. Monad m => m (a -> b) -> m a -> m b
    `ap` m a
    z m (a -> Vertex4 a) -> m a -> m (Vertex4 a)
    forall (m :: * -> *) a b. Monad m => m (a -> b) -> m a -> m b
    `ap` m a
    w

    instance Storable a => Storable (Vertex4 a) where
       sizeOf :: Vertex4 a -> Int
    sizeOf ~(Vertex4 a
    x a
    _ a
    _ a
    _) = Int
    4 Int -> Int -> Int
    forall a. Num a => a -> a -> a
    * a -> Int
    forall a. Storable a => a -> Int
    sizeOf a
    x
       alignment :: Vertex4 a -> Int
    alignment ~(Vertex4 a
    x a
    _ a
    _ a
    _) = a -> Int
    forall a. Storable a => a -> Int
    alignment a
    x
       peek :: Ptr (Vertex4 a) -> IO (Vertex4 a)
    peek = Ptr (Vertex4 a) -> IO (Vertex4 a)
    forall (t :: * -> *) a.
    (Applicative t, Traversable t, Storable a) =>
    Ptr (t a) -> IO (t a)
    peekApplicativeTraversable
       poke :: Ptr (Vertex4 a) -> Vertex4 a -> IO ()
    poke = Ptr (Vertex4 a) -> Vertex4 a -> IO ()
    forall (t :: * -> *) a.
    (Foldable t, Storable a) =>
    Ptr (t a) -> t a -> IO ()
    pokeFoldable

    --------------------------------------------------------------------------------

    -- | A one-dimensional vector.
    newtype Vector1 a = Vector1 a
       deriving (Vector1 a -> Vector1 a -> Bool
    (Vector1 a -> Vector1 a -> Bool)
    -> (Vector1 a -> Vector1 a -> Bool) -> Eq (Vector1 a)
    forall a. Eq a => Vector1 a -> Vector1 a -> Bool
    forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
    $c== :: forall a. Eq a => Vector1 a -> Vector1 a -> Bool
    == :: Vector1 a -> Vector1 a -> Bool
    $c/= :: forall a. Eq a => Vector1 a -> Vector1 a -> Bool
    /= :: Vector1 a -> Vector1 a -> Bool
    Eq, Eq (Vector1 a)
    Eq (Vector1 a) =>
    (Vector1 a -> Vector1 a -> Ordering)
    -> (Vector1 a -> Vector1 a -> Bool)
    -> (Vector1 a -> Vector1 a -> Bool)
    -> (Vector1 a -> Vector1 a -> Bool)
    -> (Vector1 a -> Vector1 a -> Bool)
    -> (Vector1 a -> Vector1 a -> Vector1 a)
    -> (Vector1 a -> Vector1 a -> Vector1 a)
    -> Ord (Vector1 a)
    Vector1 a -> Vector1 a -> Bool
    Vector1 a -> Vector1 a -> Ordering
    Vector1 a -> Vector1 a -> Vector1 a
    forall a.
    Eq a =>
    (a -> a -> Ordering)
    -> (a -> a -> Bool)
    -> (a -> a -> Bool)
    -> (a -> a -> Bool)
    -> (a -> a -> Bool)
    -> (a -> a -> a)
    -> (a -> a -> a)
    -> Ord a
    forall a. Ord a => Eq (Vector1 a)
    forall a. Ord a => Vector1 a -> Vector1 a -> Bool
    forall a. Ord a => Vector1 a -> Vector1 a -> Ordering
    forall a. Ord a => Vector1 a -> Vector1 a -> Vector1 a
    $ccompare :: forall a. Ord a => Vector1 a -> Vector1 a -> Ordering
    compare :: Vector1 a -> Vector1 a -> Ordering
    $c< :: forall a. Ord a => Vector1 a -> Vector1 a -> Bool
    < :: Vector1 a -> Vector1 a -> Bool
    $c<= :: forall a. Ord a => Vector1 a -> Vector1 a -> Bool
    <= :: Vector1 a -> Vector1 a -> Bool
    $c> :: forall a. Ord a => Vector1 a -> Vector1 a -> Bool
    > :: Vector1 a -> Vector1 a -> Bool
    $c>= :: forall a. Ord a => Vector1 a -> Vector1 a -> Bool
    >= :: Vector1 a -> Vector1 a -> Bool
    $cmax :: forall a. Ord a => Vector1 a -> Vector1 a -> Vector1 a
    max :: Vector1 a -> Vector1 a -> Vector1 a
    $cmin :: forall a. Ord a => Vector1 a -> Vector1 a -> Vector1 a
    min :: Vector1 a -> Vector1 a -> Vector1 a
    Ord, Ord (Vector1 a)
    Ord (Vector1 a) =>
    ((Vector1 a, Vector1 a) -> [Vector1 a])
    -> ((Vector1 a, Vector1 a) -> Vector1 a -> Int)
    -> ((Vector1 a, Vector1 a) -> Vector1 a -> Int)
    -> ((Vector1 a, Vector1 a) -> Vector1 a -> Bool)
    -> ((Vector1 a, Vector1 a) -> Int)
    -> ((Vector1 a, Vector1 a) -> Int)
    -> Ix (Vector1 a)
    (Vector1 a, Vector1 a) -> Int
    (Vector1 a, Vector1 a) -> [Vector1 a]
    (Vector1 a, Vector1 a) -> Vector1 a -> Bool
    (Vector1 a, Vector1 a) -> Vector1 a -> Int
    forall a.
    Ord a =>
    ((a, a) -> [a])
    -> ((a, a) -> a -> Int)
    -> ((a, a) -> a -> Int)
    -> ((a, a) -> a -> Bool)
    -> ((a, a) -> Int)
    -> ((a, a) -> Int)
    -> Ix a
    forall a. Ix a => Ord (Vector1 a)
    forall a. Ix a => (Vector1 a, Vector1 a) -> Int
    forall a. Ix a => (Vector1 a, Vector1 a) -> [Vector1 a]
    forall a. Ix a => (Vector1 a, Vector1 a) -> Vector1 a -> Bool
    forall a. Ix a => (Vector1 a, Vector1 a) -> Vector1 a -> Int
    $crange :: forall a. Ix a => (Vector1 a, Vector1 a) -> [Vector1 a]
    range :: (Vector1 a, Vector1 a) -> [Vector1 a]
    $cindex :: forall a. Ix a => (Vector1 a, Vector1 a) -> Vector1 a -> Int
    index :: (Vector1 a, Vector1 a) -> Vector1 a -> Int
    $cunsafeIndex :: forall a. Ix a => (Vector1 a, Vector1 a) -> Vector1 a -> Int
    unsafeIndex :: (Vector1 a, Vector1 a) -> Vector1 a -> Int
    $cinRange :: forall a. Ix a => (Vector1 a, Vector1 a) -> Vector1 a -> Bool
    inRange :: (Vector1 a, Vector1 a) -> Vector1 a -> Bool
    $crangeSize :: forall a. Ix a => (Vector1 a, Vector1 a) -> Int
    rangeSize :: (Vector1 a, Vector1 a) -> Int
    $cunsafeRangeSize :: forall a. Ix a => (Vector1 a, Vector1 a) -> Int
    unsafeRangeSize :: (Vector1 a, Vector1 a) -> Int
    Ix, Vector1 a
    Vector1 a -> Vector1 a -> Bounded (Vector1 a)
    forall a. a -> a -> Bounded a
    forall a. Bounded a => Vector1 a
    $cminBound :: forall a. Bounded a => Vector1 a
    minBound :: Vector1 a
    $cmaxBound :: forall a. Bounded a => Vector1 a
    maxBound :: Vector1 a
    Bounded, Int -> Vector1 a -> ShowS
    [Vector1 a] -> ShowS
    Vector1 a -> String
    (Int -> Vector1 a -> ShowS)
    -> (Vector1 a -> String)
    -> ([Vector1 a] -> ShowS)
    -> Show (Vector1 a)
    forall a. Show a => Int -> Vector1 a -> ShowS
    forall a. Show a => [Vector1 a] -> ShowS
    forall a. Show a => Vector1 a -> String
    forall a.
    (Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
    $cshowsPrec :: forall a. Show a => Int -> Vector1 a -> ShowS
    showsPrec :: Int -> Vector1 a -> ShowS
    $cshow :: forall a. Show a => Vector1 a -> String
    show :: Vector1 a -> String
    $cshowList :: forall a. Show a => [Vector1 a] -> ShowS
    showList :: [Vector1 a] -> ShowS
    Show, ReadPrec [Vector1 a]
    ReadPrec (Vector1 a)
    Int -> ReadS (Vector1 a)
    ReadS [Vector1 a]
    (Int -> ReadS (Vector1 a))
    -> ReadS [Vector1 a]
    -> ReadPrec (Vector1 a)
    -> ReadPrec [Vector1 a]
    -> Read (Vector1 a)
    forall a. Read a => ReadPrec [Vector1 a]
    forall a. Read a => ReadPrec (Vector1 a)
    forall a. Read a => Int -> ReadS (Vector1 a)
    forall a. Read a => ReadS [Vector1 a]
    forall a.
    (Int -> ReadS a)
    -> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
    $creadsPrec :: forall a. Read a => Int -> ReadS (Vector1 a)
    readsPrec :: Int -> ReadS (Vector1 a)
    $creadList :: forall a. Read a => ReadS [Vector1 a]
    readList :: ReadS [Vector1 a]
    $creadPrec :: forall a. Read a => ReadPrec (Vector1 a)
    readPrec :: ReadPrec (Vector1 a)
    $creadListPrec :: forall a. Read a => ReadPrec [Vector1 a]
    readListPrec :: ReadPrec [Vector1 a]
    Read, Typeable)

    instance Functor Vector1 where
       fmap :: forall a b. (a -> b) -> Vector1 a -> Vector1 b
    fmap a -> b
    f (Vector1 a
    x) = b -> Vector1 b
    forall a. a -> Vector1 a
    Vector1 (a -> b
    f a
    x)

    instance Applicative Vector1 where
       pure :: forall a. a -> Vector1 a
    pure a
    a = a -> Vector1 a
    forall a. a -> Vector1 a
    Vector1 a
    a
       Vector1 a -> b
    f <*> :: forall a b. Vector1 (a -> b) -> Vector1 a -> Vector1 b
    <*> Vector1 a
    x = b -> Vector1 b
    forall a. a -> Vector1 a
    Vector1 (a -> b
    f a
    x)

    instance Foldable Vector1 where
       foldr :: forall a b. (a -> b -> b) -> b -> Vector1 a -> b
    foldr a -> b -> b
    f b
    a (Vector1 a
    x) = a
    x `f ` b
    a
       foldl :: forall b a. (b -> a -> b) -> b -> Vector1 a -> b
    foldl b -> a -> b
    f b
    a (Vector1 a
    x) = b
    a b -> a -> b
    `f` a
    x
       foldr1 :: forall a. (a -> a -> a) -> Vector1 a -> a
    foldr1 a -> a -> a
    _ (Vector1 a
    x) = a
    x
       foldl1 :: forall a. (a -> a -> a) -> Vector1 a -> a
    foldl1 a -> a -> a
    _ (Vector1 a
    x) = a
    x

    instance Traversable Vector1 where
       traverse :: forall (f :: * -> *) a b.
    Applicative f =>
    (a -> f b) -> Vector1 a -> f (Vector1 b)
    traverse a -> f b
    f (Vector1 a
    x) = (b -> Vector1 b) -> f (b -> Vector1 b)
    forall a. a -> f a
    forall (f :: * -> *) a. Applicative f => a -> f a
    pure b -> Vector1 b
    forall a. a -> Vector1 a
    Vector1 f (b -> Vector1 b) -> f b -> f (Vector1 b)
    forall a b. f (a -> b) -> f a -> f b
    forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
    <*> a -> f b
    f a
    x
       sequenceA :: forall (f :: * -> *) a.
    Applicative f =>
    Vector1 (f a) -> f (Vector1 a)
    sequenceA (Vector1 f a
    x) =  (a -> Vector1 a) -> f (a -> Vector1 a)
    forall a. a -> f a
    forall (f :: * -> *) a. Applicative f => a -> f a
    pure a -> Vector1 a
    forall a. a -> Vector1 a
    Vector1 f (a -> Vector1 a) -> f a -> f (Vector1 a)
    forall a b. f (a -> b) -> f a -> f b
    forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
    <*> f a
    x
       mapM :: forall (m :: * -> *) a b.
    Monad m =>
    (a -> m b) -> Vector1 a -> m (Vector1 b)
    mapM a -> m b
    f (Vector1 a
    x) = (b -> Vector1 b) -> m (b -> Vector1 b)
    forall a. a -> m a
    forall (m :: * -> *) a. Monad m => a -> m a
    return b -> Vector1 b
    forall a. a -> Vector1 a
    Vector1 m (b -> Vector1 b) -> m b -> m (Vector1 b)
    forall (m :: * -> *) a b. Monad m => m (a -> b) -> m a -> m b
    `ap` a -> m b
    f a
    x
       sequence :: forall (m :: * -> *) a. Monad m => Vector1 (m a) -> m (Vector1 a)
    sequence (Vector1 m a
    x) = (a -> Vector1 a) -> m (a -> Vector1 a)
    forall a. a -> m a
    forall (m :: * -> *) a. Monad m => a -> m a
    return a -> Vector1 a
    forall a. a -> Vector1 a
    Vector1 m (a -> Vector1 a) -> m a -> m (Vector1 a)
    forall (m :: * -> *) a b. Monad m => m (a -> b) -> m a -> m b
    `ap` m a
    x

    instance Storable a => Storable (Vector1 a) where
       sizeOf :: Vector1 a -> Int
    sizeOf    ~(Vector1 a
    s) = a -> Int
    forall a. Storable a => a -> Int
    sizeOf a
    s
       alignment :: Vector1 a -> Int
    alignment ~(Vector1 a
    s) = a -> Int
    forall a. Storable a => a -> Int
    alignment a
    s
       peek :: Ptr (Vector1 a) -> IO (Vector1 a)
    peek = Ptr (Vector1 a) -> IO (Vector1 a)
    forall (t :: * -> *) a.
    (Applicative t, Traversable t, Storable a) =>
    Ptr (t a) -> IO (t a)
    peekApplicativeTraversable
       poke :: Ptr (Vector1 a) -> Vector1 a -> IO ()
    poke = Ptr (Vector1 a) -> Vector1 a -> IO ()
    forall (t :: * -> *) a.
    (Foldable t, Storable a) =>
    Ptr (t a) -> t a -> IO ()
    pokeFoldable

    --------------------------------------------------------------------------------

    -- | A two-dimensional vector.
    data Vector2 a = Vector2 !a !a
       deriving (Vector2 a -> Vector2 a -> Bool
    (Vector2 a -> Vector2 a -> Bool)
    -> (Vector2 a -> Vector2 a -> Bool) -> Eq (Vector2 a)
    forall a. Eq a => Vector2 a -> Vector2 a -> Bool
    forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
    $c== :: forall a. Eq a => Vector2 a -> Vector2 a -> Bool
    == :: Vector2 a -> Vector2 a -> Bool
    $c/= :: forall a. Eq a => Vector2 a -> Vector2 a -> Bool
    /= :: Vector2 a -> Vector2 a -> Bool
    Eq, Eq (Vector2 a)
    Eq (Vector2 a) =>
    (Vector2 a -> Vector2 a -> Ordering)
    -> (Vector2 a -> Vector2 a -> Bool)
    -> (Vector2 a -> Vector2 a -> Bool)
    -> (Vector2 a -> Vector2 a -> Bool)
    -> (Vector2 a -> Vector2 a -> Bool)
    -> (Vector2 a -> Vector2 a -> Vector2 a)
    -> (Vector2 a -> Vector2 a -> Vector2 a)
    -> Ord (Vector2 a)
    Vector2 a -> Vector2 a -> Bool
    Vector2 a -> Vector2 a -> Ordering
    Vector2 a -> Vector2 a -> Vector2 a
    forall a.
    Eq a =>
    (a -> a -> Ordering)
    -> (a -> a -> Bool)
    -> (a -> a -> Bool)
    -> (a -> a -> Bool)
    -> (a -> a -> Bool)
    -> (a -> a -> a)
    -> (a -> a -> a)
    -> Ord a
    forall a. Ord a => Eq (Vector2 a)
    forall a. Ord a => Vector2 a -> Vector2 a -> Bool
    forall a. Ord a => Vector2 a -> Vector2 a -> Ordering
    forall a. Ord a => Vector2 a -> Vector2 a -> Vector2 a
    $ccompare :: forall a. Ord a => Vector2 a -> Vector2 a -> Ordering
    compare :: Vector2 a -> Vector2 a -> Ordering
    $c< :: forall a. Ord a => Vector2 a -> Vector2 a -> Bool
    < :: Vector2 a -> Vector2 a -> Bool
    $c<= :: forall a. Ord a => Vector2 a -> Vector2 a -> Bool
    <= :: Vector2 a -> Vector2 a -> Bool
    $c> :: forall a. Ord a => Vector2 a -> Vector2 a -> Bool
    > :: Vector2 a -> Vector2 a -> Bool
    $c>= :: forall a. Ord a => Vector2 a -> Vector2 a -> Bool
    >= :: Vector2 a -> Vector2 a -> Bool
    $cmax :: forall a. Ord a => Vector2 a -> Vector2 a -> Vector2 a
    max :: Vector2 a -> Vector2 a -> Vector2 a
    $cmin :: forall a. Ord a => Vector2 a -> Vector2 a -> Vector2 a
    min :: Vector2 a -> Vector2 a -> Vector2 a
    Ord, Ord (Vector2 a)
    Ord (Vector2 a) =>
    ((Vector2 a, Vector2 a) -> [Vector2 a])
    -> ((Vector2 a, Vector2 a) -> Vector2 a -> Int)
    -> ((Vector2 a, Vector2 a) -> Vector2 a -> Int)
    -> ((Vector2 a, Vector2 a) -> Vector2 a -> Bool)
    -> ((Vector2 a, Vector2 a) -> Int)
    -> ((Vector2 a, Vector2 a) -> Int)
    -> Ix (Vector2 a)
    (Vector2 a, Vector2 a) -> Int
    (Vector2 a, Vector2 a) -> [Vector2 a]
    (Vector2 a, Vector2 a) -> Vector2 a -> Bool
    (Vector2 a, Vector2 a) -> Vector2 a -> Int
    forall a.
    Ord a =>
    ((a, a) -> [a])
    -> ((a, a) -> a -> Int)
    -> ((a, a) -> a -> Int)
    -> ((a, a) -> a -> Bool)
    -> ((a, a) -> Int)
    -> ((a, a) -> Int)
    -> Ix a
    forall a. Ix a => Ord (Vector2 a)
    forall a. Ix a => (Vector2 a, Vector2 a) -> Int
    forall a. Ix a => (Vector2 a, Vector2 a) -> [Vector2 a]
    forall a. Ix a => (Vector2 a, Vector2 a) -> Vector2 a -> Bool
    forall a. Ix a => (Vector2 a, Vector2 a) -> Vector2 a -> Int
    $crange :: forall a. Ix a => (Vector2 a, Vector2 a) -> [Vector2 a]
    range :: (Vector2 a, Vector2 a) -> [Vector2 a]
    $cindex :: forall a. Ix a => (Vector2 a, Vector2 a) -> Vector2 a -> Int
    index :: (Vector2 a, Vector2 a) -> Vector2 a -> Int
    $cunsafeIndex :: forall a. Ix a => (Vector2 a, Vector2 a) -> Vector2 a -> Int
    unsafeIndex :: (Vector2 a, Vector2 a) -> Vector2 a -> Int
    $cinRange :: forall a. Ix a => (Vector2 a, Vector2 a) -> Vector2 a -> Bool
    inRange :: (Vector2 a, Vector2 a) -> Vector2 a -> Bool
    $crangeSize :: forall a. Ix a => (Vector2 a, Vector2 a) -> Int
    rangeSize :: (Vector2 a, Vector2 a) -> Int
    $cunsafeRangeSize :: forall a. Ix a => (Vector2 a, Vector2 a) -> Int
    unsafeRangeSize :: (Vector2 a, Vector2 a) -> Int
    Ix, Vector2 a
    Vector2 a -> Vector2 a -> Bounded (Vector2 a)
    forall a. a -> a -> Bounded a
    forall a. Bounded a => Vector2 a
    $cminBound :: forall a. Bounded a => Vector2 a
    minBound :: Vector2 a
    $cmaxBound :: forall a. Bounded a => Vector2 a
    maxBound :: Vector2 a
    Bounded, Int -> Vector2 a -> ShowS
    [Vector2 a] -> ShowS
    Vector2 a -> String
    (Int -> Vector2 a -> ShowS)
    -> (Vector2 a -> String)
    -> ([Vector2 a] -> ShowS)
    -> Show (Vector2 a)
    forall a. Show a => Int -> Vector2 a -> ShowS
    forall a. Show a => [Vector2 a] -> ShowS
    forall a. Show a => Vector2 a -> String
    forall a.
    (Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
    $cshowsPrec :: forall a. Show a => Int -> Vector2 a -> ShowS
    showsPrec :: Int -> Vector2 a -> ShowS
    $cshow :: forall a. Show a => Vector2 a -> String
    show :: Vector2 a -> String
    $cshowList :: forall a. Show a => [Vector2 a] -> ShowS
    showList :: [Vector2 a] -> ShowS
    Show, ReadPrec [Vector2 a]
    ReadPrec (Vector2 a)
    Int -> ReadS (Vector2 a)
    ReadS [Vector2 a]
    (Int -> ReadS (Vector2 a))
    -> ReadS [Vector2 a]
    -> ReadPrec (Vector2 a)
    -> ReadPrec [Vector2 a]
    -> Read (Vector2 a)
    forall a. Read a => ReadPrec [Vector2 a]
    forall a. Read a => ReadPrec (Vector2 a)
    forall a. Read a => Int -> ReadS (Vector2 a)
    forall a. Read a => ReadS [Vector2 a]
    forall a.
    (Int -> ReadS a)
    -> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
    $creadsPrec :: forall a. Read a => Int -> ReadS (Vector2 a)
    readsPrec :: Int -> ReadS (Vector2 a)
    $creadList :: forall a. Read a => ReadS [Vector2 a]
    readList :: ReadS [Vector2 a]
    $creadPrec :: forall a. Read a => ReadPrec (Vector2 a)
    readPrec :: ReadPrec (Vector2 a)
    $creadListPrec :: forall a. Read a => ReadPrec [Vector2 a]
    readListPrec :: ReadPrec [Vector2 a]
    Read, Typeable)

    instance Functor Vector2 where
       fmap :: forall a b. (a -> b) -> Vector2 a -> Vector2 b
    fmap a -> b
    f (Vector2 a
    x a
    y) = b -> b -> Vector2 b
    forall a. a -> a -> Vector2 a
    Vector2 (a -> b
    f a
    x) (a -> b
    f a
    y)

    instance Applicative Vector2 where
       pure :: forall a. a -> Vector2 a
    pure a
    a = a -> a -> Vector2 a
    forall a. a -> a -> Vector2 a
    Vector2 a
    a a
    a
       Vector2 a -> b
    f a -> b
    g <*> :: forall a b. Vector2 (a -> b) -> Vector2 a -> Vector2 b
    <*> Vector2 a
    x a
    y = b -> b -> Vector2 b
    forall a. a -> a -> Vector2 a
    Vector2 (a -> b
    f a
    x) (a -> b
    g a
    y)

    instance Foldable Vector2 where
       foldr :: forall a b. (a -> b -> b) -> b -> Vector2 a -> b
    foldr a -> b -> b
    f b
    a (Vector2 a
    x a
    y) = a
    x `f ` (a
    y a -> b -> b
    `f` b
    a)
       foldl :: forall b a. (b -> a -> b) -> b -> Vector2 a -> b
    foldl b -> a -> b
    f b
    a (Vector2 a
    x a
    y) = (b
    a b -> a -> b
    `f` a
    x) b -> a -> b
    `f` a
    y
       foldr1 :: forall a. (a -> a -> a) -> Vector2 a -> a
    foldr1 a -> a -> a
    f (Vector2 a
    x a
    y) = a
    x a -> a -> a
    `f` a
    y
       foldl1 :: forall a. (a -> a -> a) -> Vector2 a -> a
    foldl1 a -> a -> a
    f (Vector2 a
    x a
    y) = a
    x a -> a -> a
    `f` a
    y

    instance Traversable Vector2 where
       traverse :: forall (f :: * -> *) a b.
    Applicative f =>
    (a -> f b) -> Vector2 a -> f (Vector2 b)
    traverse a -> f b
    f (Vector2 a
    x a
    y) = (b -> b -> Vector2 b) -> f (b -> b -> Vector2 b)
    forall a. a -> f a
    forall (f :: * -> *) a. Applicative f => a -> f a
    pure b -> b -> Vector2 b
    forall a. a -> a -> Vector2 a
    Vector2 f (b -> b -> Vector2 b) -> f b -> f (b -> Vector2 b)
    forall a b. f (a -> b) -> f a -> f b
    forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
    <*> a -> f b
    f a
    x f (b -> Vector2 b) -> f b -> f (Vector2 b)
    forall a b. f (a -> b) -> f a -> f b
    forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
    <*> a -> f b
    f a
    y
       sequenceA :: forall (f :: * -> *) a.
    Applicative f =>
    Vector2 (f a) -> f (Vector2 a)
    sequenceA (Vector2 f a
    x f a
    y) =  (a -> a -> Vector2 a) -> f (a -> a -> Vector2 a)
    forall a. a -> f a
    forall (f :: * -> *) a. Applicative f => a -> f a
    pure a -> a -> Vector2 a
    forall a. a -> a -> Vector2 a
    Vector2 f (a -> a -> Vector2 a) -> f a -> f (a -> Vector2 a)
    forall a b. f (a -> b) -> f a -> f b
    forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
    <*> f a
    x f (a -> Vector2 a) -> f a -> f (Vector2 a)
    forall a b. f (a -> b) -> f a -> f b
    forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
    <*> f a
    y
       mapM :: forall (m :: * -> *) a b.
    Monad m =>
    (a -> m b) -> Vector2 a -> m (Vector2 b)
    mapM a -> m b
    f (Vector2 a
    x a
    y) = (b -> b -> Vector2 b) -> m (b -> b -> Vector2 b)
    forall a. a -> m a
    forall (m :: * -> *) a. Monad m => a -> m a
    return b -> b -> Vector2 b
    forall a. a -> a -> Vector2 a
    Vector2 m (b -> b -> Vector2 b) -> m b -> m (b -> Vector2 b)
    forall (m :: * -> *) a b. Monad m => m (a -> b) -> m a -> m b
    `ap` a -> m b
    f a
    x m (b -> Vector2 b) -> m b -> m (Vector2 b)
    forall (m :: * -> *) a b. Monad m => m (a -> b) -> m a -> m b
    `ap` a -> m b
    f a
    y
       sequence :: forall (m :: * -> *) a. Monad m => Vector2 (m a) -> m (Vector2 a)
    sequence (Vector2 m a
    x m a
    y) = (a -> a -> Vector2 a) -> m (a -> a -> Vector2 a)
    forall a. a -> m a
    forall (m :: * -> *) a. Monad m => a -> m a
    return a -> a -> Vector2 a
    forall a. a -> a -> Vector2 a
    Vector2 m (a -> a -> Vector2 a) -> m a -> m (a -> Vector2 a)
    forall (m :: * -> *) a b. Monad m => m (a -> b) -> m a -> m b
    `ap` m a
    x m (a -> Vector2 a) -> m a -> m (Vector2 a)
    forall (m :: * -> *) a b. Monad m => m (a -> b) -> m a -> m b
    `ap` m a
    y

    instance Storable a => Storable (Vector2 a) where
       sizeOf :: Vector2 a -> Int
    sizeOf ~(Vector2 a
    x a
    _) = Int
    2 Int -> Int -> Int
    forall a. Num a => a -> a -> a
    * a -> Int
    forall a. Storable a => a -> Int
    sizeOf a
    x
       alignment :: Vector2 a -> Int
    alignment ~(Vector2 a
    x a
    _) = a -> Int
    forall a. Storable a => a -> Int
    alignment a
    x
       peek :: Ptr (Vector2 a) -> IO (Vector2 a)
    peek = Ptr (Vector2 a) -> IO (Vector2 a)
    forall (t :: * -> *) a.
    (Applicative t, Traversable t, Storable a) =>
    Ptr (t a) -> IO (t a)
    peekApplicativeTraversable
       poke :: Ptr (Vector2 a) -> Vector2 a -> IO ()
    poke = Ptr (Vector2 a) -> Vector2 a -> IO ()
    forall (t :: * -> *) a.
    (Foldable t, Storable a) =>
    Ptr (t a) -> t a -> IO ()
    pokeFoldable

    --------------------------------------------------------------------------------

    -- | A three-dimensional vector.
    data Vector3 a = Vector3 !a !a !a
       deriving (Vector3 a -> Vector3 a -> Bool
    (Vector3 a -> Vector3 a -> Bool)
    -> (Vector3 a -> Vector3 a -> Bool) -> Eq (Vector3 a)
    forall a. Eq a => Vector3 a -> Vector3 a -> Bool
    forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
    $c== :: forall a. Eq a => Vector3 a -> Vector3 a -> Bool
    == :: Vector3 a -> Vector3 a -> Bool
    $c/= :: forall a. Eq a => Vector3 a -> Vector3 a -> Bool
    /= :: Vector3 a -> Vector3 a -> Bool
    Eq, Eq (Vector3 a)
    Eq (Vector3 a) =>
    (Vector3 a -> Vector3 a -> Ordering)
    -> (Vector3 a -> Vector3 a -> Bool)
    -> (Vector3 a -> Vector3 a -> Bool)
    -> (Vector3 a -> Vector3 a -> Bool)
    -> (Vector3 a -> Vector3 a -> Bool)
    -> (Vector3 a -> Vector3 a -> Vector3 a)
    -> (Vector3 a -> Vector3 a -> Vector3 a)
    -> Ord (Vector3 a)
    Vector3 a -> Vector3 a -> Bool
    Vector3 a -> Vector3 a -> Ordering
    Vector3 a -> Vector3 a -> Vector3 a
    forall a.
    Eq a =>
    (a -> a -> Ordering)
    -> (a -> a -> Bool)
    -> (a -> a -> Bool)
    -> (a -> a -> Bool)
    -> (a -> a -> Bool)
    -> (a -> a -> a)
    -> (a -> a -> a)
    -> Ord a
    forall a. Ord a => Eq (Vector3 a)
    forall a. Ord a => Vector3 a -> Vector3 a -> Bool
    forall a. Ord a => Vector3 a -> Vector3 a -> Ordering
    forall a. Ord a => Vector3 a -> Vector3 a -> Vector3 a
    $ccompare :: forall a. Ord a => Vector3 a -> Vector3 a -> Ordering
    compare :: Vector3 a -> Vector3 a -> Ordering
    $c< :: forall a. Ord a => Vector3 a -> Vector3 a -> Bool
    < :: Vector3 a -> Vector3 a -> Bool
    $c<= :: forall a. Ord a => Vector3 a -> Vector3 a -> Bool
    <= :: Vector3 a -> Vector3 a -> Bool
    $c> :: forall a. Ord a => Vector3 a -> Vector3 a -> Bool
    > :: Vector3 a -> Vector3 a -> Bool
    $c>= :: forall a. Ord a => Vector3 a -> Vector3 a -> Bool
    >= :: Vector3 a -> Vector3 a -> Bool
    $cmax :: forall a. Ord a => Vector3 a -> Vector3 a -> Vector3 a
    max :: Vector3 a -> Vector3 a -> Vector3 a
    $cmin :: forall a. Ord a => Vector3 a -> Vector3 a -> Vector3 a
    min :: Vector3 a -> Vector3 a -> Vector3 a
    Ord, Ord (Vector3 a)
    Ord (Vector3 a) =>
    ((Vector3 a, Vector3 a) -> [Vector3 a])
    -> ((Vector3 a, Vector3 a) -> Vector3 a -> Int)
    -> ((Vector3 a, Vector3 a) -> Vector3 a -> Int)
    -> ((Vector3 a, Vector3 a) -> Vector3 a -> Bool)
    -> ((Vector3 a, Vector3 a) -> Int)
    -> ((Vector3 a, Vector3 a) -> Int)
    -> Ix (Vector3 a)
    (Vector3 a, Vector3 a) -> Int
    (Vector3 a, Vector3 a) -> [Vector3 a]
    (Vector3 a, Vector3 a) -> Vector3 a -> Bool
    (Vector3 a, Vector3 a) -> Vector3 a -> Int
    forall a.
    Ord a =>
    ((a, a) -> [a])
    -> ((a, a) -> a -> Int)
    -> ((a, a) -> a -> Int)
    -> ((a, a) -> a -> Bool)
    -> ((a, a) -> Int)
    -> ((a, a) -> Int)
    -> Ix a
    forall a. Ix a => Ord (Vector3 a)
    forall a. Ix a => (Vector3 a, Vector3 a) -> Int
    forall a. Ix a => (Vector3 a, Vector3 a) -> [Vector3 a]
    forall a. Ix a => (Vector3 a, Vector3 a) -> Vector3 a -> Bool
    forall a. Ix a => (Vector3 a, Vector3 a) -> Vector3 a -> Int
    $crange :: forall a. Ix a => (Vector3 a, Vector3 a) -> [Vector3 a]
    range :: (Vector3 a, Vector3 a) -> [Vector3 a]
    $cindex :: forall a. Ix a => (Vector3 a, Vector3 a) -> Vector3 a -> Int
    index :: (Vector3 a, Vector3 a) -> Vector3 a -> Int
    $cunsafeIndex :: forall a. Ix a => (Vector3 a, Vector3 a) -> Vector3 a -> Int
    unsafeIndex :: (Vector3 a, Vector3 a) -> Vector3 a -> Int
    $cinRange :: forall a. Ix a => (Vector3 a, Vector3 a) -> Vector3 a -> Bool
    inRange :: (Vector3 a, Vector3 a) -> Vector3 a -> Bool
    $crangeSize :: forall a. Ix a => (Vector3 a, Vector3 a) -> Int
    rangeSize :: (Vector3 a, Vector3 a) -> Int
    $cunsafeRangeSize :: forall a. Ix a => (Vector3 a, Vector3 a) -> Int
    unsafeRangeSize :: (Vector3 a, Vector3 a) -> Int
    Ix, Vector3 a
    Vector3 a -> Vector3 a -> Bounded (Vector3 a)
    forall a. a -> a -> Bounded a
    forall a. Bounded a => Vector3 a
    $cminBound :: forall a. Bounded a => Vector3 a
    minBound :: Vector3 a
    $cmaxBound :: forall a. Bounded a => Vector3 a
    maxBound :: Vector3 a
    Bounded, Int -> Vector3 a -> ShowS
    [Vector3 a] -> ShowS
    Vector3 a -> String
    (Int -> Vector3 a -> ShowS)
    -> (Vector3 a -> String)
    -> ([Vector3 a] -> ShowS)
    -> Show (Vector3 a)
    forall a. Show a => Int -> Vector3 a -> ShowS
    forall a. Show a => [Vector3 a] -> ShowS
    forall a. Show a => Vector3 a -> String
    forall a.
    (Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
    $cshowsPrec :: forall a. Show a => Int -> Vector3 a -> ShowS
    showsPrec :: Int -> Vector3 a -> ShowS
    $cshow :: forall a. Show a => Vector3 a -> String
    show :: Vector3 a -> String
    $cshowList :: forall a. Show a => [Vector3 a] -> ShowS
    showList :: [Vector3 a] -> ShowS
    Show, ReadPrec [Vector3 a]
    ReadPrec (Vector3 a)
    Int -> ReadS (Vector3 a)
    ReadS [Vector3 a]
    (Int -> ReadS (Vector3 a))
    -> ReadS [Vector3 a]
    -> ReadPrec (Vector3 a)
    -> ReadPrec [Vector3 a]
    -> Read (Vector3 a)
    forall a. Read a => ReadPrec [Vector3 a]
    forall a. Read a => ReadPrec (Vector3 a)
    forall a. Read a => Int -> ReadS (Vector3 a)
    forall a. Read a => ReadS [Vector3 a]
    forall a.
    (Int -> ReadS a)
    -> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
    $creadsPrec :: forall a. Read a => Int -> ReadS (Vector3 a)
    readsPrec :: Int -> ReadS (Vector3 a)
    $creadList :: forall a. Read a => ReadS [Vector3 a]
    readList :: ReadS [Vector3 a]
    $creadPrec :: forall a. Read a => ReadPrec (Vector3 a)
    readPrec :: ReadPrec (Vector3 a)
    $creadListPrec :: forall a. Read a => ReadPrec [Vector3 a]
    readListPrec :: ReadPrec [Vector3 a]
    Read, Typeable)

    instance Functor Vector3 where
       fmap :: forall a b. (a -> b) -> Vector3 a -> Vector3 b
    fmap a -> b
    f (Vector3 a
    x a
    y a
    z) = b -> b -> b -> Vector3 b
    forall a. a -> a -> a -> Vector3 a
    Vector3 (a -> b
    f a
    x) (a -> b
    f a
    y) (a -> b
    f a
    z)

    instance Applicative Vector3 where
       pure :: forall a. a -> Vector3 a
    pure a
    a = a -> a -> a -> Vector3 a
    forall a. a -> a -> a -> Vector3 a
    Vector3 a
    a a
    a a
    a
       Vector3 a -> b
    f a -> b
    g a -> b
    h <*> :: forall a b. Vector3 (a -> b) -> Vector3 a -> Vector3 b
    <*> Vector3 a
    x a
    y a
    z = b -> b -> b -> Vector3 b
    forall a. a -> a -> a -> Vector3 a
    Vector3 (a -> b
    f a
    x) (a -> b
    g a
    y) (a -> b
    h a
    z)

    instance Foldable Vector3 where
       foldr :: forall a b. (a -> b -> b) -> b -> Vector3 a -> b
    foldr a -> b -> b
    f b
    a (Vector3 a
    x a
    y a
    z) = a
    x `f ` (a
    y a -> b -> b
    `f` (a
    z a -> b -> b
    `f` b
    a))
       foldl :: forall b a. (b -> a -> b) -> b -> Vector3 a -> b
    foldl b -> a -> b
    f b
    a (Vector3 a
    x a
    y a
    z) = ((b
    a b -> a -> b
    `f` a
    x) b -> a -> b
    `f` a
    y) b -> a -> b
    `f` a
    z
       foldr1 :: forall a. (a -> a -> a) -> Vector3 a -> a
    foldr1 a -> a -> a
    f (Vector3 a
    x a
    y a
    z) = a
    x a -> a -> a
    `f` (a
    y a -> a -> a
    `f` a
    z)
       foldl1 :: forall a. (a -> a -> a) -> Vector3 a -> a
    foldl1 a -> a -> a
    f (Vector3 a
    x a
    y a
    z) = (a
    x a -> a -> a
    `f` a
    y) a -> a -> a
    `f` a
    z

    instance Traversable Vector3 where
       traverse :: forall (f :: * -> *) a b.
    Applicative f =>
    (a -> f b) -> Vector3 a -> f (Vector3 b)
    traverse a -> f b
    f (Vector3 a
    x a
    y a
    z) = (b -> b -> b -> Vector3 b) -> f (b -> b -> b -> Vector3 b)
    forall a. a -> f a
    forall (f :: * -> *) a. Applicative f => a -> f a
    pure b -> b -> b -> Vector3 b
    forall a. a -> a -> a -> Vector3 a
    Vector3 f (b -> b -> b -> Vector3 b) -> f b -> f (b -> b -> Vector3 b)
    forall a b. f (a -> b) -> f a -> f b
    forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
    <*> a -> f b
    f a
    x f (b -> b -> Vector3 b) -> f b -> f (b -> Vector3 b)
    forall a b. f (a -> b) -> f a -> f b
    forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
    <*> a -> f b
    f a
    y f (b -> Vector3 b) -> f b -> f (Vector3 b)
    forall a b. f (a -> b) -> f a -> f b
    forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
    <*> a -> f b
    f a
    z
       sequenceA :: forall (f :: * -> *) a.
    Applicative f =>
    Vector3 (f a) -> f (Vector3 a)
    sequenceA (Vector3 f a
    x f a
    y f a
    z) =  (a -> a -> a -> Vector3 a) -> f (a -> a -> a -> Vector3 a)
    forall a. a -> f a
    forall (f :: * -> *) a. Applicative f => a -> f a
    pure a -> a -> a -> Vector3 a
    forall a. a -> a -> a -> Vector3 a
    Vector3 f (a -> a -> a -> Vector3 a) -> f a -> f (a -> a -> Vector3 a)
    forall a b. f (a -> b) -> f a -> f b
    forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
    <*> f a
    x f (a -> a -> Vector3 a) -> f a -> f (a -> Vector3 a)
    forall a b. f (a -> b) -> f a -> f b
    forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
    <*> f a
    y f (a -> Vector3 a) -> f a -> f (Vector3 a)
    forall a b. f (a -> b) -> f a -> f b
    forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
    <*> f a
    z
       mapM :: forall (m :: * -> *) a b.
    Monad m =>
    (a -> m b) -> Vector3 a -> m (Vector3 b)
    mapM a -> m b
    f (Vector3 a
    x a
    y a
    z) = (b -> b -> b -> Vector3 b) -> m (b -> b -> b -> Vector3 b)
    forall a. a -> m a
    forall (m :: * -> *) a. Monad m => a -> m a
    return b -> b -> b -> Vector3 b
    forall a. a -> a -> a -> Vector3 a
    Vector3 m (b -> b -> b -> Vector3 b) -> m b -> m (b -> b -> Vector3 b)
    forall (m :: * -> *) a b. Monad m => m (a -> b) -> m a -> m b
    `ap` a -> m b
    f a
    x m (b -> b -> Vector3 b) -> m b -> m (b -> Vector3 b)
    forall (m :: * -> *) a b. Monad m => m (a -> b) -> m a -> m b
    `ap` a -> m b
    f a
    y m (b -> Vector3 b) -> m b -> m (Vector3 b)
    forall (m :: * -> *) a b. Monad m => m (a -> b) -> m a -> m b
    `ap` a -> m b
    f a
    z
       sequence :: forall (m :: * -> *) a. Monad m => Vector3 (m a) -> m (Vector3 a)
    sequence (Vector3 m a
    x m a
    y m a
    z) = (a -> a -> a -> Vector3 a) -> m (a -> a -> a -> Vector3 a)
    forall a. a -> m a
    forall (m :: * -> *) a. Monad m => a -> m a
    return a -> a -> a -> Vector3 a
    forall a. a -> a -> a -> Vector3 a
    Vector3 m (a -> a -> a -> Vector3 a) -> m a -> m (a -> a -> Vector3 a)
    forall (m :: * -> *) a b. Monad m => m (a -> b) -> m a -> m b
    `ap` m a
    x m (a -> a -> Vector3 a) -> m a -> m (a -> Vector3 a)
    forall (m :: * -> *) a b. Monad m => m (a -> b) -> m a -> m b
    `ap` m a
    y m (a -> Vector3 a) -> m a -> m (Vector3 a)
    forall (m :: * -> *) a b. Monad m => m (a -> b) -> m a -> m b
    `ap` m a
    z

    instance Storable a => Storable (Vector3 a) where
       sizeOf :: Vector3 a -> Int
    sizeOf ~(Vector3 a
    x a
    _ a
    _) = Int
    3 Int -> Int -> Int
    forall a. Num a => a -> a -> a
    * a -> Int
    forall a. Storable a => a -> Int
    sizeOf a
    x
       alignment :: Vector3 a -> Int
    alignment ~(Vector3 a
    x a
    _ a
    _) = a -> Int
    forall a. Storable a => a -> Int
    alignment a
    x
       peek :: Ptr (Vector3 a) -> IO (Vector3 a)
    peek = Ptr (Vector3 a) -> IO (Vector3 a)
    forall (t :: * -> *) a.
    (Applicative t, Traversable t, Storable a) =>
    Ptr (t a) -> IO (t a)
    peekApplicativeTraversable
       poke :: Ptr (Vector3 a) -> Vector3 a -> IO ()
    poke = Ptr (Vector3 a) -> Vector3 a -> IO ()
    forall (t :: * -> *) a.
    (Foldable t, Storable a) =>
    Ptr (t a) -> t a -> IO ()
    pokeFoldable

    --------------------------------------------------------------------------------

    -- | A four-dimensional vector.
    data Vector4 a = Vector4 !a !a !a !a
       deriving (Vector4 a -> Vector4 a -> Bool
    (Vector4 a -> Vector4 a -> Bool)
    -> (Vector4 a -> Vector4 a -> Bool) -> Eq (Vector4 a)
    forall a. Eq a => Vector4 a -> Vector4 a -> Bool
    forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
    $c== :: forall a. Eq a => Vector4 a -> Vector4 a -> Bool
    == :: Vector4 a -> Vector4 a -> Bool
    $c/= :: forall a. Eq a => Vector4 a -> Vector4 a -> Bool
    /= :: Vector4 a -> Vector4 a -> Bool
    Eq, Eq (Vector4 a)
    Eq (Vector4 a) =>
    (Vector4 a -> Vector4 a -> Ordering)
    -> (Vector4 a -> Vector4 a -> Bool)
    -> (Vector4 a -> Vector4 a -> Bool)
    -> (Vector4 a -> Vector4 a -> Bool)
    -> (Vector4 a -> Vector4 a -> Bool)
    -> (Vector4 a -> Vector4 a -> Vector4 a)
    -> (Vector4 a -> Vector4 a -> Vector4 a)
    -> Ord (Vector4 a)
    Vector4 a -> Vector4 a -> Bool
    Vector4 a -> Vector4 a -> Ordering
    Vector4 a -> Vector4 a -> Vector4 a
    forall a.
    Eq a =>
    (a -> a -> Ordering)
    -> (a -> a -> Bool)
    -> (a -> a -> Bool)
    -> (a -> a -> Bool)
    -> (a -> a -> Bool)
    -> (a -> a -> a)
    -> (a -> a -> a)
    -> Ord a
    forall a. Ord a => Eq (Vector4 a)
    forall a. Ord a => Vector4 a -> Vector4 a -> Bool
    forall a. Ord a => Vector4 a -> Vector4 a -> Ordering
    forall a. Ord a => Vector4 a -> Vector4 a -> Vector4 a
    $ccompare :: forall a. Ord a => Vector4 a -> Vector4 a -> Ordering
    compare :: Vector4 a -> Vector4 a -> Ordering
    $c< :: forall a. Ord a => Vector4 a -> Vector4 a -> Bool
    < :: Vector4 a -> Vector4 a -> Bool
    $c<= :: forall a. Ord a => Vector4 a -> Vector4 a -> Bool
    <= :: Vector4 a -> Vector4 a -> Bool
    $c> :: forall a. Ord a => Vector4 a -> Vector4 a -> Bool
    > :: Vector4 a -> Vector4 a -> Bool
    $c>= :: forall a. Ord a => Vector4 a -> Vector4 a -> Bool
    >= :: Vector4 a -> Vector4 a -> Bool
    $cmax :: forall a. Ord a => Vector4 a -> Vector4 a -> Vector4 a
    max :: Vector4 a -> Vector4 a -> Vector4 a
    $cmin :: forall a. Ord a => Vector4 a -> Vector4 a -> Vector4 a
    min :: Vector4 a -> Vector4 a -> Vector4 a
    Ord, Ord (Vector4 a)
    Ord (Vector4 a) =>
    ((Vector4 a, Vector4 a) -> [Vector4 a])
    -> ((Vector4 a, Vector4 a) -> Vector4 a -> Int)
    -> ((Vector4 a, Vector4 a) -> Vector4 a -> Int)
    -> ((Vector4 a, Vector4 a) -> Vector4 a -> Bool)
    -> ((Vector4 a, Vector4 a) -> Int)
    -> ((Vector4 a, Vector4 a) -> Int)
    -> Ix (Vector4 a)
    (Vector4 a, Vector4 a) -> Int
    (Vector4 a, Vector4 a) -> [Vector4 a]
    (Vector4 a, Vector4 a) -> Vector4 a -> Bool
    (Vector4 a, Vector4 a) -> Vector4 a -> Int
    forall a.
    Ord a =>
    ((a, a) -> [a])
    -> ((a, a) -> a -> Int)
    -> ((a, a) -> a -> Int)
    -> ((a, a) -> a -> Bool)
    -> ((a, a) -> Int)
    -> ((a, a) -> Int)
    -> Ix a
    forall a. Ix a => Ord (Vector4 a)
    forall a. Ix a => (Vector4 a, Vector4 a) -> Int
    forall a. Ix a => (Vector4 a, Vector4 a) -> [Vector4 a]
    forall a. Ix a => (Vector4 a, Vector4 a) -> Vector4 a -> Bool
    forall a. Ix a => (Vector4 a, Vector4 a) -> Vector4 a -> Int
    $crange :: forall a. Ix a => (Vector4 a, Vector4 a) -> [Vector4 a]
    range :: (Vector4 a, Vector4 a) -> [Vector4 a]
    $cindex :: forall a. Ix a => (Vector4 a, Vector4 a) -> Vector4 a -> Int
    index :: (Vector4 a, Vector4 a) -> Vector4 a -> Int
    $cunsafeIndex :: forall a. Ix a => (Vector4 a, Vector4 a) -> Vector4 a -> Int
    unsafeIndex :: (Vector4 a, Vector4 a) -> Vector4 a -> Int
    $cinRange :: forall a. Ix a => (Vector4 a, Vector4 a) -> Vector4 a -> Bool
    inRange :: (Vector4 a, Vector4 a) -> Vector4 a -> Bool
    $crangeSize :: forall a. Ix a => (Vector4 a, Vector4 a) -> Int
    rangeSize :: (Vector4 a, Vector4 a) -> Int
    $cunsafeRangeSize :: forall a. Ix a => (Vector4 a, Vector4 a) -> Int
    unsafeRangeSize :: (Vector4 a, Vector4 a) -> Int
    Ix, Vector4 a
    Vector4 a -> Vector4 a -> Bounded (Vector4 a)
    forall a. a -> a -> Bounded a
    forall a. Bounded a => Vector4 a
    $cminBound :: forall a. Bounded a => Vector4 a
    minBound :: Vector4 a
    $cmaxBound :: forall a. Bounded a => Vector4 a
    maxBound :: Vector4 a
    Bounded, Int -> Vector4 a -> ShowS
    [Vector4 a] -> ShowS
    Vector4 a -> String
    (Int -> Vector4 a -> ShowS)
    -> (Vector4 a -> String)
    -> ([Vector4 a] -> ShowS)
    -> Show (Vector4 a)
    forall a. Show a => Int -> Vector4 a -> ShowS
    forall a. Show a => [Vector4 a] -> ShowS
    forall a. Show a => Vector4 a -> String
    forall a.
    (Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
    $cshowsPrec :: forall a. Show a => Int -> Vector4 a -> ShowS
    showsPrec :: Int -> Vector4 a -> ShowS
    $cshow :: forall a. Show a => Vector4 a -> String
    show :: Vector4 a -> String
    $cshowList :: forall a. Show a => [Vector4 a] -> ShowS
    showList :: [Vector4 a] -> ShowS
    Show, ReadPrec [Vector4 a]
    ReadPrec (Vector4 a)
    Int -> ReadS (Vector4 a)
    ReadS [Vector4 a]
    (Int -> ReadS (Vector4 a))
    -> ReadS [Vector4 a]
    -> ReadPrec (Vector4 a)
    -> ReadPrec [Vector4 a]
    -> Read (Vector4 a)
    forall a. Read a => ReadPrec [Vector4 a]
    forall a. Read a => ReadPrec (Vector4 a)
    forall a. Read a => Int -> ReadS (Vector4 a)
    forall a. Read a => ReadS [Vector4 a]
    forall a.
    (Int -> ReadS a)
    -> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
    $creadsPrec :: forall a. Read a => Int -> ReadS (Vector4 a)
    readsPrec :: Int -> ReadS (Vector4 a)
    $creadList :: forall a. Read a => ReadS [Vector4 a]
    readList :: ReadS [Vector4 a]
    $creadPrec :: forall a. Read a => ReadPrec (Vector4 a)
    readPrec :: ReadPrec (Vector4 a)
    $creadListPrec :: forall a. Read a => ReadPrec [Vector4 a]
    readListPrec :: ReadPrec [Vector4 a]
    Read, Typeable)

    instance Functor Vector4 where
       fmap :: forall a b. (a -> b) -> Vector4 a -> Vector4 b
    fmap a -> b
    f (Vector4 a
    x a
    y a
    z a
    w) = b -> b -> b -> b -> Vector4 b
    forall a. a -> a -> a -> a -> Vector4 a
    Vector4 (a -> b
    f a
    x) (a -> b
    f a
    y) (a -> b
    f a
    z) (a -> b
    f a
    w)

    instance Applicative Vector4 where
       pure :: forall a. a -> Vector4 a
    pure a
    a = a -> a -> a -> a -> Vector4 a
    forall a. a -> a -> a -> a -> Vector4 a
    Vector4 a
    a a
    a a
    a a
    a
       Vector4 a -> b
    f a -> b
    g a -> b
    h a -> b
    i <*> :: forall a b. Vector4 (a -> b) -> Vector4 a -> Vector4 b
    <*> Vector4 a
    x a
    y a
    z a
    w = b -> b -> b -> b -> Vector4 b
    forall a. a -> a -> a -> a -> Vector4 a
    Vector4 (a -> b
    f a
    x) (a -> b
    g a
    y) (a -> b
    h a
    z) (a -> b
    i a
    w)

    instance Foldable Vector4 where
       foldr :: forall a b. (a -> b -> b) -> b -> Vector4 a -> b
    foldr a -> b -> b
    f b
    a (Vector4 a
    x a
    y a
    z a
    w) = a
    x `f ` (a
    y a -> b -> b
    `f` (a
    z a -> b -> b
    `f` (a
    w a -> b -> b
    `f` b
    a)))
       foldl :: forall b a. (b -> a -> b) -> b -> Vector4 a -> b
    foldl b -> a -> b
    f b
    a (Vector4 a
    x a
    y a
    z a
    w) = (((b
    a b -> a -> b
    `f` a
    x) b -> a -> b
    `f` a
    y) b -> a -> b
    `f` a
    z) b -> a -> b
    `f` a
    w
       foldr1 :: forall a. (a -> a -> a) -> Vector4 a -> a
    foldr1 a -> a -> a
    f (Vector4 a
    x a
    y a
    z a
    w) = a
    x a -> a -> a
    `f` (a
    y a -> a -> a
    `f` (a
    z a -> a -> a
    `f` a
    w))
       foldl1 :: forall a. (a -> a -> a) -> Vector4 a -> a
    foldl1 a -> a -> a
    f (Vector4 a
    x a
    y a
    z a
    w) = ((a
    x a -> a -> a
    `f` a
    y) a -> a -> a
    `f` a
    z) a -> a -> a
    `f` a
    w

    instance Traversable Vector4 where
       traverse :: forall (f :: * -> *) a b.
    Applicative f =>
    (a -> f b) -> Vector4 a -> f (Vector4 b)
    traverse a -> f b
    f (Vector4 a
    x a
    y a
    z a
    w) = (b -> b -> b -> b -> Vector4 b)
    -> f (b -> b -> b -> b -> Vector4 b)
    forall a. a -> f a
    forall (f :: * -> *) a. Applicative f => a -> f a
    pure b -> b -> b -> b -> Vector4 b
    forall a. a -> a -> a -> a -> Vector4 a
    Vector4 f (b -> b -> b -> b -> Vector4 b)
    -> f b -> f (b -> b -> b -> Vector4 b)
    forall a b. f (a -> b) -> f a -> f b
    forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
    <*> a -> f b
    f a
    x f (b -> b -> b -> Vector4 b) -> f b -> f (b -> b -> Vector4 b)
    forall a b. f (a -> b) -> f a -> f b
    forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
    <*> a -> f b
    f a
    y f (b -> b -> Vector4 b) -> f b -> f (b -> Vector4 b)
    forall a b. f (a -> b) -> f a -> f b
    forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
    <*> a -> f b
    f a
    z f (b -> Vector4 b) -> f b -> f (Vector4 b)
    forall a b. f (a -> b) -> f a -> f b
    forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
    <*> a -> f b
    f a
    w
       sequenceA :: forall (f :: * -> *) a.
    Applicative f =>
    Vector4 (f a) -> f (Vector4 a)
    sequenceA (Vector4 f a
    x f a
    y f a
    z f a
    w) =  (a -> a -> a -> a -> Vector4 a)
    -> f (a -> a -> a -> a -> Vector4 a)
    forall a. a -> f a
    forall (f :: * -> *) a. Applicative f => a -> f a
    pure a -> a -> a -> a -> Vector4 a
    forall a. a -> a -> a -> a -> Vector4 a
    Vector4 f (a -> a -> a -> a -> Vector4 a)
    -> f a -> f (a -> a -> a -> Vector4 a)
    forall a b. f (a -> b) -> f a -> f b
    forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
    <*> f a
    x f (a -> a -> a -> Vector4 a) -> f a -> f (a -> a -> Vector4 a)
    forall a b. f (a -> b) -> f a -> f b
    forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
    <*> f a
    y f (a -> a -> Vector4 a) -> f a -> f (a -> Vector4 a)
    forall a b. f (a -> b) -> f a -> f b
    forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
    <*> f a
    z f (a -> Vector4 a) -> f a -> f (Vector4 a)
    forall a b. f (a -> b) -> f a -> f b
    forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
    <*> f a
    w
       mapM :: forall (m :: * -> *) a b.
    Monad m =>
    (a -> m b) -> Vector4 a -> m (Vector4 b)
    mapM a -> m b
    f (Vector4 a
    x a
    y a
    z a
    w) = (b -> b -> b -> b -> Vector4 b)
    -> m (b -> b -> b -> b -> Vector4 b)
    forall a. a -> m a
    forall (m :: * -> *) a. Monad m => a -> m a
    return b -> b -> b -> b -> Vector4 b
    forall a. a -> a -> a -> a -> Vector4 a
    Vector4 m (b -> b -> b -> b -> Vector4 b)
    -> m b -> m (b -> b -> b -> Vector4 b)
    forall (m :: * -> *) a b. Monad m => m (a -> b) -> m a -> m b
    `ap` a -> m b
    f a
    x m (b -> b -> b -> Vector4 b) -> m b -> m (b -> b -> Vector4 b)
    forall (m :: * -> *) a b. Monad m => m (a -> b) -> m a -> m b
    `ap` a -> m b
    f a
    y m (b -> b -> Vector4 b) -> m b -> m (b -> Vector4 b)
    forall (m :: * -> *) a b. Monad m => m (a -> b) -> m a -> m b
    `ap` a -> m b
    f a
    z m (b -> Vector4 b) -> m b -> m (Vector4 b)
    forall (m :: * -> *) a b. Monad m => m (a -> b) -> m a -> m b
    `ap` a -> m b
    f a
    w
       sequence :: forall (m :: * -> *) a. Monad m => Vector4 (m a) -> m (Vector4 a)
    sequence (Vector4 m a
    x m a
    y m a
    z m a
    w) = (a -> a -> a -> a -> Vector4 a)
    -> m (a -> a -> a -> a -> Vector4 a)
    forall a. a -> m a
    forall (m :: * -> *) a. Monad m => a -> m a
    return a -> a -> a -> a -> Vector4 a
    forall a. a -> a -> a -> a -> Vector4 a
    Vector4 m (a -> a -> a -> a -> Vector4 a)
    -> m a -> m (a -> a -> a -> Vector4 a)
    forall (m :: * -> *) a b. Monad m => m (a -> b) -> m a -> m b
    `ap` m a
    x m (a -> a -> a -> Vector4 a) -> m a -> m (a -> a -> Vector4 a)
    forall (m :: * -> *) a b. Monad m => m (a -> b) -> m a -> m b
    `ap` m a
    y m (a -> a -> Vector4 a) -> m a -> m (a -> Vector4 a)
    forall (m :: * -> *) a b. Monad m => m (a -> b) -> m a -> m b
    `ap` m a
    z m (a -> Vector4 a) -> m a -> m (Vector4 a)
    forall (m :: * -> *) a b. Monad m => m (a -> b) -> m a -> m b
    `ap` m a
    w

    instance Storable a => Storable (Vector4 a) where
       sizeOf :: Vector4 a -> Int
    sizeOf ~(Vector4 a
    x a
    _ a
    _ a
    _) = Int
    4 Int -> Int -> Int
    forall a. Num a => a -> a -> a
    * a -> Int
    forall a. Storable a => a -> Int
    sizeOf a
    x
       alignment :: Vector4 a -> Int
    alignment ~(Vector4 a
    x a
    _ a
    _ a
    _) = a -> Int
    forall a. Storable a => a -> Int
    alignment a
    x
       peek :: Ptr (Vector4 a) -> IO (Vector4 a)
    peek = Ptr (Vector4 a) -> IO (Vector4 a)
    forall (t :: * -> *) a.
    (Applicative t, Traversable t, Storable a) =>
    Ptr (t a) -> IO (t a)
    peekApplicativeTraversable
       poke :: Ptr (Vector4 a) -> Vector4 a -> IO ()
    poke = Ptr (Vector4 a) -> Vector4 a -> IO ()
    forall (t :: * -> *) a.
    (Foldable t, Storable a) =>
    Ptr (t a) -> t a -> IO ()
    pokeFoldable

    --------------------------------------------------------------------------------

    peekApplicativeTraversable :: (Applicative t, Traversable t, Storable a) => Ptr (t a) -> IO (t a)
    peekApplicativeTraversable :: forall (t :: * -> *) a.
    (Applicative t, Traversable t, Storable a) =>
    Ptr (t a) -> IO (t a)
    peekApplicativeTraversable = (Ptr a -> IO a) -> t (Ptr a) -> IO (t a)
    forall (t :: * -> *) (m :: * -> *) a b.
    (Traversable t, Monad m) =>
    (a -> m b) -> t a -> m (t b)
    forall (m :: * -> *) a b. Monad m => (a -> m b) -> t a -> m (t b)
    Data.Traversable.mapM Ptr a -> IO a
    forall a. Storable a => Ptr a -> IO a
    peek (t (Ptr a) -> IO (t a))
    -> (Ptr (t a) -> t (Ptr a)) -> Ptr (t a) -> IO (t a)
    forall b c a. (b -> c) -> (a -> b) -> a -> c
    . Ptr (t a) -> t (Ptr a)
    forall (t :: * -> *) a.
    (Applicative t, Traversable t, Storable a) =>
    Ptr (t a) -> t (Ptr a)
    addresses

    addresses :: (Applicative t, Traversable t, Storable a) => Ptr (t a) -> t (Ptr a)
    addresses :: forall (t :: * -> *) a.
    (Applicative t, Traversable t, Storable a) =>
    Ptr (t a) -> t (Ptr a)
    addresses = (Int, t (Ptr a)) -> t (Ptr a)
    forall a b. (a, b) -> b
    snd ((Int, t (Ptr a)) -> t (Ptr a))
    -> (Ptr (t a) -> (Int, t (Ptr a))) -> Ptr (t a) -> t (Ptr a)
    forall b c a. (b -> c) -> (a -> b) -> a -> c
    . (Int -> Ptr a -> (Int, Ptr a))
    -> Int -> t (Ptr a) -> (Int, t (Ptr a))
    forall (t :: * -> *) s a b.
    Traversable t =>
    (s -> a -> (s, b)) -> s -> t a -> (s, t b)
    mapAccumL Int -> Ptr a -> (Int, Ptr a)
    forall a. Storable a => Int -> Ptr a -> (Int, Ptr a)
    nextPtr Int
    0 (t (Ptr a) -> (Int, t (Ptr a)))
    -> (Ptr (t a) -> t (Ptr a)) -> Ptr (t a) -> (Int, t (Ptr a))
    forall b c a. (b -> c) -> (a -> b) -> a -> c
    . Ptr a -> t (Ptr a)
    forall a. a -> t a
    forall (f :: * -> *) a. Applicative f => a -> f a
    pure (Ptr a -> t (Ptr a))
    -> (Ptr (t a) -> Ptr a) -> Ptr (t a) -> t (Ptr a)
    forall b c a. (b -> c) -> (a -> b) -> a -> c
    . Ptr (t a) -> Ptr a
    forall a b. Ptr a -> Ptr b
    castPtr

    nextPtr :: Storable a => Int -> Ptr a -> (Int, Ptr a)
    nextPtr :: forall a. Storable a => Int -> Ptr a -> (Int, Ptr a)
    nextPtr Int
    offset Ptr a
    ptr = (Int
    offset Int -> Int -> Int
    forall a. Num a => a -> a -> a
    + Int
    1, Ptr a -> Int -> Ptr a
    forall a. Storable a => Ptr a -> Int -> Ptr a
    advancePtr Ptr a
    ptr Int
    offset)

    --------------------------------------------------------------------------------

    pokeFoldable :: (Foldable t, Storable a) => Ptr (t a) -> t a -> IO ()
    pokeFoldable :: forall (t :: * -> *) a.
    (Foldable t, Storable a) =>
    Ptr (t a) -> t a -> IO ()
    pokeFoldable Ptr (t a)
    ptr t a
    xs = (Ptr a -> a -> IO (Ptr a)) -> Ptr a -> t a -> IO (Ptr a)
    forall (t :: * -> *) (m :: * -> *) b a.
    (Foldable t, Monad m) =>
    (b -> a -> m b) -> b -> t a -> m b
    foldlM Ptr a -> a -> IO (Ptr a)
    forall a. Storable a => Ptr a -> a -> IO (Ptr a)
    pokeAndAdvance (Ptr (t a) -> Ptr a
    forall a b. Ptr a -> Ptr b
    castPtr Ptr (t a)
    ptr) t a
    xs IO (Ptr a) -> IO () -> IO ()
    forall a b. IO a -> IO b -> IO b
    forall (m :: * -> *) a b. Monad m => m a -> m b -> m b
    >> () -> IO ()
    forall a. a -> IO a
    forall (m :: * -> *) a. Monad m => a -> m a
    return ()

    pokeAndAdvance :: Storable a => Ptr a -> a -> IO (Ptr a)
    pokeAndAdvance :: forall a. Storable a => Ptr a -> a -> IO (Ptr a)
    pokeAndAdvance Ptr a
    ptr a
    value = do
       Ptr a -> a -> IO ()
    forall a. Storable a => Ptr a -> a -> IO ()
    poke Ptr a
    ptr a
    value
       Ptr a -> IO (Ptr a)
    forall a. a -> IO a
    forall (m :: * -> *) a. Monad m => a -> m a
    return (Ptr a -> IO (Ptr a)) -> Ptr a -> IO (Ptr a)
    forall a b. (a -> b) -> a -> b
    $ Ptr a
    ptr Ptr a -> Int -> Ptr a
    forall a b. Ptr a -> Int -> Ptr b
    `plusPtr` a -> Int
    forall a. Storable a => a -> Int
    sizeOf a
    value