{-# LANGUAGE DataKinds #-}
{-# LANGUAGE DefaultSignatures #-}
{-# LANGUAGE DeriveDataTypeable #-}
{-# LANGUAGE DeriveGeneric #-}
{-# LANGUAGE DeriveTraversable #-}
{-# LANGUAGE FlexibleContexts #-}
{-# LANGUAGE FlexibleInstances #-}
{-# LANGUAGE MagicHash #-}
{-# LANGUAGE PolyKinds #-}
{-# LANGUAGE ScopedTypeVariables #-}
{-# LANGUAGE TypeFamilies #-}
{-# LANGUAGE TypeOperators #-}
{-# LANGUAGE UndecidableInstances #-}
module Graphics.Gl.Block
( Block(..)
, GBlock(..)
, Packed(..)
, Std140(..)
, Std430(..)
, roundUp
) where
import Control.Monad.IO.Class (MonadIO(..))
import Data.Data (Data, Typeable)
import Data.Int (Int32)
import Data.Proxy (Proxy(..))
import Data.Word (Word32)
import Foreign.Ptr (Ptr)
import Foreign.Ptr.Diff (Diff(..), peekDiffOff, pokeDiffOff)
import Foreign.Storable (Storable(..))
import GHC.Generics (Generic, Rep, M1(..), K1(..), U1(..), C, D, S, (:*:)(..), from, to)
import GHC.TypeLits (KnownNat, Nat, type (+), natVal)
newtype Packed a = Packed { forall a. Packed a -> a
getPacked :: a }
deriving (Packed a -> DataType
Packed a -> Constr
forall {a}. Data a => Typeable (Packed a)
forall a. Data a => Packed a -> DataType
forall a. Data a => Packed a -> Constr
forall a.
Data a =>
(forall b. Data b => b -> b) -> Packed a -> Packed a
forall a u.
Data a =>
Int -> (forall d. Data d => d -> u) -> Packed a -> u
forall a u.
Data a =>
(forall d. Data d => d -> u) -> Packed a -> [u]
forall a r r'.
Data a =>
(r -> r' -> r)
-> r -> (forall d. Data d => d -> r') -> Packed a -> r
forall a r r'.
Data a =>
(r' -> r -> r)
-> r -> (forall d. Data d => d -> r') -> Packed a -> r
forall a (m :: * -> *).
(Data a, Monad m) =>
(forall d. Data d => d -> m d) -> Packed a -> m (Packed a)
forall a (m :: * -> *).
(Data a, MonadPlus m) =>
(forall d. Data d => d -> m d) -> Packed a -> m (Packed a)
forall a (c :: * -> *).
Data a =>
(forall b r. Data b => c (b -> r) -> c r)
-> (forall r. r -> c r) -> Constr -> c (Packed a)
forall a (c :: * -> *).
Data a =>
(forall d b. Data d => c (d -> b) -> d -> c b)
-> (forall g. g -> c g) -> Packed a -> c (Packed a)
forall a (t :: * -> *) (c :: * -> *).
(Data a, Typeable t) =>
(forall d. Data d => c (t d)) -> Maybe (c (Packed a))
forall a (t :: * -> * -> *) (c :: * -> *).
(Data a, Typeable t) =>
(forall d e. (Data d, Data e) => c (t d e)) -> Maybe (c (Packed a))
forall a.
Typeable a
-> (forall (c :: * -> *).
(forall d b. Data d => c (d -> b) -> d -> c b)
-> (forall g. g -> c g) -> a -> c a)
-> (forall (c :: * -> *).
(forall b r. Data b => c (b -> r) -> c r)
-> (forall r. r -> c r) -> Constr -> c a)
-> (a -> Constr)
-> (a -> DataType)
-> (forall (t :: * -> *) (c :: * -> *).
Typeable t =>
(forall d. Data d => c (t d)) -> Maybe (c a))
-> (forall (t :: * -> * -> *) (c :: * -> *).
Typeable t =>
(forall d e. (Data d, Data e) => c (t d e)) -> Maybe (c a))
-> ((forall b. Data b => b -> b) -> a -> a)
-> (forall r r'.
(r -> r' -> r) -> r -> (forall d. Data d => d -> r') -> a -> r)
-> (forall r r'.
(r' -> r -> r) -> r -> (forall d. Data d => d -> r') -> a -> r)
-> (forall u. (forall d. Data d => d -> u) -> a -> [u])
-> (forall u. Int -> (forall d. Data d => d -> u) -> a -> u)
-> (forall (m :: * -> *).
Monad m =>
(forall d. Data d => d -> m d) -> a -> m a)
-> (forall (m :: * -> *).
MonadPlus m =>
(forall d. Data d => d -> m d) -> a -> m a)
-> (forall (m :: * -> *).
MonadPlus m =>
(forall d. Data d => d -> m d) -> a -> m a)
-> Data a
forall (c :: * -> *).
(forall b r. Data b => c (b -> r) -> c r)
-> (forall r. r -> c r) -> Constr -> c (Packed a)
forall (c :: * -> *).
(forall d b. Data d => c (d -> b) -> d -> c b)
-> (forall g. g -> c g) -> Packed a -> c (Packed a)
forall (t :: * -> *) (c :: * -> *).
Typeable t =>
(forall d. Data d => c (t d)) -> Maybe (c (Packed a))
gmapMo :: forall (m :: * -> *).
MonadPlus m =>
(forall d. Data d => d -> m d) -> Packed a -> m (Packed a)
$cgmapMo :: forall a (m :: * -> *).
(Data a, MonadPlus m) =>
(forall d. Data d => d -> m d) -> Packed a -> m (Packed a)
gmapMp :: forall (m :: * -> *).
MonadPlus m =>
(forall d. Data d => d -> m d) -> Packed a -> m (Packed a)
$cgmapMp :: forall a (m :: * -> *).
(Data a, MonadPlus m) =>
(forall d. Data d => d -> m d) -> Packed a -> m (Packed a)
gmapM :: forall (m :: * -> *).
Monad m =>
(forall d. Data d => d -> m d) -> Packed a -> m (Packed a)
$cgmapM :: forall a (m :: * -> *).
(Data a, Monad m) =>
(forall d. Data d => d -> m d) -> Packed a -> m (Packed a)
gmapQi :: forall u. Int -> (forall d. Data d => d -> u) -> Packed a -> u
$cgmapQi :: forall a u.
Data a =>
Int -> (forall d. Data d => d -> u) -> Packed a -> u
gmapQ :: forall u. (forall d. Data d => d -> u) -> Packed a -> [u]
$cgmapQ :: forall a u.
Data a =>
(forall d. Data d => d -> u) -> Packed a -> [u]
gmapQr :: forall r r'.
(r' -> r -> r)
-> r -> (forall d. Data d => d -> r') -> Packed a -> r
$cgmapQr :: forall a r r'.
Data a =>
(r' -> r -> r)
-> r -> (forall d. Data d => d -> r') -> Packed a -> r
gmapQl :: forall r r'.
(r -> r' -> r)
-> r -> (forall d. Data d => d -> r') -> Packed a -> r
$cgmapQl :: forall a r r'.
Data a =>
(r -> r' -> r)
-> r -> (forall d. Data d => d -> r') -> Packed a -> r
gmapT :: (forall b. Data b => b -> b) -> Packed a -> Packed a
$cgmapT :: forall a.
Data a =>
(forall b. Data b => b -> b) -> Packed a -> Packed a
dataCast2 :: forall (t :: * -> * -> *) (c :: * -> *).
Typeable t =>
(forall d e. (Data d, Data e) => c (t d e)) -> Maybe (c (Packed a))
$cdataCast2 :: forall a (t :: * -> * -> *) (c :: * -> *).
(Data a, Typeable t) =>
(forall d e. (Data d, Data e) => c (t d e)) -> Maybe (c (Packed a))
dataCast1 :: forall (t :: * -> *) (c :: * -> *).
Typeable t =>
(forall d. Data d => c (t d)) -> Maybe (c (Packed a))
$cdataCast1 :: forall a (t :: * -> *) (c :: * -> *).
(Data a, Typeable t) =>
(forall d. Data d => c (t d)) -> Maybe (c (Packed a))
dataTypeOf :: Packed a -> DataType
$cdataTypeOf :: forall a. Data a => Packed a -> DataType
toConstr :: Packed a -> Constr
$ctoConstr :: forall a. Data a => Packed a -> Constr
gunfold :: forall (c :: * -> *).
(forall b r. Data b => c (b -> r) -> c r)
-> (forall r. r -> c r) -> Constr -> c (Packed a)
$cgunfold :: forall a (c :: * -> *).
Data a =>
(forall b r. Data b => c (b -> r) -> c r)
-> (forall r. r -> c r) -> Constr -> c (Packed a)
gfoldl :: forall (c :: * -> *).
(forall d b. Data d => c (d -> b) -> d -> c b)
-> (forall g. g -> c g) -> Packed a -> c (Packed a)
$cgfoldl :: forall a (c :: * -> *).
Data a =>
(forall d b. Data d => c (d -> b) -> d -> c b)
-> (forall g. g -> c g) -> Packed a -> c (Packed a)
Data, Typeable, forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
forall a x. Rep (Packed a) x -> Packed a
forall a x. Packed a -> Rep (Packed a) x
$cto :: forall a x. Rep (Packed a) x -> Packed a
$cfrom :: forall a x. Packed a -> Rep (Packed a) x
Generic, forall a b. a -> Packed b -> Packed a
forall a b. (a -> b) -> Packed a -> Packed b
forall (f :: * -> *).
(forall a b. (a -> b) -> f a -> f b)
-> (forall a b. a -> f b -> f a) -> Functor f
<$ :: forall a b. a -> Packed b -> Packed a
$c<$ :: forall a b. a -> Packed b -> Packed a
fmap :: forall a b. (a -> b) -> Packed a -> Packed b
$cfmap :: forall a b. (a -> b) -> Packed a -> Packed b
Functor, forall a. Eq a => a -> Packed a -> Bool
forall a. Num a => Packed a -> a
forall a. Ord a => Packed a -> a
forall m. Monoid m => Packed m -> m
forall a. Packed a -> Bool
forall a. Packed a -> Int
forall a. Packed a -> [a]
forall a. (a -> a -> a) -> Packed a -> a
forall m a. Monoid m => (a -> m) -> Packed a -> m
forall b a. (b -> a -> b) -> b -> Packed a -> b
forall a b. (a -> b -> b) -> b -> Packed a -> b
forall (t :: * -> *).
(forall m. Monoid m => t m -> m)
-> (forall m a. Monoid m => (a -> m) -> t a -> m)
-> (forall m a. Monoid m => (a -> m) -> t a -> m)
-> (forall a b. (a -> b -> b) -> b -> t a -> b)
-> (forall a b. (a -> b -> b) -> b -> t a -> b)
-> (forall b a. (b -> a -> b) -> b -> t a -> b)
-> (forall b a. (b -> a -> b) -> b -> t a -> b)
-> (forall a. (a -> a -> a) -> t a -> a)
-> (forall a. (a -> a -> a) -> t a -> a)
-> (forall a. t a -> [a])
-> (forall a. t a -> Bool)
-> (forall a. t a -> Int)
-> (forall a. Eq a => a -> t a -> Bool)
-> (forall a. Ord a => t a -> a)
-> (forall a. Ord a => t a -> a)
-> (forall a. Num a => t a -> a)
-> (forall a. Num a => t a -> a)
-> Foldable t
product :: forall a. Num a => Packed a -> a
$cproduct :: forall a. Num a => Packed a -> a
sum :: forall a. Num a => Packed a -> a
$csum :: forall a. Num a => Packed a -> a
minimum :: forall a. Ord a => Packed a -> a
$cminimum :: forall a. Ord a => Packed a -> a
maximum :: forall a. Ord a => Packed a -> a
$cmaximum :: forall a. Ord a => Packed a -> a
elem :: forall a. Eq a => a -> Packed a -> Bool
$celem :: forall a. Eq a => a -> Packed a -> Bool
length :: forall a. Packed a -> Int
$clength :: forall a. Packed a -> Int
null :: forall a. Packed a -> Bool
$cnull :: forall a. Packed a -> Bool
toList :: forall a. Packed a -> [a]
$ctoList :: forall a. Packed a -> [a]
foldl1 :: forall a. (a -> a -> a) -> Packed a -> a
$cfoldl1 :: forall a. (a -> a -> a) -> Packed a -> a
foldr1 :: forall a. (a -> a -> a) -> Packed a -> a
$cfoldr1 :: forall a. (a -> a -> a) -> Packed a -> a
foldl' :: forall b a. (b -> a -> b) -> b -> Packed a -> b
$cfoldl' :: forall b a. (b -> a -> b) -> b -> Packed a -> b
foldl :: forall b a. (b -> a -> b) -> b -> Packed a -> b
$cfoldl :: forall b a. (b -> a -> b) -> b -> Packed a -> b
foldr' :: forall a b. (a -> b -> b) -> b -> Packed a -> b
$cfoldr' :: forall a b. (a -> b -> b) -> b -> Packed a -> b
foldr :: forall a b. (a -> b -> b) -> b -> Packed a -> b
$cfoldr :: forall a b. (a -> b -> b) -> b -> Packed a -> b
foldMap' :: forall m a. Monoid m => (a -> m) -> Packed a -> m
$cfoldMap' :: forall m a. Monoid m => (a -> m) -> Packed a -> m
foldMap :: forall m a. Monoid m => (a -> m) -> Packed a -> m
$cfoldMap :: forall m a. Monoid m => (a -> m) -> Packed a -> m
fold :: forall m. Monoid m => Packed m -> m
$cfold :: forall m. Monoid m => Packed m -> m
Foldable, Functor Packed
Foldable Packed
forall (t :: * -> *).
Functor t
-> Foldable t
-> (forall (f :: * -> *) a b.
Applicative f =>
(a -> f b) -> t a -> f (t b))
-> (forall (f :: * -> *) a. Applicative f => t (f a) -> f (t a))
-> (forall (m :: * -> *) a b.
Monad m =>
(a -> m b) -> t a -> m (t b))
-> (forall (m :: * -> *) a. Monad m => t (m a) -> m (t a))
-> Traversable t
forall (m :: * -> *) a. Monad m => Packed (m a) -> m (Packed a)
forall (f :: * -> *) a.
Applicative f =>
Packed (f a) -> f (Packed a)
forall (m :: * -> *) a b.
Monad m =>
(a -> m b) -> Packed a -> m (Packed b)
forall (f :: * -> *) a b.
Applicative f =>
(a -> f b) -> Packed a -> f (Packed b)
sequence :: forall (m :: * -> *) a. Monad m => Packed (m a) -> m (Packed a)
$csequence :: forall (m :: * -> *) a. Monad m => Packed (m a) -> m (Packed a)
mapM :: forall (m :: * -> *) a b.
Monad m =>
(a -> m b) -> Packed a -> m (Packed b)
$cmapM :: forall (m :: * -> *) a b.
Monad m =>
(a -> m b) -> Packed a -> m (Packed b)
sequenceA :: forall (f :: * -> *) a.
Applicative f =>
Packed (f a) -> f (Packed a)
$csequenceA :: forall (f :: * -> *) a.
Applicative f =>
Packed (f a) -> f (Packed a)
traverse :: forall (f :: * -> *) a b.
Applicative f =>
(a -> f b) -> Packed a -> f (Packed b)
$ctraverse :: forall (f :: * -> *) a b.
Applicative f =>
(a -> f b) -> Packed a -> f (Packed b)
Traversable, Packed a -> Packed a -> Bool
forall a. Eq a => Packed a -> Packed a -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: Packed a -> Packed a -> Bool
$c/= :: forall a. Eq a => Packed a -> Packed a -> Bool
== :: Packed a -> Packed a -> Bool
$c== :: forall a. Eq a => Packed a -> Packed a -> Bool
Eq, Packed a -> Packed a -> Bool
Packed a -> Packed a -> Ordering
Packed a -> Packed a -> Packed 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 (Packed a)
forall a. Ord a => Packed a -> Packed a -> Bool
forall a. Ord a => Packed a -> Packed a -> Ordering
forall a. Ord a => Packed a -> Packed a -> Packed a
min :: Packed a -> Packed a -> Packed a
$cmin :: forall a. Ord a => Packed a -> Packed a -> Packed a
max :: Packed a -> Packed a -> Packed a
$cmax :: forall a. Ord a => Packed a -> Packed a -> Packed a
>= :: Packed a -> Packed a -> Bool
$c>= :: forall a. Ord a => Packed a -> Packed a -> Bool
> :: Packed a -> Packed a -> Bool
$c> :: forall a. Ord a => Packed a -> Packed a -> Bool
<= :: Packed a -> Packed a -> Bool
$c<= :: forall a. Ord a => Packed a -> Packed a -> Bool
< :: Packed a -> Packed a -> Bool
$c< :: forall a. Ord a => Packed a -> Packed a -> Bool
compare :: Packed a -> Packed a -> Ordering
$ccompare :: forall a. Ord a => Packed a -> Packed a -> Ordering
Ord, Int -> Packed a -> ShowS
forall a. Show a => Int -> Packed a -> ShowS
forall a. Show a => [Packed a] -> ShowS
forall a. Show a => Packed a -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [Packed a] -> ShowS
$cshowList :: forall a. Show a => [Packed a] -> ShowS
show :: Packed a -> String
$cshow :: forall a. Show a => Packed a -> String
showsPrec :: Int -> Packed a -> ShowS
$cshowsPrec :: forall a. Show a => Int -> Packed a -> ShowS
Show, ReadPrec [Packed a]
ReadPrec (Packed a)
ReadS [Packed a]
forall a. Read a => ReadPrec [Packed a]
forall a. Read a => ReadPrec (Packed a)
forall a. Read a => Int -> ReadS (Packed a)
forall a. Read a => ReadS [Packed a]
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [Packed a]
$creadListPrec :: forall a. Read a => ReadPrec [Packed a]
readPrec :: ReadPrec (Packed a)
$creadPrec :: forall a. Read a => ReadPrec (Packed a)
readList :: ReadS [Packed a]
$creadList :: forall a. Read a => ReadS [Packed a]
readsPrec :: Int -> ReadS (Packed a)
$creadsPrec :: forall a. Read a => Int -> ReadS (Packed a)
Read)
instance Block a => Storable (Packed a) where
alignment :: Packed a -> Int
alignment Packed a
_ = Int
1
sizeOf :: Packed a -> Int
sizeOf Packed a
_ = forall b (proxy :: * -> *). Block b => proxy b -> Int
sizeOfPacked (forall {k} (t :: k). Proxy t
Proxy :: Proxy a)
peekByteOff :: forall b. Ptr b -> Int -> IO (Packed a)
peekByteOff Ptr b
p Int
o = forall a. a -> Packed a
Packed forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
<$> forall b (m :: * -> *) a.
(Block b, MonadIO m) =>
Ptr a -> Diff a b -> m b
readPacked Ptr b
p (forall a b. Int -> Diff a b
Diff Int
o)
pokeByteOff :: forall b. Ptr b -> Int -> Packed a -> IO ()
pokeByteOff Ptr b
p Int
o = forall b (m :: * -> *) a.
(Block b, MonadIO m) =>
Ptr a -> Diff a b -> b -> m ()
writePacked Ptr b
p (forall a b. Int -> Diff a b
Diff Int
o) forall b c a. (b -> c) -> (a -> b) -> a -> c
. forall a. Packed a -> a
getPacked
newtype Std140 a = Std140 { forall a. Std140 a -> a
getStd140 :: a }
deriving (Std140 a -> DataType
Std140 a -> Constr
forall {a}. Data a => Typeable (Std140 a)
forall a. Data a => Std140 a -> DataType
forall a. Data a => Std140 a -> Constr
forall a.
Data a =>
(forall b. Data b => b -> b) -> Std140 a -> Std140 a
forall a u.
Data a =>
Int -> (forall d. Data d => d -> u) -> Std140 a -> u
forall a u.
Data a =>
(forall d. Data d => d -> u) -> Std140 a -> [u]
forall a r r'.
Data a =>
(r -> r' -> r)
-> r -> (forall d. Data d => d -> r') -> Std140 a -> r
forall a r r'.
Data a =>
(r' -> r -> r)
-> r -> (forall d. Data d => d -> r') -> Std140 a -> r
forall a (m :: * -> *).
(Data a, Monad m) =>
(forall d. Data d => d -> m d) -> Std140 a -> m (Std140 a)
forall a (m :: * -> *).
(Data a, MonadPlus m) =>
(forall d. Data d => d -> m d) -> Std140 a -> m (Std140 a)
forall a (c :: * -> *).
Data a =>
(forall b r. Data b => c (b -> r) -> c r)
-> (forall r. r -> c r) -> Constr -> c (Std140 a)
forall a (c :: * -> *).
Data a =>
(forall d b. Data d => c (d -> b) -> d -> c b)
-> (forall g. g -> c g) -> Std140 a -> c (Std140 a)
forall a (t :: * -> *) (c :: * -> *).
(Data a, Typeable t) =>
(forall d. Data d => c (t d)) -> Maybe (c (Std140 a))
forall a (t :: * -> * -> *) (c :: * -> *).
(Data a, Typeable t) =>
(forall d e. (Data d, Data e) => c (t d e)) -> Maybe (c (Std140 a))
forall a.
Typeable a
-> (forall (c :: * -> *).
(forall d b. Data d => c (d -> b) -> d -> c b)
-> (forall g. g -> c g) -> a -> c a)
-> (forall (c :: * -> *).
(forall b r. Data b => c (b -> r) -> c r)
-> (forall r. r -> c r) -> Constr -> c a)
-> (a -> Constr)
-> (a -> DataType)
-> (forall (t :: * -> *) (c :: * -> *).
Typeable t =>
(forall d. Data d => c (t d)) -> Maybe (c a))
-> (forall (t :: * -> * -> *) (c :: * -> *).
Typeable t =>
(forall d e. (Data d, Data e) => c (t d e)) -> Maybe (c a))
-> ((forall b. Data b => b -> b) -> a -> a)
-> (forall r r'.
(r -> r' -> r) -> r -> (forall d. Data d => d -> r') -> a -> r)
-> (forall r r'.
(r' -> r -> r) -> r -> (forall d. Data d => d -> r') -> a -> r)
-> (forall u. (forall d. Data d => d -> u) -> a -> [u])
-> (forall u. Int -> (forall d. Data d => d -> u) -> a -> u)
-> (forall (m :: * -> *).
Monad m =>
(forall d. Data d => d -> m d) -> a -> m a)
-> (forall (m :: * -> *).
MonadPlus m =>
(forall d. Data d => d -> m d) -> a -> m a)
-> (forall (m :: * -> *).
MonadPlus m =>
(forall d. Data d => d -> m d) -> a -> m a)
-> Data a
forall (c :: * -> *).
(forall b r. Data b => c (b -> r) -> c r)
-> (forall r. r -> c r) -> Constr -> c (Std140 a)
forall (c :: * -> *).
(forall d b. Data d => c (d -> b) -> d -> c b)
-> (forall g. g -> c g) -> Std140 a -> c (Std140 a)
forall (t :: * -> *) (c :: * -> *).
Typeable t =>
(forall d. Data d => c (t d)) -> Maybe (c (Std140 a))
gmapMo :: forall (m :: * -> *).
MonadPlus m =>
(forall d. Data d => d -> m d) -> Std140 a -> m (Std140 a)
$cgmapMo :: forall a (m :: * -> *).
(Data a, MonadPlus m) =>
(forall d. Data d => d -> m d) -> Std140 a -> m (Std140 a)
gmapMp :: forall (m :: * -> *).
MonadPlus m =>
(forall d. Data d => d -> m d) -> Std140 a -> m (Std140 a)
$cgmapMp :: forall a (m :: * -> *).
(Data a, MonadPlus m) =>
(forall d. Data d => d -> m d) -> Std140 a -> m (Std140 a)
gmapM :: forall (m :: * -> *).
Monad m =>
(forall d. Data d => d -> m d) -> Std140 a -> m (Std140 a)
$cgmapM :: forall a (m :: * -> *).
(Data a, Monad m) =>
(forall d. Data d => d -> m d) -> Std140 a -> m (Std140 a)
gmapQi :: forall u. Int -> (forall d. Data d => d -> u) -> Std140 a -> u
$cgmapQi :: forall a u.
Data a =>
Int -> (forall d. Data d => d -> u) -> Std140 a -> u
gmapQ :: forall u. (forall d. Data d => d -> u) -> Std140 a -> [u]
$cgmapQ :: forall a u.
Data a =>
(forall d. Data d => d -> u) -> Std140 a -> [u]
gmapQr :: forall r r'.
(r' -> r -> r)
-> r -> (forall d. Data d => d -> r') -> Std140 a -> r
$cgmapQr :: forall a r r'.
Data a =>
(r' -> r -> r)
-> r -> (forall d. Data d => d -> r') -> Std140 a -> r
gmapQl :: forall r r'.
(r -> r' -> r)
-> r -> (forall d. Data d => d -> r') -> Std140 a -> r
$cgmapQl :: forall a r r'.
Data a =>
(r -> r' -> r)
-> r -> (forall d. Data d => d -> r') -> Std140 a -> r
gmapT :: (forall b. Data b => b -> b) -> Std140 a -> Std140 a
$cgmapT :: forall a.
Data a =>
(forall b. Data b => b -> b) -> Std140 a -> Std140 a
dataCast2 :: forall (t :: * -> * -> *) (c :: * -> *).
Typeable t =>
(forall d e. (Data d, Data e) => c (t d e)) -> Maybe (c (Std140 a))
$cdataCast2 :: forall a (t :: * -> * -> *) (c :: * -> *).
(Data a, Typeable t) =>
(forall d e. (Data d, Data e) => c (t d e)) -> Maybe (c (Std140 a))
dataCast1 :: forall (t :: * -> *) (c :: * -> *).
Typeable t =>
(forall d. Data d => c (t d)) -> Maybe (c (Std140 a))
$cdataCast1 :: forall a (t :: * -> *) (c :: * -> *).
(Data a, Typeable t) =>
(forall d. Data d => c (t d)) -> Maybe (c (Std140 a))
dataTypeOf :: Std140 a -> DataType
$cdataTypeOf :: forall a. Data a => Std140 a -> DataType
toConstr :: Std140 a -> Constr
$ctoConstr :: forall a. Data a => Std140 a -> Constr
gunfold :: forall (c :: * -> *).
(forall b r. Data b => c (b -> r) -> c r)
-> (forall r. r -> c r) -> Constr -> c (Std140 a)
$cgunfold :: forall a (c :: * -> *).
Data a =>
(forall b r. Data b => c (b -> r) -> c r)
-> (forall r. r -> c r) -> Constr -> c (Std140 a)
gfoldl :: forall (c :: * -> *).
(forall d b. Data d => c (d -> b) -> d -> c b)
-> (forall g. g -> c g) -> Std140 a -> c (Std140 a)
$cgfoldl :: forall a (c :: * -> *).
Data a =>
(forall d b. Data d => c (d -> b) -> d -> c b)
-> (forall g. g -> c g) -> Std140 a -> c (Std140 a)
Data, Typeable, forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
forall a x. Rep (Std140 a) x -> Std140 a
forall a x. Std140 a -> Rep (Std140 a) x
$cto :: forall a x. Rep (Std140 a) x -> Std140 a
$cfrom :: forall a x. Std140 a -> Rep (Std140 a) x
Generic, forall a b. a -> Std140 b -> Std140 a
forall a b. (a -> b) -> Std140 a -> Std140 b
forall (f :: * -> *).
(forall a b. (a -> b) -> f a -> f b)
-> (forall a b. a -> f b -> f a) -> Functor f
<$ :: forall a b. a -> Std140 b -> Std140 a
$c<$ :: forall a b. a -> Std140 b -> Std140 a
fmap :: forall a b. (a -> b) -> Std140 a -> Std140 b
$cfmap :: forall a b. (a -> b) -> Std140 a -> Std140 b
Functor, forall a. Eq a => a -> Std140 a -> Bool
forall a. Num a => Std140 a -> a
forall a. Ord a => Std140 a -> a
forall m. Monoid m => Std140 m -> m
forall a. Std140 a -> Bool
forall a. Std140 a -> Int
forall a. Std140 a -> [a]
forall a. (a -> a -> a) -> Std140 a -> a
forall m a. Monoid m => (a -> m) -> Std140 a -> m
forall b a. (b -> a -> b) -> b -> Std140 a -> b
forall a b. (a -> b -> b) -> b -> Std140 a -> b
forall (t :: * -> *).
(forall m. Monoid m => t m -> m)
-> (forall m a. Monoid m => (a -> m) -> t a -> m)
-> (forall m a. Monoid m => (a -> m) -> t a -> m)
-> (forall a b. (a -> b -> b) -> b -> t a -> b)
-> (forall a b. (a -> b -> b) -> b -> t a -> b)
-> (forall b a. (b -> a -> b) -> b -> t a -> b)
-> (forall b a. (b -> a -> b) -> b -> t a -> b)
-> (forall a. (a -> a -> a) -> t a -> a)
-> (forall a. (a -> a -> a) -> t a -> a)
-> (forall a. t a -> [a])
-> (forall a. t a -> Bool)
-> (forall a. t a -> Int)
-> (forall a. Eq a => a -> t a -> Bool)
-> (forall a. Ord a => t a -> a)
-> (forall a. Ord a => t a -> a)
-> (forall a. Num a => t a -> a)
-> (forall a. Num a => t a -> a)
-> Foldable t
product :: forall a. Num a => Std140 a -> a
$cproduct :: forall a. Num a => Std140 a -> a
sum :: forall a. Num a => Std140 a -> a
$csum :: forall a. Num a => Std140 a -> a
minimum :: forall a. Ord a => Std140 a -> a
$cminimum :: forall a. Ord a => Std140 a -> a
maximum :: forall a. Ord a => Std140 a -> a
$cmaximum :: forall a. Ord a => Std140 a -> a
elem :: forall a. Eq a => a -> Std140 a -> Bool
$celem :: forall a. Eq a => a -> Std140 a -> Bool
length :: forall a. Std140 a -> Int
$clength :: forall a. Std140 a -> Int
null :: forall a. Std140 a -> Bool
$cnull :: forall a. Std140 a -> Bool
toList :: forall a. Std140 a -> [a]
$ctoList :: forall a. Std140 a -> [a]
foldl1 :: forall a. (a -> a -> a) -> Std140 a -> a
$cfoldl1 :: forall a. (a -> a -> a) -> Std140 a -> a
foldr1 :: forall a. (a -> a -> a) -> Std140 a -> a
$cfoldr1 :: forall a. (a -> a -> a) -> Std140 a -> a
foldl' :: forall b a. (b -> a -> b) -> b -> Std140 a -> b
$cfoldl' :: forall b a. (b -> a -> b) -> b -> Std140 a -> b
foldl :: forall b a. (b -> a -> b) -> b -> Std140 a -> b
$cfoldl :: forall b a. (b -> a -> b) -> b -> Std140 a -> b
foldr' :: forall a b. (a -> b -> b) -> b -> Std140 a -> b
$cfoldr' :: forall a b. (a -> b -> b) -> b -> Std140 a -> b
foldr :: forall a b. (a -> b -> b) -> b -> Std140 a -> b
$cfoldr :: forall a b. (a -> b -> b) -> b -> Std140 a -> b
foldMap' :: forall m a. Monoid m => (a -> m) -> Std140 a -> m
$cfoldMap' :: forall m a. Monoid m => (a -> m) -> Std140 a -> m
foldMap :: forall m a. Monoid m => (a -> m) -> Std140 a -> m
$cfoldMap :: forall m a. Monoid m => (a -> m) -> Std140 a -> m
fold :: forall m. Monoid m => Std140 m -> m
$cfold :: forall m. Monoid m => Std140 m -> m
Foldable, Functor Std140
Foldable Std140
forall (t :: * -> *).
Functor t
-> Foldable t
-> (forall (f :: * -> *) a b.
Applicative f =>
(a -> f b) -> t a -> f (t b))
-> (forall (f :: * -> *) a. Applicative f => t (f a) -> f (t a))
-> (forall (m :: * -> *) a b.
Monad m =>
(a -> m b) -> t a -> m (t b))
-> (forall (m :: * -> *) a. Monad m => t (m a) -> m (t a))
-> Traversable t
forall (m :: * -> *) a. Monad m => Std140 (m a) -> m (Std140 a)
forall (f :: * -> *) a.
Applicative f =>
Std140 (f a) -> f (Std140 a)
forall (m :: * -> *) a b.
Monad m =>
(a -> m b) -> Std140 a -> m (Std140 b)
forall (f :: * -> *) a b.
Applicative f =>
(a -> f b) -> Std140 a -> f (Std140 b)
sequence :: forall (m :: * -> *) a. Monad m => Std140 (m a) -> m (Std140 a)
$csequence :: forall (m :: * -> *) a. Monad m => Std140 (m a) -> m (Std140 a)
mapM :: forall (m :: * -> *) a b.
Monad m =>
(a -> m b) -> Std140 a -> m (Std140 b)
$cmapM :: forall (m :: * -> *) a b.
Monad m =>
(a -> m b) -> Std140 a -> m (Std140 b)
sequenceA :: forall (f :: * -> *) a.
Applicative f =>
Std140 (f a) -> f (Std140 a)
$csequenceA :: forall (f :: * -> *) a.
Applicative f =>
Std140 (f a) -> f (Std140 a)
traverse :: forall (f :: * -> *) a b.
Applicative f =>
(a -> f b) -> Std140 a -> f (Std140 b)
$ctraverse :: forall (f :: * -> *) a b.
Applicative f =>
(a -> f b) -> Std140 a -> f (Std140 b)
Traversable, Std140 a -> Std140 a -> Bool
forall a. Eq a => Std140 a -> Std140 a -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: Std140 a -> Std140 a -> Bool
$c/= :: forall a. Eq a => Std140 a -> Std140 a -> Bool
== :: Std140 a -> Std140 a -> Bool
$c== :: forall a. Eq a => Std140 a -> Std140 a -> Bool
Eq, Std140 a -> Std140 a -> Bool
Std140 a -> Std140 a -> Ordering
Std140 a -> Std140 a -> Std140 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 (Std140 a)
forall a. Ord a => Std140 a -> Std140 a -> Bool
forall a. Ord a => Std140 a -> Std140 a -> Ordering
forall a. Ord a => Std140 a -> Std140 a -> Std140 a
min :: Std140 a -> Std140 a -> Std140 a
$cmin :: forall a. Ord a => Std140 a -> Std140 a -> Std140 a
max :: Std140 a -> Std140 a -> Std140 a
$cmax :: forall a. Ord a => Std140 a -> Std140 a -> Std140 a
>= :: Std140 a -> Std140 a -> Bool
$c>= :: forall a. Ord a => Std140 a -> Std140 a -> Bool
> :: Std140 a -> Std140 a -> Bool
$c> :: forall a. Ord a => Std140 a -> Std140 a -> Bool
<= :: Std140 a -> Std140 a -> Bool
$c<= :: forall a. Ord a => Std140 a -> Std140 a -> Bool
< :: Std140 a -> Std140 a -> Bool
$c< :: forall a. Ord a => Std140 a -> Std140 a -> Bool
compare :: Std140 a -> Std140 a -> Ordering
$ccompare :: forall a. Ord a => Std140 a -> Std140 a -> Ordering
Ord, Int -> Std140 a -> ShowS
forall a. Show a => Int -> Std140 a -> ShowS
forall a. Show a => [Std140 a] -> ShowS
forall a. Show a => Std140 a -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [Std140 a] -> ShowS
$cshowList :: forall a. Show a => [Std140 a] -> ShowS
show :: Std140 a -> String
$cshow :: forall a. Show a => Std140 a -> String
showsPrec :: Int -> Std140 a -> ShowS
$cshowsPrec :: forall a. Show a => Int -> Std140 a -> ShowS
Show, ReadPrec [Std140 a]
ReadPrec (Std140 a)
ReadS [Std140 a]
forall a. Read a => ReadPrec [Std140 a]
forall a. Read a => ReadPrec (Std140 a)
forall a. Read a => Int -> ReadS (Std140 a)
forall a. Read a => ReadS [Std140 a]
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [Std140 a]
$creadListPrec :: forall a. Read a => ReadPrec [Std140 a]
readPrec :: ReadPrec (Std140 a)
$creadPrec :: forall a. Read a => ReadPrec (Std140 a)
readList :: ReadS [Std140 a]
$creadList :: forall a. Read a => ReadS [Std140 a]
readsPrec :: Int -> ReadS (Std140 a)
$creadsPrec :: forall a. Read a => Int -> ReadS (Std140 a)
Read)
instance Block a => Storable (Std140 a) where
alignment :: Std140 a -> Int
alignment Std140 a
_ = forall b (proxy :: * -> *). Block b => proxy b -> Int
alignment140 (forall {k} (t :: k). Proxy t
Proxy :: Proxy a)
sizeOf :: Std140 a -> Int
sizeOf Std140 a
_ = forall b (proxy :: * -> *). Block b => proxy b -> Int
sizeOf140 (forall {k} (t :: k). Proxy t
Proxy :: Proxy a)
peekByteOff :: forall b. Ptr b -> Int -> IO (Std140 a)
peekByteOff Ptr b
p Int
o = forall a. a -> Std140 a
Std140 forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
<$> forall b (m :: * -> *) a.
(Block b, MonadIO m) =>
Ptr a -> Diff a b -> m b
read140 Ptr b
p (forall a b. Int -> Diff a b
Diff Int
o)
pokeByteOff :: forall b. Ptr b -> Int -> Std140 a -> IO ()
pokeByteOff Ptr b
p Int
o = forall b (m :: * -> *) a.
(Block b, MonadIO m) =>
Ptr a -> Diff a b -> b -> m ()
write140 Ptr b
p (forall a b. Int -> Diff a b
Diff Int
o) forall b c a. (b -> c) -> (a -> b) -> a -> c
. forall a. Std140 a -> a
getStd140
newtype Std430 a = Std430 { forall a. Std430 a -> a
getStd430 :: a }
deriving (Std430 a -> DataType
Std430 a -> Constr
forall {a}. Data a => Typeable (Std430 a)
forall a. Data a => Std430 a -> DataType
forall a. Data a => Std430 a -> Constr
forall a.
Data a =>
(forall b. Data b => b -> b) -> Std430 a -> Std430 a
forall a u.
Data a =>
Int -> (forall d. Data d => d -> u) -> Std430 a -> u
forall a u.
Data a =>
(forall d. Data d => d -> u) -> Std430 a -> [u]
forall a r r'.
Data a =>
(r -> r' -> r)
-> r -> (forall d. Data d => d -> r') -> Std430 a -> r
forall a r r'.
Data a =>
(r' -> r -> r)
-> r -> (forall d. Data d => d -> r') -> Std430 a -> r
forall a (m :: * -> *).
(Data a, Monad m) =>
(forall d. Data d => d -> m d) -> Std430 a -> m (Std430 a)
forall a (m :: * -> *).
(Data a, MonadPlus m) =>
(forall d. Data d => d -> m d) -> Std430 a -> m (Std430 a)
forall a (c :: * -> *).
Data a =>
(forall b r. Data b => c (b -> r) -> c r)
-> (forall r. r -> c r) -> Constr -> c (Std430 a)
forall a (c :: * -> *).
Data a =>
(forall d b. Data d => c (d -> b) -> d -> c b)
-> (forall g. g -> c g) -> Std430 a -> c (Std430 a)
forall a (t :: * -> *) (c :: * -> *).
(Data a, Typeable t) =>
(forall d. Data d => c (t d)) -> Maybe (c (Std430 a))
forall a (t :: * -> * -> *) (c :: * -> *).
(Data a, Typeable t) =>
(forall d e. (Data d, Data e) => c (t d e)) -> Maybe (c (Std430 a))
forall a.
Typeable a
-> (forall (c :: * -> *).
(forall d b. Data d => c (d -> b) -> d -> c b)
-> (forall g. g -> c g) -> a -> c a)
-> (forall (c :: * -> *).
(forall b r. Data b => c (b -> r) -> c r)
-> (forall r. r -> c r) -> Constr -> c a)
-> (a -> Constr)
-> (a -> DataType)
-> (forall (t :: * -> *) (c :: * -> *).
Typeable t =>
(forall d. Data d => c (t d)) -> Maybe (c a))
-> (forall (t :: * -> * -> *) (c :: * -> *).
Typeable t =>
(forall d e. (Data d, Data e) => c (t d e)) -> Maybe (c a))
-> ((forall b. Data b => b -> b) -> a -> a)
-> (forall r r'.
(r -> r' -> r) -> r -> (forall d. Data d => d -> r') -> a -> r)
-> (forall r r'.
(r' -> r -> r) -> r -> (forall d. Data d => d -> r') -> a -> r)
-> (forall u. (forall d. Data d => d -> u) -> a -> [u])
-> (forall u. Int -> (forall d. Data d => d -> u) -> a -> u)
-> (forall (m :: * -> *).
Monad m =>
(forall d. Data d => d -> m d) -> a -> m a)
-> (forall (m :: * -> *).
MonadPlus m =>
(forall d. Data d => d -> m d) -> a -> m a)
-> (forall (m :: * -> *).
MonadPlus m =>
(forall d. Data d => d -> m d) -> a -> m a)
-> Data a
forall (c :: * -> *).
(forall b r. Data b => c (b -> r) -> c r)
-> (forall r. r -> c r) -> Constr -> c (Std430 a)
forall (c :: * -> *).
(forall d b. Data d => c (d -> b) -> d -> c b)
-> (forall g. g -> c g) -> Std430 a -> c (Std430 a)
forall (t :: * -> *) (c :: * -> *).
Typeable t =>
(forall d. Data d => c (t d)) -> Maybe (c (Std430 a))
gmapMo :: forall (m :: * -> *).
MonadPlus m =>
(forall d. Data d => d -> m d) -> Std430 a -> m (Std430 a)
$cgmapMo :: forall a (m :: * -> *).
(Data a, MonadPlus m) =>
(forall d. Data d => d -> m d) -> Std430 a -> m (Std430 a)
gmapMp :: forall (m :: * -> *).
MonadPlus m =>
(forall d. Data d => d -> m d) -> Std430 a -> m (Std430 a)
$cgmapMp :: forall a (m :: * -> *).
(Data a, MonadPlus m) =>
(forall d. Data d => d -> m d) -> Std430 a -> m (Std430 a)
gmapM :: forall (m :: * -> *).
Monad m =>
(forall d. Data d => d -> m d) -> Std430 a -> m (Std430 a)
$cgmapM :: forall a (m :: * -> *).
(Data a, Monad m) =>
(forall d. Data d => d -> m d) -> Std430 a -> m (Std430 a)
gmapQi :: forall u. Int -> (forall d. Data d => d -> u) -> Std430 a -> u
$cgmapQi :: forall a u.
Data a =>
Int -> (forall d. Data d => d -> u) -> Std430 a -> u
gmapQ :: forall u. (forall d. Data d => d -> u) -> Std430 a -> [u]
$cgmapQ :: forall a u.
Data a =>
(forall d. Data d => d -> u) -> Std430 a -> [u]
gmapQr :: forall r r'.
(r' -> r -> r)
-> r -> (forall d. Data d => d -> r') -> Std430 a -> r
$cgmapQr :: forall a r r'.
Data a =>
(r' -> r -> r)
-> r -> (forall d. Data d => d -> r') -> Std430 a -> r
gmapQl :: forall r r'.
(r -> r' -> r)
-> r -> (forall d. Data d => d -> r') -> Std430 a -> r
$cgmapQl :: forall a r r'.
Data a =>
(r -> r' -> r)
-> r -> (forall d. Data d => d -> r') -> Std430 a -> r
gmapT :: (forall b. Data b => b -> b) -> Std430 a -> Std430 a
$cgmapT :: forall a.
Data a =>
(forall b. Data b => b -> b) -> Std430 a -> Std430 a
dataCast2 :: forall (t :: * -> * -> *) (c :: * -> *).
Typeable t =>
(forall d e. (Data d, Data e) => c (t d e)) -> Maybe (c (Std430 a))
$cdataCast2 :: forall a (t :: * -> * -> *) (c :: * -> *).
(Data a, Typeable t) =>
(forall d e. (Data d, Data e) => c (t d e)) -> Maybe (c (Std430 a))
dataCast1 :: forall (t :: * -> *) (c :: * -> *).
Typeable t =>
(forall d. Data d => c (t d)) -> Maybe (c (Std430 a))
$cdataCast1 :: forall a (t :: * -> *) (c :: * -> *).
(Data a, Typeable t) =>
(forall d. Data d => c (t d)) -> Maybe (c (Std430 a))
dataTypeOf :: Std430 a -> DataType
$cdataTypeOf :: forall a. Data a => Std430 a -> DataType
toConstr :: Std430 a -> Constr
$ctoConstr :: forall a. Data a => Std430 a -> Constr
gunfold :: forall (c :: * -> *).
(forall b r. Data b => c (b -> r) -> c r)
-> (forall r. r -> c r) -> Constr -> c (Std430 a)
$cgunfold :: forall a (c :: * -> *).
Data a =>
(forall b r. Data b => c (b -> r) -> c r)
-> (forall r. r -> c r) -> Constr -> c (Std430 a)
gfoldl :: forall (c :: * -> *).
(forall d b. Data d => c (d -> b) -> d -> c b)
-> (forall g. g -> c g) -> Std430 a -> c (Std430 a)
$cgfoldl :: forall a (c :: * -> *).
Data a =>
(forall d b. Data d => c (d -> b) -> d -> c b)
-> (forall g. g -> c g) -> Std430 a -> c (Std430 a)
Data, Typeable, forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
forall a x. Rep (Std430 a) x -> Std430 a
forall a x. Std430 a -> Rep (Std430 a) x
$cto :: forall a x. Rep (Std430 a) x -> Std430 a
$cfrom :: forall a x. Std430 a -> Rep (Std430 a) x
Generic, forall a b. a -> Std430 b -> Std430 a
forall a b. (a -> b) -> Std430 a -> Std430 b
forall (f :: * -> *).
(forall a b. (a -> b) -> f a -> f b)
-> (forall a b. a -> f b -> f a) -> Functor f
<$ :: forall a b. a -> Std430 b -> Std430 a
$c<$ :: forall a b. a -> Std430 b -> Std430 a
fmap :: forall a b. (a -> b) -> Std430 a -> Std430 b
$cfmap :: forall a b. (a -> b) -> Std430 a -> Std430 b
Functor, forall a. Eq a => a -> Std430 a -> Bool
forall a. Num a => Std430 a -> a
forall a. Ord a => Std430 a -> a
forall m. Monoid m => Std430 m -> m
forall a. Std430 a -> Bool
forall a. Std430 a -> Int
forall a. Std430 a -> [a]
forall a. (a -> a -> a) -> Std430 a -> a
forall m a. Monoid m => (a -> m) -> Std430 a -> m
forall b a. (b -> a -> b) -> b -> Std430 a -> b
forall a b. (a -> b -> b) -> b -> Std430 a -> b
forall (t :: * -> *).
(forall m. Monoid m => t m -> m)
-> (forall m a. Monoid m => (a -> m) -> t a -> m)
-> (forall m a. Monoid m => (a -> m) -> t a -> m)
-> (forall a b. (a -> b -> b) -> b -> t a -> b)
-> (forall a b. (a -> b -> b) -> b -> t a -> b)
-> (forall b a. (b -> a -> b) -> b -> t a -> b)
-> (forall b a. (b -> a -> b) -> b -> t a -> b)
-> (forall a. (a -> a -> a) -> t a -> a)
-> (forall a. (a -> a -> a) -> t a -> a)
-> (forall a. t a -> [a])
-> (forall a. t a -> Bool)
-> (forall a. t a -> Int)
-> (forall a. Eq a => a -> t a -> Bool)
-> (forall a. Ord a => t a -> a)
-> (forall a. Ord a => t a -> a)
-> (forall a. Num a => t a -> a)
-> (forall a. Num a => t a -> a)
-> Foldable t
product :: forall a. Num a => Std430 a -> a
$cproduct :: forall a. Num a => Std430 a -> a
sum :: forall a. Num a => Std430 a -> a
$csum :: forall a. Num a => Std430 a -> a
minimum :: forall a. Ord a => Std430 a -> a
$cminimum :: forall a. Ord a => Std430 a -> a
maximum :: forall a. Ord a => Std430 a -> a
$cmaximum :: forall a. Ord a => Std430 a -> a
elem :: forall a. Eq a => a -> Std430 a -> Bool
$celem :: forall a. Eq a => a -> Std430 a -> Bool
length :: forall a. Std430 a -> Int
$clength :: forall a. Std430 a -> Int
null :: forall a. Std430 a -> Bool
$cnull :: forall a. Std430 a -> Bool
toList :: forall a. Std430 a -> [a]
$ctoList :: forall a. Std430 a -> [a]
foldl1 :: forall a. (a -> a -> a) -> Std430 a -> a
$cfoldl1 :: forall a. (a -> a -> a) -> Std430 a -> a
foldr1 :: forall a. (a -> a -> a) -> Std430 a -> a
$cfoldr1 :: forall a. (a -> a -> a) -> Std430 a -> a
foldl' :: forall b a. (b -> a -> b) -> b -> Std430 a -> b
$cfoldl' :: forall b a. (b -> a -> b) -> b -> Std430 a -> b
foldl :: forall b a. (b -> a -> b) -> b -> Std430 a -> b
$cfoldl :: forall b a. (b -> a -> b) -> b -> Std430 a -> b
foldr' :: forall a b. (a -> b -> b) -> b -> Std430 a -> b
$cfoldr' :: forall a b. (a -> b -> b) -> b -> Std430 a -> b
foldr :: forall a b. (a -> b -> b) -> b -> Std430 a -> b
$cfoldr :: forall a b. (a -> b -> b) -> b -> Std430 a -> b
foldMap' :: forall m a. Monoid m => (a -> m) -> Std430 a -> m
$cfoldMap' :: forall m a. Monoid m => (a -> m) -> Std430 a -> m
foldMap :: forall m a. Monoid m => (a -> m) -> Std430 a -> m
$cfoldMap :: forall m a. Monoid m => (a -> m) -> Std430 a -> m
fold :: forall m. Monoid m => Std430 m -> m
$cfold :: forall m. Monoid m => Std430 m -> m
Foldable, Functor Std430
Foldable Std430
forall (t :: * -> *).
Functor t
-> Foldable t
-> (forall (f :: * -> *) a b.
Applicative f =>
(a -> f b) -> t a -> f (t b))
-> (forall (f :: * -> *) a. Applicative f => t (f a) -> f (t a))
-> (forall (m :: * -> *) a b.
Monad m =>
(a -> m b) -> t a -> m (t b))
-> (forall (m :: * -> *) a. Monad m => t (m a) -> m (t a))
-> Traversable t
forall (m :: * -> *) a. Monad m => Std430 (m a) -> m (Std430 a)
forall (f :: * -> *) a.
Applicative f =>
Std430 (f a) -> f (Std430 a)
forall (m :: * -> *) a b.
Monad m =>
(a -> m b) -> Std430 a -> m (Std430 b)
forall (f :: * -> *) a b.
Applicative f =>
(a -> f b) -> Std430 a -> f (Std430 b)
sequence :: forall (m :: * -> *) a. Monad m => Std430 (m a) -> m (Std430 a)
$csequence :: forall (m :: * -> *) a. Monad m => Std430 (m a) -> m (Std430 a)
mapM :: forall (m :: * -> *) a b.
Monad m =>
(a -> m b) -> Std430 a -> m (Std430 b)
$cmapM :: forall (m :: * -> *) a b.
Monad m =>
(a -> m b) -> Std430 a -> m (Std430 b)
sequenceA :: forall (f :: * -> *) a.
Applicative f =>
Std430 (f a) -> f (Std430 a)
$csequenceA :: forall (f :: * -> *) a.
Applicative f =>
Std430 (f a) -> f (Std430 a)
traverse :: forall (f :: * -> *) a b.
Applicative f =>
(a -> f b) -> Std430 a -> f (Std430 b)
$ctraverse :: forall (f :: * -> *) a b.
Applicative f =>
(a -> f b) -> Std430 a -> f (Std430 b)
Traversable, Std430 a -> Std430 a -> Bool
forall a. Eq a => Std430 a -> Std430 a -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: Std430 a -> Std430 a -> Bool
$c/= :: forall a. Eq a => Std430 a -> Std430 a -> Bool
== :: Std430 a -> Std430 a -> Bool
$c== :: forall a. Eq a => Std430 a -> Std430 a -> Bool
Eq, Std430 a -> Std430 a -> Bool
Std430 a -> Std430 a -> Ordering
Std430 a -> Std430 a -> Std430 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 (Std430 a)
forall a. Ord a => Std430 a -> Std430 a -> Bool
forall a. Ord a => Std430 a -> Std430 a -> Ordering
forall a. Ord a => Std430 a -> Std430 a -> Std430 a
min :: Std430 a -> Std430 a -> Std430 a
$cmin :: forall a. Ord a => Std430 a -> Std430 a -> Std430 a
max :: Std430 a -> Std430 a -> Std430 a
$cmax :: forall a. Ord a => Std430 a -> Std430 a -> Std430 a
>= :: Std430 a -> Std430 a -> Bool
$c>= :: forall a. Ord a => Std430 a -> Std430 a -> Bool
> :: Std430 a -> Std430 a -> Bool
$c> :: forall a. Ord a => Std430 a -> Std430 a -> Bool
<= :: Std430 a -> Std430 a -> Bool
$c<= :: forall a. Ord a => Std430 a -> Std430 a -> Bool
< :: Std430 a -> Std430 a -> Bool
$c< :: forall a. Ord a => Std430 a -> Std430 a -> Bool
compare :: Std430 a -> Std430 a -> Ordering
$ccompare :: forall a. Ord a => Std430 a -> Std430 a -> Ordering
Ord, Int -> Std430 a -> ShowS
forall a. Show a => Int -> Std430 a -> ShowS
forall a. Show a => [Std430 a] -> ShowS
forall a. Show a => Std430 a -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [Std430 a] -> ShowS
$cshowList :: forall a. Show a => [Std430 a] -> ShowS
show :: Std430 a -> String
$cshow :: forall a. Show a => Std430 a -> String
showsPrec :: Int -> Std430 a -> ShowS
$cshowsPrec :: forall a. Show a => Int -> Std430 a -> ShowS
Show, ReadPrec [Std430 a]
ReadPrec (Std430 a)
ReadS [Std430 a]
forall a. Read a => ReadPrec [Std430 a]
forall a. Read a => ReadPrec (Std430 a)
forall a. Read a => Int -> ReadS (Std430 a)
forall a. Read a => ReadS [Std430 a]
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [Std430 a]
$creadListPrec :: forall a. Read a => ReadPrec [Std430 a]
readPrec :: ReadPrec (Std430 a)
$creadPrec :: forall a. Read a => ReadPrec (Std430 a)
readList :: ReadS [Std430 a]
$creadList :: forall a. Read a => ReadS [Std430 a]
readsPrec :: Int -> ReadS (Std430 a)
$creadsPrec :: forall a. Read a => Int -> ReadS (Std430 a)
Read)
instance Block a => Storable (Std430 a) where
alignment :: Std430 a -> Int
alignment Std430 a
_ = forall b (proxy :: * -> *). Block b => proxy b -> Int
alignment430 (forall {k} (t :: k). Proxy t
Proxy :: Proxy a)
sizeOf :: Std430 a -> Int
sizeOf Std430 a
_ = forall b (proxy :: * -> *). Block b => proxy b -> Int
sizeOf430 (forall {k} (t :: k). Proxy t
Proxy :: Proxy a)
peekByteOff :: forall b. Ptr b -> Int -> IO (Std430 a)
peekByteOff Ptr b
p Int
o = forall a. a -> Std430 a
Std430 forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
<$> forall b (m :: * -> *) a.
(Block b, MonadIO m) =>
Ptr a -> Diff a b -> m b
read430 Ptr b
p (forall a b. Int -> Diff a b
Diff Int
o)
pokeByteOff :: forall b. Ptr b -> Int -> Std430 a -> IO ()
pokeByteOff Ptr b
p Int
o = forall b (m :: * -> *) a.
(Block b, MonadIO m) =>
Ptr a -> Diff a b -> b -> m ()
write430 Ptr b
p (forall a b. Int -> Diff a b
Diff Int
o) forall b c a. (b -> c) -> (a -> b) -> a -> c
. forall a. Std430 a -> a
getStd430
class Block b where
alignment140 :: proxy b -> Int
default alignment140 :: GBlock (Rep b) => proxy b -> Int
alignment140 proxy b
_ = forall {k} (f :: k -> *) (p :: (k -> *) -> *).
GBlock f =>
p f -> Int
galignment140 (forall {k} (t :: k). Proxy t
Proxy :: Proxy (Rep b))
sizeOf140 :: proxy b -> Int
default sizeOf140 :: GBlock (Rep b) => proxy b -> Int
sizeOf140 proxy b
_ = forall {k} (f :: k -> *) (p :: (k -> *) -> *).
GBlock f =>
p f -> Int
gsizeOf140 (forall {k} (t :: k). Proxy t
Proxy :: Proxy (Rep b))
isStruct :: proxy b -> Bool
isStruct proxy b
_ = Bool
True
read140 :: MonadIO m => Ptr a -> Diff a b -> m b
default read140 :: (MonadIO m, Generic b, GBlock (Rep b)) => Ptr a -> Diff a b -> m b
read140 Ptr a
p (Diff Int
o) = forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO forall a b. (a -> b) -> a -> b
$ forall a x. Generic a => Rep a x -> a
to forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
<$> forall {k} (f :: k -> *) a (b :: k).
GBlock f =>
Ptr a -> Int -> IO (f b)
gread140 Ptr a
p Int
o
write140 :: MonadIO m => Ptr a -> Diff a b -> b -> m ()
default write140 :: (MonadIO m, Generic b, GBlock (Rep b)) => Ptr a -> Diff a b -> b -> m ()
write140 Ptr a
p (Diff Int
o) b
b = forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO forall a b. (a -> b) -> a -> b
$ forall {k} (f :: k -> *) a (b :: k).
GBlock f =>
Ptr a -> Int -> f b -> IO ()
gwrite140 Ptr a
p Int
o (forall a x. Generic a => a -> Rep a x
from b
b)
alignment430 :: proxy b -> Int
default alignment430 :: GBlock (Rep b) => proxy b -> Int
alignment430 proxy b
_ = forall {k} (f :: k -> *) (p :: (k -> *) -> *).
GBlock f =>
p f -> Int
galignment430 (forall {k} (t :: k). Proxy t
Proxy :: Proxy (Rep b))
sizeOf430 :: proxy b -> Int
default sizeOf430 :: GBlock (Rep b) => proxy b -> Int
sizeOf430 proxy b
_ = forall {k} (f :: k -> *) (p :: (k -> *) -> *).
GBlock f =>
p f -> Int
gsizeOf430 (forall {k} (t :: k). Proxy t
Proxy :: Proxy (Rep b))
read430 :: MonadIO m => Ptr a -> Diff a b -> m b
default read430 :: (MonadIO m, Generic b, GBlock (Rep b)) => Ptr a -> Diff a b -> m b
read430 Ptr a
p (Diff Int
o) = forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO forall a b. (a -> b) -> a -> b
$ forall a x. Generic a => Rep a x -> a
to forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
<$> forall {k} (f :: k -> *) a (b :: k).
GBlock f =>
Ptr a -> Int -> IO (f b)
gread430 Ptr a
p Int
o
write430 :: MonadIO m => Ptr a -> Diff a b -> b -> m ()
default write430 :: (MonadIO m, Generic b, GBlock (Rep b)) => Ptr a -> Diff a b -> b -> m ()
write430 Ptr a
p (Diff Int
o) b
b = forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO forall a b. (a -> b) -> a -> b
$ forall {k} (f :: k -> *) a (b :: k).
GBlock f =>
Ptr a -> Int -> f b -> IO ()
gwrite430 Ptr a
p Int
o (forall a x. Generic a => a -> Rep a x
from b
b)
type PackedSize b :: Nat
type PackedSize b = GPackedSize (Rep b)
sizeOfPacked :: proxy b -> Int
default sizeOfPacked :: KnownNat (PackedSize b) => proxy b -> Int
sizeOfPacked proxy b
_ = forall a. Num a => Integer -> a
fromInteger forall a b. (a -> b) -> a -> b
$! forall (n :: Nat) (proxy :: Nat -> *).
KnownNat n =>
proxy n -> Integer
natVal (forall {k} (t :: k). Proxy t
Proxy :: Proxy (PackedSize b))
readPacked :: MonadIO m => Ptr a -> Diff a b -> m b
default readPacked :: (MonadIO m, Generic b, GBlock (Rep b)) => Ptr a -> Diff a b -> m b
readPacked Ptr a
p (Diff Int
o) = forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO forall a b. (a -> b) -> a -> b
$ forall a x. Generic a => Rep a x -> a
to forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
<$> forall {k} (f :: k -> *) a (b :: k).
GBlock f =>
Ptr a -> Int -> IO (f b)
greadPacked Ptr a
p Int
o
writePacked :: MonadIO m => Ptr a -> Diff a b -> b -> m ()
default writePacked :: (MonadIO m, Generic b, GBlock (Rep b)) => Ptr a -> Diff a b -> b -> m ()
writePacked Ptr a
p (Diff Int
o) b
b = forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO forall a b. (a -> b) -> a -> b
$ forall {k} (f :: k -> *) a (b :: k).
GBlock f =>
Ptr a -> Int -> f b -> IO ()
gwritePacked Ptr a
p Int
o (forall a x. Generic a => a -> Rep a x
from b
b)
class GBlock f where
type GPackedSize f :: Nat
galignment140 :: p f -> Int
galignment430 :: p f -> Int
gsizeOf140 :: p f -> Int
gsizeOf430 :: p f -> Int
gsizeOfPacked :: p f -> Int
gread140 :: Ptr a -> Int -> IO (f b)
gread430 :: Ptr a -> Int -> IO (f b)
greadPacked :: Ptr a -> Int -> IO (f b)
gwrite140 :: Ptr a -> Int -> f b -> IO ()
gwrite430 :: Ptr a -> Int -> f b -> IO ()
gwritePacked :: Ptr a -> Int -> f b -> IO ()
instance GBlock U1 where
type GPackedSize U1 = 0
galignment140 :: forall (p :: (k -> *) -> *). p U1 -> Int
galignment140 p U1
_ = Int
1
gsizeOf140 :: forall (p :: (k -> *) -> *). p U1 -> Int
gsizeOf140 p U1
_ = Int
0
galignment430 :: forall (p :: (k -> *) -> *). p U1 -> Int
galignment430 p U1
_ = Int
1
gsizeOf430 :: forall (p :: (k -> *) -> *). p U1 -> Int
gsizeOf430 p U1
_ = Int
0
gsizeOfPacked :: forall (p :: (k -> *) -> *). p U1 -> Int
gsizeOfPacked p U1
_ = Int
0
gread140 :: forall a (b :: k). Ptr a -> Int -> IO (U1 b)
gread140 Ptr a
_ Int
_ = forall (m :: * -> *) a. Monad m => a -> m a
return forall k (p :: k). U1 p
U1
gread430 :: forall a (b :: k). Ptr a -> Int -> IO (U1 b)
gread430 Ptr a
_ Int
_ = forall (m :: * -> *) a. Monad m => a -> m a
return forall k (p :: k). U1 p
U1
greadPacked :: forall a (b :: k). Ptr a -> Int -> IO (U1 b)
greadPacked Ptr a
_ Int
_ = forall (m :: * -> *) a. Monad m => a -> m a
return forall k (p :: k). U1 p
U1
gwrite140 :: forall a (b :: k). Ptr a -> Int -> U1 b -> IO ()
gwrite140 Ptr a
_ Int
_ U1 b
U1 = forall (m :: * -> *) a. Monad m => a -> m a
return ()
gwrite430 :: forall a (b :: k). Ptr a -> Int -> U1 b -> IO ()
gwrite430 Ptr a
_ Int
_ U1 b
U1 = forall (m :: * -> *) a. Monad m => a -> m a
return ()
gwritePacked :: forall a (b :: k). Ptr a -> Int -> U1 b -> IO ()
gwritePacked Ptr a
_ Int
_ U1 b
U1 = forall (m :: * -> *) a. Monad m => a -> m a
return ()
instance (GBlock f, GBlock g) => GBlock (f :*: g) where
type GPackedSize (f :*: g) = GPackedSize f + GPackedSize g
gsizeOfPacked :: forall (p :: (k -> *) -> *). p (f :*: g) -> Int
gsizeOfPacked p (f :*: g)
_ =
forall {k} (f :: k -> *) (p :: (k -> *) -> *).
GBlock f =>
p f -> Int
gsizeOfPacked (forall {k} (t :: k). Proxy t
Proxy :: Proxy f) forall a. Num a => a -> a -> a
+ forall {k} (f :: k -> *) (p :: (k -> *) -> *).
GBlock f =>
p f -> Int
gsizeOfPacked (forall {k} (t :: k). Proxy t
Proxy :: Proxy g)
galignment140 :: forall (p :: (k -> *) -> *). p (f :*: g) -> Int
galignment140 p (f :*: g)
_ =
forall a. Ord a => a -> a -> a
max
(forall {k} (f :: k -> *) (p :: (k -> *) -> *).
GBlock f =>
p f -> Int
galignment140 (forall {k} (t :: k). Proxy t
Proxy :: Proxy f))
(forall {k} (f :: k -> *) (p :: (k -> *) -> *).
GBlock f =>
p f -> Int
galignment140 (forall {k} (t :: k). Proxy t
Proxy :: Proxy g))
galignment430 :: forall (p :: (k -> *) -> *). p (f :*: g) -> Int
galignment430 p (f :*: g)
_ =
forall a. Ord a => a -> a -> a
max
(forall {k} (f :: k -> *) (p :: (k -> *) -> *).
GBlock f =>
p f -> Int
galignment430 (forall {k} (t :: k). Proxy t
Proxy :: Proxy f))
(forall {k} (f :: k -> *) (p :: (k -> *) -> *).
GBlock f =>
p f -> Int
galignment430 (forall {k} (t :: k). Proxy t
Proxy :: Proxy g))
gsizeOf140 :: forall (p :: (k -> *) -> *). p (f :*: g) -> Int
gsizeOf140 p (f :*: g)
_ =
Int -> Int -> Int
roundUp
(forall {k} (f :: k -> *) (p :: (k -> *) -> *).
GBlock f =>
p f -> Int
gsizeOf140 (forall {k} (t :: k). Proxy t
Proxy :: Proxy f))
(forall {k} (f :: k -> *) (p :: (k -> *) -> *).
GBlock f =>
p f -> Int
galignment140 (forall {k} (t :: k). Proxy t
Proxy :: Proxy g))
forall a. Num a => a -> a -> a
+ forall {k} (f :: k -> *) (p :: (k -> *) -> *).
GBlock f =>
p f -> Int
gsizeOf140 (forall {k} (t :: k). Proxy t
Proxy :: Proxy g)
gsizeOf430 :: forall (p :: (k -> *) -> *). p (f :*: g) -> Int
gsizeOf430 p (f :*: g)
_ =
Int -> Int -> Int
roundUp
(forall {k} (f :: k -> *) (p :: (k -> *) -> *).
GBlock f =>
p f -> Int
gsizeOf430 (forall {k} (t :: k). Proxy t
Proxy :: Proxy f))
(forall {k} (f :: k -> *) (p :: (k -> *) -> *).
GBlock f =>
p f -> Int
galignment430 (forall {k} (t :: k). Proxy t
Proxy :: Proxy g))
forall a. Num a => a -> a -> a
+ forall {k} (f :: k -> *) (p :: (k -> *) -> *).
GBlock f =>
p f -> Int
gsizeOf430 (forall {k} (t :: k). Proxy t
Proxy :: Proxy g)
gread140 :: forall a (b :: k). Ptr a -> Int -> IO ((:*:) f g b)
gread140 Ptr a
p Int
o = forall k (f :: k -> *) (g :: k -> *) (p :: k).
f p -> g p -> (:*:) f g p
(:*:)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
<$> forall {k} (f :: k -> *) a (b :: k).
GBlock f =>
Ptr a -> Int -> IO (f b)
gread140 Ptr a
p Int
o
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
<*> forall {k} (f :: k -> *) a (b :: k).
GBlock f =>
Ptr a -> Int -> IO (f b)
gread140 Ptr a
p (Int
o forall a. Num a => a -> a -> a
+ Int -> Int -> Int
roundUp (forall {k} (f :: k -> *) (p :: (k -> *) -> *).
GBlock f =>
p f -> Int
gsizeOf140 (forall {k} (t :: k). Proxy t
Proxy :: Proxy f)) (forall {k} (f :: k -> *) (p :: (k -> *) -> *).
GBlock f =>
p f -> Int
galignment140 (forall {k} (t :: k). Proxy t
Proxy :: Proxy g)))
gread430 :: forall a (b :: k). Ptr a -> Int -> IO ((:*:) f g b)
gread430 Ptr a
p Int
o = forall k (f :: k -> *) (g :: k -> *) (p :: k).
f p -> g p -> (:*:) f g p
(:*:)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
<$> forall {k} (f :: k -> *) a (b :: k).
GBlock f =>
Ptr a -> Int -> IO (f b)
gread430 Ptr a
p Int
o
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
<*> forall {k} (f :: k -> *) a (b :: k).
GBlock f =>
Ptr a -> Int -> IO (f b)
gread430 Ptr a
p (Int
o forall a. Num a => a -> a -> a
+ Int -> Int -> Int
roundUp (forall {k} (f :: k -> *) (p :: (k -> *) -> *).
GBlock f =>
p f -> Int
gsizeOf430 (forall {k} (t :: k). Proxy t
Proxy :: Proxy f)) (forall {k} (f :: k -> *) (p :: (k -> *) -> *).
GBlock f =>
p f -> Int
galignment430 (forall {k} (t :: k). Proxy t
Proxy :: Proxy g)))
greadPacked :: forall a (b :: k). Ptr a -> Int -> IO ((:*:) f g b)
greadPacked Ptr a
p Int
o = forall k (f :: k -> *) (g :: k -> *) (p :: k).
f p -> g p -> (:*:) f g p
(:*:)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
<$> forall {k} (f :: k -> *) a (b :: k).
GBlock f =>
Ptr a -> Int -> IO (f b)
greadPacked Ptr a
p Int
o
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
<*> forall {k} (f :: k -> *) a (b :: k).
GBlock f =>
Ptr a -> Int -> IO (f b)
greadPacked Ptr a
p (Int
o forall a. Num a => a -> a -> a
+ forall {k} (f :: k -> *) (p :: (k -> *) -> *).
GBlock f =>
p f -> Int
gsizeOfPacked (forall {k} (t :: k). Proxy t
Proxy :: Proxy f))
gwrite140 :: forall a (b :: k). Ptr a -> Int -> (:*:) f g b -> IO ()
gwrite140 Ptr a
p Int
o (f b
a :*: g b
b) = do
forall {k} (f :: k -> *) a (b :: k).
GBlock f =>
Ptr a -> Int -> f b -> IO ()
gwrite140 Ptr a
p Int
o f b
a
forall {k} (f :: k -> *) a (b :: k).
GBlock f =>
Ptr a -> Int -> f b -> IO ()
gwrite140 Ptr a
p (Int
o forall a. Num a => a -> a -> a
+ Int -> Int -> Int
roundUp (forall {k} (f :: k -> *) (p :: (k -> *) -> *).
GBlock f =>
p f -> Int
gsizeOf140 (forall {k} (t :: k). Proxy t
Proxy :: Proxy f)) (forall {k} (f :: k -> *) (p :: (k -> *) -> *).
GBlock f =>
p f -> Int
galignment140 (forall {k} (t :: k). Proxy t
Proxy :: Proxy g))) g b
b
gwrite430 :: forall a (b :: k). Ptr a -> Int -> (:*:) f g b -> IO ()
gwrite430 Ptr a
p Int
o (f b
a :*: g b
b) = do
forall {k} (f :: k -> *) a (b :: k).
GBlock f =>
Ptr a -> Int -> f b -> IO ()
gwrite430 Ptr a
p Int
o f b
a
forall {k} (f :: k -> *) a (b :: k).
GBlock f =>
Ptr a -> Int -> f b -> IO ()
gwrite430 Ptr a
p (Int
o forall a. Num a => a -> a -> a
+ Int -> Int -> Int
roundUp (forall {k} (f :: k -> *) (p :: (k -> *) -> *).
GBlock f =>
p f -> Int
gsizeOf430 (forall {k} (t :: k). Proxy t
Proxy :: Proxy f)) (forall {k} (f :: k -> *) (p :: (k -> *) -> *).
GBlock f =>
p f -> Int
galignment430 (forall {k} (t :: k). Proxy t
Proxy :: Proxy g))) g b
b
gwritePacked :: forall a (b :: k). Ptr a -> Int -> (:*:) f g b -> IO ()
gwritePacked Ptr a
p Int
o (f b
a :*: g b
b) = do
forall {k} (f :: k -> *) a (b :: k).
GBlock f =>
Ptr a -> Int -> f b -> IO ()
gwritePacked Ptr a
p Int
o f b
a
forall {k} (f :: k -> *) a (b :: k).
GBlock f =>
Ptr a -> Int -> f b -> IO ()
gwritePacked Ptr a
p (Int
o forall a. Num a => a -> a -> a
+ forall {k} (f :: k -> *) (p :: (k -> *) -> *).
GBlock f =>
p f -> Int
gsizeOfPacked (forall {k} (t :: k). Proxy t
Proxy :: Proxy f)) g b
b
instance GBlock f => GBlock (M1 S c f) where
type GPackedSize (M1 S c f) = GPackedSize f
galignment140 :: forall (p :: (k -> *) -> *). p (M1 S c f) -> Int
galignment140 p (M1 S c f)
_ = forall {k} (f :: k -> *) (p :: (k -> *) -> *).
GBlock f =>
p f -> Int
galignment140 (forall {k} (t :: k). Proxy t
Proxy :: Proxy f)
galignment430 :: forall (p :: (k -> *) -> *). p (M1 S c f) -> Int
galignment430 p (M1 S c f)
_ = forall {k} (f :: k -> *) (p :: (k -> *) -> *).
GBlock f =>
p f -> Int
galignment430 (forall {k} (t :: k). Proxy t
Proxy :: Proxy f)
gsizeOf140 :: forall (p :: (k -> *) -> *). p (M1 S c f) -> Int
gsizeOf140 p (M1 S c f)
_ = forall {k} (f :: k -> *) (p :: (k -> *) -> *).
GBlock f =>
p f -> Int
gsizeOf140 (forall {k} (t :: k). Proxy t
Proxy :: Proxy f)
gsizeOf430 :: forall (p :: (k -> *) -> *). p (M1 S c f) -> Int
gsizeOf430 p (M1 S c f)
_ = forall {k} (f :: k -> *) (p :: (k -> *) -> *).
GBlock f =>
p f -> Int
gsizeOf430 (forall {k} (t :: k). Proxy t
Proxy :: Proxy f)
gsizeOfPacked :: forall (p :: (k -> *) -> *). p (M1 S c f) -> Int
gsizeOfPacked p (M1 S c f)
_ = forall {k} (f :: k -> *) (p :: (k -> *) -> *).
GBlock f =>
p f -> Int
gsizeOfPacked (forall {k} (t :: k). Proxy t
Proxy :: Proxy f)
gread140 :: forall a (b :: k). Ptr a -> Int -> IO (M1 S c f b)
gread140 Ptr a
p Int
o = forall k i (c :: Meta) (f :: k -> *) (p :: k). f p -> M1 i c f p
M1 forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
<$> forall {k} (f :: k -> *) a (b :: k).
GBlock f =>
Ptr a -> Int -> IO (f b)
gread140 Ptr a
p Int
o
gread430 :: forall a (b :: k). Ptr a -> Int -> IO (M1 S c f b)
gread430 Ptr a
p Int
o = forall k i (c :: Meta) (f :: k -> *) (p :: k). f p -> M1 i c f p
M1 forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
<$> forall {k} (f :: k -> *) a (b :: k).
GBlock f =>
Ptr a -> Int -> IO (f b)
gread430 Ptr a
p Int
o
greadPacked :: forall a (b :: k). Ptr a -> Int -> IO (M1 S c f b)
greadPacked Ptr a
p Int
o = forall k i (c :: Meta) (f :: k -> *) (p :: k). f p -> M1 i c f p
M1 forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
<$> forall {k} (f :: k -> *) a (b :: k).
GBlock f =>
Ptr a -> Int -> IO (f b)
greadPacked Ptr a
p Int
o
gwrite140 :: forall a (b :: k). Ptr a -> Int -> M1 S c f b -> IO ()
gwrite140 Ptr a
p Int
o (M1 f b
a) = forall {k} (f :: k -> *) a (b :: k).
GBlock f =>
Ptr a -> Int -> f b -> IO ()
gwrite140 Ptr a
p Int
o f b
a
gwrite430 :: forall a (b :: k). Ptr a -> Int -> M1 S c f b -> IO ()
gwrite430 Ptr a
p Int
o (M1 f b
a) = forall {k} (f :: k -> *) a (b :: k).
GBlock f =>
Ptr a -> Int -> f b -> IO ()
gwrite430 Ptr a
p Int
o f b
a
gwritePacked :: forall a (b :: k). Ptr a -> Int -> M1 S c f b -> IO ()
gwritePacked Ptr a
p Int
o (M1 f b
a) = forall {k} (f :: k -> *) a (b :: k).
GBlock f =>
Ptr a -> Int -> f b -> IO ()
gwritePacked Ptr a
p Int
o f b
a
instance GBlock f => GBlock (M1 C c f) where
type GPackedSize (M1 C c f) = GPackedSize f
galignment140 :: forall (p :: (k -> *) -> *). p (M1 C c f) -> Int
galignment140 p (M1 C c f)
_ = forall a. Integral a => a -> a -> a
lcm Int
16 forall a b. (a -> b) -> a -> b
$ forall {k} (f :: k -> *) (p :: (k -> *) -> *).
GBlock f =>
p f -> Int
galignment140 (forall {k} (t :: k). Proxy t
Proxy :: Proxy f)
galignment430 :: forall (p :: (k -> *) -> *). p (M1 C c f) -> Int
galignment430 p (M1 C c f)
_ = forall {k} (f :: k -> *) (p :: (k -> *) -> *).
GBlock f =>
p f -> Int
galignment430 (forall {k} (t :: k). Proxy t
Proxy :: Proxy f)
gsizeOf140 :: forall (p :: (k -> *) -> *). p (M1 C c f) -> Int
gsizeOf140 p (M1 C c f)
_ = Int -> Int -> Int
roundUp (forall {k} (f :: k -> *) (p :: (k -> *) -> *).
GBlock f =>
p f -> Int
gsizeOf140 (forall {k} (t :: k). Proxy t
Proxy :: Proxy f)) (forall {k} (f :: k -> *) (p :: (k -> *) -> *).
GBlock f =>
p f -> Int
galignment140 (forall {k} (t :: k). Proxy t
Proxy :: Proxy f))
gsizeOf430 :: forall (p :: (k -> *) -> *). p (M1 C c f) -> Int
gsizeOf430 p (M1 C c f)
_ = Int -> Int -> Int
roundUp (forall {k} (f :: k -> *) (p :: (k -> *) -> *).
GBlock f =>
p f -> Int
gsizeOf430 (forall {k} (t :: k). Proxy t
Proxy :: Proxy f)) (forall {k} (f :: k -> *) (p :: (k -> *) -> *).
GBlock f =>
p f -> Int
galignment430 (forall {k} (t :: k). Proxy t
Proxy :: Proxy f))
gsizeOfPacked :: forall (p :: (k -> *) -> *). p (M1 C c f) -> Int
gsizeOfPacked p (M1 C c f)
_ = forall {k} (f :: k -> *) (p :: (k -> *) -> *).
GBlock f =>
p f -> Int
gsizeOfPacked (forall {k} (t :: k). Proxy t
Proxy :: Proxy f)
gread140 :: forall a (b :: k). Ptr a -> Int -> IO (M1 C c f b)
gread140 Ptr a
p Int
o = forall k i (c :: Meta) (f :: k -> *) (p :: k). f p -> M1 i c f p
M1 forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
<$> forall {k} (f :: k -> *) a (b :: k).
GBlock f =>
Ptr a -> Int -> IO (f b)
gread140 Ptr a
p Int
o
gread430 :: forall a (b :: k). Ptr a -> Int -> IO (M1 C c f b)
gread430 Ptr a
p Int
o = forall k i (c :: Meta) (f :: k -> *) (p :: k). f p -> M1 i c f p
M1 forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
<$> forall {k} (f :: k -> *) a (b :: k).
GBlock f =>
Ptr a -> Int -> IO (f b)
gread430 Ptr a
p Int
o
greadPacked :: forall a (b :: k). Ptr a -> Int -> IO (M1 C c f b)
greadPacked Ptr a
p Int
o = forall k i (c :: Meta) (f :: k -> *) (p :: k). f p -> M1 i c f p
M1 forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
<$> forall {k} (f :: k -> *) a (b :: k).
GBlock f =>
Ptr a -> Int -> IO (f b)
greadPacked Ptr a
p Int
o
gwrite140 :: forall a (b :: k). Ptr a -> Int -> M1 C c f b -> IO ()
gwrite140 Ptr a
p Int
o (M1 f b
a) = forall {k} (f :: k -> *) a (b :: k).
GBlock f =>
Ptr a -> Int -> f b -> IO ()
gwrite140 Ptr a
p Int
o f b
a
gwrite430 :: forall a (b :: k). Ptr a -> Int -> M1 C c f b -> IO ()
gwrite430 Ptr a
p Int
o (M1 f b
a) = forall {k} (f :: k -> *) a (b :: k).
GBlock f =>
Ptr a -> Int -> f b -> IO ()
gwrite430 Ptr a
p Int
o f b
a
gwritePacked :: forall a (b :: k). Ptr a -> Int -> M1 C c f b -> IO ()
gwritePacked Ptr a
p Int
o (M1 f b
a) = forall {k} (f :: k -> *) a (b :: k).
GBlock f =>
Ptr a -> Int -> f b -> IO ()
gwritePacked Ptr a
p Int
o f b
a
instance GBlock f => GBlock (M1 D c f) where
type GPackedSize (M1 D c f) = GPackedSize f
galignment140 :: forall (p :: (k -> *) -> *). p (M1 D c f) -> Int
galignment140 p (M1 D c f)
_ = forall {k} (f :: k -> *) (p :: (k -> *) -> *).
GBlock f =>
p f -> Int
galignment140 (forall {k} (t :: k). Proxy t
Proxy :: Proxy f)
galignment430 :: forall (p :: (k -> *) -> *). p (M1 D c f) -> Int
galignment430 p (M1 D c f)
_ = forall {k} (f :: k -> *) (p :: (k -> *) -> *).
GBlock f =>
p f -> Int
galignment430 (forall {k} (t :: k). Proxy t
Proxy :: Proxy f)
gsizeOf140 :: forall (p :: (k -> *) -> *). p (M1 D c f) -> Int
gsizeOf140 p (M1 D c f)
_ = forall {k} (f :: k -> *) (p :: (k -> *) -> *).
GBlock f =>
p f -> Int
gsizeOf140 (forall {k} (t :: k). Proxy t
Proxy :: Proxy f)
gsizeOf430 :: forall (p :: (k -> *) -> *). p (M1 D c f) -> Int
gsizeOf430 p (M1 D c f)
_ = forall {k} (f :: k -> *) (p :: (k -> *) -> *).
GBlock f =>
p f -> Int
gsizeOf430 (forall {k} (t :: k). Proxy t
Proxy :: Proxy f)
gsizeOfPacked :: forall (p :: (k -> *) -> *). p (M1 D c f) -> Int
gsizeOfPacked p (M1 D c f)
_ = forall {k} (f :: k -> *) (p :: (k -> *) -> *).
GBlock f =>
p f -> Int
gsizeOfPacked (forall {k} (t :: k). Proxy t
Proxy :: Proxy f)
gread140 :: forall a (b :: k). Ptr a -> Int -> IO (M1 D c f b)
gread140 Ptr a
p Int
o = forall k i (c :: Meta) (f :: k -> *) (p :: k). f p -> M1 i c f p
M1 forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
<$> forall {k} (f :: k -> *) a (b :: k).
GBlock f =>
Ptr a -> Int -> IO (f b)
gread140 Ptr a
p Int
o
gread430 :: forall a (b :: k). Ptr a -> Int -> IO (M1 D c f b)
gread430 Ptr a
p Int
o = forall k i (c :: Meta) (f :: k -> *) (p :: k). f p -> M1 i c f p
M1 forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
<$> forall {k} (f :: k -> *) a (b :: k).
GBlock f =>
Ptr a -> Int -> IO (f b)
gread430 Ptr a
p Int
o
greadPacked :: forall a (b :: k). Ptr a -> Int -> IO (M1 D c f b)
greadPacked Ptr a
p Int
o = forall k i (c :: Meta) (f :: k -> *) (p :: k). f p -> M1 i c f p
M1 forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
<$> forall {k} (f :: k -> *) a (b :: k).
GBlock f =>
Ptr a -> Int -> IO (f b)
greadPacked Ptr a
p Int
o
gwrite140 :: forall a (b :: k). Ptr a -> Int -> M1 D c f b -> IO ()
gwrite140 Ptr a
p Int
o (M1 f b
a) = forall {k} (f :: k -> *) a (b :: k).
GBlock f =>
Ptr a -> Int -> f b -> IO ()
gwrite140 Ptr a
p Int
o f b
a
gwrite430 :: forall a (b :: k). Ptr a -> Int -> M1 D c f b -> IO ()
gwrite430 Ptr a
p Int
o (M1 f b
a) = forall {k} (f :: k -> *) a (b :: k).
GBlock f =>
Ptr a -> Int -> f b -> IO ()
gwrite430 Ptr a
p Int
o f b
a
gwritePacked :: forall a (b :: k). Ptr a -> Int -> M1 D c f b -> IO ()
gwritePacked Ptr a
p Int
o (M1 f b
a) = forall {k} (f :: k -> *) a (b :: k).
GBlock f =>
Ptr a -> Int -> f b -> IO ()
gwritePacked Ptr a
p Int
o f b
a
instance Block c => GBlock (K1 i c) where
type GPackedSize (K1 i c) = PackedSize c
galignment140 :: forall (p :: (k -> *) -> *). p (K1 i c) -> Int
galignment140 p (K1 i c)
_ = forall b (proxy :: * -> *). Block b => proxy b -> Int
alignment140 (forall {k} (t :: k). Proxy t
Proxy :: Proxy c)
galignment430 :: forall (p :: (k -> *) -> *). p (K1 i c) -> Int
galignment430 p (K1 i c)
_ = forall b (proxy :: * -> *). Block b => proxy b -> Int
alignment430 (forall {k} (t :: k). Proxy t
Proxy :: Proxy c)
gsizeOf140 :: forall (p :: (k -> *) -> *). p (K1 i c) -> Int
gsizeOf140 p (K1 i c)
_ = forall b (proxy :: * -> *). Block b => proxy b -> Int
sizeOf140 (forall {k} (t :: k). Proxy t
Proxy :: Proxy c)
gsizeOf430 :: forall (p :: (k -> *) -> *). p (K1 i c) -> Int
gsizeOf430 p (K1 i c)
_ = forall b (proxy :: * -> *). Block b => proxy b -> Int
sizeOf430 (forall {k} (t :: k). Proxy t
Proxy :: Proxy c)
gsizeOfPacked :: forall (p :: (k -> *) -> *). p (K1 i c) -> Int
gsizeOfPacked p (K1 i c)
_ = forall b (proxy :: * -> *). Block b => proxy b -> Int
sizeOfPacked (forall {k} (t :: k). Proxy t
Proxy :: Proxy c)
gread140 :: forall a (b :: k). Ptr a -> Int -> IO (K1 i c b)
gread140 Ptr a
p Int
o = forall k i c (p :: k). c -> K1 i c p
K1 forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
<$> forall b (m :: * -> *) a.
(Block b, MonadIO m) =>
Ptr a -> Diff a b -> m b
read140 Ptr a
p (forall a b. Int -> Diff a b
Diff Int
o)
gread430 :: forall a (b :: k). Ptr a -> Int -> IO (K1 i c b)
gread430 Ptr a
p Int
o = forall k i c (p :: k). c -> K1 i c p
K1 forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
<$> forall b (m :: * -> *) a.
(Block b, MonadIO m) =>
Ptr a -> Diff a b -> m b
read430 Ptr a
p (forall a b. Int -> Diff a b
Diff Int
o)
greadPacked :: forall a (b :: k). Ptr a -> Int -> IO (K1 i c b)
greadPacked Ptr a
p Int
o = forall k i c (p :: k). c -> K1 i c p
K1 forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
<$> forall b (m :: * -> *) a.
(Block b, MonadIO m) =>
Ptr a -> Diff a b -> m b
readPacked Ptr a
p (forall a b. Int -> Diff a b
Diff Int
o)
gwrite140 :: forall a (b :: k). Ptr a -> Int -> K1 i c b -> IO ()
gwrite140 Ptr a
p Int
o (K1 c
a) = forall b (m :: * -> *) a.
(Block b, MonadIO m) =>
Ptr a -> Diff a b -> b -> m ()
write140 Ptr a
p (forall a b. Int -> Diff a b
Diff Int
o) c
a
gwrite430 :: forall a (b :: k). Ptr a -> Int -> K1 i c b -> IO ()
gwrite430 Ptr a
p Int
o (K1 c
a) = forall b (m :: * -> *) a.
(Block b, MonadIO m) =>
Ptr a -> Diff a b -> b -> m ()
write430 Ptr a
p (forall a b. Int -> Diff a b
Diff Int
o) c
a
gwritePacked :: forall a (b :: k). Ptr a -> Int -> K1 i c b -> IO ()
gwritePacked Ptr a
p Int
o (K1 c
a) = forall b (m :: * -> *) a.
(Block b, MonadIO m) =>
Ptr a -> Diff a b -> b -> m ()
writePacked Ptr a
p (forall a b. Int -> Diff a b
Diff Int
o) c
a
toBool :: Int32 -> Bool
toBool :: Int32 -> Bool
toBool Int32
0 = Bool
False
toBool Int32
_ = Bool
True
fromBool :: Bool -> Int32
fromBool :: Bool -> Int32
fromBool Bool
False = Int32
0
fromBool Bool
True = Int32
1
instance Block Bool where
type PackedSize Bool = 4
alignment140 :: forall (proxy :: * -> *). proxy Bool -> Int
alignment140 proxy Bool
_ = Int
4
sizeOf140 :: forall (proxy :: * -> *). proxy Bool -> Int
sizeOf140 = forall b (proxy :: * -> *). Block b => proxy b -> Int
sizeOfPacked
alignment430 :: forall (proxy :: * -> *). proxy Bool -> Int
alignment430 = forall b (proxy :: * -> *). Block b => proxy b -> Int
alignment140
sizeOf430 :: forall (proxy :: * -> *). proxy Bool -> Int
sizeOf430 = forall b (proxy :: * -> *). Block b => proxy b -> Int
sizeOf140
isStruct :: forall (proxy :: * -> *). proxy Bool -> Bool
isStruct proxy Bool
_ = Bool
False
read140 :: forall (m :: * -> *) a. MonadIO m => Ptr a -> Diff a Bool -> m Bool
read140 Ptr a
p (Diff Int
d) = forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
fmap Int32 -> Bool
toBool forall a b. (a -> b) -> a -> b
$ forall (m :: * -> *) b a.
(MonadIO m, Storable b) =>
Ptr a -> Diff a b -> m b
peekDiffOff Ptr a
p (forall a b. Int -> Diff a b
Diff Int
d)
write140 :: forall (m :: * -> *) a.
MonadIO m =>
Ptr a -> Diff a Bool -> Bool -> m ()
write140 Ptr a
p (Diff Int
d) = forall (m :: * -> *) b a.
(MonadIO m, Storable b) =>
Ptr a -> Diff a b -> b -> m ()
pokeDiffOff Ptr a
p (forall a b. Int -> Diff a b
Diff Int
d) forall b c a. (b -> c) -> (a -> b) -> a -> c
. Bool -> Int32
fromBool
read430 :: forall (m :: * -> *) a. MonadIO m => Ptr a -> Diff a Bool -> m Bool
read430 = forall b (m :: * -> *) a.
(Block b, MonadIO m) =>
Ptr a -> Diff a b -> m b
read140
write430 :: forall (m :: * -> *) a.
MonadIO m =>
Ptr a -> Diff a Bool -> Bool -> m ()
write430 = forall b (m :: * -> *) a.
(Block b, MonadIO m) =>
Ptr a -> Diff a b -> b -> m ()
write140
readPacked :: forall (m :: * -> *) a. MonadIO m => Ptr a -> Diff a Bool -> m Bool
readPacked = forall b (m :: * -> *) a.
(Block b, MonadIO m) =>
Ptr a -> Diff a b -> m b
read140
writePacked :: forall (m :: * -> *) a.
MonadIO m =>
Ptr a -> Diff a Bool -> Bool -> m ()
writePacked = forall b (m :: * -> *) a.
(Block b, MonadIO m) =>
Ptr a -> Diff a b -> b -> m ()
write140
{-# INLINE alignment140 #-}
{-# INLINE sizeOf140 #-}
{-# INLINE alignment430 #-}
{-# INLINE sizeOf430 #-}
{-# INLINE isStruct #-}
{-# INLINE read140 #-}
{-# INLINE write140 #-}
{-# INLINE read430 #-}
{-# INLINE write430 #-}
{-# INLINE readPacked #-}
{-# INLINE writePacked #-}
instance Block Int32 where
type PackedSize Int32 = 4
alignment140 :: forall (proxy :: * -> *). proxy Int32 -> Int
alignment140 proxy Int32
_ = Int
4
sizeOf140 :: forall (proxy :: * -> *). proxy Int32 -> Int
sizeOf140 = forall b (proxy :: * -> *). Block b => proxy b -> Int
sizeOfPacked
alignment430 :: forall (proxy :: * -> *). proxy Int32 -> Int
alignment430 = forall b (proxy :: * -> *). Block b => proxy b -> Int
alignment140
sizeOf430 :: forall (proxy :: * -> *). proxy Int32 -> Int
sizeOf430 = forall b (proxy :: * -> *). Block b => proxy b -> Int
sizeOf140
isStruct :: forall (proxy :: * -> *). proxy Int32 -> Bool
isStruct proxy Int32
_ = Bool
False
read140 :: forall (m :: * -> *) a.
MonadIO m =>
Ptr a -> Diff a Int32 -> m Int32
read140 = forall (m :: * -> *) b a.
(MonadIO m, Storable b) =>
Ptr a -> Diff a b -> m b
peekDiffOff
write140 :: forall (m :: * -> *) a.
MonadIO m =>
Ptr a -> Diff a Int32 -> Int32 -> m ()
write140 = forall (m :: * -> *) b a.
(MonadIO m, Storable b) =>
Ptr a -> Diff a b -> b -> m ()
pokeDiffOff
read430 :: forall (m :: * -> *) a.
MonadIO m =>
Ptr a -> Diff a Int32 -> m Int32
read430 = forall b (m :: * -> *) a.
(Block b, MonadIO m) =>
Ptr a -> Diff a b -> m b
read140
write430 :: forall (m :: * -> *) a.
MonadIO m =>
Ptr a -> Diff a Int32 -> Int32 -> m ()
write430 = forall b (m :: * -> *) a.
(Block b, MonadIO m) =>
Ptr a -> Diff a b -> b -> m ()
write140
readPacked :: forall (m :: * -> *) a.
MonadIO m =>
Ptr a -> Diff a Int32 -> m Int32
readPacked = forall b (m :: * -> *) a.
(Block b, MonadIO m) =>
Ptr a -> Diff a b -> m b
read140
writePacked :: forall (m :: * -> *) a.
MonadIO m =>
Ptr a -> Diff a Int32 -> Int32 -> m ()
writePacked = forall b (m :: * -> *) a.
(Block b, MonadIO m) =>
Ptr a -> Diff a b -> b -> m ()
write140
{-# INLINE alignment140 #-}
{-# INLINE sizeOf140 #-}
{-# INLINE alignment430 #-}
{-# INLINE sizeOf430 #-}
{-# INLINE isStruct #-}
{-# INLINE read140 #-}
{-# INLINE write140 #-}
{-# INLINE read430 #-}
{-# INLINE write430 #-}
{-# INLINE readPacked #-}
{-# INLINE writePacked #-}
instance Block Word32 where
type PackedSize Word32 = 4
alignment140 :: forall (proxy :: * -> *). proxy Word32 -> Int
alignment140 proxy Word32
_ = Int
4
sizeOf140 :: forall (proxy :: * -> *). proxy Word32 -> Int
sizeOf140 = forall b (proxy :: * -> *). Block b => proxy b -> Int
sizeOfPacked
alignment430 :: forall (proxy :: * -> *). proxy Word32 -> Int
alignment430 = forall b (proxy :: * -> *). Block b => proxy b -> Int
alignment140
sizeOf430 :: forall (proxy :: * -> *). proxy Word32 -> Int
sizeOf430 = forall b (proxy :: * -> *). Block b => proxy b -> Int
sizeOf140
isStruct :: forall (proxy :: * -> *). proxy Word32 -> Bool
isStruct proxy Word32
_ = Bool
False
read140 :: forall (m :: * -> *) a.
MonadIO m =>
Ptr a -> Diff a Word32 -> m Word32
read140 = forall (m :: * -> *) b a.
(MonadIO m, Storable b) =>
Ptr a -> Diff a b -> m b
peekDiffOff
write140 :: forall (m :: * -> *) a.
MonadIO m =>
Ptr a -> Diff a Word32 -> Word32 -> m ()
write140 = forall (m :: * -> *) b a.
(MonadIO m, Storable b) =>
Ptr a -> Diff a b -> b -> m ()
pokeDiffOff
read430 :: forall (m :: * -> *) a.
MonadIO m =>
Ptr a -> Diff a Word32 -> m Word32
read430 = forall b (m :: * -> *) a.
(Block b, MonadIO m) =>
Ptr a -> Diff a b -> m b
read140
write430 :: forall (m :: * -> *) a.
MonadIO m =>
Ptr a -> Diff a Word32 -> Word32 -> m ()
write430 = forall b (m :: * -> *) a.
(Block b, MonadIO m) =>
Ptr a -> Diff a b -> b -> m ()
write140
readPacked :: forall (m :: * -> *) a.
MonadIO m =>
Ptr a -> Diff a Word32 -> m Word32
readPacked = forall b (m :: * -> *) a.
(Block b, MonadIO m) =>
Ptr a -> Diff a b -> m b
read140
writePacked :: forall (m :: * -> *) a.
MonadIO m =>
Ptr a -> Diff a Word32 -> Word32 -> m ()
writePacked = forall b (m :: * -> *) a.
(Block b, MonadIO m) =>
Ptr a -> Diff a b -> b -> m ()
write140
{-# INLINE alignment140 #-}
{-# INLINE sizeOf140 #-}
{-# INLINE alignment430 #-}
{-# INLINE sizeOf430 #-}
{-# INLINE isStruct #-}
{-# INLINE read140 #-}
{-# INLINE write140 #-}
{-# INLINE read430 #-}
{-# INLINE write430 #-}
{-# INLINE readPacked #-}
{-# INLINE writePacked #-}
instance Block Float where
type PackedSize Float = 4
alignment140 :: forall (proxy :: * -> *). proxy Float -> Int
alignment140 proxy Float
_ = Int
4
sizeOf140 :: forall (proxy :: * -> *). proxy Float -> Int
sizeOf140 = forall b (proxy :: * -> *). Block b => proxy b -> Int
sizeOfPacked
alignment430 :: forall (proxy :: * -> *). proxy Float -> Int
alignment430 = forall b (proxy :: * -> *). Block b => proxy b -> Int
alignment140
sizeOf430 :: forall (proxy :: * -> *). proxy Float -> Int
sizeOf430 = forall b (proxy :: * -> *). Block b => proxy b -> Int
sizeOf140
isStruct :: forall (proxy :: * -> *). proxy Float -> Bool
isStruct proxy Float
_ = Bool
False
read140 :: forall (m :: * -> *) a.
MonadIO m =>
Ptr a -> Diff a Float -> m Float
read140 = forall (m :: * -> *) b a.
(MonadIO m, Storable b) =>
Ptr a -> Diff a b -> m b
peekDiffOff
write140 :: forall (m :: * -> *) a.
MonadIO m =>
Ptr a -> Diff a Float -> Float -> m ()
write140 = forall (m :: * -> *) b a.
(MonadIO m, Storable b) =>
Ptr a -> Diff a b -> b -> m ()
pokeDiffOff
read430 :: forall (m :: * -> *) a.
MonadIO m =>
Ptr a -> Diff a Float -> m Float
read430 = forall b (m :: * -> *) a.
(Block b, MonadIO m) =>
Ptr a -> Diff a b -> m b
read140
write430 :: forall (m :: * -> *) a.
MonadIO m =>
Ptr a -> Diff a Float -> Float -> m ()
write430 = forall b (m :: * -> *) a.
(Block b, MonadIO m) =>
Ptr a -> Diff a b -> b -> m ()
write140
readPacked :: forall (m :: * -> *) a.
MonadIO m =>
Ptr a -> Diff a Float -> m Float
readPacked = forall b (m :: * -> *) a.
(Block b, MonadIO m) =>
Ptr a -> Diff a b -> m b
read140
writePacked :: forall (m :: * -> *) a.
MonadIO m =>
Ptr a -> Diff a Float -> Float -> m ()
writePacked = forall b (m :: * -> *) a.
(Block b, MonadIO m) =>
Ptr a -> Diff a b -> b -> m ()
write140
{-# INLINE alignment140 #-}
{-# INLINE sizeOf140 #-}
{-# INLINE alignment430 #-}
{-# INLINE sizeOf430 #-}
{-# INLINE isStruct #-}
{-# INLINE read140 #-}
{-# INLINE write140 #-}
{-# INLINE read430 #-}
{-# INLINE write430 #-}
{-# INLINE readPacked #-}
{-# INLINE writePacked #-}
instance Block Double where
type PackedSize Double = 8
alignment140 :: forall (proxy :: * -> *). proxy Double -> Int
alignment140 proxy Double
_ = Int
8
sizeOf140 :: forall (proxy :: * -> *). proxy Double -> Int
sizeOf140 = forall b (proxy :: * -> *). Block b => proxy b -> Int
sizeOfPacked
alignment430 :: forall (proxy :: * -> *). proxy Double -> Int
alignment430 = forall b (proxy :: * -> *). Block b => proxy b -> Int
alignment140
sizeOf430 :: forall (proxy :: * -> *). proxy Double -> Int
sizeOf430 = forall b (proxy :: * -> *). Block b => proxy b -> Int
sizeOf140
isStruct :: forall (proxy :: * -> *). proxy Double -> Bool
isStruct proxy Double
_ = Bool
False
read140 :: forall (m :: * -> *) a.
MonadIO m =>
Ptr a -> Diff a Double -> m Double
read140 = forall (m :: * -> *) b a.
(MonadIO m, Storable b) =>
Ptr a -> Diff a b -> m b
peekDiffOff
write140 :: forall (m :: * -> *) a.
MonadIO m =>
Ptr a -> Diff a Double -> Double -> m ()
write140 = forall (m :: * -> *) b a.
(MonadIO m, Storable b) =>
Ptr a -> Diff a b -> b -> m ()
pokeDiffOff
read430 :: forall (m :: * -> *) a.
MonadIO m =>
Ptr a -> Diff a Double -> m Double
read430 = forall b (m :: * -> *) a.
(Block b, MonadIO m) =>
Ptr a -> Diff a b -> m b
read140
write430 :: forall (m :: * -> *) a.
MonadIO m =>
Ptr a -> Diff a Double -> Double -> m ()
write430 = forall b (m :: * -> *) a.
(Block b, MonadIO m) =>
Ptr a -> Diff a b -> b -> m ()
write140
readPacked :: forall (m :: * -> *) a.
MonadIO m =>
Ptr a -> Diff a Double -> m Double
readPacked = forall b (m :: * -> *) a.
(Block b, MonadIO m) =>
Ptr a -> Diff a b -> m b
read140
writePacked :: forall (m :: * -> *) a.
MonadIO m =>
Ptr a -> Diff a Double -> Double -> m ()
writePacked = forall b (m :: * -> *) a.
(Block b, MonadIO m) =>
Ptr a -> Diff a b -> b -> m ()
write140
{-# INLINE alignment140 #-}
{-# INLINE sizeOf140 #-}
{-# INLINE alignment430 #-}
{-# INLINE sizeOf430 #-}
{-# INLINE isStruct #-}
{-# INLINE read140 #-}
{-# INLINE write140 #-}
{-# INLINE read430 #-}
{-# INLINE write430 #-}
{-# INLINE readPacked #-}
{-# INLINE writePacked #-}
roundUp :: Int -> Int -> Int
roundUp :: Int -> Int -> Int
roundUp Int
k Int
n = Int
k forall a. Num a => a -> a -> a
+ forall a. Integral a => a -> a -> a
mod (Int
n forall a. Num a => a -> a -> a
- Int
k) Int
n
{-# INLINEABLE roundUp #-}
instance (Block a, Block b, KnownNat (PackedSize a + PackedSize b)) => Block (a, b)
instance (Block a, Block b, Block c, KnownNat (PackedSize a + (PackedSize b + PackedSize c))) => Block (a, b, c)