{-# LANGUAGE Trustworthy, CPP, MagicHash, UnboxedTuples, BangPatterns #-}
{-# LANGUAGE FlexibleInstances, FlexibleContexts, TypeOperators #-}

{- |
    Module      :  SDP.Unboxed
    Copyright   :  (c) Andrey Mulik 2019-2021
    License     :  BSD-style
    Maintainer  :  work.a.mulik@gmail.com
    Portability :  non-portable (GHC extensions)
    
    "SDP.Unboxed" provide service class 'Unboxed', that needed for
    "SDP.Prim.SBytes"-based structures.
-}
module SDP.Unboxed
(
  -- * Unboxed
  Unboxed (..), cloneUnboxed#, cloneUnboxedM#, thawUnboxed#, freezeUnboxed#,
  
  -- ** Kind @(Type -> Type)@ proxies
  fromProxy, psizeof#, psizeof, pnewUnboxed, pcopyUnboxed, pcopyUnboxedM,
  pcloneUnboxed, pcloneUnboxedM, pthawUnboxed, pfreezeUnboxed,
  
  -- ** Kind @(Type -> Type -> Type)@ proxies
  fromProxy1, pnewUnboxed1, pcloneUnboxed1, pcopyUnboxed1, pcopyUnboxedM1,
  cloneUnboxed1#, pcloneUnboxedM1,
  
  -- Wrap helper
  Wrap (..), lzero#, single#, fromList#, fromFoldable#, fromListN#,
  newLinear#, newLinearN#, fromFoldableM#, concat#, pconcat
)
where

import Prelude ()
import SDP.SafePrelude
import SDP.Nullable
import SDP.Finite
import SDP.Shape
import SDP.Ratio

import GHC.Stable
import GHC.Base   hiding ( (.), foldr )
import GHC.Word
import GHC.Int
import GHC.Ptr
import GHC.ST

import Data.Complex

import Foreign.C.Types

#include "MachDeps.h"

default ()

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

{- |
  'Unboxed' is a layer between untyped raw data and parameterized unboxed data
  structures. Also it prevents direct interaction with primitives.
-}
class (Eq e) => Unboxed e
  where
    {-# MINIMAL (sizeof#|sizeof), (!#), (!>#), writeByteArray#, newUnboxed #-}
    
    {- |
      @sizeof e n@ returns the length (in bytes) of primitive, where @n@ - count
      of elements, @e@ - type parameter.
    -}
    {-# INLINE sizeof #-}
    sizeof :: e -> Int -> Int
    sizeof e
e (I# Int#
c#) = Int# -> Int
I# (e -> Int# -> Int#
forall e. Unboxed e => e -> Int# -> Int#
sizeof# e
e Int#
c#)
    
    -- | 'sizeof#' is unboxed 'sizeof'.
    {-# INLINE sizeof# #-}
    sizeof# :: e -> Int# -> Int#
    sizeof# e
e Int#
c# = case e -> Int -> Int
forall e. Unboxed e => e -> Int -> Int
sizeof e
e (Int# -> Int
I# Int#
c#) of I# Int#
n# -> Int#
n#
    
    -- | Unsafe 'ByteArray#' reader with overloaded result type.
    (!#) :: ByteArray# -> Int# -> e
    
    -- | Unsafe 'MutableByteArray#' reader with overloaded result type.
    (!>#) :: MutableByteArray# s -> Int# -> State# s -> (# State# s, e #)
    
    -- | Unsafe 'MutableByteArray#' writer.
    writeByteArray# :: MutableByteArray# s -> Int# -> e -> State# s -> State# s
    
    {-# INLINE fillByteArray# #-}
    -- | Procedure for filling the array with the default value (like calloc).
    fillByteArray# :: MutableByteArray# s -> Int# -> e -> State# s -> State# s
    fillByteArray# MutableByteArray# s
mbytes# Int#
n# e
e = Int# -> Int
I# Int#
n# Int -> Int -> Bool
forall a. Ord a => a -> a -> Bool
> Int
0 Bool
-> (State# s -> State# s)
-> (State# s -> State# s)
-> State# s
-> State# s
forall a. Bool -> a -> a -> a
? Int# -> State# s -> State# s
go (Int#
n# Int# -> Int# -> Int#
-# Int#
1#) ((State# s -> State# s) -> State# s -> State# s)
-> (State# s -> State# s) -> State# s -> State# s
forall a b. (a -> b) -> a -> b
$ \ State# s
s1# -> State# s
s1#
      where
        go :: Int# -> State# s -> State# s
go Int#
0# State# s
s2# = MutableByteArray# s -> Int# -> e -> State# s -> State# s
forall e s.
Unboxed e =>
MutableByteArray# s -> Int# -> e -> State# s -> State# s
writeByteArray# MutableByteArray# s
mbytes# Int#
0# e
e State# s
s2#
        go Int#
c# State# s
s2# = Int# -> State# s -> State# s
go (Int#
c# Int# -> Int# -> Int#
-# Int#
1#) (MutableByteArray# s -> Int# -> e -> State# s -> State# s
forall e s.
Unboxed e =>
MutableByteArray# s -> Int# -> e -> State# s -> State# s
writeByteArray# MutableByteArray# s
mbytes# Int#
c# e
e State# s
s2#)
    
    {- |
      'newUnboxed' creates new 'MutableByteArray#' of given count of elements.
      First argument used as type variable.
    -}
    newUnboxed :: e -> Int# -> State# s -> (# State# s, MutableByteArray# s #)
    
    {-# INLINE newUnboxed' #-}
    {- |
      'newUnboxed'' is version of 'newUnboxed', that use first argument as
      initial value. May fail when trying to write 'error' or 'undefined'.
    -}
    newUnboxed' :: e -> Int# -> State# s -> (# State# s, MutableByteArray# s #)
    newUnboxed' e
e Int#
n# = \ State# s
s1# -> case Int# -> State# s -> (# State# s, MutableByteArray# s #)
forall d. Int# -> State# d -> (# State# d, MutableByteArray# d #)
newByteArray# (e -> Int# -> Int#
forall e. Unboxed e => e -> Int# -> Int#
sizeof# e
e Int#
n#) State# s
s1# of
      (# State# s
s2#, MutableByteArray# s
mbytes# #) -> case MutableByteArray# s -> Int# -> e -> State# s -> State# s
forall e s.
Unboxed e =>
MutableByteArray# s -> Int# -> e -> State# s -> State# s
fillByteArray# MutableByteArray# s
mbytes# Int#
n# e
e State# s
s2# of
        State# s
s3# -> (# State# s
s3#, MutableByteArray# s
mbytes# #)
    
    {- |
      @'copyUnboxed#' e bytes\# o1\# mbytes\# o2\# n\#@ unsafely writes elements
      from @bytes\#@ to @mbytes\#@, where o1\# and o2\# - offsets (element
      count), @n\#@ - count of elements to copy.
    -}
    copyUnboxed# :: e -> ByteArray# -> Int# -> MutableByteArray# s -> Int# -> Int# -> State# s -> State# s
    copyUnboxed# e
e ByteArray#
bytes# Int#
o1# MutableByteArray# s
mbytes# Int#
o2# Int#
n# = ByteArray#
-> Int#
-> MutableByteArray# s
-> Int#
-> Int#
-> State# s
-> State# s
forall d.
ByteArray#
-> Int#
-> MutableByteArray# d
-> Int#
-> Int#
-> State# d
-> State# d
copyByteArray# ByteArray#
bytes# (e -> Int# -> Int#
forall e. Unboxed e => e -> Int# -> Int#
sizeof# e
e Int#
o1#) MutableByteArray# s
mbytes# (e -> Int# -> Int#
forall e. Unboxed e => e -> Int# -> Int#
sizeof# e
e Int#
o2#) (e -> Int# -> Int#
forall e. Unboxed e => e -> Int# -> Int#
sizeof# e
e Int#
n#)
    
    {- |
      @'copyUnboxedM#' e msrc\# o1\# mbytes\# o2\# n\#@ unsafely writes elements
      from @msrc\#@ to @mbytes\#@, where o1\# and o2\# - offsets (element
      count), @n\#@ - count of elements to copy.
    -}
    copyUnboxedM# :: e -> MutableByteArray# s -> Int# -> MutableByteArray# s -> Int# -> Int# -> State# s -> State# s
    copyUnboxedM# e
e MutableByteArray# s
msrc# Int#
o1# MutableByteArray# s
mbytes# Int#
o2# Int#
n# = MutableByteArray# s
-> Int#
-> MutableByteArray# s
-> Int#
-> Int#
-> State# s
-> State# s
forall d.
MutableByteArray# d
-> Int#
-> MutableByteArray# d
-> Int#
-> Int#
-> State# d
-> State# d
copyMutableByteArray# MutableByteArray# s
msrc# (e -> Int# -> Int#
forall e. Unboxed e => e -> Int# -> Int#
sizeof# e
e Int#
o1#) MutableByteArray# s
mbytes# (e -> Int# -> Int#
forall e. Unboxed e => e -> Int# -> Int#
sizeof# e
e Int#
o2#) (e -> Int# -> Int#
forall e. Unboxed e => e -> Int# -> Int#
sizeof# e
e Int#
n#)
    
    {- |
      @'hashUnboxedWith' e len# off# bytes# salt@ returns @bytes#@ @FNV-1@ hash,
      where @off#@ and @len#@ is offset and length (in elements).
      
      Note: the standard definition of this function is written in Haskell using
      low-level functions, but this implementation mayn't be as efficient as the
      foreign procedure in the @hashable@ package.
    -}
    hashUnboxedWith :: e -> Int# -> Int# -> ByteArray# -> Int# -> Int#
    hashUnboxedWith e
e Int#
len# Int#
off# ByteArray#
bytes# = Int# -> Int# -> Int# -> Int#
go (e -> Int# -> Int#
forall e. Unboxed e => e -> Int# -> Int#
sizeof# e
e Int#
off#) (e -> Int# -> Int#
forall e. Unboxed e => e -> Int# -> Int#
sizeof# e
e Int#
len#)
      where
        go :: Int# -> Int# -> Int# -> Int#
go Int#
_  Int#
0# Int#
salt# = Int#
salt#
        go Int#
o# Int#
n# Int#
salt# = Int# -> Int# -> Int# -> Int#
go (Int#
o# Int# -> Int# -> Int#
+# Int#
1#) (Int#
n# Int# -> Int# -> Int#
-# Int#
1#) (Word# -> Int#
word2Int# Word#
hash#)
          where
            prod# :: Word#
prod# = Int# -> Word#
int2Word# (Int#
salt# Int# -> Int# -> Int#
*# Int#
16777619#)
            elem# :: Word#
elem# = ByteArray# -> Int# -> Word#
indexWord8Array# ByteArray#
bytes# Int#
o#
            hash# :: Word#
hash# = Word#
prod# Word# -> Word# -> Word#
`xor#` Word#
elem#

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

{- Unboxed helpers. -}

{- |
  @since 0.2
  @cloneUnboxed# e bytes# o# c#@ creates new @c#@-element length immutable slice
  of @bytes#@ beginning from @o#@-th element.
-}
cloneUnboxed# :: (Unboxed e) => e -> ByteArray# -> Int# -> Int# -> ByteArray#
cloneUnboxed# :: e -> ByteArray# -> Int# -> Int# -> ByteArray#
cloneUnboxed# e
e ByteArray#
bytes# Int#
o# Int#
c# = Wrap -> ByteArray#
unwrap (Wrap -> ByteArray#) -> Wrap -> ByteArray#
forall a b. (a -> b) -> a -> b
$ (forall s. ST s Wrap) -> Wrap
forall a. (forall s. ST s a) -> a
runST ((forall s. ST s Wrap) -> Wrap) -> (forall s. ST s Wrap) -> Wrap
forall a b. (a -> b) -> a -> b
$ STRep s Wrap -> ST s Wrap
forall s a. STRep s a -> ST s a
ST (STRep s Wrap -> ST s Wrap) -> STRep s Wrap -> ST s Wrap
forall a b. (a -> b) -> a -> b
$
  \ State# s
s1# -> case e -> Int# -> State# s -> (# State# s, MutableByteArray# s #)
forall e s.
Unboxed e =>
e -> Int# -> State# s -> (# State# s, MutableByteArray# s #)
newUnboxed e
e Int#
c# State# s
s1# of
    (# State# s
s2#, MutableByteArray# s
mbytes# #) -> case e
-> ByteArray#
-> Int#
-> MutableByteArray# s
-> Int#
-> Int#
-> State# s
-> State# s
forall e s.
Unboxed e =>
e
-> ByteArray#
-> Int#
-> MutableByteArray# s
-> Int#
-> Int#
-> State# s
-> State# s
copyUnboxed# e
e ByteArray#
bytes# Int#
o# MutableByteArray# s
mbytes# Int#
0# Int#
c# State# s
s2# of
      State# s
s3# -> case MutableByteArray# s -> State# s -> (# State# s, ByteArray# #)
forall d.
MutableByteArray# d -> State# d -> (# State# d, ByteArray# #)
unsafeFreezeByteArray# MutableByteArray# s
mbytes# State# s
s3# of
        (# State# s
s4#, ByteArray#
bytes'# #) -> (# State# s
s4#, (ByteArray# -> Wrap
Wrap ByteArray#
bytes'#) #)

{- |
  @since 0.2.1
  @cloneUnboxedM# e mbytes# o# c#@ creates new @c#@-element length mutable slice
  of @bytes#@ beginning from @o#@-th element.
-}
cloneUnboxedM# :: (Unboxed e) => e -> MutableByteArray# s -> Int# -> Int# ->
  State# s -> (# State# s, MutableByteArray# s #)
cloneUnboxedM# :: e
-> MutableByteArray# s
-> Int#
-> Int#
-> State# s
-> (# State# s, MutableByteArray# s #)
cloneUnboxedM# e
e MutableByteArray# s
mbytes# Int#
o# Int#
n# = \ State# s
s1# -> case Int# -> State# s -> (# State# s, MutableByteArray# s #)
forall d. Int# -> State# d -> (# State# d, MutableByteArray# d #)
newByteArray# (e -> Int# -> Int#
forall e. Unboxed e => e -> Int# -> Int#
sizeof# e
e Int#
n#) State# s
s1# of
  (# State# s
s2#, MutableByteArray# s
copy# #) -> case e
-> MutableByteArray# s
-> Int#
-> MutableByteArray# s
-> Int#
-> Int#
-> State# s
-> State# s
forall e s.
Unboxed e =>
e
-> MutableByteArray# s
-> Int#
-> MutableByteArray# s
-> Int#
-> Int#
-> State# s
-> State# s
copyUnboxedM# e
e MutableByteArray# s
mbytes# Int#
o# MutableByteArray# s
copy# Int#
0# Int#
n# State# s
s2# of
    State# s
s3# -> (# State# s
s3#, MutableByteArray# s
copy# #)

{- |
  @since 0.2.1
  @'thawUnboxed#' e bytes# c#@ creates new @sizeof# e c#@ bytes length
  'MutableByteArray#' and copy @bytes#@ to it.
-}
thawUnboxed# :: (Unboxed e) => e -> ByteArray# -> Int# ->
  State# s -> (# State# s, MutableByteArray# s #)
thawUnboxed# :: e
-> ByteArray#
-> Int#
-> State# s
-> (# State# s, MutableByteArray# s #)
thawUnboxed# e
e ByteArray#
bytes# Int#
c# = \ State# s
s1# -> case Int# -> State# s -> (# State# s, MutableByteArray# s #)
forall d. Int# -> State# d -> (# State# d, MutableByteArray# d #)
newByteArray# Int#
n# State# s
s1# of
    (# State# s
s2#, MutableByteArray# s
mbytes# #) -> case ByteArray#
-> Int#
-> MutableByteArray# s
-> Int#
-> Int#
-> State# s
-> State# s
forall d.
ByteArray#
-> Int#
-> MutableByteArray# d
-> Int#
-> Int#
-> State# d
-> State# d
copyByteArray# ByteArray#
bytes# Int#
0# MutableByteArray# s
mbytes# Int#
0# Int#
n# State# s
s2# of
      State# s
s3# -> (# State# s
s3#, MutableByteArray# s
mbytes# #)
  where
    n# :: Int#
n# = e -> Int# -> Int#
forall e. Unboxed e => e -> Int# -> Int#
sizeof# e
e Int#
c#

{- |
  @since 0.2.1
  @'freezeUnboxed#' e mbytes# c#@ creates new @sizeof# e c#@ bytes length
  'ByteArray#' and copy @mbytes#@ to it.
-}
freezeUnboxed# :: (Unboxed e) => e -> MutableByteArray# s -> Int# ->
  State# s -> (# State# s, ByteArray# #)
freezeUnboxed# :: e
-> MutableByteArray# s
-> Int#
-> State# s
-> (# State# s, ByteArray# #)
freezeUnboxed# e
e MutableByteArray# s
mbytes# Int#
n# = \ State# s
s1# -> case e
-> MutableByteArray# s
-> Int#
-> Int#
-> State# s
-> (# State# s, MutableByteArray# s #)
forall e s.
Unboxed e =>
e
-> MutableByteArray# s
-> Int#
-> Int#
-> State# s
-> (# State# s, MutableByteArray# s #)
cloneUnboxedM# e
e MutableByteArray# s
mbytes# Int#
0# Int#
n# State# s
s1# of
  (# State# s
s2#, MutableByteArray# s
copy# #) -> MutableByteArray# s -> State# s -> (# State# s, ByteArray# #)
forall d.
MutableByteArray# d -> State# d -> (# State# d, ByteArray# #)
unsafeFreezeByteArray# MutableByteArray# s
copy# State# s
s2#

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

{- Rank 1 Unboxed proxies. -}

-- | Returns 'undefined' of suitable type.
fromProxy :: proxy e -> e
fromProxy :: proxy e -> e
fromProxy =  e -> proxy e -> e
forall a b. a -> b -> a
const e
forall a. HasCallStack => a
undefined

{- |
  @since 0.2.1
  'psizeof#' is proxy version of 'sizeof#'.
-}
psizeof# :: (Unboxed e) => proxy e -> Int# -> Int#
psizeof# :: proxy e -> Int# -> Int#
psizeof# =  e -> Int# -> Int#
forall e. Unboxed e => e -> Int# -> Int#
sizeof# (e -> Int# -> Int#) -> (proxy e -> e) -> proxy e -> Int# -> Int#
forall k (cat :: k -> k -> *) (b :: k) (c :: k) (a :: k).
Category cat =>
cat b c -> cat a b -> cat a c
. proxy e -> e
forall (proxy :: * -> *) e. proxy e -> e
fromProxy

{- |
  @since 0.2
  'psizeof' is proxy version of 'sizeof'.
-}
psizeof :: (Unboxed e) => proxy e -> Int -> Int
psizeof :: proxy e -> Int -> Int
psizeof =  e -> Int -> Int
forall e. Unboxed e => e -> Int -> Int
sizeof (e -> Int -> Int) -> (proxy e -> e) -> proxy e -> Int -> Int
forall k (cat :: k -> k -> *) (b :: k) (c :: k) (a :: k).
Category cat =>
cat b c -> cat a b -> cat a c
. proxy e -> e
forall (proxy :: * -> *) e. proxy e -> e
fromProxy

{- |
  @since 0.2
  Kind @(Type -> Type)@ proxy version of 'newUnboxed'.
-}
pnewUnboxed :: (Unboxed e) => proxy e -> Int# ->
  State# s -> (# State# s, MutableByteArray# s #)
pnewUnboxed :: proxy e -> Int# -> State# s -> (# State# s, MutableByteArray# s #)
pnewUnboxed =  e -> Int# -> State# s -> (# State# s, MutableByteArray# s #)
forall e s.
Unboxed e =>
e -> Int# -> State# s -> (# State# s, MutableByteArray# s #)
newUnboxed (e -> Int# -> State# s -> (# State# s, MutableByteArray# s #))
-> (proxy e -> e)
-> proxy e
-> Int#
-> State# s
-> (# State# s, MutableByteArray# s #)
forall k (cat :: k -> k -> *) (b :: k) (c :: k) (a :: k).
Category cat =>
cat b c -> cat a b -> cat a c
. proxy e -> e
forall (proxy :: * -> *) e. proxy e -> e
fromProxy

{- |
  @since 0.2
  Kind @(Type -> Type)@ proxy version if 'copyUnboxed#'.
-}
pcopyUnboxed :: (Unboxed e) => proxy e -> ByteArray# -> Int# ->
  MutableByteArray# s -> Int# -> Int# -> State# s -> State# s
pcopyUnboxed :: proxy e
-> ByteArray#
-> Int#
-> MutableByteArray# s
-> Int#
-> Int#
-> State# s
-> State# s
pcopyUnboxed =  e
-> ByteArray#
-> Int#
-> MutableByteArray# s
-> Int#
-> Int#
-> State# s
-> State# s
forall e s.
Unboxed e =>
e
-> ByteArray#
-> Int#
-> MutableByteArray# s
-> Int#
-> Int#
-> State# s
-> State# s
copyUnboxed# (e
 -> ByteArray#
 -> Int#
 -> MutableByteArray# s
 -> Int#
 -> Int#
 -> State# s
 -> State# s)
-> (proxy e -> e)
-> proxy e
-> ByteArray#
-> Int#
-> MutableByteArray# s
-> Int#
-> Int#
-> State# s
-> State# s
forall k (cat :: k -> k -> *) (b :: k) (c :: k) (a :: k).
Category cat =>
cat b c -> cat a b -> cat a c
. proxy e -> e
forall (proxy :: * -> *) e. proxy e -> e
fromProxy

{- |
  @since 0.2
  Kind @(Type -> Type)@ proxy version if 'copyUnboxedM#'.
-}
pcopyUnboxedM :: (Unboxed e) => proxy e -> MutableByteArray# s -> Int# ->
  MutableByteArray# s -> Int# -> Int# -> State# s -> State# s
pcopyUnboxedM :: proxy e
-> MutableByteArray# s
-> Int#
-> MutableByteArray# s
-> Int#
-> Int#
-> State# s
-> State# s
pcopyUnboxedM =  e
-> MutableByteArray# s
-> Int#
-> MutableByteArray# s
-> Int#
-> Int#
-> State# s
-> State# s
forall e s.
Unboxed e =>
e
-> MutableByteArray# s
-> Int#
-> MutableByteArray# s
-> Int#
-> Int#
-> State# s
-> State# s
copyUnboxedM# (e
 -> MutableByteArray# s
 -> Int#
 -> MutableByteArray# s
 -> Int#
 -> Int#
 -> State# s
 -> State# s)
-> (proxy e -> e)
-> proxy e
-> MutableByteArray# s
-> Int#
-> MutableByteArray# s
-> Int#
-> Int#
-> State# s
-> State# s
forall k (cat :: k -> k -> *) (b :: k) (c :: k) (a :: k).
Category cat =>
cat b c -> cat a b -> cat a c
. proxy e -> e
forall (proxy :: * -> *) e. proxy e -> e
fromProxy

{- |
  @since 0.2
  Kind @(Type -> Type)@ proxy version of 'cloneUnboxed#'.
-}
cloneUnboxed1# :: (Unboxed e) => proxy e -> ByteArray# -> Int# -> Int# -> ByteArray#
cloneUnboxed1# :: proxy e -> ByteArray# -> Int# -> Int# -> ByteArray#
cloneUnboxed1# =  e -> ByteArray# -> Int# -> Int# -> ByteArray#
forall e.
Unboxed e =>
e -> ByteArray# -> Int# -> Int# -> ByteArray#
cloneUnboxed# (e -> ByteArray# -> Int# -> Int# -> ByteArray#)
-> (proxy e -> e)
-> proxy e
-> ByteArray#
-> Int#
-> Int#
-> ByteArray#
forall k (cat :: k -> k -> *) (b :: k) (c :: k) (a :: k).
Category cat =>
cat b c -> cat a b -> cat a c
. proxy e -> e
forall (proxy :: * -> *) e. proxy e -> e
fromProxy

{- |
  @since 0.2.1
  Same as @sdp-0.2@ 'cloneUnboxed1#'. Use only if you don't need @sdp-0.2@
  compatibility.
-}
pcloneUnboxed :: (Unboxed e) => proxy e -> ByteArray# -> Int# -> Int# -> ByteArray#
pcloneUnboxed :: proxy e -> ByteArray# -> Int# -> Int# -> ByteArray#
pcloneUnboxed =  proxy e -> ByteArray# -> Int# -> Int# -> ByteArray#
forall e (proxy :: * -> *).
Unboxed e =>
proxy e -> ByteArray# -> Int# -> Int# -> ByteArray#
cloneUnboxed1#

{- |
  @since 0.2.1
  Kind @(Type -> Type)@ proxy version of 'cloneUnboxed#'.
-}
pcloneUnboxedM :: (Unboxed e) => proxy e -> MutableByteArray# s -> Int# -> Int# ->
  State# s -> (# State# s, MutableByteArray# s #)
pcloneUnboxedM :: proxy e
-> MutableByteArray# s
-> Int#
-> Int#
-> State# s
-> (# State# s, MutableByteArray# s #)
pcloneUnboxedM =  e
-> MutableByteArray# s
-> Int#
-> Int#
-> State# s
-> (# State# s, MutableByteArray# s #)
forall e s.
Unboxed e =>
e
-> MutableByteArray# s
-> Int#
-> Int#
-> State# s
-> (# State# s, MutableByteArray# s #)
cloneUnboxedM# (e
 -> MutableByteArray# s
 -> Int#
 -> Int#
 -> State# s
 -> (# State# s, MutableByteArray# s #))
-> (proxy e -> e)
-> proxy e
-> MutableByteArray# s
-> Int#
-> Int#
-> State# s
-> (# State# s, MutableByteArray# s #)
forall k (cat :: k -> k -> *) (b :: k) (c :: k) (a :: k).
Category cat =>
cat b c -> cat a b -> cat a c
. proxy e -> e
forall (proxy :: * -> *) e. proxy e -> e
fromProxy

{- |
  @since 0.2.1
  Kind @(Type -> Type)@ proxy version of 'thawUnboxed#'.
-}
pthawUnboxed :: (Unboxed e) => proxy e -> ByteArray# -> Int# ->
  State# s -> (# State# s, MutableByteArray# s #)
pthawUnboxed :: proxy e
-> ByteArray#
-> Int#
-> State# s
-> (# State# s, MutableByteArray# s #)
pthawUnboxed =  e
-> ByteArray#
-> Int#
-> State# s
-> (# State# s, MutableByteArray# s #)
forall e s.
Unboxed e =>
e
-> ByteArray#
-> Int#
-> State# s
-> (# State# s, MutableByteArray# s #)
thawUnboxed# (e
 -> ByteArray#
 -> Int#
 -> State# s
 -> (# State# s, MutableByteArray# s #))
-> (proxy e -> e)
-> proxy e
-> ByteArray#
-> Int#
-> State# s
-> (# State# s, MutableByteArray# s #)
forall k (cat :: k -> k -> *) (b :: k) (c :: k) (a :: k).
Category cat =>
cat b c -> cat a b -> cat a c
. proxy e -> e
forall (proxy :: * -> *) e. proxy e -> e
fromProxy

{- |
  @since 0.2.1
  Kind @(Type -> Type)@ proxy version of 'pfreezeUnboxed'.
-}
pfreezeUnboxed :: (Unboxed e) => proxy e -> MutableByteArray# s -> Int# ->
  State# s -> (# State# s, ByteArray# #)
pfreezeUnboxed :: proxy e
-> MutableByteArray# s
-> Int#
-> State# s
-> (# State# s, ByteArray# #)
pfreezeUnboxed =  e
-> MutableByteArray# s
-> Int#
-> State# s
-> (# State# s, ByteArray# #)
forall e s.
Unboxed e =>
e
-> MutableByteArray# s
-> Int#
-> State# s
-> (# State# s, ByteArray# #)
freezeUnboxed# (e
 -> MutableByteArray# s
 -> Int#
 -> State# s
 -> (# State# s, ByteArray# #))
-> (proxy e -> e)
-> proxy e
-> MutableByteArray# s
-> Int#
-> State# s
-> (# State# s, ByteArray# #)
forall k (cat :: k -> k -> *) (b :: k) (c :: k) (a :: k).
Category cat =>
cat b c -> cat a b -> cat a c
. proxy e -> e
forall (proxy :: * -> *) e. proxy e -> e
fromProxy

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

{- (Type -> Type -> Type)-kind Unboxed proxies. -}

-- | Returns 'undefined' of suitable type.
fromProxy1 :: m (proxy e) -> e
fromProxy1 :: m (proxy e) -> e
fromProxy1 =  e -> m (proxy e) -> e
forall a b. a -> b -> a
const e
forall a. HasCallStack => a
undefined

{- |
  @since 0.2
  Kind @(Type -> Type -> Type)@ proxy version of 'newUnboxed'.
-}
pnewUnboxed1 :: (Unboxed e) => p (proxy e) -> Int# ->
  State# s -> (# State# s, MutableByteArray# s #)
pnewUnboxed1 :: p (proxy e)
-> Int# -> State# s -> (# State# s, MutableByteArray# s #)
pnewUnboxed1 =  e -> Int# -> State# s -> (# State# s, MutableByteArray# s #)
forall e s.
Unboxed e =>
e -> Int# -> State# s -> (# State# s, MutableByteArray# s #)
newUnboxed (e -> Int# -> State# s -> (# State# s, MutableByteArray# s #))
-> (p (proxy e) -> e)
-> p (proxy e)
-> Int#
-> State# s
-> (# State# s, MutableByteArray# s #)
forall k (cat :: k -> k -> *) (b :: k) (c :: k) (a :: k).
Category cat =>
cat b c -> cat a b -> cat a c
. p (proxy e) -> e
forall (m :: * -> *) (proxy :: * -> *) e. m (proxy e) -> e
fromProxy1

{- |
  @since 0.2
  Kind @(Type -> Type -> Type)@ proxy version of 'copyUnboxed#'.
-}
pcopyUnboxed1 :: (Unboxed e) => p (proxy e) -> ByteArray# -> Int# ->
  MutableByteArray# s -> Int# -> Int# -> State# s -> State# s
pcopyUnboxed1 :: p (proxy e)
-> ByteArray#
-> Int#
-> MutableByteArray# s
-> Int#
-> Int#
-> State# s
-> State# s
pcopyUnboxed1 =  e
-> ByteArray#
-> Int#
-> MutableByteArray# s
-> Int#
-> Int#
-> State# s
-> State# s
forall e s.
Unboxed e =>
e
-> ByteArray#
-> Int#
-> MutableByteArray# s
-> Int#
-> Int#
-> State# s
-> State# s
copyUnboxed# (e
 -> ByteArray#
 -> Int#
 -> MutableByteArray# s
 -> Int#
 -> Int#
 -> State# s
 -> State# s)
-> (p (proxy e) -> e)
-> p (proxy e)
-> ByteArray#
-> Int#
-> MutableByteArray# s
-> Int#
-> Int#
-> State# s
-> State# s
forall k (cat :: k -> k -> *) (b :: k) (c :: k) (a :: k).
Category cat =>
cat b c -> cat a b -> cat a c
. p (proxy e) -> e
forall (m :: * -> *) (proxy :: * -> *) e. m (proxy e) -> e
fromProxy1

{- |
  @since 0.2.1
  Kind @(Type -> Type -> Type)@ proxy version of 'copyUnboxedM#'.
-}
pcopyUnboxedM1 :: (Unboxed e) => p (proxy e) -> MutableByteArray# s -> Int# ->
  MutableByteArray# s -> Int# -> Int# -> State# s -> State# s
pcopyUnboxedM1 :: p (proxy e)
-> MutableByteArray# s
-> Int#
-> MutableByteArray# s
-> Int#
-> Int#
-> State# s
-> State# s
pcopyUnboxedM1 =  e
-> MutableByteArray# s
-> Int#
-> MutableByteArray# s
-> Int#
-> Int#
-> State# s
-> State# s
forall e s.
Unboxed e =>
e
-> MutableByteArray# s
-> Int#
-> MutableByteArray# s
-> Int#
-> Int#
-> State# s
-> State# s
copyUnboxedM# (e
 -> MutableByteArray# s
 -> Int#
 -> MutableByteArray# s
 -> Int#
 -> Int#
 -> State# s
 -> State# s)
-> (p (proxy e) -> e)
-> p (proxy e)
-> MutableByteArray# s
-> Int#
-> MutableByteArray# s
-> Int#
-> Int#
-> State# s
-> State# s
forall k (cat :: k -> k -> *) (b :: k) (c :: k) (a :: k).
Category cat =>
cat b c -> cat a b -> cat a c
. p (proxy e) -> e
forall (m :: * -> *) (proxy :: * -> *) e. m (proxy e) -> e
fromProxy1

{- |
  @since 0.2.1
  Kind @(Type -> Type -> Type)@ proxy version of 'cloneUnboxed#'.
-}
pcloneUnboxed1 :: (Unboxed e) => p (proxy e) -> ByteArray# -> Int# -> Int# -> ByteArray#
pcloneUnboxed1 :: p (proxy e) -> ByteArray# -> Int# -> Int# -> ByteArray#
pcloneUnboxed1 =  e -> ByteArray# -> Int# -> Int# -> ByteArray#
forall e.
Unboxed e =>
e -> ByteArray# -> Int# -> Int# -> ByteArray#
cloneUnboxed# (e -> ByteArray# -> Int# -> Int# -> ByteArray#)
-> (p (proxy e) -> e)
-> p (proxy e)
-> ByteArray#
-> Int#
-> Int#
-> ByteArray#
forall k (cat :: k -> k -> *) (b :: k) (c :: k) (a :: k).
Category cat =>
cat b c -> cat a b -> cat a c
. p (proxy e) -> e
forall (m :: * -> *) (proxy :: * -> *) e. m (proxy e) -> e
fromProxy1

{- |
  @since 0.2.1
  Kind @(Type -> Type -> Type)@ proxy version of 'cloneUnboxed#'.
-}
pcloneUnboxedM1 :: (Unboxed e) => p (proxy e) -> MutableByteArray# s -> Int# -> Int# ->
  State# s -> (# State# s, MutableByteArray# s #)
pcloneUnboxedM1 :: p (proxy e)
-> MutableByteArray# s
-> Int#
-> Int#
-> State# s
-> (# State# s, MutableByteArray# s #)
pcloneUnboxedM1 =  e
-> MutableByteArray# s
-> Int#
-> Int#
-> State# s
-> (# State# s, MutableByteArray# s #)
forall e s.
Unboxed e =>
e
-> MutableByteArray# s
-> Int#
-> Int#
-> State# s
-> (# State# s, MutableByteArray# s #)
cloneUnboxedM# (e
 -> MutableByteArray# s
 -> Int#
 -> Int#
 -> State# s
 -> (# State# s, MutableByteArray# s #))
-> (p (proxy e) -> e)
-> p (proxy e)
-> MutableByteArray# s
-> Int#
-> Int#
-> State# s
-> (# State# s, MutableByteArray# s #)
forall k (cat :: k -> k -> *) (b :: k) (c :: k) (a :: k).
Category cat =>
cat b c -> cat a b -> cat a c
. p (proxy e) -> e
forall (m :: * -> *) (proxy :: * -> *) e. m (proxy e) -> e
fromProxy1

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

{- Numeric instances. -}

instance Unboxed Int
  where
    {-# INLINE sizeof #-}
    sizeof :: Int -> Int -> Int
sizeof Int
_ Int
n = Int -> Int -> Int
forall a. Ord a => a -> a -> a
max Int
0 Int
n Int -> Int -> Int
forall a. Num a => a -> a -> a
* SIZEOF_HSWORD
    
    {-# INLINE (!#) #-}
    ByteArray#
bytes# !# :: ByteArray# -> Int# -> Int
!# Int#
i# = Int# -> Int
I# (ByteArray# -> Int# -> Int#
indexIntArray# ByteArray#
bytes# Int#
i#)
    
    {-# INLINE (!>#) #-}
    MutableByteArray# s
mbytes# !># :: MutableByteArray# s -> Int# -> State# s -> (# State# s, Int #)
!># Int#
i# = \ State# s
s1# -> case MutableByteArray# s -> Int# -> State# s -> (# State# s, Int# #)
forall d.
MutableByteArray# d -> Int# -> State# d -> (# State# d, Int# #)
readIntArray# MutableByteArray# s
mbytes# Int#
i# State# s
s1# of
      (# State# s
s2#, Int#
e# #) -> (# State# s
s2#, Int# -> Int
I# Int#
e# #)
    
    {-# INLINE writeByteArray# #-}
    writeByteArray# :: MutableByteArray# s -> Int# -> Int -> State# s -> State# s
writeByteArray# MutableByteArray# s
mbytes# Int#
n# (I# Int#
e#) = MutableByteArray# s -> Int# -> Int# -> State# s -> State# s
forall d.
MutableByteArray# d -> Int# -> Int# -> State# d -> State# d
writeIntArray# MutableByteArray# s
mbytes# Int#
n# Int#
e#
    
    {-# INLINE newUnboxed #-}
    newUnboxed :: Int -> Int# -> State# s -> (# State# s, MutableByteArray# s #)
newUnboxed Int
_ = Int -> Int# -> State# s -> (# State# s, MutableByteArray# s #)
forall e s.
Unboxed e =>
e -> Int# -> State# s -> (# State# s, MutableByteArray# s #)
newUnboxed' (Int
0 :: Int)

instance Unboxed Int8
  where
    {-# INLINE sizeof #-}
    sizeof :: Int8 -> Int -> Int
sizeof Int8
_ Int
n = Int -> Int -> Int
forall a. Ord a => a -> a -> a
max Int
0 Int
n
    
    {-# INLINE (!#) #-}
    ByteArray#
bytes# !# :: ByteArray# -> Int# -> Int8
!# Int#
i# = Int# -> Int8
I8# (ByteArray# -> Int# -> Int#
indexInt8Array# ByteArray#
bytes# Int#
i#)
    
    {-# INLINE (!>#) #-}
    MutableByteArray# s
mbytes# !># :: MutableByteArray# s -> Int# -> State# s -> (# State# s, Int8 #)
!># Int#
i# = \ State# s
s1# -> case MutableByteArray# s -> Int# -> State# s -> (# State# s, Int# #)
forall d.
MutableByteArray# d -> Int# -> State# d -> (# State# d, Int# #)
readInt8Array# MutableByteArray# s
mbytes# Int#
i# State# s
s1# of
      (# State# s
s2#, Int#
e# #) -> (# State# s
s2#, Int# -> Int8
I8# Int#
e# #)
    
    {-# INLINE writeByteArray# #-}
    writeByteArray# :: MutableByteArray# s -> Int# -> Int8 -> State# s -> State# s
writeByteArray# MutableByteArray# s
mbytes# Int#
n# (I8# Int#
e#) = MutableByteArray# s -> Int# -> Int# -> State# s -> State# s
forall d.
MutableByteArray# d -> Int# -> Int# -> State# d -> State# d
writeInt8Array# MutableByteArray# s
mbytes# Int#
n# Int#
e#
    
    {-# INLINE newUnboxed #-}
    newUnboxed :: Int8 -> Int# -> State# s -> (# State# s, MutableByteArray# s #)
newUnboxed Int8
_ = Int8 -> Int# -> State# s -> (# State# s, MutableByteArray# s #)
forall e s.
Unboxed e =>
e -> Int# -> State# s -> (# State# s, MutableByteArray# s #)
newUnboxed' (Int8
0 :: Int8)

instance Unboxed Int16
  where
    {-# INLINE sizeof #-}
    sizeof :: Int16 -> Int -> Int
sizeof Int16
_ Int
n = Int -> Int -> Int
forall a. Ord a => a -> a -> a
max Int
0 Int
n Int -> Int -> Int
forall a. Num a => a -> a -> a
* Int
2
    
    {-# INLINE (!#) #-}
    ByteArray#
bytes# !# :: ByteArray# -> Int# -> Int16
!# Int#
i# = Int# -> Int16
I16# (ByteArray# -> Int# -> Int#
indexInt16Array# ByteArray#
bytes# Int#
i#)
    
    {-# INLINE (!>#) #-}
    MutableByteArray# s
mbytes# !># :: MutableByteArray# s -> Int# -> State# s -> (# State# s, Int16 #)
!># Int#
i# = \ State# s
s1# -> case MutableByteArray# s -> Int# -> State# s -> (# State# s, Int# #)
forall d.
MutableByteArray# d -> Int# -> State# d -> (# State# d, Int# #)
readInt16Array# MutableByteArray# s
mbytes# Int#
i# State# s
s1# of
      (# State# s
s2#, Int#
e# #) -> (# State# s
s2#, Int# -> Int16
I16# Int#
e# #)
    
    {-# INLINE writeByteArray# #-}
    writeByteArray# :: MutableByteArray# s -> Int# -> Int16 -> State# s -> State# s
writeByteArray# MutableByteArray# s
mbytes# Int#
n# (I16# Int#
e#) = MutableByteArray# s -> Int# -> Int# -> State# s -> State# s
forall d.
MutableByteArray# d -> Int# -> Int# -> State# d -> State# d
writeInt16Array# MutableByteArray# s
mbytes# Int#
n# Int#
e#
    
    {-# INLINE newUnboxed #-}
    newUnboxed :: Int16 -> Int# -> State# s -> (# State# s, MutableByteArray# s #)
newUnboxed Int16
_ = Int16 -> Int# -> State# s -> (# State# s, MutableByteArray# s #)
forall e s.
Unboxed e =>
e -> Int# -> State# s -> (# State# s, MutableByteArray# s #)
newUnboxed' (Int16
0 :: Int16)

instance Unboxed Int32
  where
    {-# INLINE sizeof #-}
    sizeof :: Int32 -> Int -> Int
sizeof Int32
_ Int
n = Int -> Int -> Int
forall a. Ord a => a -> a -> a
max Int
0 Int
n Int -> Int -> Int
forall a. Num a => a -> a -> a
* Int
4
    
    {-# INLINE (!#) #-}
    ByteArray#
bytes# !# :: ByteArray# -> Int# -> Int32
!# Int#
i# = Int# -> Int32
I32# (ByteArray# -> Int# -> Int#
indexInt32Array# ByteArray#
bytes# Int#
i#)
    
    {-# INLINE (!>#) #-}
    MutableByteArray# s
mbytes# !># :: MutableByteArray# s -> Int# -> State# s -> (# State# s, Int32 #)
!># Int#
i# = \ State# s
s1# -> case MutableByteArray# s -> Int# -> State# s -> (# State# s, Int# #)
forall d.
MutableByteArray# d -> Int# -> State# d -> (# State# d, Int# #)
readInt32Array# MutableByteArray# s
mbytes# Int#
i# State# s
s1# of
      (# State# s
s2#, Int#
e# #) -> (# State# s
s2#, Int# -> Int32
I32# Int#
e# #)
    
    {-# INLINE writeByteArray# #-}
    writeByteArray# :: MutableByteArray# s -> Int# -> Int32 -> State# s -> State# s
writeByteArray# MutableByteArray# s
mbytes# Int#
n# (I32# Int#
e#) = MutableByteArray# s -> Int# -> Int# -> State# s -> State# s
forall d.
MutableByteArray# d -> Int# -> Int# -> State# d -> State# d
writeInt32Array# MutableByteArray# s
mbytes# Int#
n# Int#
e#
    
    {-# INLINE newUnboxed #-}
    newUnboxed :: Int32 -> Int# -> State# s -> (# State# s, MutableByteArray# s #)
newUnboxed Int32
_ = Int32 -> Int# -> State# s -> (# State# s, MutableByteArray# s #)
forall e s.
Unboxed e =>
e -> Int# -> State# s -> (# State# s, MutableByteArray# s #)
newUnboxed' (Int32
0 :: Int32)

instance Unboxed Int64
  where
    {-# INLINE sizeof #-}
    sizeof :: Int64 -> Int -> Int
sizeof Int64
_ Int
n = Int -> Int -> Int
forall a. Ord a => a -> a -> a
max Int
0 Int
n Int -> Int -> Int
forall a. Num a => a -> a -> a
* Int
8
    
    {-# INLINE (!#) #-}
    ByteArray#
bytes# !# :: ByteArray# -> Int# -> Int64
!# Int#
i# = Int# -> Int64
I64# (ByteArray# -> Int# -> Int#
indexInt64Array# ByteArray#
bytes# Int#
i#)
    
    {-# INLINE (!>#) #-}
    MutableByteArray# s
mbytes# !># :: MutableByteArray# s -> Int# -> State# s -> (# State# s, Int64 #)
!># Int#
i# = \ State# s
s1# -> case MutableByteArray# s -> Int# -> State# s -> (# State# s, Int# #)
forall d.
MutableByteArray# d -> Int# -> State# d -> (# State# d, Int# #)
readInt64Array# MutableByteArray# s
mbytes# Int#
i# State# s
s1# of
      (# State# s
s2#, Int#
e# #) -> (# State# s
s2#, Int# -> Int64
I64# Int#
e# #)
    
    {-# INLINE writeByteArray# #-}
    writeByteArray# :: MutableByteArray# s -> Int# -> Int64 -> State# s -> State# s
writeByteArray# MutableByteArray# s
mbytes# Int#
n# (I64# Int#
e#) = MutableByteArray# s -> Int# -> Int# -> State# s -> State# s
forall d.
MutableByteArray# d -> Int# -> Int# -> State# d -> State# d
writeInt64Array# MutableByteArray# s
mbytes# Int#
n# Int#
e#
    
    {-# INLINE newUnboxed #-}
    newUnboxed :: Int64 -> Int# -> State# s -> (# State# s, MutableByteArray# s #)
newUnboxed Int64
_ = Int64 -> Int# -> State# s -> (# State# s, MutableByteArray# s #)
forall e s.
Unboxed e =>
e -> Int# -> State# s -> (# State# s, MutableByteArray# s #)
newUnboxed' (Int64
0 :: Int64)

instance Unboxed Word
  where
    {-# INLINE sizeof #-}
    sizeof :: Word -> Int -> Int
sizeof Word
_ Int
n = Int -> Int -> Int
forall a. Ord a => a -> a -> a
max Int
0 Int
n Int -> Int -> Int
forall a. Num a => a -> a -> a
* SIZEOF_HSWORD
    
    {-# INLINE (!#) #-}
    ByteArray#
bytes# !# :: ByteArray# -> Int# -> Word
!# Int#
i# = Word# -> Word
W# (ByteArray# -> Int# -> Word#
indexWordArray# ByteArray#
bytes# Int#
i#)
    
    {-# INLINE (!>#) #-}
    MutableByteArray# s
mbytes# !># :: MutableByteArray# s -> Int# -> State# s -> (# State# s, Word #)
!># Int#
i# = \ State# s
s1# -> case MutableByteArray# s -> Int# -> State# s -> (# State# s, Word# #)
forall d.
MutableByteArray# d -> Int# -> State# d -> (# State# d, Word# #)
readWordArray# MutableByteArray# s
mbytes# Int#
i# State# s
s1# of
      (# State# s
s2#, Word#
e# #) -> (# State# s
s2#, Word# -> Word
W# Word#
e# #)
    
    {-# INLINE writeByteArray# #-}
    writeByteArray# :: MutableByteArray# s -> Int# -> Word -> State# s -> State# s
writeByteArray# MutableByteArray# s
mbytes# Int#
n# (W# Word#
e#) = MutableByteArray# s -> Int# -> Word# -> State# s -> State# s
forall d.
MutableByteArray# d -> Int# -> Word# -> State# d -> State# d
writeWordArray# MutableByteArray# s
mbytes# Int#
n# Word#
e#
    
    {-# INLINE newUnboxed #-}
    newUnboxed :: Word -> Int# -> State# s -> (# State# s, MutableByteArray# s #)
newUnboxed Word
_ = Word -> Int# -> State# s -> (# State# s, MutableByteArray# s #)
forall e s.
Unboxed e =>
e -> Int# -> State# s -> (# State# s, MutableByteArray# s #)
newUnboxed' (Word
0 :: Word)

instance Unboxed Word8
  where
    {-# INLINE sizeof #-}
    sizeof :: Word8 -> Int -> Int
sizeof Word8
_ Int
n = Int -> Int -> Int
forall a. Ord a => a -> a -> a
max Int
0 Int
n
    
    {-# INLINE (!#) #-}
    ByteArray#
bytes# !# :: ByteArray# -> Int# -> Word8
!# Int#
i# = Word# -> Word8
W8# (ByteArray# -> Int# -> Word#
indexWord8Array# ByteArray#
bytes# Int#
i#)
    
    {-# INLINE (!>#) #-}
    MutableByteArray# s
mbytes# !># :: MutableByteArray# s -> Int# -> State# s -> (# State# s, Word8 #)
!># Int#
i# = \ State# s
s1# -> case MutableByteArray# s -> Int# -> State# s -> (# State# s, Word# #)
forall d.
MutableByteArray# d -> Int# -> State# d -> (# State# d, Word# #)
readWord8Array# MutableByteArray# s
mbytes# Int#
i# State# s
s1# of
      (# State# s
s2#, Word#
e# #) -> (# State# s
s2#, Word# -> Word8
W8# Word#
e# #)
    
    {-# INLINE writeByteArray# #-}
    writeByteArray# :: MutableByteArray# s -> Int# -> Word8 -> State# s -> State# s
writeByteArray# MutableByteArray# s
mbytes# Int#
n# (W8#  Word#
e#) = MutableByteArray# s -> Int# -> Word# -> State# s -> State# s
forall d.
MutableByteArray# d -> Int# -> Word# -> State# d -> State# d
writeWord8Array# MutableByteArray# s
mbytes# Int#
n# Word#
e#
    
    {-# INLINE newUnboxed #-}
    newUnboxed :: Word8 -> Int# -> State# s -> (# State# s, MutableByteArray# s #)
newUnboxed Word8
_ = Word8 -> Int# -> State# s -> (# State# s, MutableByteArray# s #)
forall e s.
Unboxed e =>
e -> Int# -> State# s -> (# State# s, MutableByteArray# s #)
newUnboxed' (Word8
0 :: Word8)

instance Unboxed Word16
  where
    {-# INLINE sizeof #-}
    sizeof :: Word16 -> Int -> Int
sizeof Word16
_ Int
n = Int -> Int -> Int
forall a. Ord a => a -> a -> a
max Int
0 Int
n Int -> Int -> Int
forall a. Num a => a -> a -> a
* Int
2
    
    {-# INLINE (!#) #-}
    ByteArray#
bytes# !# :: ByteArray# -> Int# -> Word16
!# Int#
i# = Word# -> Word16
W16# (ByteArray# -> Int# -> Word#
indexWord16Array# ByteArray#
bytes# Int#
i#)
    
    {-# INLINE (!>#) #-}
    MutableByteArray# s
mbytes# !># :: MutableByteArray# s -> Int# -> State# s -> (# State# s, Word16 #)
!># Int#
i# = \ State# s
s1# -> case MutableByteArray# s -> Int# -> State# s -> (# State# s, Word# #)
forall d.
MutableByteArray# d -> Int# -> State# d -> (# State# d, Word# #)
readWord16Array# MutableByteArray# s
mbytes# Int#
i# State# s
s1# of
      (# State# s
s2#, Word#
e# #) -> (# State# s
s2#, Word# -> Word16
W16# Word#
e# #)
    
    {-# INLINE writeByteArray# #-}
    writeByteArray# :: MutableByteArray# s -> Int# -> Word16 -> State# s -> State# s
writeByteArray# MutableByteArray# s
mbytes# Int#
n# (W16# Word#
e#) = MutableByteArray# s -> Int# -> Word# -> State# s -> State# s
forall d.
MutableByteArray# d -> Int# -> Word# -> State# d -> State# d
writeWord16Array# MutableByteArray# s
mbytes# Int#
n# Word#
e#
    
    {-# INLINE newUnboxed #-}
    newUnboxed :: Word16 -> Int# -> State# s -> (# State# s, MutableByteArray# s #)
newUnboxed Word16
_ = Word16 -> Int# -> State# s -> (# State# s, MutableByteArray# s #)
forall e s.
Unboxed e =>
e -> Int# -> State# s -> (# State# s, MutableByteArray# s #)
newUnboxed' (Word16
0 :: Word16)

instance Unboxed Word32
  where
    {-# INLINE sizeof #-}
    sizeof :: Word32 -> Int -> Int
sizeof Word32
_ Int
n = Int -> Int -> Int
forall a. Ord a => a -> a -> a
max Int
0 Int
n Int -> Int -> Int
forall a. Num a => a -> a -> a
* Int
4
    
    {-# INLINE (!#) #-}
    ByteArray#
bytes# !# :: ByteArray# -> Int# -> Word32
!# Int#
i# = Word# -> Word32
W32# (ByteArray# -> Int# -> Word#
indexWord32Array# ByteArray#
bytes# Int#
i#)
    
    {-# INLINE (!>#) #-}
    MutableByteArray# s
mbytes# !># :: MutableByteArray# s -> Int# -> State# s -> (# State# s, Word32 #)
!># Int#
i# = \ State# s
s1# -> case MutableByteArray# s -> Int# -> State# s -> (# State# s, Word# #)
forall d.
MutableByteArray# d -> Int# -> State# d -> (# State# d, Word# #)
readWord32Array# MutableByteArray# s
mbytes# Int#
i# State# s
s1# of
      (# State# s
s2#, Word#
e# #) -> (# State# s
s2#, Word# -> Word32
W32# Word#
e# #)
    
    {-# INLINE writeByteArray# #-}
    writeByteArray# :: MutableByteArray# s -> Int# -> Word32 -> State# s -> State# s
writeByteArray# MutableByteArray# s
mbytes# Int#
n# (W32# Word#
e#) = MutableByteArray# s -> Int# -> Word# -> State# s -> State# s
forall d.
MutableByteArray# d -> Int# -> Word# -> State# d -> State# d
writeWord32Array# MutableByteArray# s
mbytes# Int#
n# Word#
e#
    
    {-# INLINE newUnboxed #-}
    newUnboxed :: Word32 -> Int# -> State# s -> (# State# s, MutableByteArray# s #)
newUnboxed Word32
_ = Word32 -> Int# -> State# s -> (# State# s, MutableByteArray# s #)
forall e s.
Unboxed e =>
e -> Int# -> State# s -> (# State# s, MutableByteArray# s #)
newUnboxed' (Word32
0 :: Word32)

instance Unboxed Word64
  where
    {-# INLINE sizeof #-}
    sizeof :: Word64 -> Int -> Int
sizeof Word64
_ Int
n = Int -> Int -> Int
forall a. Ord a => a -> a -> a
max Int
0 Int
n Int -> Int -> Int
forall a. Num a => a -> a -> a
* Int
8
    
    {-# INLINE (!#) #-}
    ByteArray#
bytes# !# :: ByteArray# -> Int# -> Word64
!# Int#
i# = Word# -> Word64
W64# (ByteArray# -> Int# -> Word#
indexWord64Array# ByteArray#
bytes# Int#
i#)
    
    {-# INLINE (!>#) #-}
    MutableByteArray# s
mbytes# !># :: MutableByteArray# s -> Int# -> State# s -> (# State# s, Word64 #)
!># Int#
i# = \ State# s
s1# -> case MutableByteArray# s -> Int# -> State# s -> (# State# s, Word# #)
forall d.
MutableByteArray# d -> Int# -> State# d -> (# State# d, Word# #)
readWord64Array# MutableByteArray# s
mbytes# Int#
i# State# s
s1# of
      (# State# s
s2#, Word#
e# #) -> (# State# s
s2#, Word# -> Word64
W64# Word#
e# #)
    
    {-# INLINE writeByteArray# #-}
    writeByteArray# :: MutableByteArray# s -> Int# -> Word64 -> State# s -> State# s
writeByteArray# MutableByteArray# s
mbytes# Int#
n# (W64# Word#
e#) = MutableByteArray# s -> Int# -> Word# -> State# s -> State# s
forall d.
MutableByteArray# d -> Int# -> Word# -> State# d -> State# d
writeWord64Array# MutableByteArray# s
mbytes# Int#
n# Word#
e#
    
    {-# INLINE newUnboxed #-}
    newUnboxed :: Word64 -> Int# -> State# s -> (# State# s, MutableByteArray# s #)
newUnboxed Word64
_ = Word64 -> Int# -> State# s -> (# State# s, MutableByteArray# s #)
forall e s.
Unboxed e =>
e -> Int# -> State# s -> (# State# s, MutableByteArray# s #)
newUnboxed' (Word64
0 :: Word64)

instance Unboxed Float
  where
    {-# INLINE sizeof #-}
    sizeof :: Float -> Int -> Int
sizeof Float
_ Int
n = Int -> Int -> Int
forall a. Ord a => a -> a -> a
max Int
0 Int
n Int -> Int -> Int
forall a. Num a => a -> a -> a
* SIZEOF_HSFLOAT
    
    {-# INLINE (!#) #-}
    ByteArray#
bytes# !# :: ByteArray# -> Int# -> Float
!# Int#
i# = Float# -> Float
F# (ByteArray# -> Int# -> Float#
indexFloatArray# ByteArray#
bytes# Int#
i#)
    
    {-# INLINE (!>#) #-}
    MutableByteArray# s
mbytes# !># :: MutableByteArray# s -> Int# -> State# s -> (# State# s, Float #)
!># Int#
i# = \ State# s
s1# -> case MutableByteArray# s -> Int# -> State# s -> (# State# s, Float# #)
forall d.
MutableByteArray# d -> Int# -> State# d -> (# State# d, Float# #)
readFloatArray# MutableByteArray# s
mbytes# Int#
i# State# s
s1# of
      (# State# s
s2#, Float#
f# #) -> (# State# s
s2#, Float# -> Float
F# Float#
f# #)
    
    {-# INLINE writeByteArray# #-}
    writeByteArray# :: MutableByteArray# s -> Int# -> Float -> State# s -> State# s
writeByteArray# MutableByteArray# s
mbytes# Int#
n# (F# Float#
e#) = MutableByteArray# s -> Int# -> Float# -> State# s -> State# s
forall d.
MutableByteArray# d -> Int# -> Float# -> State# d -> State# d
writeFloatArray# MutableByteArray# s
mbytes# Int#
n# Float#
e#
    
    {-# INLINE newUnboxed #-}
    newUnboxed :: Float -> Int# -> State# s -> (# State# s, MutableByteArray# s #)
newUnboxed Float
_ = Float -> Int# -> State# s -> (# State# s, MutableByteArray# s #)
forall e s.
Unboxed e =>
e -> Int# -> State# s -> (# State# s, MutableByteArray# s #)
newUnboxed' (Float
0 :: Float)

instance Unboxed Double
  where
    {-# INLINE sizeof #-}
    sizeof :: Double -> Int -> Int
sizeof Double
_ Int
n = Int -> Int -> Int
forall a. Ord a => a -> a -> a
max Int
0 Int
n Int -> Int -> Int
forall a. Num a => a -> a -> a
* SIZEOF_HSDOUBLE
    
    {-# INLINE (!#) #-}
    ByteArray#
bytes# !# :: ByteArray# -> Int# -> Double
!# Int#
i# = Double# -> Double
D# (ByteArray# -> Int# -> Double#
indexDoubleArray# ByteArray#
bytes# Int#
i#)
    
    {-# INLINE (!>#) #-}
    MutableByteArray# s
mbytes# !># :: MutableByteArray# s -> Int# -> State# s -> (# State# s, Double #)
!># Int#
i# = \ State# s
s1# -> case MutableByteArray# s -> Int# -> State# s -> (# State# s, Double# #)
forall d.
MutableByteArray# d -> Int# -> State# d -> (# State# d, Double# #)
readDoubleArray# MutableByteArray# s
mbytes# Int#
i# State# s
s1# of
      (# State# s
s2#, Double#
d# #) -> (# State# s
s2#, Double# -> Double
D# Double#
d# #)
    
    {-# INLINE writeByteArray# #-}
    writeByteArray# :: MutableByteArray# s -> Int# -> Double -> State# s -> State# s
writeByteArray# MutableByteArray# s
mbytes# Int#
n# (D# Double#
e#) = MutableByteArray# s -> Int# -> Double# -> State# s -> State# s
forall d.
MutableByteArray# d -> Int# -> Double# -> State# d -> State# d
writeDoubleArray# MutableByteArray# s
mbytes# Int#
n# Double#
e#
    
    {-# INLINE newUnboxed #-}
    newUnboxed :: Double -> Int# -> State# s -> (# State# s, MutableByteArray# s #)
newUnboxed Double
_ = Double -> Int# -> State# s -> (# State# s, MutableByteArray# s #)
forall e s.
Unboxed e =>
e -> Int# -> State# s -> (# State# s, MutableByteArray# s #)
newUnboxed' (Double
0 :: Double)

instance (Unboxed a, Integral a) => Unboxed (Ratio a)
  where
    sizeof :: Ratio a -> Int -> Int
sizeof Ratio a
e Int
n = Int
2 Int -> Int -> Int
forall a. Num a => a -> a -> a
* Ratio a -> Int -> Int
forall e (proxy :: * -> *). Unboxed e => proxy e -> Int -> Int
psizeof Ratio a
e Int
n
    
    ByteArray#
bytes# !# :: ByteArray# -> Int# -> Ratio a
!# Int#
i# = ByteArray#
bytes# ByteArray# -> Int# -> a
forall e. Unboxed e => ByteArray# -> Int# -> e
!# Int#
i2# a -> a -> Ratio a
forall a. Integral a => a -> a -> Ratio a
:% (ByteArray#
bytes# ByteArray# -> Int# -> a
forall e. Unboxed e => ByteArray# -> Int# -> e
!# (Int#
i2# Int# -> Int# -> Int#
+# Int#
1#)) where i2# :: Int#
i2# = Int#
2# Int# -> Int# -> Int#
*# Int#
i#
    
    MutableByteArray# s
mbytes# !># :: MutableByteArray# s -> Int# -> State# s -> (# State# s, Ratio a #)
!># Int#
i# = let i2# :: Int#
i2# = Int#
2# Int# -> Int# -> Int#
*# Int#
i# in \ State# s
s1# -> case MutableByteArray# s -> Int# -> State# s -> (# State# s, a #)
forall e s.
Unboxed e =>
MutableByteArray# s -> Int# -> State# s -> (# State# s, e #)
(!>#) MutableByteArray# s
mbytes# Int#
i2# State# s
s1# of
      (# State# s
s2#, a
n #) -> case MutableByteArray# s -> Int# -> State# s -> (# State# s, a #)
forall e s.
Unboxed e =>
MutableByteArray# s -> Int# -> State# s -> (# State# s, e #)
(!>#) MutableByteArray# s
mbytes# (Int#
i2# Int# -> Int# -> Int#
+# Int#
1#) State# s
s2# of
        (# State# s
s3#, a
d #) -> (# State# s
s3#, a
n a -> a -> Ratio a
forall a. Integral a => a -> a -> Ratio a
:% a
d #)
    
    {-# INLINE writeByteArray# #-}
    writeByteArray# :: MutableByteArray# s -> Int# -> Ratio a -> State# s -> State# s
writeByteArray# MutableByteArray# s
mbytes# Int#
i# (a
n :% a
d) = let i2# :: Int#
i2# = Int#
2# Int# -> Int# -> Int#
*# Int#
i# in
      \ State# s
s1# -> case MutableByteArray# s -> Int# -> a -> State# s -> State# s
forall e s.
Unboxed e =>
MutableByteArray# s -> Int# -> e -> State# s -> State# s
writeByteArray# MutableByteArray# s
mbytes# Int#
i2# a
n State# s
s1# of
        State# s
s2# -> MutableByteArray# s -> Int# -> a -> State# s -> State# s
forall e s.
Unboxed e =>
MutableByteArray# s -> Int# -> e -> State# s -> State# s
writeByteArray# MutableByteArray# s
mbytes# (Int#
i2# Int# -> Int# -> Int#
+# Int#
1#) a
d State# s
s2#
    
    {-# INLINE newUnboxed #-}
    newUnboxed :: Ratio a -> Int# -> State# s -> (# State# s, MutableByteArray# s #)
newUnboxed Ratio a
e Int#
n# = Ratio a -> Int# -> State# s -> (# State# s, MutableByteArray# s #)
forall e (proxy :: * -> *) s.
Unboxed e =>
proxy e -> Int# -> State# s -> (# State# s, MutableByteArray# s #)
pnewUnboxed Ratio a
e (Int#
2# Int# -> Int# -> Int#
*# Int#
n#)

instance (Unboxed a, Num a) => Unboxed (Complex a)
  where
    sizeof :: Complex a -> Int -> Int
sizeof Complex a
e Int
n = Int
2 Int -> Int -> Int
forall a. Num a => a -> a -> a
* Complex a -> Int -> Int
forall e (proxy :: * -> *). Unboxed e => proxy e -> Int -> Int
psizeof Complex a
e Int
n
    
    ByteArray#
bytes#  !# :: ByteArray# -> Int# -> Complex a
!#  Int#
i# = ByteArray#
bytes# ByteArray# -> Int# -> a
forall e. Unboxed e => ByteArray# -> Int# -> e
!# Int#
i2# a -> a -> Complex a
forall a. a -> a -> Complex a
:+ (ByteArray#
bytes# ByteArray# -> Int# -> a
forall e. Unboxed e => ByteArray# -> Int# -> e
!# (Int#
i2# Int# -> Int# -> Int#
+# Int#
1#)) where i2# :: Int#
i2# = Int#
2# Int# -> Int# -> Int#
*# Int#
i#
    MutableByteArray# s
mbytes# !># :: MutableByteArray# s
-> Int# -> State# s -> (# State# s, Complex a #)
!># Int#
i# = let i2# :: Int#
i2# = Int#
2# Int# -> Int# -> Int#
*# Int#
i# in \ State# s
s1# -> case MutableByteArray# s -> Int# -> State# s -> (# State# s, a #)
forall e s.
Unboxed e =>
MutableByteArray# s -> Int# -> State# s -> (# State# s, e #)
(!>#) MutableByteArray# s
mbytes# Int#
i2# State# s
s1# of
      (# State# s
s2#, a
n #) -> case MutableByteArray# s -> Int# -> State# s -> (# State# s, a #)
forall e s.
Unboxed e =>
MutableByteArray# s -> Int# -> State# s -> (# State# s, e #)
(!>#) MutableByteArray# s
mbytes# (Int#
i2# Int# -> Int# -> Int#
+# Int#
1#) State# s
s2# of
        (# State# s
s3#, a
d #) -> (# State# s
s3#, a
n a -> a -> Complex a
forall a. a -> a -> Complex a
:+ a
d #)
    
    {-# INLINE writeByteArray# #-}
    writeByteArray# :: MutableByteArray# s -> Int# -> Complex a -> State# s -> State# s
writeByteArray# MutableByteArray# s
mbytes# Int#
i# (a
n :+ a
d) = let i2# :: Int#
i2# = Int#
2# Int# -> Int# -> Int#
*# Int#
i# in
      \ State# s
s1# -> case MutableByteArray# s -> Int# -> a -> State# s -> State# s
forall e s.
Unboxed e =>
MutableByteArray# s -> Int# -> e -> State# s -> State# s
writeByteArray# MutableByteArray# s
mbytes# Int#
i2# a
n State# s
s1# of
        State# s
s2# -> MutableByteArray# s -> Int# -> a -> State# s -> State# s
forall e s.
Unboxed e =>
MutableByteArray# s -> Int# -> e -> State# s -> State# s
writeByteArray# MutableByteArray# s
mbytes# (Int#
i2# Int# -> Int# -> Int#
+# Int#
1#) a
d State# s
s2#
    
    {-# INLINE newUnboxed #-}
    newUnboxed :: Complex a
-> Int# -> State# s -> (# State# s, MutableByteArray# s #)
newUnboxed Complex a
e Int#
n# = Complex a
-> Int# -> State# s -> (# State# s, MutableByteArray# s #)
forall e (proxy :: * -> *) s.
Unboxed e =>
proxy e -> Int# -> State# s -> (# State# s, MutableByteArray# s #)
pnewUnboxed Complex a
e (Int#
2# Int# -> Int# -> Int#
*# Int#
n#)

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

{- Pointer instances. -}

instance Unboxed (Ptr a)
  where
    {-# INLINE sizeof #-}
    sizeof :: Ptr a -> Int -> Int
sizeof Ptr a
_ Int
n = Int -> Int -> Int
forall a. Ord a => a -> a -> a
max Int
0 Int
n Int -> Int -> Int
forall a. Num a => a -> a -> a
* SIZEOF_HSWORD
    
    {-# INLINE (!#) #-}
    ByteArray#
bytes# !# :: ByteArray# -> Int# -> Ptr a
!# Int#
i# = Addr# -> Ptr a
forall a. Addr# -> Ptr a
Ptr (ByteArray# -> Int# -> Addr#
indexAddrArray# ByteArray#
bytes# Int#
i#)
    
    {-# INLINE (!>#) #-}
    MutableByteArray# s
mbytes# !># :: MutableByteArray# s -> Int# -> State# s -> (# State# s, Ptr a #)
!># Int#
i# = \ State# s
s1# -> case MutableByteArray# s -> Int# -> State# s -> (# State# s, Addr# #)
forall d.
MutableByteArray# d -> Int# -> State# d -> (# State# d, Addr# #)
readAddrArray# MutableByteArray# s
mbytes# Int#
i# State# s
s1# of
      (# State# s
s2#, Addr#
e# #) -> (# State# s
s2#, Addr# -> Ptr a
forall a. Addr# -> Ptr a
Ptr Addr#
e# #)
    
    {-# INLINE writeByteArray# #-}
    writeByteArray# :: MutableByteArray# s -> Int# -> Ptr a -> State# s -> State# s
writeByteArray# MutableByteArray# s
mbytes# Int#
n# (Ptr Addr#
e) = MutableByteArray# s -> Int# -> Addr# -> State# s -> State# s
forall d.
MutableByteArray# d -> Int# -> Addr# -> State# d -> State# d
writeAddrArray# MutableByteArray# s
mbytes# Int#
n# Addr#
e

    {-# INLINE newUnboxed #-}
    newUnboxed :: Ptr a -> Int# -> State# s -> (# State# s, MutableByteArray# s #)
newUnboxed Ptr a
_ = Ptr Any -> Int# -> State# s -> (# State# s, MutableByteArray# s #)
forall e s.
Unboxed e =>
e -> Int# -> State# s -> (# State# s, MutableByteArray# s #)
newUnboxed' Ptr Any
forall a. Ptr a
nullPtr

instance Unboxed (FunPtr a)
  where
    {-# INLINE sizeof #-}
    sizeof :: FunPtr a -> Int -> Int
sizeof FunPtr a
_ Int
n = Int -> Int -> Int
forall a. Ord a => a -> a -> a
max Int
0 Int
n Int -> Int -> Int
forall a. Num a => a -> a -> a
* SIZEOF_HSWORD
    
    {-# INLINE (!#) #-}
    ByteArray#
bytes#  !# :: ByteArray# -> Int# -> FunPtr a
!#  Int#
i# = Addr# -> FunPtr a
forall a. Addr# -> FunPtr a
FunPtr (ByteArray# -> Int# -> Addr#
indexAddrArray# ByteArray#
bytes# Int#
i#)
    
    {-# INLINE (!>#) #-}
    MutableByteArray# s
mbytes# !># :: MutableByteArray# s -> Int# -> State# s -> (# State# s, FunPtr a #)
!># Int#
i# = \ State# s
s1# -> case MutableByteArray# s -> Int# -> State# s -> (# State# s, Addr# #)
forall d.
MutableByteArray# d -> Int# -> State# d -> (# State# d, Addr# #)
readAddrArray# MutableByteArray# s
mbytes# Int#
i# State# s
s1# of
      (# State# s
s2#, Addr#
e# #) -> (# State# s
s2#, Addr# -> FunPtr a
forall a. Addr# -> FunPtr a
FunPtr Addr#
e# #)
    
    {-# INLINE writeByteArray# #-}
    writeByteArray# :: MutableByteArray# s -> Int# -> FunPtr a -> State# s -> State# s
writeByteArray# MutableByteArray# s
mbytes# Int#
n# (FunPtr Addr#
e) = MutableByteArray# s -> Int# -> Addr# -> State# s -> State# s
forall d.
MutableByteArray# d -> Int# -> Addr# -> State# d -> State# d
writeAddrArray# MutableByteArray# s
mbytes# Int#
n# Addr#
e

    {-# INLINE newUnboxed #-}
    newUnboxed :: FunPtr a -> Int# -> State# s -> (# State# s, MutableByteArray# s #)
newUnboxed FunPtr a
e = FunPtr a -> Int# -> State# s -> (# State# s, MutableByteArray# s #)
forall e s.
Unboxed e =>
e -> Int# -> State# s -> (# State# s, MutableByteArray# s #)
newUnboxed' (FunPtr a
forall e. Nullable e => e
NULL FunPtr a -> FunPtr a -> FunPtr a
forall a. a -> a -> a
`asTypeOf` FunPtr a
e)

instance Unboxed (StablePtr a)
  where
    {-# INLINE sizeof #-}
    sizeof :: StablePtr a -> Int -> Int
sizeof StablePtr a
_ Int
n = Int -> Int -> Int
forall a. Ord a => a -> a -> a
max Int
0 Int
n Int -> Int -> Int
forall a. Num a => a -> a -> a
* SIZEOF_HSWORD
    
    {-# INLINE (!#) #-}
    ByteArray#
bytes# !# :: ByteArray# -> Int# -> StablePtr a
!# Int#
i# = StablePtr# a -> StablePtr a
forall a. StablePtr# a -> StablePtr a
StablePtr (ByteArray# -> Int# -> StablePtr# a
forall a. ByteArray# -> Int# -> StablePtr# a
indexStablePtrArray# ByteArray#
bytes# Int#
i#)
    
    {-# INLINE (!>#) #-}
    MutableByteArray# s
mbytes# !># :: MutableByteArray# s
-> Int# -> State# s -> (# State# s, StablePtr a #)
!># Int#
i# = \ State# s
s1# -> case MutableByteArray# s
-> Int# -> State# s -> (# State# s, StablePtr# a #)
forall d a.
MutableByteArray# d
-> Int# -> State# d -> (# State# d, StablePtr# a #)
readStablePtrArray# MutableByteArray# s
mbytes# Int#
i# State# s
s1# of
      (# State# s
s2#, StablePtr# a
e# #) -> (# State# s
s2#, StablePtr# a -> StablePtr a
forall a. StablePtr# a -> StablePtr a
StablePtr StablePtr# a
e# #)
    
    {-# INLINE writeByteArray# #-}
    writeByteArray# :: MutableByteArray# s -> Int# -> StablePtr a -> State# s -> State# s
writeByteArray# MutableByteArray# s
mbytes# Int#
n# (StablePtr StablePtr# a
e) = MutableByteArray# s -> Int# -> StablePtr# a -> State# s -> State# s
forall d a.
MutableByteArray# d -> Int# -> StablePtr# a -> State# d -> State# d
writeStablePtrArray# MutableByteArray# s
mbytes# Int#
n# StablePtr# a
e

    {-# INLINE newUnboxed #-}
    newUnboxed :: StablePtr a
-> Int# -> State# s -> (# State# s, MutableByteArray# s #)
newUnboxed StablePtr a
e = StablePtr a
-> Int# -> State# s -> (# State# s, MutableByteArray# s #)
forall e s.
Unboxed e =>
e -> Int# -> State# s -> (# State# s, MutableByteArray# s #)
newUnboxed' (StablePtr a
forall e. Nullable e => e
NULL StablePtr a -> StablePtr a -> StablePtr a
forall a. a -> a -> a
`asTypeOf` StablePtr a
e)

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

{- Foreign C instances. -}

#define deriving_instance_Unboxed(Type)\
instance Unboxed Type where\
{\
  sizeof e = sizeof (consSizeof Type e);\
  arr# !# i# = Type ( arr# !# i# );\
  marr# !># i# = \ s1# -> case (!>#) marr# i# s1# of {(# s2#, e #) -> (# s2#, Type e #)};\
  writeByteArray# marr# i# (Type e) = writeByteArray# marr# i# e;\
  fillByteArray#  marr# i# (Type e) = fillByteArray#  marr# i# e;\
  newUnboxed  (Type e) = newUnboxed  e;\
  newUnboxed' (Type e) = newUnboxed' e;\
}

deriving_instance_Unboxed(CChar)
deriving_instance_Unboxed(CSChar)
deriving_instance_Unboxed(CWchar)
deriving_instance_Unboxed(CShort)
deriving_instance_Unboxed(CUShort)

deriving_instance_Unboxed(CInt)
deriving_instance_Unboxed(CUInt)
deriving_instance_Unboxed(CLong)
deriving_instance_Unboxed(CULong)
deriving_instance_Unboxed(CLLong)
deriving_instance_Unboxed(CULLong)
deriving_instance_Unboxed(CIntPtr)
deriving_instance_Unboxed(CUIntPtr)
deriving_instance_Unboxed(CIntMax)
deriving_instance_Unboxed(CUIntMax)
deriving_instance_Unboxed(CPtrdiff)

deriving_instance_Unboxed(CTime)
deriving_instance_Unboxed(CClock)
deriving_instance_Unboxed(CUSeconds)
deriving_instance_Unboxed(CSUSeconds)

deriving_instance_Unboxed(CSize)

#if MIN_VERSION_base(4,10,0)
-- | @since base-4.10.0.0
deriving_instance_Unboxed(CBool)
#endif

deriving_instance_Unboxed(CFloat)
deriving_instance_Unboxed(CDouble)
deriving_instance_Unboxed(CSigAtomic)

#undef deriving_instance_Unboxed

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

{- Other instances. -}

instance Unboxed Bool
  where
    {-# INLINE sizeof #-}
    sizeof :: Bool -> Int -> Int
sizeof Bool
_ Int
c = Int
d Int -> Int -> Bool
forall a. Eq a => a -> a -> Bool
== Int
0 Bool -> Int -> Int -> Int
forall a. Bool -> a -> a -> a
? Int
n (Int -> Int) -> Int -> Int
forall a b. (a -> b) -> a -> b
$ Int
n Int -> Int -> Int
forall a. Num a => a -> a -> a
+ Int
1 where (Int
n, Int
d) = Int -> Int -> Int
forall a. Ord a => a -> a -> a
max Int
0 Int
c Int -> Int -> (Int, Int)
forall a. Integral a => a -> a -> (a, a)
`divMod` Int
8
    
    {-# INLINE (!#) #-}
    ByteArray#
bytes# !# :: ByteArray# -> Int# -> Bool
!# Int#
i# = Int# -> Bool
isTrue# ((ByteArray# -> Int# -> Word#
indexWordArray# ByteArray#
bytes# (Int# -> Int#
bool_index Int#
i#) Word# -> Word# -> Word#
`and#` Int# -> Word#
bool_bit Int#
i#) Word# -> Word# -> Int#
`neWord#` Int# -> Word#
int2Word# Int#
0#)
    
    {-# INLINE (!>#) #-}
    MutableByteArray# s
mbytes# !># :: MutableByteArray# s -> Int# -> State# s -> (# State# s, Bool #)
!># Int#
i# = \ State# s
s1# -> case MutableByteArray# s -> Int# -> State# s -> (# State# s, Word# #)
forall d.
MutableByteArray# d -> Int# -> State# d -> (# State# d, Word# #)
readWordArray# MutableByteArray# s
mbytes# (Int# -> Int#
bool_index Int#
i#) State# s
s1# of
      (# State# s
s2#, Word#
e# #) -> (# State# s
s2#, Int# -> Bool
isTrue# ((Word#
e# Word# -> Word# -> Word#
`and#` Int# -> Word#
bool_bit Int#
i#) Word# -> Word# -> Int#
`neWord#` Int# -> Word#
int2Word# Int#
0#) #)
    
    {-# INLINE writeByteArray# #-}
    writeByteArray# :: MutableByteArray# s -> Int# -> Bool -> State# s -> State# s
writeByteArray# MutableByteArray# s
mbytes# Int#
n# Bool
e = \ State# s
s1# -> case MutableByteArray# s -> Int# -> State# s -> (# State# s, Word# #)
forall d.
MutableByteArray# d -> Int# -> State# d -> (# State# d, Word# #)
readWordArray# MutableByteArray# s
mbytes# Int#
i# State# s
s1# of
        (# State# s
s2#, Word#
old_byte# #) -> MutableByteArray# s -> Int# -> Word# -> State# s -> State# s
forall d.
MutableByteArray# d -> Int# -> Word# -> State# d -> State# d
writeWordArray# MutableByteArray# s
mbytes# Int#
i# (Word# -> Word#
bitWrite Word#
old_byte#) State# s
s2#
      where
        bitWrite :: Word# -> Word#
bitWrite Word#
old_byte# = if Bool
e then Word#
old_byte# Word# -> Word# -> Word#
`or#` Int# -> Word#
bool_bit Int#
n# else Word#
old_byte# Word# -> Word# -> Word#
`and#` Int# -> Word#
bool_not_bit Int#
n#
        i# :: Int#
i# = Int# -> Int#
bool_index Int#
n#
    
    {-# INLINE newUnboxed #-}
    newUnboxed :: Bool -> Int# -> State# s -> (# State# s, MutableByteArray# s #)
newUnboxed Bool
_ = Bool -> Int# -> State# s -> (# State# s, MutableByteArray# s #)
forall e s.
Unboxed e =>
e -> Int# -> State# s -> (# State# s, MutableByteArray# s #)
newUnboxed' Bool
False
    
    fillByteArray# :: MutableByteArray# s -> Int# -> Bool -> State# s -> State# s
fillByteArray# MutableByteArray# s
mbytes# Int#
n# Bool
e =
      MutableByteArray# s -> Int# -> Int# -> Int# -> State# s -> State# s
forall d.
MutableByteArray# d -> Int# -> Int# -> Int# -> State# d -> State# d
setByteArray# MutableByteArray# s
mbytes# Int#
0# (Int# -> Int#
bool_scale Int#
n#) (if Bool
e then Int#
0xff# else Int#
0#)
    
    copyUnboxed# :: Bool
-> ByteArray#
-> Int#
-> MutableByteArray# s
-> Int#
-> Int#
-> State# s
-> State# s
copyUnboxed# Bool
e ByteArray#
bytes# Int#
o1# MutableByteArray# s
mbytes# Int#
o2# Int#
c# = Int# -> Bool
isTrue# (Int#
c# Int# -> Int# -> Int#
<# Int#
1#) Bool
-> (State# s -> State# s)
-> (State# s -> State# s)
-> State# s
-> State# s
forall a. Bool -> a -> a -> a
? (\ State# s
s1# -> State# s
s1#) ((State# s -> State# s) -> State# s -> State# s)
-> (State# s -> State# s) -> State# s -> State# s
forall a b. (a -> b) -> a -> b
$
      \ State# s
s1# -> case MutableByteArray# s -> Int# -> Bool -> State# s -> State# s
forall e s.
Unboxed e =>
MutableByteArray# s -> Int# -> e -> State# s -> State# s
writeByteArray# MutableByteArray# s
mbytes# Int#
o2# ((ByteArray#
bytes# ByteArray# -> Int# -> Bool
forall e. Unboxed e => ByteArray# -> Int# -> e
!# Int#
o1#) Bool -> Bool -> Bool
forall a. a -> a -> a
`asTypeOf` Bool
e) State# s
s1# of
        State# s
s2# -> Bool
-> ByteArray#
-> Int#
-> MutableByteArray# s
-> Int#
-> Int#
-> State# s
-> State# s
forall e s.
Unboxed e =>
e
-> ByteArray#
-> Int#
-> MutableByteArray# s
-> Int#
-> Int#
-> State# s
-> State# s
copyUnboxed# Bool
e ByteArray#
bytes# (Int#
o1# Int# -> Int# -> Int#
+# Int#
1#) MutableByteArray# s
mbytes# (Int#
o2# Int# -> Int# -> Int#
+# Int#
1#) (Int#
c# Int# -> Int# -> Int#
-# Int#
1#) State# s
s2#
    
    copyUnboxedM# :: Bool
-> MutableByteArray# s
-> Int#
-> MutableByteArray# s
-> Int#
-> Int#
-> State# s
-> State# s
copyUnboxedM# Bool
e MutableByteArray# s
src# Int#
o1# MutableByteArray# s
mbytes# Int#
o2# Int#
n# = \ State# s
s1# -> case MutableByteArray# s -> Int# -> State# s -> (# State# s, Bool #)
forall e s.
Unboxed e =>
MutableByteArray# s -> Int# -> State# s -> (# State# s, e #)
(!>#) MutableByteArray# s
src# Int#
o1# State# s
s1# of
      (# State# s
s2#, Bool
x #) -> case MutableByteArray# s -> Int# -> Bool -> State# s -> State# s
forall e s.
Unboxed e =>
MutableByteArray# s -> Int# -> e -> State# s -> State# s
writeByteArray# MutableByteArray# s
mbytes# Int#
o2# (Bool
x Bool -> Bool -> Bool
forall a. a -> a -> a
`asTypeOf` Bool
e) State# s
s2# of
        State# s
s3# -> Bool
-> MutableByteArray# s
-> Int#
-> MutableByteArray# s
-> Int#
-> Int#
-> State# s
-> State# s
forall e s.
Unboxed e =>
e
-> MutableByteArray# s
-> Int#
-> MutableByteArray# s
-> Int#
-> Int#
-> State# s
-> State# s
copyUnboxedM# Bool
e MutableByteArray# s
src# (Int#
o1# Int# -> Int# -> Int#
+# Int#
1#) MutableByteArray# s
mbytes# (Int#
o2# Int# -> Int# -> Int#
+# Int#
1#) (Int#
n# Int# -> Int# -> Int#
-# Int#
1#) State# s
s3#
    
    hashUnboxedWith :: Bool -> Int# -> Int# -> ByteArray# -> Int# -> Int#
hashUnboxedWith Bool
e Int#
len# Int#
off# ByteArray#
bytes#
        | Int# -> Bool
isTrue#   (Int#
len# Int# -> Int# -> Int#
<# Int#
1#)    = \ Int#
salt# -> Int#
salt#
        | Int# -> Bool
isTrue#   (Int#
off# Int# -> Int# -> Int#
<# Int#
0#)    = Bool -> Int# -> Int# -> ByteArray# -> Int# -> Int#
forall e.
Unboxed e =>
e -> Int# -> Int# -> ByteArray# -> Int# -> Int#
hashUnboxedWith Bool
e Int#
len# Int#
0# ByteArray#
bytes#
        | Int# -> Bool
isTrue# (Int#
bit_off# Int# -> Int# -> Int#
==# Int#
0#) = Int# -> Int# -> Int# -> Int#
go0 Int#
byte_cnt# Int#
byte_off#
        |            Bool
True           = Int# -> Int# -> Word# -> Int# -> Int#
goo Int#
byte_cnt# (Int#
byte_off# Int# -> Int# -> Int#
+# Int#
1#) (ByteArray# -> Int# -> Word#
indexWord8Array# ByteArray#
bytes# Int#
byte_off#)
      where
        go0 :: Int# -> Int# -> Int# -> Int#
go0 Int#
0# Int#
_  Int#
salt# = Int#
salt#
        go0 Int#
1# Int#
o# Int#
salt# = Int# -> Word# -> Int#
hash# Int#
salt# (ByteArray# -> Int# -> Word#
indexWord8Array# ByteArray#
bytes# Int#
o# Word# -> Word# -> Word#
`and#` Word#
mask#)
        go0 Int#
n# Int#
o# Int#
salt# = Int# -> Int# -> Int# -> Int#
go0 (Int#
n# Int# -> Int# -> Int#
-# Int#
1#) (Int#
o# Int# -> Int# -> Int#
+# Int#
1#) (Int#
salt# Int# -> Word# -> Int#
`hash#` ByteArray# -> Int# -> Word#
indexWord8Array# ByteArray#
bytes# Int#
o#)
        
        goo :: Int# -> Int# -> Word# -> Int# -> Int#
goo Int#
0# Int#
_    Word#
_   Int#
salt# = Int#
salt#
        goo Int#
1# Int#
_  Word#
temp# Int#
salt# = Int# -> Word# -> Int#
hash# Int#
salt# (Word# -> Int# -> Word#
shiftRL# Word#
temp# Int#
bit_off# Word# -> Word# -> Word#
`and#` Word#
mask#)
        goo Int#
n# Int#
o# Word#
temp# Int#
salt# = Int# -> Int# -> Word# -> Int# -> Int#
goo (Int#
n# Int# -> Int# -> Int#
-# Int#
1#) (Int#
o# Int# -> Int# -> Int#
+# Int#
1#) Word#
byte# (Int# -> Word# -> Int#
hash# Int#
salt# Word#
curr#)
          where
            curr# :: Word#
curr# = Word# -> Int# -> Word#
shiftRL# Word#
temp# Int#
bit_off# Word# -> Word# -> Word#
`or#` Word# -> Int# -> Word#
shiftL# Word#
byte# (Int#
8# Int# -> Int# -> Int#
-# Int#
bit_off#)
            byte# :: Word#
byte# = ByteArray# -> Int# -> Word#
indexWord8Array# ByteArray#
bytes# Int#
o#
        
        hash# :: Int# -> Word# -> Int#
hash# = \ Int#
s# Word#
v# -> Word# -> Int#
word2Int# (Int# -> Word#
int2Word# (Int#
s# Int# -> Int# -> Int#
*# Int#
16777619#) Word# -> Word# -> Word#
`xor#` Word#
v#)
        mask# :: Word#
mask# = Int# -> Word#
int2Word# Int#
0xff# Word# -> Int# -> Word#
`shiftRL#` Int#
bit_rest#
        
        !(I# Int#
byte_off#, I# Int#
bit_off#) = Int# -> Int
I# Int#
off# Int -> Int -> (Int, Int)
forall a. Integral a => a -> a -> (a, a)
`divMod` Int
8
        !(I# Int#
bit_len#) = Int# -> Int
I# Int#
len# Int -> Int -> Int
forall a. Integral a => a -> a -> a
`mod` Int
8
        
        bit_rest# :: Int#
bit_rest# = if Int# -> Bool
isTrue# (Int#
bit_len# Int# -> Int# -> Int#
==# Int#
0#) then Int#
0# else Int#
8# Int# -> Int# -> Int#
-# Int#
bit_len#
        byte_cnt# :: Int#
byte_cnt# = Bool -> Int# -> Int#
forall e. Unboxed e => e -> Int# -> Int#
sizeof# Bool
e Int#
len#

instance Unboxed Char
  where
    {-# INLINE sizeof #-}
    sizeof :: Char -> Int -> Int
sizeof Char
_ Int
n = Int -> Int -> Int
forall a. Ord a => a -> a -> a
max Int
0 Int
n Int -> Int -> Int
forall a. Num a => a -> a -> a
* Int
4
    
    {-# INLINE (!#) #-}
    ByteArray#
bytes# !# :: ByteArray# -> Int# -> Char
!# Int#
i# = Char# -> Char
C# (ByteArray# -> Int# -> Char#
indexWideCharArray# ByteArray#
bytes# Int#
i#)
    
    {-# INLINE (!>#) #-}
    MutableByteArray# s
mbytes# !># :: MutableByteArray# s -> Int# -> State# s -> (# State# s, Char #)
!># Int#
i# = \ State# s
s1# -> case MutableByteArray# s -> Int# -> State# s -> (# State# s, Char# #)
forall d.
MutableByteArray# d -> Int# -> State# d -> (# State# d, Char# #)
readWideCharArray# MutableByteArray# s
mbytes# Int#
i# State# s
s1# of
      (# State# s
s2#, Char#
c# #) -> (# State# s
s2#, Char# -> Char
C# Char#
c# #)
    
    {-# INLINE writeByteArray# #-}
    writeByteArray# :: MutableByteArray# s -> Int# -> Char -> State# s -> State# s
writeByteArray# MutableByteArray# s
mbytes# Int#
n# (C# Char#
e#) = MutableByteArray# s -> Int# -> Char# -> State# s -> State# s
forall d.
MutableByteArray# d -> Int# -> Char# -> State# d -> State# d
writeWideCharArray# MutableByteArray# s
mbytes# Int#
n# Char#
e#
    
    {-# INLINE newUnboxed #-}
    newUnboxed :: Char -> Int# -> State# s -> (# State# s, MutableByteArray# s #)
newUnboxed Char
e Int#
n# = \ State# s
s1# -> case Int# -> State# s -> (# State# s, MutableByteArray# s #)
forall d. Int# -> State# d -> (# State# d, MutableByteArray# d #)
newByteArray# (Char -> Int# -> Int#
forall e. Unboxed e => e -> Int# -> Int#
sizeof# Char
e Int#
n#) State# s
s1# of
      (# State# s
s2#, MutableByteArray# s
mbytes# #) -> case MutableByteArray# s -> Int# -> Char -> State# s -> State# s
forall e s.
Unboxed e =>
MutableByteArray# s -> Int# -> e -> State# s -> State# s
fillByteArray# MutableByteArray# s
mbytes# Int#
n# Char
'\0' State# s
s2# of
        State# s
s3# -> (# State# s
s3#, MutableByteArray# s
mbytes# #)

instance Unboxed E
  where
    {-# INLINE sizeof #-}
    sizeof :: E -> Int -> Int
sizeof E
_ Int
_ = Int
0
    
    {-# INLINE (!#) #-}
    !># :: MutableByteArray# s -> Int# -> State# s -> (# State# s, E #)
(!>#) = \ MutableByteArray# s
_ Int#
_ State# s
s# -> (# State# s
s#, E
E #)
    !# :: ByteArray# -> Int# -> E
(!#)  = \ ByteArray#
_ Int#
_ -> E
E
    
    newUnboxed :: E -> Int# -> State# s -> (# State# s, MutableByteArray# s #)
newUnboxed  E
_ Int#
_ = Int# -> State# s -> (# State# s, MutableByteArray# s #)
forall d. Int# -> State# d -> (# State# d, MutableByteArray# d #)
newByteArray# Int#
0#
    newUnboxed' :: E -> Int# -> State# s -> (# State# s, MutableByteArray# s #)
newUnboxed' E
_ Int#
_ = Int# -> State# s -> (# State# s, MutableByteArray# s #)
forall d. Int# -> State# d -> (# State# d, MutableByteArray# d #)
newByteArray# Int#
0#
    
    writeByteArray# :: MutableByteArray# s -> Int# -> E -> State# s -> State# s
writeByteArray# MutableByteArray# s
_ Int#
_ = \ E
_ State# s
s# -> State# s
s#
    fillByteArray# :: MutableByteArray# s -> Int# -> E -> State# s -> State# s
fillByteArray#  MutableByteArray# s
_ Int#
_ = \ E
_ State# s
s# -> State# s
s#

instance (Unboxed e) => Unboxed (I1 e)
  where
    sizeof# :: I1 e -> Int# -> Int#
sizeof# = I1 e -> Int# -> Int#
forall e (proxy :: * -> *). Unboxed e => proxy e -> Int# -> Int#
psizeof#
    sizeof :: I1 e -> Int -> Int
sizeof  = I1 e -> Int -> Int
forall e (proxy :: * -> *). Unboxed e => proxy e -> Int -> Int
psizeof
    
    ByteArray#
bytes# !# :: ByteArray# -> Int# -> I1 e
!#  Int#
i# = E
E E -> e -> I1 e
forall tail head. tail -> head -> tail :& head
:& (ByteArray#
bytes# ByteArray# -> Int# -> e
forall e. Unboxed e => ByteArray# -> Int# -> e
!# Int#
i#)
    MutableByteArray# s
bytes# !># :: MutableByteArray# s -> Int# -> State# s -> (# State# s, I1 e #)
!># Int#
i# = \ State# s
s1# -> case MutableByteArray# s -> Int# -> State# s -> (# State# s, e #)
forall e s.
Unboxed e =>
MutableByteArray# s -> Int# -> State# s -> (# State# s, e #)
(!>#) MutableByteArray# s
bytes# Int#
i# State# s
s1# of
      (# State# s
s2#, e
e #) -> (# State# s
s2#, E
E E -> e -> I1 e
forall tail head. tail -> head -> tail :& head
:& e
e #)
    
    writeByteArray# :: MutableByteArray# s -> Int# -> I1 e -> State# s -> State# s
writeByteArray# MutableByteArray# s
bytes# Int#
n# (E
E :& e
e) = MutableByteArray# s -> Int# -> e -> State# s -> State# s
forall e s.
Unboxed e =>
MutableByteArray# s -> Int# -> e -> State# s -> State# s
writeByteArray# MutableByteArray# s
bytes# Int#
n# e
e
    fillByteArray# :: MutableByteArray# s -> Int# -> I1 e -> State# s -> State# s
fillByteArray#  MutableByteArray# s
bytes# Int#
n# (E
E :& e
e) = MutableByteArray# s -> Int# -> e -> State# s -> State# s
forall e s.
Unboxed e =>
MutableByteArray# s -> Int# -> e -> State# s -> State# s
fillByteArray#  MutableByteArray# s
bytes# Int#
n# e
e
    
    newUnboxed' :: I1 e -> Int# -> State# s -> (# State# s, MutableByteArray# s #)
newUnboxed' = \ (E
E :& e
i) -> e -> Int# -> State# s -> (# State# s, MutableByteArray# s #)
forall e s.
Unboxed e =>
e -> Int# -> State# s -> (# State# s, MutableByteArray# s #)
newUnboxed e
i
    newUnboxed :: I1 e -> Int# -> State# s -> (# State# s, MutableByteArray# s #)
newUnboxed  = I1 e -> Int# -> State# s -> (# State# s, MutableByteArray# s #)
forall e (proxy :: * -> *) s.
Unboxed e =>
proxy e -> Int# -> State# s -> (# State# s, MutableByteArray# s #)
pnewUnboxed

instance (Enum e, Shape e, Bounded e, Unboxed e, Shape (e' :& e), Unboxed (e' :& e)) => Unboxed (e' :& e :& e)
  where
    sizeof# :: ((e' :& e) :& e) -> Int# -> Int#
sizeof# (e' :& e) :& e
e Int#
n# = ((e' :& e) :& e) -> Int# -> Int#
forall e (proxy :: * -> *). Unboxed e => proxy e -> Int# -> Int#
psizeof# (e' :& e) :& e
e (((e' :& e) :& e) -> Int#
forall i. Shape i => i -> Int#
rank# (e' :& e) :& e
e Int# -> Int# -> Int#
*# Int#
n#)
    sizeof :: ((e' :& e) :& e) -> Int -> Int
sizeof  (e' :& e) :& e
e  Int
n = ((e' :& e) :& e) -> Int -> Int
forall e (proxy :: * -> *). Unboxed e => proxy e -> Int -> Int
psizeof  (e' :& e) :& e
e (((e' :& e) :& e) -> Int
forall i. Shape i => i -> Int
rank  (e' :& e) :& e
e Int -> Int -> Int
forall a. Num a => a -> a -> a
*   Int
n)
    
    ByteArray#
bytes# !# :: ByteArray# -> Int# -> (e' :& e) :& e
!# Int#
i# = (e' :& e) -> (e' :& e) :& e
forall i head. (Unboxed i, Unboxed head, Shape i) => i -> i :& head
go e' :& e
forall a. HasCallStack => a
undefined
      where
        go :: i -> i :& head
go i
t =
          let r# :: Int#
r# = i -> Int#
forall i. Shape i => i -> Int#
rank# i
t; o# :: Int#
o# = Int#
i#Int# -> Int# -> Int#
*#Int#
r# Int# -> Int# -> Int#
+# Int#
i#
          in  ((ByteArray#
bytes# ByteArray# -> Int# -> i
forall e. Unboxed e => ByteArray# -> Int# -> e
!# Int#
o#) i -> i -> i
forall a. a -> a -> a
`asTypeOf` i
t) i -> head -> i :& head
forall tail head. tail -> head -> tail :& head
:& (ByteArray#
bytes# ByteArray# -> Int# -> head
forall e. Unboxed e => ByteArray# -> Int# -> e
!# (Int#
o# Int# -> Int# -> Int#
+# Int#
r#))
    
    MutableByteArray# s
bytes# !># :: MutableByteArray# s
-> Int# -> State# s -> (# State# s, (e' :& e) :& e #)
!># Int#
i# = (e' :& e) -> State# s -> (# State# s, (e' :& e) :& e #)
forall i head.
(Unboxed i, Unboxed head, Shape i) =>
i -> State# s -> (# State# s, i :& head #)
go e' :& e
forall a. HasCallStack => a
undefined
      where
        go :: i -> State# s -> (# State# s, i :& head #)
go i
t = let r# :: Int#
r# = i -> Int#
forall i. Shape i => i -> Int#
rank# i
t; o# :: Int#
o# = Int#
i#Int# -> Int# -> Int#
*#Int#
r# Int# -> Int# -> Int#
+# Int#
i# in
          \ State# s
s1# -> case MutableByteArray# s -> Int# -> State# s -> (# State# s, i #)
forall e s.
Unboxed e =>
MutableByteArray# s -> Int# -> State# s -> (# State# s, e #)
(!>#) MutableByteArray# s
bytes# Int#
o# State# s
s1# of
            (# State# s
s2#, i
es #) -> case MutableByteArray# s -> Int# -> State# s -> (# State# s, head #)
forall e s.
Unboxed e =>
MutableByteArray# s -> Int# -> State# s -> (# State# s, e #)
(!>#) MutableByteArray# s
bytes# (Int#
o# Int# -> Int# -> Int#
+# Int#
r#) State# s
s2# of
              (# State# s
s3#, head
e #) -> (# State# s
s3#, (i
es i -> i -> i
forall a. a -> a -> a
`asTypeOf` i
t) i -> head -> i :& head
forall tail head. tail -> head -> tail :& head
:& head
e #)
    
    writeByteArray# :: MutableByteArray# s
-> Int# -> ((e' :& e) :& e) -> State# s -> State# s
writeByteArray# MutableByteArray# s
bytes# Int#
i# (e' :& e
es :& e
e) = let r# :: Int#
r# = (e' :& e) -> Int#
forall i. Shape i => i -> Int#
rank# e' :& e
es; o# :: Int#
o# = Int#
i#Int# -> Int# -> Int#
*#Int#
r# Int# -> Int# -> Int#
+# Int#
i# in
      \ State# s
s1# -> case MutableByteArray# s -> Int# -> (e' :& e) -> State# s -> State# s
forall e s.
Unboxed e =>
MutableByteArray# s -> Int# -> e -> State# s -> State# s
writeByteArray# MutableByteArray# s
bytes# Int#
o# e' :& e
es State# s
s1# of
        State# s
s2# -> MutableByteArray# s -> Int# -> e -> State# s -> State# s
forall e s.
Unboxed e =>
MutableByteArray# s -> Int# -> e -> State# s -> State# s
writeByteArray# MutableByteArray# s
bytes# (Int#
o# Int# -> Int# -> Int#
+# Int#
r#) e
e State# s
s2#
    
    newUnboxed :: ((e' :& e) :& e)
-> Int# -> State# s -> (# State# s, MutableByteArray# s #)
newUnboxed (e' :& e) :& e
e Int#
n# = ((e' :& e) :& e)
-> Int# -> State# s -> (# State# s, MutableByteArray# s #)
forall e (proxy :: * -> *) s.
Unboxed e =>
proxy e -> Int# -> State# s -> (# State# s, MutableByteArray# s #)
pnewUnboxed (e' :& e) :& e
e (((e' :& e) :& e) -> Int#
forall i. Shape i => i -> Int#
rank# (e' :& e) :& e
e Int# -> Int# -> Int#
*# Int#
n#)

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

{- Tuple instances. -}

instance Unboxed ()
  where
    {-# INLINE sizeof #-}
    sizeof :: () -> Int -> Int
sizeof ()
_ Int
_ = Int
0
    
    {-# INLINE (!#) #-}
    !># :: MutableByteArray# s -> Int# -> State# s -> (# State# s, () #)
(!>#) = \ MutableByteArray# s
_ Int#
_ State# s
s# -> (# State# s
s#, () #)
    !# :: ByteArray# -> Int# -> ()
(!#)  = \ ByteArray#
_ Int#
_ -> ()
    
    newUnboxed :: () -> Int# -> State# s -> (# State# s, MutableByteArray# s #)
newUnboxed  ()
_ Int#
_ = Int# -> State# s -> (# State# s, MutableByteArray# s #)
forall d. Int# -> State# d -> (# State# d, MutableByteArray# d #)
newByteArray# Int#
0#
    newUnboxed' :: () -> Int# -> State# s -> (# State# s, MutableByteArray# s #)
newUnboxed' ()
_ Int#
_ = Int# -> State# s -> (# State# s, MutableByteArray# s #)
forall d. Int# -> State# d -> (# State# d, MutableByteArray# d #)
newByteArray# Int#
0#
    
    writeByteArray# :: MutableByteArray# s -> Int# -> () -> State# s -> State# s
writeByteArray# MutableByteArray# s
_ Int#
_ = \ ()
_ State# s
s# -> State# s
s#
    fillByteArray# :: MutableByteArray# s -> Int# -> () -> State# s -> State# s
fillByteArray#  MutableByteArray# s
_ Int#
_ = \ ()
_ State# s
s# -> State# s
s#

instance (Unboxed e) => Unboxed (T2 e)
  where
    sizeof :: T2 e -> Int -> Int
sizeof  T2 e
e2 Int
n  = T2 e -> Int -> Int
forall e (proxy :: * -> *). Unboxed e => proxy e -> Int -> Int
psizeof  T2 e
e2 (Int
2  Int -> Int -> Int
forall a. Num a => a -> a -> a
*   Int
n)
    sizeof# :: T2 e -> Int# -> Int#
sizeof# T2 e
e2 Int#
n# = T2 e -> Int# -> Int#
forall e (proxy :: * -> *). Unboxed e => proxy e -> Int# -> Int#
psizeof# T2 e
e2 (Int#
2# Int# -> Int# -> Int#
*# Int#
n#)
    
    ByteArray#
bytes# !# :: ByteArray# -> Int# -> T2 e
!#  Int#
n# = let o# :: Int#
o# = Int#
2# Int# -> Int# -> Int#
*# Int#
n# in (ByteArray#
bytes# ByteArray# -> Int# -> e
forall e. Unboxed e => ByteArray# -> Int# -> e
!# Int#
o#, ByteArray#
bytes# ByteArray# -> Int# -> e
forall e. Unboxed e => ByteArray# -> Int# -> e
!# (Int#
o#Int# -> Int# -> Int#
+#Int#
1#))
    MutableByteArray# s
bytes# !># :: MutableByteArray# s -> Int# -> State# s -> (# State# s, T2 e #)
!># Int#
n# = let o# :: Int#
o# = Int#
2# Int# -> Int# -> Int#
*# Int#
n# in \ State# s
s1# -> case MutableByteArray# s -> Int# -> State# s -> (# State# s, e #)
forall e s.
Unboxed e =>
MutableByteArray# s -> Int# -> State# s -> (# State# s, e #)
(!>#) MutableByteArray# s
bytes# Int#
o# State# s
s1# of
      (# State# s
s2#, e
e1 #) -> case MutableByteArray# s -> Int# -> State# s -> (# State# s, e #)
forall e s.
Unboxed e =>
MutableByteArray# s -> Int# -> State# s -> (# State# s, e #)
(!>#) MutableByteArray# s
bytes# (Int#
o# Int# -> Int# -> Int#
+# Int#
1#) State# s
s2# of
        (# State# s
s3#, e
e2 #) -> (# State# s
s3#, (e
e1,e
e2) #)
    
    writeByteArray# :: MutableByteArray# s -> Int# -> T2 e -> State# s -> State# s
writeByteArray# MutableByteArray# s
mbytes# Int#
n# (e
e1,e
e2) = let o# :: Int#
o# = Int#
2# Int# -> Int# -> Int#
*# Int#
n# in
      \ State# s
s1# -> case MutableByteArray# s -> Int# -> e -> State# s -> State# s
forall e s.
Unboxed e =>
MutableByteArray# s -> Int# -> e -> State# s -> State# s
writeByteArray# MutableByteArray# s
mbytes# Int#
o# e
e1 State# s
s1# of
        State# s
s2# -> MutableByteArray# s -> Int# -> e -> State# s -> State# s
forall e s.
Unboxed e =>
MutableByteArray# s -> Int# -> e -> State# s -> State# s
writeByteArray# MutableByteArray# s
mbytes# (Int#
o# Int# -> Int# -> Int#
+# Int#
1#) e
e2 State# s
s2#
    
    newUnboxed :: T2 e -> Int# -> State# s -> (# State# s, MutableByteArray# s #)
newUnboxed T2 e
e Int#
n# = T2 e -> Int# -> State# s -> (# State# s, MutableByteArray# s #)
forall e (proxy :: * -> *) s.
Unboxed e =>
proxy e -> Int# -> State# s -> (# State# s, MutableByteArray# s #)
pnewUnboxed T2 e
e (Int#
2# Int# -> Int# -> Int#
*# Int#
n#)

instance (Unboxed e) => Unboxed (T3 e)
  where
    sizeof :: T3 e -> Int -> Int
sizeof  T3 e
e2 Int
n  = T3 e -> Int -> Int
forall e (proxy :: * -> *). Unboxed e => proxy e -> Int -> Int
psizeof  T3 e
e2 (Int
3  Int -> Int -> Int
forall a. Num a => a -> a -> a
*   Int
n)
    sizeof# :: T3 e -> Int# -> Int#
sizeof# T3 e
e2 Int#
n# = T3 e -> Int# -> Int#
forall e (proxy :: * -> *). Unboxed e => proxy e -> Int# -> Int#
psizeof# T3 e
e2 (Int#
3# Int# -> Int# -> Int#
*# Int#
n#)
    
    ByteArray#
bytes# !# :: ByteArray# -> Int# -> T3 e
!# Int#
n# =
      let o# :: Int#
o# = Int#
3# Int# -> Int# -> Int#
*# Int#
n#
      in  (ByteArray#
bytes# ByteArray# -> Int# -> e
forall e. Unboxed e => ByteArray# -> Int# -> e
!# Int#
o#, ByteArray#
bytes# ByteArray# -> Int# -> e
forall e. Unboxed e => ByteArray# -> Int# -> e
!# (Int#
o#Int# -> Int# -> Int#
+#Int#
1#), ByteArray#
bytes# ByteArray# -> Int# -> e
forall e. Unboxed e => ByteArray# -> Int# -> e
!# (Int#
o#Int# -> Int# -> Int#
+#Int#
2#))
    
    MutableByteArray# s
bytes# !># :: MutableByteArray# s -> Int# -> State# s -> (# State# s, T3 e #)
!># Int#
n# = let o# :: Int#
o# = Int#
3# Int# -> Int# -> Int#
*# Int#
n# in \ State# s
s1# -> case MutableByteArray# s -> Int# -> State# s -> (# State# s, e #)
forall e s.
Unboxed e =>
MutableByteArray# s -> Int# -> State# s -> (# State# s, e #)
(!>#) MutableByteArray# s
bytes# Int#
o# State# s
s1# of
      (# State# s
s2#, e
e1 #) -> case MutableByteArray# s -> Int# -> State# s -> (# State# s, e #)
forall e s.
Unboxed e =>
MutableByteArray# s -> Int# -> State# s -> (# State# s, e #)
(!>#) MutableByteArray# s
bytes# (Int#
o# Int# -> Int# -> Int#
+# Int#
1#) State# s
s2# of
        (# State# s
s3#, e
e2 #) -> case MutableByteArray# s -> Int# -> State# s -> (# State# s, e #)
forall e s.
Unboxed e =>
MutableByteArray# s -> Int# -> State# s -> (# State# s, e #)
(!>#) MutableByteArray# s
bytes# (Int#
o# Int# -> Int# -> Int#
+# Int#
2#) State# s
s3# of
          (# State# s
s4#, e
e3 #) -> (# State# s
s4#, (e
e1,e
e2,e
e3) #)
    
    writeByteArray# :: MutableByteArray# s -> Int# -> T3 e -> State# s -> State# s
writeByteArray# MutableByteArray# s
mbytes# Int#
n# (e
e1,e
e2,e
e3) = let o# :: Int#
o# = Int#
3# Int# -> Int# -> Int#
*# Int#
n# in
      \ State# s
s1# -> case MutableByteArray# s -> Int# -> e -> State# s -> State# s
forall e s.
Unboxed e =>
MutableByteArray# s -> Int# -> e -> State# s -> State# s
writeByteArray# MutableByteArray# s
mbytes# Int#
o# e
e1 State# s
s1# of
        State# s
s2# -> case MutableByteArray# s -> Int# -> e -> State# s -> State# s
forall e s.
Unboxed e =>
MutableByteArray# s -> Int# -> e -> State# s -> State# s
writeByteArray# MutableByteArray# s
mbytes# (Int#
o# Int# -> Int# -> Int#
+# Int#
1#) e
e2 State# s
s2# of
          State# s
s3# -> MutableByteArray# s -> Int# -> e -> State# s -> State# s
forall e s.
Unboxed e =>
MutableByteArray# s -> Int# -> e -> State# s -> State# s
writeByteArray# MutableByteArray# s
mbytes# (Int#
o# Int# -> Int# -> Int#
+# Int#
2#) e
e3 State# s
s3#
    
    newUnboxed :: T3 e -> Int# -> State# s -> (# State# s, MutableByteArray# s #)
newUnboxed T3 e
e Int#
n# = T3 e -> Int# -> State# s -> (# State# s, MutableByteArray# s #)
forall e (proxy :: * -> *) s.
Unboxed e =>
proxy e -> Int# -> State# s -> (# State# s, MutableByteArray# s #)
pnewUnboxed T3 e
e (Int#
3# Int# -> Int# -> Int#
*# Int#
n#)

instance (Unboxed e) => Unboxed (T4 e)
  where
    sizeof :: T4 e -> Int -> Int
sizeof  T4 e
e2 Int
n  = T4 e -> Int -> Int
forall e (proxy :: * -> *). Unboxed e => proxy e -> Int -> Int
psizeof  T4 e
e2 (Int
4  Int -> Int -> Int
forall a. Num a => a -> a -> a
*   Int
n)
    sizeof# :: T4 e -> Int# -> Int#
sizeof# T4 e
e2 Int#
n# = T4 e -> Int# -> Int#
forall e (proxy :: * -> *). Unboxed e => proxy e -> Int# -> Int#
psizeof# T4 e
e2 (Int#
4# Int# -> Int# -> Int#
*# Int#
n#)
    
    ByteArray#
bytes# !# :: ByteArray# -> Int# -> T4 e
!# Int#
n# =
      let o# :: Int#
o# = Int#
4# Int# -> Int# -> Int#
*# Int#
n#
      in  (ByteArray#
bytes# ByteArray# -> Int# -> e
forall e. Unboxed e => ByteArray# -> Int# -> e
!# Int#
o#, ByteArray#
bytes# ByteArray# -> Int# -> e
forall e. Unboxed e => ByteArray# -> Int# -> e
!# (Int#
o#Int# -> Int# -> Int#
+#Int#
1#), ByteArray#
bytes# ByteArray# -> Int# -> e
forall e. Unboxed e => ByteArray# -> Int# -> e
!# (Int#
o#Int# -> Int# -> Int#
+#Int#
2#), ByteArray#
bytes# ByteArray# -> Int# -> e
forall e. Unboxed e => ByteArray# -> Int# -> e
!# (Int#
o#Int# -> Int# -> Int#
+#Int#
3#))
    
    MutableByteArray# s
bytes# !># :: MutableByteArray# s -> Int# -> State# s -> (# State# s, T4 e #)
!># Int#
n# = let o# :: Int#
o# = Int#
4# Int# -> Int# -> Int#
*# Int#
n# in \ State# s
s1# -> case MutableByteArray# s -> Int# -> State# s -> (# State# s, e #)
forall e s.
Unboxed e =>
MutableByteArray# s -> Int# -> State# s -> (# State# s, e #)
(!>#) MutableByteArray# s
bytes# Int#
o# State# s
s1# of
      (# State# s
s2#, e
e1 #) -> case MutableByteArray# s -> Int# -> State# s -> (# State# s, e #)
forall e s.
Unboxed e =>
MutableByteArray# s -> Int# -> State# s -> (# State# s, e #)
(!>#) MutableByteArray# s
bytes# (Int#
o# Int# -> Int# -> Int#
+# Int#
1#) State# s
s2# of
        (# State# s
s3#, e
e2 #) -> case MutableByteArray# s -> Int# -> State# s -> (# State# s, e #)
forall e s.
Unboxed e =>
MutableByteArray# s -> Int# -> State# s -> (# State# s, e #)
(!>#) MutableByteArray# s
bytes# (Int#
o# Int# -> Int# -> Int#
+# Int#
2#) State# s
s3# of
          (# State# s
s4#, e
e3 #) -> case MutableByteArray# s -> Int# -> State# s -> (# State# s, e #)
forall e s.
Unboxed e =>
MutableByteArray# s -> Int# -> State# s -> (# State# s, e #)
(!>#) MutableByteArray# s
bytes# (Int#
o# Int# -> Int# -> Int#
+# Int#
3#) State# s
s4# of
            (# State# s
s5#, e
e4 #) -> (# State# s
s5#, (e
e1,e
e2,e
e3,e
e4) #)
    
    writeByteArray# :: MutableByteArray# s -> Int# -> T4 e -> State# s -> State# s
writeByteArray# MutableByteArray# s
mbytes# Int#
n# (e
e1,e
e2,e
e3,e
e4) = let o# :: Int#
o# = Int#
4# Int# -> Int# -> Int#
*# Int#
n# in
      \ State# s
s1# -> case MutableByteArray# s -> Int# -> e -> State# s -> State# s
forall e s.
Unboxed e =>
MutableByteArray# s -> Int# -> e -> State# s -> State# s
writeByteArray# MutableByteArray# s
mbytes# Int#
o# e
e1 State# s
s1# of
        State# s
s2# -> case MutableByteArray# s -> Int# -> e -> State# s -> State# s
forall e s.
Unboxed e =>
MutableByteArray# s -> Int# -> e -> State# s -> State# s
writeByteArray# MutableByteArray# s
mbytes# (Int#
o# Int# -> Int# -> Int#
+# Int#
1#) e
e2 State# s
s2# of
          State# s
s3# -> case MutableByteArray# s -> Int# -> e -> State# s -> State# s
forall e s.
Unboxed e =>
MutableByteArray# s -> Int# -> e -> State# s -> State# s
writeByteArray# MutableByteArray# s
mbytes# (Int#
o# Int# -> Int# -> Int#
+# Int#
2#) e
e3 State# s
s3# of
            State# s
s4# -> MutableByteArray# s -> Int# -> e -> State# s -> State# s
forall e s.
Unboxed e =>
MutableByteArray# s -> Int# -> e -> State# s -> State# s
writeByteArray# MutableByteArray# s
mbytes# (Int#
o# Int# -> Int# -> Int#
+# Int#
3#) e
e4 State# s
s4#
    
    newUnboxed :: T4 e -> Int# -> State# s -> (# State# s, MutableByteArray# s #)
newUnboxed T4 e
e Int#
n# = T4 e -> Int# -> State# s -> (# State# s, MutableByteArray# s #)
forall e (proxy :: * -> *) s.
Unboxed e =>
proxy e -> Int# -> State# s -> (# State# s, MutableByteArray# s #)
pnewUnboxed T4 e
e (Int#
4# Int# -> Int# -> Int#
*# Int#
n#)

instance (Unboxed e) => Unboxed (T5 e)
  where
    sizeof :: T5 e -> Int -> Int
sizeof  T5 e
e2 Int
n  = T5 e -> Int -> Int
forall e (proxy :: * -> *). Unboxed e => proxy e -> Int -> Int
psizeof  T5 e
e2 (Int
5  Int -> Int -> Int
forall a. Num a => a -> a -> a
*   Int
n)
    sizeof# :: T5 e -> Int# -> Int#
sizeof# T5 e
e2 Int#
n# = T5 e -> Int# -> Int#
forall e (proxy :: * -> *). Unboxed e => proxy e -> Int# -> Int#
psizeof# T5 e
e2 (Int#
5# Int# -> Int# -> Int#
*# Int#
n#)
    
    ByteArray#
bytes# !# :: ByteArray# -> Int# -> T5 e
!# Int#
n# =
      let o# :: Int#
o# = Int#
5# Int# -> Int# -> Int#
*# Int#
n#
      in
        (
          ByteArray#
bytes# ByteArray# -> Int# -> e
forall e. Unboxed e => ByteArray# -> Int# -> e
!#       Int#
o#, ByteArray#
bytes# ByteArray# -> Int# -> e
forall e. Unboxed e => ByteArray# -> Int# -> e
!# (Int#
o#Int# -> Int# -> Int#
+#Int#
1#), ByteArray#
bytes# ByteArray# -> Int# -> e
forall e. Unboxed e => ByteArray# -> Int# -> e
!# (Int#
o#Int# -> Int# -> Int#
+#Int#
2#),
          ByteArray#
bytes# ByteArray# -> Int# -> e
forall e. Unboxed e => ByteArray# -> Int# -> e
!# (Int#
o#Int# -> Int# -> Int#
+#Int#
3#), ByteArray#
bytes# ByteArray# -> Int# -> e
forall e. Unboxed e => ByteArray# -> Int# -> e
!# (Int#
o#Int# -> Int# -> Int#
+#Int#
4#)
        )
    
    MutableByteArray# s
bytes# !># :: MutableByteArray# s -> Int# -> State# s -> (# State# s, T5 e #)
!># Int#
n# = let o# :: Int#
o# = Int#
5# Int# -> Int# -> Int#
*# Int#
n# in \ State# s
s1# -> case MutableByteArray# s -> Int# -> State# s -> (# State# s, e #)
forall e s.
Unboxed e =>
MutableByteArray# s -> Int# -> State# s -> (# State# s, e #)
(!>#) MutableByteArray# s
bytes# Int#
o# State# s
s1# of
      (# State# s
s2#, e
e1 #) -> case MutableByteArray# s -> Int# -> State# s -> (# State# s, e #)
forall e s.
Unboxed e =>
MutableByteArray# s -> Int# -> State# s -> (# State# s, e #)
(!>#) MutableByteArray# s
bytes# (Int#
o# Int# -> Int# -> Int#
+# Int#
1#) State# s
s2# of
        (# State# s
s3#, e
e2 #) -> case MutableByteArray# s -> Int# -> State# s -> (# State# s, e #)
forall e s.
Unboxed e =>
MutableByteArray# s -> Int# -> State# s -> (# State# s, e #)
(!>#) MutableByteArray# s
bytes# (Int#
o# Int# -> Int# -> Int#
+# Int#
2#) State# s
s3# of
          (# State# s
s4#, e
e3 #) -> case MutableByteArray# s -> Int# -> State# s -> (# State# s, e #)
forall e s.
Unboxed e =>
MutableByteArray# s -> Int# -> State# s -> (# State# s, e #)
(!>#) MutableByteArray# s
bytes# (Int#
o# Int# -> Int# -> Int#
+# Int#
3#) State# s
s4# of
            (# State# s
s5#, e
e4 #) -> case MutableByteArray# s -> Int# -> State# s -> (# State# s, e #)
forall e s.
Unboxed e =>
MutableByteArray# s -> Int# -> State# s -> (# State# s, e #)
(!>#) MutableByteArray# s
bytes# (Int#
o# Int# -> Int# -> Int#
+# Int#
4#) State# s
s5# of
              (# State# s
s6#, e
e5 #) -> (# State# s
s6#, (e
e1,e
e2,e
e3,e
e4,e
e5) #)
    
    writeByteArray# :: MutableByteArray# s -> Int# -> T5 e -> State# s -> State# s
writeByteArray# MutableByteArray# s
mbytes# Int#
n# (e
e1,e
e2,e
e3,e
e4,e
e5) = let o# :: Int#
o# = Int#
5# Int# -> Int# -> Int#
*# Int#
n# in
      \ State# s
s1# -> case MutableByteArray# s -> Int# -> e -> State# s -> State# s
forall e s.
Unboxed e =>
MutableByteArray# s -> Int# -> e -> State# s -> State# s
writeByteArray# MutableByteArray# s
mbytes# Int#
o# e
e1 State# s
s1# of
        State# s
s2# -> case MutableByteArray# s -> Int# -> e -> State# s -> State# s
forall e s.
Unboxed e =>
MutableByteArray# s -> Int# -> e -> State# s -> State# s
writeByteArray# MutableByteArray# s
mbytes# (Int#
o# Int# -> Int# -> Int#
+# Int#
1#) e
e2 State# s
s2# of
          State# s
s3# -> case MutableByteArray# s -> Int# -> e -> State# s -> State# s
forall e s.
Unboxed e =>
MutableByteArray# s -> Int# -> e -> State# s -> State# s
writeByteArray# MutableByteArray# s
mbytes# (Int#
o# Int# -> Int# -> Int#
+# Int#
2#) e
e3 State# s
s3# of
            State# s
s4# -> case MutableByteArray# s -> Int# -> e -> State# s -> State# s
forall e s.
Unboxed e =>
MutableByteArray# s -> Int# -> e -> State# s -> State# s
writeByteArray# MutableByteArray# s
mbytes# (Int#
o# Int# -> Int# -> Int#
+# Int#
3#) e
e4 State# s
s4# of
              State# s
s5# -> MutableByteArray# s -> Int# -> e -> State# s -> State# s
forall e s.
Unboxed e =>
MutableByteArray# s -> Int# -> e -> State# s -> State# s
writeByteArray# MutableByteArray# s
mbytes# (Int#
o# Int# -> Int# -> Int#
+# Int#
4#) e
e5 State# s
s5#
    
    newUnboxed :: T5 e -> Int# -> State# s -> (# State# s, MutableByteArray# s #)
newUnboxed T5 e
e Int#
n# = T5 e -> Int# -> State# s -> (# State# s, MutableByteArray# s #)
forall e (proxy :: * -> *) s.
Unboxed e =>
proxy e -> Int# -> State# s -> (# State# s, MutableByteArray# s #)
pnewUnboxed T5 e
e (Int#
5# Int# -> Int# -> Int#
*# Int#
n#)

instance (Unboxed e) => Unboxed (T6 e)
  where
    sizeof :: T6 e -> Int -> Int
sizeof  T6 e
e2 Int
n  = T6 e -> Int -> Int
forall e (proxy :: * -> *). Unboxed e => proxy e -> Int -> Int
psizeof  T6 e
e2 (Int
6  Int -> Int -> Int
forall a. Num a => a -> a -> a
*   Int
n)
    sizeof# :: T6 e -> Int# -> Int#
sizeof# T6 e
e2 Int#
n# = T6 e -> Int# -> Int#
forall e (proxy :: * -> *). Unboxed e => proxy e -> Int# -> Int#
psizeof# T6 e
e2 (Int#
6# Int# -> Int# -> Int#
*# Int#
n#)
    
    ByteArray#
bytes# !# :: ByteArray# -> Int# -> T6 e
!# Int#
n# =
      let o# :: Int#
o# = Int#
6# Int# -> Int# -> Int#
*# Int#
n#
      in
        (
          ByteArray#
bytes# ByteArray# -> Int# -> e
forall e. Unboxed e => ByteArray# -> Int# -> e
!#       Int#
o#, ByteArray#
bytes# ByteArray# -> Int# -> e
forall e. Unboxed e => ByteArray# -> Int# -> e
!# (Int#
o#Int# -> Int# -> Int#
+#Int#
1#), ByteArray#
bytes# ByteArray# -> Int# -> e
forall e. Unboxed e => ByteArray# -> Int# -> e
!# (Int#
o#Int# -> Int# -> Int#
+#Int#
2#),
          ByteArray#
bytes# ByteArray# -> Int# -> e
forall e. Unboxed e => ByteArray# -> Int# -> e
!# (Int#
o#Int# -> Int# -> Int#
+#Int#
3#), ByteArray#
bytes# ByteArray# -> Int# -> e
forall e. Unboxed e => ByteArray# -> Int# -> e
!# (Int#
o#Int# -> Int# -> Int#
+#Int#
4#), ByteArray#
bytes# ByteArray# -> Int# -> e
forall e. Unboxed e => ByteArray# -> Int# -> e
!# (Int#
o#Int# -> Int# -> Int#
+#Int#
5#)
        )
    
    MutableByteArray# s
bytes# !># :: MutableByteArray# s -> Int# -> State# s -> (# State# s, T6 e #)
!># Int#
n# = let o# :: Int#
o# = Int#
6# Int# -> Int# -> Int#
*# Int#
n# in \ State# s
s1# -> case MutableByteArray# s -> Int# -> State# s -> (# State# s, e #)
forall e s.
Unboxed e =>
MutableByteArray# s -> Int# -> State# s -> (# State# s, e #)
(!>#) MutableByteArray# s
bytes# Int#
o# State# s
s1# of
      (# State# s
s2#, e
e1 #) -> case MutableByteArray# s -> Int# -> State# s -> (# State# s, e #)
forall e s.
Unboxed e =>
MutableByteArray# s -> Int# -> State# s -> (# State# s, e #)
(!>#) MutableByteArray# s
bytes# (Int#
o# Int# -> Int# -> Int#
+# Int#
1#) State# s
s2# of
        (# State# s
s3#, e
e2 #) -> case MutableByteArray# s -> Int# -> State# s -> (# State# s, e #)
forall e s.
Unboxed e =>
MutableByteArray# s -> Int# -> State# s -> (# State# s, e #)
(!>#) MutableByteArray# s
bytes# (Int#
o# Int# -> Int# -> Int#
+# Int#
2#) State# s
s3# of
          (# State# s
s4#, e
e3 #) -> case MutableByteArray# s -> Int# -> State# s -> (# State# s, e #)
forall e s.
Unboxed e =>
MutableByteArray# s -> Int# -> State# s -> (# State# s, e #)
(!>#) MutableByteArray# s
bytes# (Int#
o# Int# -> Int# -> Int#
+# Int#
3#) State# s
s4# of
            (# State# s
s5#, e
e4 #) -> case MutableByteArray# s -> Int# -> State# s -> (# State# s, e #)
forall e s.
Unboxed e =>
MutableByteArray# s -> Int# -> State# s -> (# State# s, e #)
(!>#) MutableByteArray# s
bytes# (Int#
o# Int# -> Int# -> Int#
+# Int#
4#) State# s
s5# of
              (# State# s
s6#, e
e5 #) -> case MutableByteArray# s -> Int# -> State# s -> (# State# s, e #)
forall e s.
Unboxed e =>
MutableByteArray# s -> Int# -> State# s -> (# State# s, e #)
(!>#) MutableByteArray# s
bytes# (Int#
o# Int# -> Int# -> Int#
+# Int#
5#) State# s
s6# of
                (# State# s
s7#, e
e6 #) -> (# State# s
s7#, (e
e1,e
e2,e
e3,e
e4,e
e5,e
e6) #)
    
    writeByteArray# :: MutableByteArray# s -> Int# -> T6 e -> State# s -> State# s
writeByteArray# MutableByteArray# s
mbytes# Int#
n# (e
e1,e
e2,e
e3,e
e4,e
e5,e
e6) = let o# :: Int#
o# = Int#
6# Int# -> Int# -> Int#
*# Int#
n# in
      \ State# s
s1# -> case MutableByteArray# s -> Int# -> e -> State# s -> State# s
forall e s.
Unboxed e =>
MutableByteArray# s -> Int# -> e -> State# s -> State# s
writeByteArray# MutableByteArray# s
mbytes# Int#
o# e
e1 State# s
s1# of
        State# s
s2# -> case MutableByteArray# s -> Int# -> e -> State# s -> State# s
forall e s.
Unboxed e =>
MutableByteArray# s -> Int# -> e -> State# s -> State# s
writeByteArray# MutableByteArray# s
mbytes# (Int#
o# Int# -> Int# -> Int#
+# Int#
1#) e
e2 State# s
s2# of
          State# s
s3# -> case MutableByteArray# s -> Int# -> e -> State# s -> State# s
forall e s.
Unboxed e =>
MutableByteArray# s -> Int# -> e -> State# s -> State# s
writeByteArray# MutableByteArray# s
mbytes# (Int#
o# Int# -> Int# -> Int#
+# Int#
2#) e
e3 State# s
s3# of
            State# s
s4# -> case MutableByteArray# s -> Int# -> e -> State# s -> State# s
forall e s.
Unboxed e =>
MutableByteArray# s -> Int# -> e -> State# s -> State# s
writeByteArray# MutableByteArray# s
mbytes# (Int#
o# Int# -> Int# -> Int#
+# Int#
3#) e
e4 State# s
s4# of
              State# s
s5# -> case MutableByteArray# s -> Int# -> e -> State# s -> State# s
forall e s.
Unboxed e =>
MutableByteArray# s -> Int# -> e -> State# s -> State# s
writeByteArray# MutableByteArray# s
mbytes# (Int#
o# Int# -> Int# -> Int#
+# Int#
4#) e
e5 State# s
s5# of
                State# s
s6# -> MutableByteArray# s -> Int# -> e -> State# s -> State# s
forall e s.
Unboxed e =>
MutableByteArray# s -> Int# -> e -> State# s -> State# s
writeByteArray# MutableByteArray# s
mbytes# (Int#
o# Int# -> Int# -> Int#
+# Int#
5#) e
e6 State# s
s6#
    
    newUnboxed :: T6 e -> Int# -> State# s -> (# State# s, MutableByteArray# s #)
newUnboxed T6 e
e Int#
n# = T6 e -> Int# -> State# s -> (# State# s, MutableByteArray# s #)
forall e (proxy :: * -> *) s.
Unboxed e =>
proxy e -> Int# -> State# s -> (# State# s, MutableByteArray# s #)
pnewUnboxed T6 e
e (Int#
6# Int# -> Int# -> Int#
*# Int#
n#)

instance (Unboxed e) => Unboxed (T7 e)
  where
    sizeof :: T7 e -> Int -> Int
sizeof  T7 e
e2 Int
n  = T7 e -> Int -> Int
forall e (proxy :: * -> *). Unboxed e => proxy e -> Int -> Int
psizeof  T7 e
e2 (Int
7  Int -> Int -> Int
forall a. Num a => a -> a -> a
*   Int
n)
    sizeof# :: T7 e -> Int# -> Int#
sizeof# T7 e
e2 Int#
n# = T7 e -> Int# -> Int#
forall e (proxy :: * -> *). Unboxed e => proxy e -> Int# -> Int#
psizeof# T7 e
e2 (Int#
7# Int# -> Int# -> Int#
*# Int#
n#)
    
    ByteArray#
bytes# !# :: ByteArray# -> Int# -> T7 e
!# Int#
n# =
      let o# :: Int#
o# = Int#
7# Int# -> Int# -> Int#
*# Int#
n#
      in
        (
          ByteArray#
bytes# ByteArray# -> Int# -> e
forall e. Unboxed e => ByteArray# -> Int# -> e
!#       Int#
o#, ByteArray#
bytes# ByteArray# -> Int# -> e
forall e. Unboxed e => ByteArray# -> Int# -> e
!# (Int#
o#Int# -> Int# -> Int#
+#Int#
1#), ByteArray#
bytes# ByteArray# -> Int# -> e
forall e. Unboxed e => ByteArray# -> Int# -> e
!# (Int#
o#Int# -> Int# -> Int#
+#Int#
2#),
          ByteArray#
bytes# ByteArray# -> Int# -> e
forall e. Unboxed e => ByteArray# -> Int# -> e
!# (Int#
o#Int# -> Int# -> Int#
+#Int#
3#), ByteArray#
bytes# ByteArray# -> Int# -> e
forall e. Unboxed e => ByteArray# -> Int# -> e
!# (Int#
o#Int# -> Int# -> Int#
+#Int#
4#), ByteArray#
bytes# ByteArray# -> Int# -> e
forall e. Unboxed e => ByteArray# -> Int# -> e
!# (Int#
o#Int# -> Int# -> Int#
+#Int#
5#),
          ByteArray#
bytes# ByteArray# -> Int# -> e
forall e. Unboxed e => ByteArray# -> Int# -> e
!# (Int#
o#Int# -> Int# -> Int#
+#Int#
6#)
        )
    
    MutableByteArray# s
bytes# !># :: MutableByteArray# s -> Int# -> State# s -> (# State# s, T7 e #)
!># Int#
n# = let o# :: Int#
o# = Int#
7# Int# -> Int# -> Int#
*# Int#
n# in \ State# s
s1# -> case MutableByteArray# s -> Int# -> State# s -> (# State# s, e #)
forall e s.
Unboxed e =>
MutableByteArray# s -> Int# -> State# s -> (# State# s, e #)
(!>#) MutableByteArray# s
bytes# Int#
o# State# s
s1# of
      (# State# s
s2#, e
e1 #) -> case MutableByteArray# s -> Int# -> State# s -> (# State# s, e #)
forall e s.
Unboxed e =>
MutableByteArray# s -> Int# -> State# s -> (# State# s, e #)
(!>#) MutableByteArray# s
bytes# (Int#
o# Int# -> Int# -> Int#
+# Int#
1#) State# s
s2# of
        (# State# s
s3#, e
e2 #) -> case MutableByteArray# s -> Int# -> State# s -> (# State# s, e #)
forall e s.
Unboxed e =>
MutableByteArray# s -> Int# -> State# s -> (# State# s, e #)
(!>#) MutableByteArray# s
bytes# (Int#
o# Int# -> Int# -> Int#
+# Int#
2#) State# s
s3# of
          (# State# s
s4#, e
e3 #) -> case MutableByteArray# s -> Int# -> State# s -> (# State# s, e #)
forall e s.
Unboxed e =>
MutableByteArray# s -> Int# -> State# s -> (# State# s, e #)
(!>#) MutableByteArray# s
bytes# (Int#
o# Int# -> Int# -> Int#
+# Int#
3#) State# s
s4# of
            (# State# s
s5#, e
e4 #) -> case MutableByteArray# s -> Int# -> State# s -> (# State# s, e #)
forall e s.
Unboxed e =>
MutableByteArray# s -> Int# -> State# s -> (# State# s, e #)
(!>#) MutableByteArray# s
bytes# (Int#
o# Int# -> Int# -> Int#
+# Int#
4#) State# s
s5# of
              (# State# s
s6#, e
e5 #) -> case MutableByteArray# s -> Int# -> State# s -> (# State# s, e #)
forall e s.
Unboxed e =>
MutableByteArray# s -> Int# -> State# s -> (# State# s, e #)
(!>#) MutableByteArray# s
bytes# (Int#
o# Int# -> Int# -> Int#
+# Int#
5#) State# s
s6# of
                (# State# s
s7#, e
e6 #) -> case MutableByteArray# s -> Int# -> State# s -> (# State# s, e #)
forall e s.
Unboxed e =>
MutableByteArray# s -> Int# -> State# s -> (# State# s, e #)
(!>#) MutableByteArray# s
bytes# (Int#
o# Int# -> Int# -> Int#
+# Int#
6#) State# s
s7# of
                  (# State# s
s8#, e
e7 #) -> (# State# s
s8#, (e
e1,e
e2,e
e3,e
e4,e
e5,e
e6,e
e7) #)
    
    writeByteArray# :: MutableByteArray# s -> Int# -> T7 e -> State# s -> State# s
writeByteArray# MutableByteArray# s
mbytes# Int#
n# (e
e1,e
e2,e
e3,e
e4,e
e5,e
e6,e
e7) = let o# :: Int#
o# = Int#
7# Int# -> Int# -> Int#
*# Int#
n# in
      \ State# s
s1# -> case MutableByteArray# s -> Int# -> e -> State# s -> State# s
forall e s.
Unboxed e =>
MutableByteArray# s -> Int# -> e -> State# s -> State# s
writeByteArray# MutableByteArray# s
mbytes# Int#
o# e
e1 State# s
s1# of
        State# s
s2# -> case MutableByteArray# s -> Int# -> e -> State# s -> State# s
forall e s.
Unboxed e =>
MutableByteArray# s -> Int# -> e -> State# s -> State# s
writeByteArray# MutableByteArray# s
mbytes# (Int#
o# Int# -> Int# -> Int#
+# Int#
1#) e
e2 State# s
s2# of
          State# s
s3# -> case MutableByteArray# s -> Int# -> e -> State# s -> State# s
forall e s.
Unboxed e =>
MutableByteArray# s -> Int# -> e -> State# s -> State# s
writeByteArray# MutableByteArray# s
mbytes# (Int#
o# Int# -> Int# -> Int#
+# Int#
2#) e
e3 State# s
s3# of
            State# s
s4# -> case MutableByteArray# s -> Int# -> e -> State# s -> State# s
forall e s.
Unboxed e =>
MutableByteArray# s -> Int# -> e -> State# s -> State# s
writeByteArray# MutableByteArray# s
mbytes# (Int#
o# Int# -> Int# -> Int#
+# Int#
3#) e
e4 State# s
s4# of
              State# s
s5# -> case MutableByteArray# s -> Int# -> e -> State# s -> State# s
forall e s.
Unboxed e =>
MutableByteArray# s -> Int# -> e -> State# s -> State# s
writeByteArray# MutableByteArray# s
mbytes# (Int#
o# Int# -> Int# -> Int#
+# Int#
4#) e
e5 State# s
s5# of
                State# s
s6# -> case MutableByteArray# s -> Int# -> e -> State# s -> State# s
forall e s.
Unboxed e =>
MutableByteArray# s -> Int# -> e -> State# s -> State# s
writeByteArray# MutableByteArray# s
mbytes# (Int#
o# Int# -> Int# -> Int#
+# Int#
5#) e
e6 State# s
s6# of
                  State# s
s7# -> MutableByteArray# s -> Int# -> e -> State# s -> State# s
forall e s.
Unboxed e =>
MutableByteArray# s -> Int# -> e -> State# s -> State# s
writeByteArray# MutableByteArray# s
mbytes# (Int#
o# Int# -> Int# -> Int#
+# Int#
6#) e
e7 State# s
s7#
    
    newUnboxed :: T7 e -> Int# -> State# s -> (# State# s, MutableByteArray# s #)
newUnboxed T7 e
e Int#
n# = T7 e -> Int# -> State# s -> (# State# s, MutableByteArray# s #)
forall e (proxy :: * -> *) s.
Unboxed e =>
proxy e -> Int# -> State# s -> (# State# s, MutableByteArray# s #)
pnewUnboxed T7 e
e (Int#
7# Int# -> Int# -> Int#
*# Int#
n#)

instance (Unboxed e) => Unboxed (T8 e)
  where
    sizeof :: T8 e -> Int -> Int
sizeof  T8 e
e2 Int
n  = T8 e -> Int -> Int
forall e (proxy :: * -> *). Unboxed e => proxy e -> Int -> Int
psizeof  T8 e
e2 (Int
8  Int -> Int -> Int
forall a. Num a => a -> a -> a
*   Int
n)
    sizeof# :: T8 e -> Int# -> Int#
sizeof# T8 e
e2 Int#
n# = T8 e -> Int# -> Int#
forall e (proxy :: * -> *). Unboxed e => proxy e -> Int# -> Int#
psizeof# T8 e
e2 (Int#
8# Int# -> Int# -> Int#
*# Int#
n#)
    
    ByteArray#
bytes# !# :: ByteArray# -> Int# -> T8 e
!# Int#
n# =
      let o# :: Int#
o# = Int#
8# Int# -> Int# -> Int#
*# Int#
n#
      in
        (
          ByteArray#
bytes# ByteArray# -> Int# -> e
forall e. Unboxed e => ByteArray# -> Int# -> e
!#       Int#
o#, ByteArray#
bytes# ByteArray# -> Int# -> e
forall e. Unboxed e => ByteArray# -> Int# -> e
!# (Int#
o#Int# -> Int# -> Int#
+#Int#
1#), ByteArray#
bytes# ByteArray# -> Int# -> e
forall e. Unboxed e => ByteArray# -> Int# -> e
!# (Int#
o#Int# -> Int# -> Int#
+#Int#
2#),
          ByteArray#
bytes# ByteArray# -> Int# -> e
forall e. Unboxed e => ByteArray# -> Int# -> e
!# (Int#
o#Int# -> Int# -> Int#
+#Int#
3#), ByteArray#
bytes# ByteArray# -> Int# -> e
forall e. Unboxed e => ByteArray# -> Int# -> e
!# (Int#
o#Int# -> Int# -> Int#
+#Int#
4#), ByteArray#
bytes# ByteArray# -> Int# -> e
forall e. Unboxed e => ByteArray# -> Int# -> e
!# (Int#
o#Int# -> Int# -> Int#
+#Int#
5#),
          ByteArray#
bytes# ByteArray# -> Int# -> e
forall e. Unboxed e => ByteArray# -> Int# -> e
!# (Int#
o#Int# -> Int# -> Int#
+#Int#
6#), ByteArray#
bytes# ByteArray# -> Int# -> e
forall e. Unboxed e => ByteArray# -> Int# -> e
!# (Int#
o#Int# -> Int# -> Int#
+#Int#
7#)
        )
    
    MutableByteArray# s
bytes# !># :: MutableByteArray# s -> Int# -> State# s -> (# State# s, T8 e #)
!># Int#
n# = let o# :: Int#
o# = Int#
8# Int# -> Int# -> Int#
*# Int#
n# in \ State# s
s1# -> case MutableByteArray# s -> Int# -> State# s -> (# State# s, e #)
forall e s.
Unboxed e =>
MutableByteArray# s -> Int# -> State# s -> (# State# s, e #)
(!>#) MutableByteArray# s
bytes# Int#
o# State# s
s1# of
      (# State# s
s2#, e
e1 #) -> case MutableByteArray# s -> Int# -> State# s -> (# State# s, e #)
forall e s.
Unboxed e =>
MutableByteArray# s -> Int# -> State# s -> (# State# s, e #)
(!>#) MutableByteArray# s
bytes# (Int#
o# Int# -> Int# -> Int#
+# Int#
1#) State# s
s2# of
        (# State# s
s3#, e
e2 #) -> case MutableByteArray# s -> Int# -> State# s -> (# State# s, e #)
forall e s.
Unboxed e =>
MutableByteArray# s -> Int# -> State# s -> (# State# s, e #)
(!>#) MutableByteArray# s
bytes# (Int#
o# Int# -> Int# -> Int#
+# Int#
2#) State# s
s3# of
          (# State# s
s4#, e
e3 #) -> case MutableByteArray# s -> Int# -> State# s -> (# State# s, e #)
forall e s.
Unboxed e =>
MutableByteArray# s -> Int# -> State# s -> (# State# s, e #)
(!>#) MutableByteArray# s
bytes# (Int#
o# Int# -> Int# -> Int#
+# Int#
3#) State# s
s4# of
            (# State# s
s5#, e
e4 #) -> case MutableByteArray# s -> Int# -> State# s -> (# State# s, e #)
forall e s.
Unboxed e =>
MutableByteArray# s -> Int# -> State# s -> (# State# s, e #)
(!>#) MutableByteArray# s
bytes# (Int#
o# Int# -> Int# -> Int#
+# Int#
4#) State# s
s5# of
              (# State# s
s6#, e
e5 #) -> case MutableByteArray# s -> Int# -> State# s -> (# State# s, e #)
forall e s.
Unboxed e =>
MutableByteArray# s -> Int# -> State# s -> (# State# s, e #)
(!>#) MutableByteArray# s
bytes# (Int#
o# Int# -> Int# -> Int#
+# Int#
5#) State# s
s6# of
                (# State# s
s7#, e
e6 #) -> case MutableByteArray# s -> Int# -> State# s -> (# State# s, e #)
forall e s.
Unboxed e =>
MutableByteArray# s -> Int# -> State# s -> (# State# s, e #)
(!>#) MutableByteArray# s
bytes# (Int#
o# Int# -> Int# -> Int#
+# Int#
6#) State# s
s7# of
                  (# State# s
s8#, e
e7 #) -> case MutableByteArray# s -> Int# -> State# s -> (# State# s, e #)
forall e s.
Unboxed e =>
MutableByteArray# s -> Int# -> State# s -> (# State# s, e #)
(!>#) MutableByteArray# s
bytes# (Int#
o# Int# -> Int# -> Int#
+# Int#
7#) State# s
s8# of
                    (# State# s
s9#, e
e8 #) -> (# State# s
s9#, (e
e1,e
e2,e
e3,e
e4,e
e5,e
e6,e
e7,e
e8) #)
    
    writeByteArray# :: MutableByteArray# s -> Int# -> T8 e -> State# s -> State# s
writeByteArray# MutableByteArray# s
mbytes# Int#
n# (e
e1,e
e2,e
e3,e
e4,e
e5,e
e6,e
e7,e
e8) = let o# :: Int#
o# = Int#
8# Int# -> Int# -> Int#
*# Int#
n# in
      \ State# s
s1# -> case MutableByteArray# s -> Int# -> e -> State# s -> State# s
forall e s.
Unboxed e =>
MutableByteArray# s -> Int# -> e -> State# s -> State# s
writeByteArray# MutableByteArray# s
mbytes# Int#
o# e
e1 State# s
s1# of
        State# s
s2# -> case MutableByteArray# s -> Int# -> e -> State# s -> State# s
forall e s.
Unboxed e =>
MutableByteArray# s -> Int# -> e -> State# s -> State# s
writeByteArray# MutableByteArray# s
mbytes# (Int#
o# Int# -> Int# -> Int#
+# Int#
1#) e
e2 State# s
s2# of
          State# s
s3# -> case MutableByteArray# s -> Int# -> e -> State# s -> State# s
forall e s.
Unboxed e =>
MutableByteArray# s -> Int# -> e -> State# s -> State# s
writeByteArray# MutableByteArray# s
mbytes# (Int#
o# Int# -> Int# -> Int#
+# Int#
2#) e
e3 State# s
s3# of
            State# s
s4# -> case MutableByteArray# s -> Int# -> e -> State# s -> State# s
forall e s.
Unboxed e =>
MutableByteArray# s -> Int# -> e -> State# s -> State# s
writeByteArray# MutableByteArray# s
mbytes# (Int#
o# Int# -> Int# -> Int#
+# Int#
3#) e
e4 State# s
s4# of
              State# s
s5# -> case MutableByteArray# s -> Int# -> e -> State# s -> State# s
forall e s.
Unboxed e =>
MutableByteArray# s -> Int# -> e -> State# s -> State# s
writeByteArray# MutableByteArray# s
mbytes# (Int#
o# Int# -> Int# -> Int#
+# Int#
4#) e
e5 State# s
s5# of
                State# s
s6# -> case MutableByteArray# s -> Int# -> e -> State# s -> State# s
forall e s.
Unboxed e =>
MutableByteArray# s -> Int# -> e -> State# s -> State# s
writeByteArray# MutableByteArray# s
mbytes# (Int#
o# Int# -> Int# -> Int#
+# Int#
5#) e
e6 State# s
s6# of
                  State# s
s7# -> case MutableByteArray# s -> Int# -> e -> State# s -> State# s
forall e s.
Unboxed e =>
MutableByteArray# s -> Int# -> e -> State# s -> State# s
writeByteArray# MutableByteArray# s
mbytes# (Int#
o# Int# -> Int# -> Int#
+# Int#
6#) e
e7 State# s
s7# of
                    State# s
s8# -> MutableByteArray# s -> Int# -> e -> State# s -> State# s
forall e s.
Unboxed e =>
MutableByteArray# s -> Int# -> e -> State# s -> State# s
writeByteArray# MutableByteArray# s
mbytes# (Int#
o# Int# -> Int# -> Int#
+# Int#
7#) e
e8 State# s
s8#
    
    newUnboxed :: T8 e -> Int# -> State# s -> (# State# s, MutableByteArray# s #)
newUnboxed T8 e
e Int#
n# = T8 e -> Int# -> State# s -> (# State# s, MutableByteArray# s #)
forall e (proxy :: * -> *) s.
Unboxed e =>
proxy e -> Int# -> State# s -> (# State# s, MutableByteArray# s #)
pnewUnboxed T8 e
e (Int#
8# Int# -> Int# -> Int#
*# Int#
n#)

instance (Unboxed e) => Unboxed (T9 e)
  where
    sizeof :: T9 e -> Int -> Int
sizeof  T9 e
e2 Int
n  = T9 e -> Int -> Int
forall e (proxy :: * -> *). Unboxed e => proxy e -> Int -> Int
psizeof  T9 e
e2 (Int
9  Int -> Int -> Int
forall a. Num a => a -> a -> a
*   Int
n)
    sizeof# :: T9 e -> Int# -> Int#
sizeof# T9 e
e2 Int#
n# = T9 e -> Int# -> Int#
forall e (proxy :: * -> *). Unboxed e => proxy e -> Int# -> Int#
psizeof# T9 e
e2 (Int#
9# Int# -> Int# -> Int#
*# Int#
n#)
    
    ByteArray#
bytes# !# :: ByteArray# -> Int# -> T9 e
!# Int#
n# =
      let o# :: Int#
o# = Int#
9# Int# -> Int# -> Int#
*# Int#
n#
      in
        (
          ByteArray#
bytes# ByteArray# -> Int# -> e
forall e. Unboxed e => ByteArray# -> Int# -> e
!#       Int#
o#, ByteArray#
bytes# ByteArray# -> Int# -> e
forall e. Unboxed e => ByteArray# -> Int# -> e
!# (Int#
o#Int# -> Int# -> Int#
+#Int#
1#), ByteArray#
bytes# ByteArray# -> Int# -> e
forall e. Unboxed e => ByteArray# -> Int# -> e
!# (Int#
o#Int# -> Int# -> Int#
+#Int#
2#),
          ByteArray#
bytes# ByteArray# -> Int# -> e
forall e. Unboxed e => ByteArray# -> Int# -> e
!# (Int#
o#Int# -> Int# -> Int#
+#Int#
3#), ByteArray#
bytes# ByteArray# -> Int# -> e
forall e. Unboxed e => ByteArray# -> Int# -> e
!# (Int#
o#Int# -> Int# -> Int#
+#Int#
4#), ByteArray#
bytes# ByteArray# -> Int# -> e
forall e. Unboxed e => ByteArray# -> Int# -> e
!# (Int#
o#Int# -> Int# -> Int#
+#Int#
5#),
          ByteArray#
bytes# ByteArray# -> Int# -> e
forall e. Unboxed e => ByteArray# -> Int# -> e
!# (Int#
o#Int# -> Int# -> Int#
+#Int#
6#), ByteArray#
bytes# ByteArray# -> Int# -> e
forall e. Unboxed e => ByteArray# -> Int# -> e
!# (Int#
o#Int# -> Int# -> Int#
+#Int#
7#), ByteArray#
bytes# ByteArray# -> Int# -> e
forall e. Unboxed e => ByteArray# -> Int# -> e
!# (Int#
o#Int# -> Int# -> Int#
+#Int#
8#)
        )
    
    MutableByteArray# s
bytes# !># :: MutableByteArray# s -> Int# -> State# s -> (# State# s, T9 e #)
!># Int#
n# = let o# :: Int#
o# = Int#
9# Int# -> Int# -> Int#
*# Int#
n# in \ State# s
s1# -> case MutableByteArray# s -> Int# -> State# s -> (# State# s, e #)
forall e s.
Unboxed e =>
MutableByteArray# s -> Int# -> State# s -> (# State# s, e #)
(!>#) MutableByteArray# s
bytes# Int#
o# State# s
s1# of
      (# State# s
s2#, e
e1 #) -> case MutableByteArray# s -> Int# -> State# s -> (# State# s, e #)
forall e s.
Unboxed e =>
MutableByteArray# s -> Int# -> State# s -> (# State# s, e #)
(!>#) MutableByteArray# s
bytes# (Int#
o# Int# -> Int# -> Int#
+# Int#
1#) State# s
s2# of
        (# State# s
s3#, e
e2 #) -> case MutableByteArray# s -> Int# -> State# s -> (# State# s, e #)
forall e s.
Unboxed e =>
MutableByteArray# s -> Int# -> State# s -> (# State# s, e #)
(!>#) MutableByteArray# s
bytes# (Int#
o# Int# -> Int# -> Int#
+# Int#
2#) State# s
s3# of
          (# State# s
s4#, e
e3 #) -> case MutableByteArray# s -> Int# -> State# s -> (# State# s, e #)
forall e s.
Unboxed e =>
MutableByteArray# s -> Int# -> State# s -> (# State# s, e #)
(!>#) MutableByteArray# s
bytes# (Int#
o# Int# -> Int# -> Int#
+# Int#
3#) State# s
s4# of
            (# State# s
s5#, e
e4 #) -> case MutableByteArray# s -> Int# -> State# s -> (# State# s, e #)
forall e s.
Unboxed e =>
MutableByteArray# s -> Int# -> State# s -> (# State# s, e #)
(!>#) MutableByteArray# s
bytes# (Int#
o# Int# -> Int# -> Int#
+# Int#
4#) State# s
s5# of
              (# State# s
s6#, e
e5 #) -> case MutableByteArray# s -> Int# -> State# s -> (# State# s, e #)
forall e s.
Unboxed e =>
MutableByteArray# s -> Int# -> State# s -> (# State# s, e #)
(!>#) MutableByteArray# s
bytes# (Int#
o# Int# -> Int# -> Int#
+# Int#
5#) State# s
s6# of
                (# State# s
s7#, e
e6 #) -> case MutableByteArray# s -> Int# -> State# s -> (# State# s, e #)
forall e s.
Unboxed e =>
MutableByteArray# s -> Int# -> State# s -> (# State# s, e #)
(!>#) MutableByteArray# s
bytes# (Int#
o# Int# -> Int# -> Int#
+# Int#
6#) State# s
s7# of
                  (# State# s
s8#, e
e7 #) -> case MutableByteArray# s -> Int# -> State# s -> (# State# s, e #)
forall e s.
Unboxed e =>
MutableByteArray# s -> Int# -> State# s -> (# State# s, e #)
(!>#) MutableByteArray# s
bytes# (Int#
o# Int# -> Int# -> Int#
+# Int#
7#) State# s
s8# of
                    (# State# s
s9#, e
e8 #) -> case MutableByteArray# s -> Int# -> State# s -> (# State# s, e #)
forall e s.
Unboxed e =>
MutableByteArray# s -> Int# -> State# s -> (# State# s, e #)
(!>#) MutableByteArray# s
bytes# (Int#
o# Int# -> Int# -> Int#
+# Int#
8#) State# s
s9# of
                      (# State# s
s10#, e
e9 #) -> (# State# s
s10#, (e
e1,e
e2,e
e3,e
e4,e
e5,e
e6,e
e7,e
e8,e
e9) #)
    
    writeByteArray# :: MutableByteArray# s -> Int# -> T9 e -> State# s -> State# s
writeByteArray# MutableByteArray# s
mbytes# Int#
n# (e
e1,e
e2,e
e3,e
e4,e
e5,e
e6,e
e7,e
e8,e
e9) = let o# :: Int#
o# = Int#
9# Int# -> Int# -> Int#
*# Int#
n# in
      \ State# s
s1# -> case MutableByteArray# s -> Int# -> e -> State# s -> State# s
forall e s.
Unboxed e =>
MutableByteArray# s -> Int# -> e -> State# s -> State# s
writeByteArray# MutableByteArray# s
mbytes# Int#
o# e
e1 State# s
s1# of
        State# s
s2# -> case MutableByteArray# s -> Int# -> e -> State# s -> State# s
forall e s.
Unboxed e =>
MutableByteArray# s -> Int# -> e -> State# s -> State# s
writeByteArray# MutableByteArray# s
mbytes# (Int#
o# Int# -> Int# -> Int#
+# Int#
1#) e
e2 State# s
s2# of
          State# s
s3# -> case MutableByteArray# s -> Int# -> e -> State# s -> State# s
forall e s.
Unboxed e =>
MutableByteArray# s -> Int# -> e -> State# s -> State# s
writeByteArray# MutableByteArray# s
mbytes# (Int#
o# Int# -> Int# -> Int#
+# Int#
2#) e
e3 State# s
s3# of
            State# s
s4# -> case MutableByteArray# s -> Int# -> e -> State# s -> State# s
forall e s.
Unboxed e =>
MutableByteArray# s -> Int# -> e -> State# s -> State# s
writeByteArray# MutableByteArray# s
mbytes# (Int#
o# Int# -> Int# -> Int#
+# Int#
3#) e
e4 State# s
s4# of
              State# s
s5# -> case MutableByteArray# s -> Int# -> e -> State# s -> State# s
forall e s.
Unboxed e =>
MutableByteArray# s -> Int# -> e -> State# s -> State# s
writeByteArray# MutableByteArray# s
mbytes# (Int#
o# Int# -> Int# -> Int#
+# Int#
4#) e
e5 State# s
s5# of
                State# s
s6# -> case MutableByteArray# s -> Int# -> e -> State# s -> State# s
forall e s.
Unboxed e =>
MutableByteArray# s -> Int# -> e -> State# s -> State# s
writeByteArray# MutableByteArray# s
mbytes# (Int#
o# Int# -> Int# -> Int#
+# Int#
5#) e
e6 State# s
s6# of
                  State# s
s7# -> case MutableByteArray# s -> Int# -> e -> State# s -> State# s
forall e s.
Unboxed e =>
MutableByteArray# s -> Int# -> e -> State# s -> State# s
writeByteArray# MutableByteArray# s
mbytes# (Int#
o# Int# -> Int# -> Int#
+# Int#
6#) e
e7 State# s
s7# of
                    State# s
s8# -> case MutableByteArray# s -> Int# -> e -> State# s -> State# s
forall e s.
Unboxed e =>
MutableByteArray# s -> Int# -> e -> State# s -> State# s
writeByteArray# MutableByteArray# s
mbytes# (Int#
o# Int# -> Int# -> Int#
+# Int#
7#) e
e8 State# s
s8# of
                      State# s
s9# -> MutableByteArray# s -> Int# -> e -> State# s -> State# s
forall e s.
Unboxed e =>
MutableByteArray# s -> Int# -> e -> State# s -> State# s
writeByteArray# MutableByteArray# s
mbytes# (Int#
o# Int# -> Int# -> Int#
+# Int#
8#) e
e9 State# s
s9#
    
    newUnboxed :: T9 e -> Int# -> State# s -> (# State# s, MutableByteArray# s #)
newUnboxed T9 e
e Int#
n# = T9 e -> Int# -> State# s -> (# State# s, MutableByteArray# s #)
forall e (proxy :: * -> *) s.
Unboxed e =>
proxy e -> Int# -> State# s -> (# State# s, MutableByteArray# s #)
pnewUnboxed T9 e
e (Int#
9# Int# -> Int# -> Int#
*# Int#
n#)

instance (Unboxed e) => Unboxed (T10 e)
  where
    sizeof :: T10 e -> Int -> Int
sizeof  T10 e
e2 Int
n  = T10 e -> Int -> Int
forall e (proxy :: * -> *). Unboxed e => proxy e -> Int -> Int
psizeof  T10 e
e2 (Int
10  Int -> Int -> Int
forall a. Num a => a -> a -> a
*   Int
n)
    sizeof# :: T10 e -> Int# -> Int#
sizeof# T10 e
e2 Int#
n# = T10 e -> Int# -> Int#
forall e (proxy :: * -> *). Unboxed e => proxy e -> Int# -> Int#
psizeof# T10 e
e2 (Int#
10# Int# -> Int# -> Int#
*# Int#
n#)
    
    ByteArray#
bytes# !# :: ByteArray# -> Int# -> T10 e
!# Int#
n# =
      let o# :: Int#
o# = Int#
10# Int# -> Int# -> Int#
*# Int#
n#
      in
        (
          ByteArray#
bytes# ByteArray# -> Int# -> e
forall e. Unboxed e => ByteArray# -> Int# -> e
!#       Int#
o#, ByteArray#
bytes# ByteArray# -> Int# -> e
forall e. Unboxed e => ByteArray# -> Int# -> e
!# (Int#
o#Int# -> Int# -> Int#
+#Int#
1#), ByteArray#
bytes# ByteArray# -> Int# -> e
forall e. Unboxed e => ByteArray# -> Int# -> e
!# (Int#
o#Int# -> Int# -> Int#
+#Int#
2#),
          ByteArray#
bytes# ByteArray# -> Int# -> e
forall e. Unboxed e => ByteArray# -> Int# -> e
!# (Int#
o#Int# -> Int# -> Int#
+#Int#
3#), ByteArray#
bytes# ByteArray# -> Int# -> e
forall e. Unboxed e => ByteArray# -> Int# -> e
!# (Int#
o#Int# -> Int# -> Int#
+#Int#
4#), ByteArray#
bytes# ByteArray# -> Int# -> e
forall e. Unboxed e => ByteArray# -> Int# -> e
!# (Int#
o#Int# -> Int# -> Int#
+#Int#
5#),
          ByteArray#
bytes# ByteArray# -> Int# -> e
forall e. Unboxed e => ByteArray# -> Int# -> e
!# (Int#
o#Int# -> Int# -> Int#
+#Int#
6#), ByteArray#
bytes# ByteArray# -> Int# -> e
forall e. Unboxed e => ByteArray# -> Int# -> e
!# (Int#
o#Int# -> Int# -> Int#
+#Int#
7#), ByteArray#
bytes# ByteArray# -> Int# -> e
forall e. Unboxed e => ByteArray# -> Int# -> e
!# (Int#
o#Int# -> Int# -> Int#
+#Int#
8#),
          ByteArray#
bytes# ByteArray# -> Int# -> e
forall e. Unboxed e => ByteArray# -> Int# -> e
!# (Int#
o#Int# -> Int# -> Int#
+#Int#
9#)
        )
    
    MutableByteArray# s
bytes# !># :: MutableByteArray# s -> Int# -> State# s -> (# State# s, T10 e #)
!># Int#
n# = let o# :: Int#
o# = Int#
10# Int# -> Int# -> Int#
*# Int#
n# in \ State# s
s1# -> case MutableByteArray# s -> Int# -> State# s -> (# State# s, e #)
forall e s.
Unboxed e =>
MutableByteArray# s -> Int# -> State# s -> (# State# s, e #)
(!>#) MutableByteArray# s
bytes# Int#
o# State# s
s1# of
      (# State# s
s2#, e
e1 #) -> case MutableByteArray# s -> Int# -> State# s -> (# State# s, e #)
forall e s.
Unboxed e =>
MutableByteArray# s -> Int# -> State# s -> (# State# s, e #)
(!>#) MutableByteArray# s
bytes# (Int#
o# Int# -> Int# -> Int#
+# Int#
1#) State# s
s2# of
        (# State# s
s3#, e
e2 #) -> case MutableByteArray# s -> Int# -> State# s -> (# State# s, e #)
forall e s.
Unboxed e =>
MutableByteArray# s -> Int# -> State# s -> (# State# s, e #)
(!>#) MutableByteArray# s
bytes# (Int#
o# Int# -> Int# -> Int#
+# Int#
2#) State# s
s3# of
          (# State# s
s4#, e
e3 #) -> case MutableByteArray# s -> Int# -> State# s -> (# State# s, e #)
forall e s.
Unboxed e =>
MutableByteArray# s -> Int# -> State# s -> (# State# s, e #)
(!>#) MutableByteArray# s
bytes# (Int#
o# Int# -> Int# -> Int#
+# Int#
3#) State# s
s4# of
            (# State# s
s5#, e
e4 #) -> case MutableByteArray# s -> Int# -> State# s -> (# State# s, e #)
forall e s.
Unboxed e =>
MutableByteArray# s -> Int# -> State# s -> (# State# s, e #)
(!>#) MutableByteArray# s
bytes# (Int#
o# Int# -> Int# -> Int#
+# Int#
4#) State# s
s5# of
              (# State# s
s6#, e
e5 #) -> case MutableByteArray# s -> Int# -> State# s -> (# State# s, e #)
forall e s.
Unboxed e =>
MutableByteArray# s -> Int# -> State# s -> (# State# s, e #)
(!>#) MutableByteArray# s
bytes# (Int#
o# Int# -> Int# -> Int#
+# Int#
5#) State# s
s6# of
                (# State# s
s7#, e
e6 #) -> case MutableByteArray# s -> Int# -> State# s -> (# State# s, e #)
forall e s.
Unboxed e =>
MutableByteArray# s -> Int# -> State# s -> (# State# s, e #)
(!>#) MutableByteArray# s
bytes# (Int#
o# Int# -> Int# -> Int#
+# Int#
6#) State# s
s7# of
                  (# State# s
s8#, e
e7 #) -> case MutableByteArray# s -> Int# -> State# s -> (# State# s, e #)
forall e s.
Unboxed e =>
MutableByteArray# s -> Int# -> State# s -> (# State# s, e #)
(!>#) MutableByteArray# s
bytes# (Int#
o# Int# -> Int# -> Int#
+# Int#
7#) State# s
s8# of
                    (# State# s
s9#, e
e8 #) -> case MutableByteArray# s -> Int# -> State# s -> (# State# s, e #)
forall e s.
Unboxed e =>
MutableByteArray# s -> Int# -> State# s -> (# State# s, e #)
(!>#) MutableByteArray# s
bytes# (Int#
o# Int# -> Int# -> Int#
+# Int#
8#) State# s
s9# of
                      (# State# s
s10#, e
e9 #) -> case MutableByteArray# s -> Int# -> State# s -> (# State# s, e #)
forall e s.
Unboxed e =>
MutableByteArray# s -> Int# -> State# s -> (# State# s, e #)
(!>#) MutableByteArray# s
bytes# (Int#
o# Int# -> Int# -> Int#
+# Int#
9#) State# s
s10# of
                        (# State# s
s11#, e
e10 #) -> (# State# s
s11#, (e
e1,e
e2,e
e3,e
e4,e
e5,e
e6,e
e7,e
e8,e
e9,e
e10) #)
    
    writeByteArray# :: MutableByteArray# s -> Int# -> T10 e -> State# s -> State# s
writeByteArray# MutableByteArray# s
mbytes# Int#
n# (e
e1,e
e2,e
e3,e
e4,e
e5,e
e6,e
e7,e
e8,e
e9,e
e10) = let o# :: Int#
o# = Int#
10# Int# -> Int# -> Int#
*# Int#
n# in
      \ State# s
s1# -> case MutableByteArray# s -> Int# -> e -> State# s -> State# s
forall e s.
Unboxed e =>
MutableByteArray# s -> Int# -> e -> State# s -> State# s
writeByteArray# MutableByteArray# s
mbytes# Int#
o# e
e1 State# s
s1# of
        State# s
s2# -> case MutableByteArray# s -> Int# -> e -> State# s -> State# s
forall e s.
Unboxed e =>
MutableByteArray# s -> Int# -> e -> State# s -> State# s
writeByteArray# MutableByteArray# s
mbytes# (Int#
o# Int# -> Int# -> Int#
+# Int#
1#) e
e2 State# s
s2# of
          State# s
s3# -> case MutableByteArray# s -> Int# -> e -> State# s -> State# s
forall e s.
Unboxed e =>
MutableByteArray# s -> Int# -> e -> State# s -> State# s
writeByteArray# MutableByteArray# s
mbytes# (Int#
o# Int# -> Int# -> Int#
+# Int#
2#) e
e3 State# s
s3# of
            State# s
s4# -> case MutableByteArray# s -> Int# -> e -> State# s -> State# s
forall e s.
Unboxed e =>
MutableByteArray# s -> Int# -> e -> State# s -> State# s
writeByteArray# MutableByteArray# s
mbytes# (Int#
o# Int# -> Int# -> Int#
+# Int#
3#) e
e4 State# s
s4# of
              State# s
s5# -> case MutableByteArray# s -> Int# -> e -> State# s -> State# s
forall e s.
Unboxed e =>
MutableByteArray# s -> Int# -> e -> State# s -> State# s
writeByteArray# MutableByteArray# s
mbytes# (Int#
o# Int# -> Int# -> Int#
+# Int#
4#) e
e5 State# s
s5# of
                State# s
s6# -> case MutableByteArray# s -> Int# -> e -> State# s -> State# s
forall e s.
Unboxed e =>
MutableByteArray# s -> Int# -> e -> State# s -> State# s
writeByteArray# MutableByteArray# s
mbytes# (Int#
o# Int# -> Int# -> Int#
+# Int#
5#) e
e6 State# s
s6# of
                  State# s
s7# -> case MutableByteArray# s -> Int# -> e -> State# s -> State# s
forall e s.
Unboxed e =>
MutableByteArray# s -> Int# -> e -> State# s -> State# s
writeByteArray# MutableByteArray# s
mbytes# (Int#
o# Int# -> Int# -> Int#
+# Int#
6#) e
e7 State# s
s7# of
                    State# s
s8# -> case MutableByteArray# s -> Int# -> e -> State# s -> State# s
forall e s.
Unboxed e =>
MutableByteArray# s -> Int# -> e -> State# s -> State# s
writeByteArray# MutableByteArray# s
mbytes# (Int#
o# Int# -> Int# -> Int#
+# Int#
7#) e
e8 State# s
s8# of
                      State# s
s9# -> case MutableByteArray# s -> Int# -> e -> State# s -> State# s
forall e s.
Unboxed e =>
MutableByteArray# s -> Int# -> e -> State# s -> State# s
writeByteArray# MutableByteArray# s
mbytes# (Int#
o# Int# -> Int# -> Int#
+# Int#
8#) e
e9 State# s
s9# of
                        State# s
s10# -> MutableByteArray# s -> Int# -> e -> State# s -> State# s
forall e s.
Unboxed e =>
MutableByteArray# s -> Int# -> e -> State# s -> State# s
writeByteArray# MutableByteArray# s
mbytes# (Int#
o# Int# -> Int# -> Int#
+# Int#
9#) e
e10 State# s
s10#
    
    newUnboxed :: T10 e -> Int# -> State# s -> (# State# s, MutableByteArray# s #)
newUnboxed T10 e
e Int#
n# = T10 e -> Int# -> State# s -> (# State# s, MutableByteArray# s #)
forall e (proxy :: * -> *) s.
Unboxed e =>
proxy e -> Int# -> State# s -> (# State# s, MutableByteArray# s #)
pnewUnboxed T10 e
e (Int#
10# Int# -> Int# -> Int#
*# Int#
n#)

instance (Unboxed e) => Unboxed (T11 e)
  where
    sizeof :: T11 e -> Int -> Int
sizeof  T11 e
e2 Int
n  = T11 e -> Int -> Int
forall e (proxy :: * -> *). Unboxed e => proxy e -> Int -> Int
psizeof  T11 e
e2 (Int
11  Int -> Int -> Int
forall a. Num a => a -> a -> a
*   Int
n)
    sizeof# :: T11 e -> Int# -> Int#
sizeof# T11 e
e2 Int#
n# = T11 e -> Int# -> Int#
forall e (proxy :: * -> *). Unboxed e => proxy e -> Int# -> Int#
psizeof# T11 e
e2 (Int#
11# Int# -> Int# -> Int#
*# Int#
n#)
    
    ByteArray#
bytes# !# :: ByteArray# -> Int# -> T11 e
!# Int#
n# =
      let o# :: Int#
o# = Int#
11# Int# -> Int# -> Int#
*# Int#
n#
      in
        (
          ByteArray#
bytes# ByteArray# -> Int# -> e
forall e. Unboxed e => ByteArray# -> Int# -> e
!#       Int#
o#, ByteArray#
bytes# ByteArray# -> Int# -> e
forall e. Unboxed e => ByteArray# -> Int# -> e
!# (Int#
o#Int# -> Int# -> Int#
+#Int#
1#), ByteArray#
bytes# ByteArray# -> Int# -> e
forall e. Unboxed e => ByteArray# -> Int# -> e
!# (Int#
o#Int# -> Int# -> Int#
+#Int#
2#),
          ByteArray#
bytes# ByteArray# -> Int# -> e
forall e. Unboxed e => ByteArray# -> Int# -> e
!# (Int#
o#Int# -> Int# -> Int#
+#Int#
3#), ByteArray#
bytes# ByteArray# -> Int# -> e
forall e. Unboxed e => ByteArray# -> Int# -> e
!# (Int#
o#Int# -> Int# -> Int#
+#Int#
4#), ByteArray#
bytes# ByteArray# -> Int# -> e
forall e. Unboxed e => ByteArray# -> Int# -> e
!# (Int#
o#Int# -> Int# -> Int#
+#Int#
5#),
          ByteArray#
bytes# ByteArray# -> Int# -> e
forall e. Unboxed e => ByteArray# -> Int# -> e
!# (Int#
o#Int# -> Int# -> Int#
+#Int#
6#), ByteArray#
bytes# ByteArray# -> Int# -> e
forall e. Unboxed e => ByteArray# -> Int# -> e
!# (Int#
o#Int# -> Int# -> Int#
+#Int#
7#), ByteArray#
bytes# ByteArray# -> Int# -> e
forall e. Unboxed e => ByteArray# -> Int# -> e
!# (Int#
o#Int# -> Int# -> Int#
+#Int#
8#),
          ByteArray#
bytes# ByteArray# -> Int# -> e
forall e. Unboxed e => ByteArray# -> Int# -> e
!# (Int#
o#Int# -> Int# -> Int#
+#Int#
9#), ByteArray#
bytes# ByteArray# -> Int# -> e
forall e. Unboxed e => ByteArray# -> Int# -> e
!# (Int#
o#Int# -> Int# -> Int#
+#Int#
10#)
        )
    
    MutableByteArray# s
bytes# !># :: MutableByteArray# s -> Int# -> State# s -> (# State# s, T11 e #)
!># Int#
n# = let o# :: Int#
o# = Int#
11# Int# -> Int# -> Int#
*# Int#
n# in \ State# s
s1# -> case MutableByteArray# s -> Int# -> State# s -> (# State# s, e #)
forall e s.
Unboxed e =>
MutableByteArray# s -> Int# -> State# s -> (# State# s, e #)
(!>#) MutableByteArray# s
bytes# Int#
o# State# s
s1# of
      (# State# s
s2#, e
e1 #) -> case MutableByteArray# s -> Int# -> State# s -> (# State# s, e #)
forall e s.
Unboxed e =>
MutableByteArray# s -> Int# -> State# s -> (# State# s, e #)
(!>#) MutableByteArray# s
bytes# (Int#
o# Int# -> Int# -> Int#
+# Int#
1#) State# s
s2# of
        (# State# s
s3#, e
e2 #) -> case MutableByteArray# s -> Int# -> State# s -> (# State# s, e #)
forall e s.
Unboxed e =>
MutableByteArray# s -> Int# -> State# s -> (# State# s, e #)
(!>#) MutableByteArray# s
bytes# (Int#
o# Int# -> Int# -> Int#
+# Int#
2#) State# s
s3# of
          (# State# s
s4#, e
e3 #) -> case MutableByteArray# s -> Int# -> State# s -> (# State# s, e #)
forall e s.
Unboxed e =>
MutableByteArray# s -> Int# -> State# s -> (# State# s, e #)
(!>#) MutableByteArray# s
bytes# (Int#
o# Int# -> Int# -> Int#
+# Int#
3#) State# s
s4# of
            (# State# s
s5#, e
e4 #) -> case MutableByteArray# s -> Int# -> State# s -> (# State# s, e #)
forall e s.
Unboxed e =>
MutableByteArray# s -> Int# -> State# s -> (# State# s, e #)
(!>#) MutableByteArray# s
bytes# (Int#
o# Int# -> Int# -> Int#
+# Int#
4#) State# s
s5# of
              (# State# s
s6#, e
e5 #) -> case MutableByteArray# s -> Int# -> State# s -> (# State# s, e #)
forall e s.
Unboxed e =>
MutableByteArray# s -> Int# -> State# s -> (# State# s, e #)
(!>#) MutableByteArray# s
bytes# (Int#
o# Int# -> Int# -> Int#
+# Int#
5#) State# s
s6# of
                (# State# s
s7#, e
e6 #) -> case MutableByteArray# s -> Int# -> State# s -> (# State# s, e #)
forall e s.
Unboxed e =>
MutableByteArray# s -> Int# -> State# s -> (# State# s, e #)
(!>#) MutableByteArray# s
bytes# (Int#
o# Int# -> Int# -> Int#
+# Int#
6#) State# s
s7# of
                  (# State# s
s8#, e
e7 #) -> case MutableByteArray# s -> Int# -> State# s -> (# State# s, e #)
forall e s.
Unboxed e =>
MutableByteArray# s -> Int# -> State# s -> (# State# s, e #)
(!>#) MutableByteArray# s
bytes# (Int#
o# Int# -> Int# -> Int#
+# Int#
7#) State# s
s8# of
                    (# State# s
s9#, e
e8 #) -> case MutableByteArray# s -> Int# -> State# s -> (# State# s, e #)
forall e s.
Unboxed e =>
MutableByteArray# s -> Int# -> State# s -> (# State# s, e #)
(!>#) MutableByteArray# s
bytes# (Int#
o# Int# -> Int# -> Int#
+# Int#
8#) State# s
s9# of
                      (# State# s
s10#, e
e9 #) -> case MutableByteArray# s -> Int# -> State# s -> (# State# s, e #)
forall e s.
Unboxed e =>
MutableByteArray# s -> Int# -> State# s -> (# State# s, e #)
(!>#) MutableByteArray# s
bytes# (Int#
o# Int# -> Int# -> Int#
+# Int#
9#) State# s
s10# of
                        (# State# s
s11#, e
e10 #) -> case MutableByteArray# s -> Int# -> State# s -> (# State# s, e #)
forall e s.
Unboxed e =>
MutableByteArray# s -> Int# -> State# s -> (# State# s, e #)
(!>#) MutableByteArray# s
bytes# (Int#
o# Int# -> Int# -> Int#
+# Int#
10#) State# s
s11# of
                          (# State# s
s12#, e
e11 #) -> (# State# s
s12#, (e
e1,e
e2,e
e3,e
e4,e
e5,e
e6,e
e7,e
e8,e
e9,e
e10,e
e11) #)
    
    writeByteArray# :: MutableByteArray# s -> Int# -> T11 e -> State# s -> State# s
writeByteArray# MutableByteArray# s
mbytes# Int#
n# (e
e1,e
e2,e
e3,e
e4,e
e5,e
e6,e
e7,e
e8,e
e9,e
e10,e
e11) = let o# :: Int#
o# = Int#
11# Int# -> Int# -> Int#
*# Int#
n# in
      \ State# s
s1# -> case MutableByteArray# s -> Int# -> e -> State# s -> State# s
forall e s.
Unboxed e =>
MutableByteArray# s -> Int# -> e -> State# s -> State# s
writeByteArray# MutableByteArray# s
mbytes# Int#
o# e
e1 State# s
s1# of
        State# s
s2# -> case MutableByteArray# s -> Int# -> e -> State# s -> State# s
forall e s.
Unboxed e =>
MutableByteArray# s -> Int# -> e -> State# s -> State# s
writeByteArray# MutableByteArray# s
mbytes# (Int#
o# Int# -> Int# -> Int#
+# Int#
1#) e
e2 State# s
s2# of
          State# s
s3# -> case MutableByteArray# s -> Int# -> e -> State# s -> State# s
forall e s.
Unboxed e =>
MutableByteArray# s -> Int# -> e -> State# s -> State# s
writeByteArray# MutableByteArray# s
mbytes# (Int#
o# Int# -> Int# -> Int#
+# Int#
2#) e
e3 State# s
s3# of
            State# s
s4# -> case MutableByteArray# s -> Int# -> e -> State# s -> State# s
forall e s.
Unboxed e =>
MutableByteArray# s -> Int# -> e -> State# s -> State# s
writeByteArray# MutableByteArray# s
mbytes# (Int#
o# Int# -> Int# -> Int#
+# Int#
3#) e
e4 State# s
s4# of
              State# s
s5# -> case MutableByteArray# s -> Int# -> e -> State# s -> State# s
forall e s.
Unboxed e =>
MutableByteArray# s -> Int# -> e -> State# s -> State# s
writeByteArray# MutableByteArray# s
mbytes# (Int#
o# Int# -> Int# -> Int#
+# Int#
4#) e
e5 State# s
s5# of
                State# s
s6# -> case MutableByteArray# s -> Int# -> e -> State# s -> State# s
forall e s.
Unboxed e =>
MutableByteArray# s -> Int# -> e -> State# s -> State# s
writeByteArray# MutableByteArray# s
mbytes# (Int#
o# Int# -> Int# -> Int#
+# Int#
5#) e
e6 State# s
s6# of
                  State# s
s7# -> case MutableByteArray# s -> Int# -> e -> State# s -> State# s
forall e s.
Unboxed e =>
MutableByteArray# s -> Int# -> e -> State# s -> State# s
writeByteArray# MutableByteArray# s
mbytes# (Int#
o# Int# -> Int# -> Int#
+# Int#
6#) e
e7 State# s
s7# of
                    State# s
s8# -> case MutableByteArray# s -> Int# -> e -> State# s -> State# s
forall e s.
Unboxed e =>
MutableByteArray# s -> Int# -> e -> State# s -> State# s
writeByteArray# MutableByteArray# s
mbytes# (Int#
o# Int# -> Int# -> Int#
+# Int#
7#) e
e8 State# s
s8# of
                      State# s
s9# -> case MutableByteArray# s -> Int# -> e -> State# s -> State# s
forall e s.
Unboxed e =>
MutableByteArray# s -> Int# -> e -> State# s -> State# s
writeByteArray# MutableByteArray# s
mbytes# (Int#
o# Int# -> Int# -> Int#
+# Int#
8#) e
e9 State# s
s9# of
                        State# s
s10# -> case MutableByteArray# s -> Int# -> e -> State# s -> State# s
forall e s.
Unboxed e =>
MutableByteArray# s -> Int# -> e -> State# s -> State# s
writeByteArray# MutableByteArray# s
mbytes# (Int#
o# Int# -> Int# -> Int#
+# Int#
9#) e
e10 State# s
s10# of
                          State# s
s11# -> MutableByteArray# s -> Int# -> e -> State# s -> State# s
forall e s.
Unboxed e =>
MutableByteArray# s -> Int# -> e -> State# s -> State# s
writeByteArray# MutableByteArray# s
mbytes# (Int#
o# Int# -> Int# -> Int#
+# Int#
10#) e
e11 State# s
s11#
    
    newUnboxed :: T11 e -> Int# -> State# s -> (# State# s, MutableByteArray# s #)
newUnboxed T11 e
e Int#
n# = T11 e -> Int# -> State# s -> (# State# s, MutableByteArray# s #)
forall e (proxy :: * -> *) s.
Unboxed e =>
proxy e -> Int# -> State# s -> (# State# s, MutableByteArray# s #)
pnewUnboxed T11 e
e (Int#
11# Int# -> Int# -> Int#
*# Int#
n#)

instance (Unboxed e) => Unboxed (T12 e)
  where
    sizeof :: T12 e -> Int -> Int
sizeof  T12 e
e2 Int
n  = T12 e -> Int -> Int
forall e (proxy :: * -> *). Unboxed e => proxy e -> Int -> Int
psizeof  T12 e
e2 (Int
12  Int -> Int -> Int
forall a. Num a => a -> a -> a
*   Int
n)
    sizeof# :: T12 e -> Int# -> Int#
sizeof# T12 e
e2 Int#
n# = T12 e -> Int# -> Int#
forall e (proxy :: * -> *). Unboxed e => proxy e -> Int# -> Int#
psizeof# T12 e
e2 (Int#
12# Int# -> Int# -> Int#
*# Int#
n#)
    
    ByteArray#
bytes# !# :: ByteArray# -> Int# -> T12 e
!# Int#
n# =
      let o# :: Int#
o# = Int#
12# Int# -> Int# -> Int#
*# Int#
n#
      in
        (
          ByteArray#
bytes# ByteArray# -> Int# -> e
forall e. Unboxed e => ByteArray# -> Int# -> e
!#       Int#
o#, ByteArray#
bytes# ByteArray# -> Int# -> e
forall e. Unboxed e => ByteArray# -> Int# -> e
!#  (Int#
o#Int# -> Int# -> Int#
+#Int#
1#), ByteArray#
bytes# ByteArray# -> Int# -> e
forall e. Unboxed e => ByteArray# -> Int# -> e
!#  (Int#
o#Int# -> Int# -> Int#
+#Int#
2#),
          ByteArray#
bytes# ByteArray# -> Int# -> e
forall e. Unboxed e => ByteArray# -> Int# -> e
!# (Int#
o#Int# -> Int# -> Int#
+#Int#
3#), ByteArray#
bytes# ByteArray# -> Int# -> e
forall e. Unboxed e => ByteArray# -> Int# -> e
!#  (Int#
o#Int# -> Int# -> Int#
+#Int#
4#), ByteArray#
bytes# ByteArray# -> Int# -> e
forall e. Unboxed e => ByteArray# -> Int# -> e
!#  (Int#
o#Int# -> Int# -> Int#
+#Int#
5#),
          ByteArray#
bytes# ByteArray# -> Int# -> e
forall e. Unboxed e => ByteArray# -> Int# -> e
!# (Int#
o#Int# -> Int# -> Int#
+#Int#
6#), ByteArray#
bytes# ByteArray# -> Int# -> e
forall e. Unboxed e => ByteArray# -> Int# -> e
!#  (Int#
o#Int# -> Int# -> Int#
+#Int#
7#), ByteArray#
bytes# ByteArray# -> Int# -> e
forall e. Unboxed e => ByteArray# -> Int# -> e
!#  (Int#
o#Int# -> Int# -> Int#
+#Int#
8#),
          ByteArray#
bytes# ByteArray# -> Int# -> e
forall e. Unboxed e => ByteArray# -> Int# -> e
!# (Int#
o#Int# -> Int# -> Int#
+#Int#
9#), ByteArray#
bytes# ByteArray# -> Int# -> e
forall e. Unboxed e => ByteArray# -> Int# -> e
!# (Int#
o#Int# -> Int# -> Int#
+#Int#
10#), ByteArray#
bytes# ByteArray# -> Int# -> e
forall e. Unboxed e => ByteArray# -> Int# -> e
!# (Int#
o#Int# -> Int# -> Int#
+#Int#
11#)
        )
    
    MutableByteArray# s
bytes# !># :: MutableByteArray# s -> Int# -> State# s -> (# State# s, T12 e #)
!># Int#
n# = let o# :: Int#
o# = Int#
12# Int# -> Int# -> Int#
*# Int#
n# in \ State# s
s1# -> case MutableByteArray# s -> Int# -> State# s -> (# State# s, e #)
forall e s.
Unboxed e =>
MutableByteArray# s -> Int# -> State# s -> (# State# s, e #)
(!>#) MutableByteArray# s
bytes# Int#
o# State# s
s1# of
      (# State# s
s2#, e
e1 #) -> case MutableByteArray# s -> Int# -> State# s -> (# State# s, e #)
forall e s.
Unboxed e =>
MutableByteArray# s -> Int# -> State# s -> (# State# s, e #)
(!>#) MutableByteArray# s
bytes# (Int#
o# Int# -> Int# -> Int#
+# Int#
1#) State# s
s2# of
        (# State# s
s3#, e
e2 #) -> case MutableByteArray# s -> Int# -> State# s -> (# State# s, e #)
forall e s.
Unboxed e =>
MutableByteArray# s -> Int# -> State# s -> (# State# s, e #)
(!>#) MutableByteArray# s
bytes# (Int#
o# Int# -> Int# -> Int#
+# Int#
2#) State# s
s3# of
          (# State# s
s4#, e
e3 #) -> case MutableByteArray# s -> Int# -> State# s -> (# State# s, e #)
forall e s.
Unboxed e =>
MutableByteArray# s -> Int# -> State# s -> (# State# s, e #)
(!>#) MutableByteArray# s
bytes# (Int#
o# Int# -> Int# -> Int#
+# Int#
3#) State# s
s4# of
            (# State# s
s5#, e
e4 #) -> case MutableByteArray# s -> Int# -> State# s -> (# State# s, e #)
forall e s.
Unboxed e =>
MutableByteArray# s -> Int# -> State# s -> (# State# s, e #)
(!>#) MutableByteArray# s
bytes# (Int#
o# Int# -> Int# -> Int#
+# Int#
4#) State# s
s5# of
              (# State# s
s6#, e
e5 #) -> case MutableByteArray# s -> Int# -> State# s -> (# State# s, e #)
forall e s.
Unboxed e =>
MutableByteArray# s -> Int# -> State# s -> (# State# s, e #)
(!>#) MutableByteArray# s
bytes# (Int#
o# Int# -> Int# -> Int#
+# Int#
5#) State# s
s6# of
                (# State# s
s7#, e
e6 #) -> case MutableByteArray# s -> Int# -> State# s -> (# State# s, e #)
forall e s.
Unboxed e =>
MutableByteArray# s -> Int# -> State# s -> (# State# s, e #)
(!>#) MutableByteArray# s
bytes# (Int#
o# Int# -> Int# -> Int#
+# Int#
6#) State# s
s7# of
                  (# State# s
s8#, e
e7 #) -> case MutableByteArray# s -> Int# -> State# s -> (# State# s, e #)
forall e s.
Unboxed e =>
MutableByteArray# s -> Int# -> State# s -> (# State# s, e #)
(!>#) MutableByteArray# s
bytes# (Int#
o# Int# -> Int# -> Int#
+# Int#
7#) State# s
s8# of
                    (# State# s
s9#, e
e8 #) -> case MutableByteArray# s -> Int# -> State# s -> (# State# s, e #)
forall e s.
Unboxed e =>
MutableByteArray# s -> Int# -> State# s -> (# State# s, e #)
(!>#) MutableByteArray# s
bytes# (Int#
o# Int# -> Int# -> Int#
+# Int#
8#) State# s
s9# of
                      (# State# s
s10#, e
e9 #) -> case MutableByteArray# s -> Int# -> State# s -> (# State# s, e #)
forall e s.
Unboxed e =>
MutableByteArray# s -> Int# -> State# s -> (# State# s, e #)
(!>#) MutableByteArray# s
bytes# (Int#
o# Int# -> Int# -> Int#
+# Int#
9#) State# s
s10# of
                        (# State# s
s11#, e
e10 #) -> case MutableByteArray# s -> Int# -> State# s -> (# State# s, e #)
forall e s.
Unboxed e =>
MutableByteArray# s -> Int# -> State# s -> (# State# s, e #)
(!>#) MutableByteArray# s
bytes# (Int#
o# Int# -> Int# -> Int#
+# Int#
10#) State# s
s11# of
                          (# State# s
s12#, e
e11 #) -> case MutableByteArray# s -> Int# -> State# s -> (# State# s, e #)
forall e s.
Unboxed e =>
MutableByteArray# s -> Int# -> State# s -> (# State# s, e #)
(!>#) MutableByteArray# s
bytes# (Int#
o# Int# -> Int# -> Int#
+# Int#
11#) State# s
s12# of
                            (# State# s
s13#, e
e12 #) -> (# State# s
s13#, (e
e1,e
e2,e
e3,e
e4,e
e5,e
e6,e
e7,e
e8,e
e9,e
e10,e
e11,e
e12) #)
    
    writeByteArray# :: MutableByteArray# s -> Int# -> T12 e -> State# s -> State# s
writeByteArray# MutableByteArray# s
mbytes# Int#
n# (e
e1,e
e2,e
e3,e
e4,e
e5,e
e6,e
e7,e
e8,e
e9,e
e10,e
e11,e
e12) = let o# :: Int#
o# = Int#
12# Int# -> Int# -> Int#
*# Int#
n# in
      \ State# s
s1# -> case MutableByteArray# s -> Int# -> e -> State# s -> State# s
forall e s.
Unboxed e =>
MutableByteArray# s -> Int# -> e -> State# s -> State# s
writeByteArray# MutableByteArray# s
mbytes# Int#
o# e
e1 State# s
s1# of
        State# s
s2# -> case MutableByteArray# s -> Int# -> e -> State# s -> State# s
forall e s.
Unboxed e =>
MutableByteArray# s -> Int# -> e -> State# s -> State# s
writeByteArray# MutableByteArray# s
mbytes# (Int#
o# Int# -> Int# -> Int#
+# Int#
1#) e
e2 State# s
s2# of
          State# s
s3# -> case MutableByteArray# s -> Int# -> e -> State# s -> State# s
forall e s.
Unboxed e =>
MutableByteArray# s -> Int# -> e -> State# s -> State# s
writeByteArray# MutableByteArray# s
mbytes# (Int#
o# Int# -> Int# -> Int#
+# Int#
2#) e
e3 State# s
s3# of
            State# s
s4# -> case MutableByteArray# s -> Int# -> e -> State# s -> State# s
forall e s.
Unboxed e =>
MutableByteArray# s -> Int# -> e -> State# s -> State# s
writeByteArray# MutableByteArray# s
mbytes# (Int#
o# Int# -> Int# -> Int#
+# Int#
3#) e
e4 State# s
s4# of
              State# s
s5# -> case MutableByteArray# s -> Int# -> e -> State# s -> State# s
forall e s.
Unboxed e =>
MutableByteArray# s -> Int# -> e -> State# s -> State# s
writeByteArray# MutableByteArray# s
mbytes# (Int#
o# Int# -> Int# -> Int#
+# Int#
4#) e
e5 State# s
s5# of
                State# s
s6# -> case MutableByteArray# s -> Int# -> e -> State# s -> State# s
forall e s.
Unboxed e =>
MutableByteArray# s -> Int# -> e -> State# s -> State# s
writeByteArray# MutableByteArray# s
mbytes# (Int#
o# Int# -> Int# -> Int#
+# Int#
5#) e
e6 State# s
s6# of
                  State# s
s7# -> case MutableByteArray# s -> Int# -> e -> State# s -> State# s
forall e s.
Unboxed e =>
MutableByteArray# s -> Int# -> e -> State# s -> State# s
writeByteArray# MutableByteArray# s
mbytes# (Int#
o# Int# -> Int# -> Int#
+# Int#
6#) e
e7 State# s
s7# of
                    State# s
s8# -> case MutableByteArray# s -> Int# -> e -> State# s -> State# s
forall e s.
Unboxed e =>
MutableByteArray# s -> Int# -> e -> State# s -> State# s
writeByteArray# MutableByteArray# s
mbytes# (Int#
o# Int# -> Int# -> Int#
+# Int#
7#) e
e8 State# s
s8# of
                      State# s
s9# -> case MutableByteArray# s -> Int# -> e -> State# s -> State# s
forall e s.
Unboxed e =>
MutableByteArray# s -> Int# -> e -> State# s -> State# s
writeByteArray# MutableByteArray# s
mbytes# (Int#
o# Int# -> Int# -> Int#
+# Int#
8#) e
e9 State# s
s9# of
                        State# s
s10# -> case MutableByteArray# s -> Int# -> e -> State# s -> State# s
forall e s.
Unboxed e =>
MutableByteArray# s -> Int# -> e -> State# s -> State# s
writeByteArray# MutableByteArray# s
mbytes# (Int#
o# Int# -> Int# -> Int#
+# Int#
9#) e
e10 State# s
s10# of
                          State# s
s11# -> case MutableByteArray# s -> Int# -> e -> State# s -> State# s
forall e s.
Unboxed e =>
MutableByteArray# s -> Int# -> e -> State# s -> State# s
writeByteArray# MutableByteArray# s
mbytes# (Int#
o# Int# -> Int# -> Int#
+# Int#
10#) e
e11 State# s
s11# of
                            State# s
s12# -> MutableByteArray# s -> Int# -> e -> State# s -> State# s
forall e s.
Unboxed e =>
MutableByteArray# s -> Int# -> e -> State# s -> State# s
writeByteArray# MutableByteArray# s
mbytes# (Int#
o# Int# -> Int# -> Int#
+# Int#
11#) e
e12 State# s
s12#
    
    newUnboxed :: T12 e -> Int# -> State# s -> (# State# s, MutableByteArray# s #)
newUnboxed T12 e
e Int#
n# = T12 e -> Int# -> State# s -> (# State# s, MutableByteArray# s #)
forall e (proxy :: * -> *) s.
Unboxed e =>
proxy e -> Int# -> State# s -> (# State# s, MutableByteArray# s #)
pnewUnboxed T12 e
e (Int#
12# Int# -> Int# -> Int#
*# Int#
n#)

instance (Unboxed e) => Unboxed (T13 e)
  where
    sizeof :: T13 e -> Int -> Int
sizeof  T13 e
e2 Int
n  = T13 e -> Int -> Int
forall e (proxy :: * -> *). Unboxed e => proxy e -> Int -> Int
psizeof  T13 e
e2 (Int
13  Int -> Int -> Int
forall a. Num a => a -> a -> a
*   Int
n)
    sizeof# :: T13 e -> Int# -> Int#
sizeof# T13 e
e2 Int#
n# = T13 e -> Int# -> Int#
forall e (proxy :: * -> *). Unboxed e => proxy e -> Int# -> Int#
psizeof# T13 e
e2 (Int#
13# Int# -> Int# -> Int#
*# Int#
n#)
    
    ByteArray#
bytes# !# :: ByteArray# -> Int# -> T13 e
!# Int#
n# =
      let o# :: Int#
o# = Int#
13# Int# -> Int# -> Int#
*# Int#
n#
      in
        (
          ByteArray#
bytes# ByteArray# -> Int# -> e
forall e. Unboxed e => ByteArray# -> Int# -> e
!#        Int#
o#, ByteArray#
bytes# ByteArray# -> Int# -> e
forall e. Unboxed e => ByteArray# -> Int# -> e
!#  (Int#
o#Int# -> Int# -> Int#
+#Int#
1#), ByteArray#
bytes# ByteArray# -> Int# -> e
forall e. Unboxed e => ByteArray# -> Int# -> e
!#  (Int#
o#Int# -> Int# -> Int#
+#Int#
2#),
          ByteArray#
bytes# ByteArray# -> Int# -> e
forall e. Unboxed e => ByteArray# -> Int# -> e
!#  (Int#
o#Int# -> Int# -> Int#
+#Int#
3#), ByteArray#
bytes# ByteArray# -> Int# -> e
forall e. Unboxed e => ByteArray# -> Int# -> e
!#  (Int#
o#Int# -> Int# -> Int#
+#Int#
4#), ByteArray#
bytes# ByteArray# -> Int# -> e
forall e. Unboxed e => ByteArray# -> Int# -> e
!#  (Int#
o#Int# -> Int# -> Int#
+#Int#
5#),
          ByteArray#
bytes# ByteArray# -> Int# -> e
forall e. Unboxed e => ByteArray# -> Int# -> e
!#  (Int#
o#Int# -> Int# -> Int#
+#Int#
6#), ByteArray#
bytes# ByteArray# -> Int# -> e
forall e. Unboxed e => ByteArray# -> Int# -> e
!#  (Int#
o#Int# -> Int# -> Int#
+#Int#
7#), ByteArray#
bytes# ByteArray# -> Int# -> e
forall e. Unboxed e => ByteArray# -> Int# -> e
!#  (Int#
o#Int# -> Int# -> Int#
+#Int#
8#),
          ByteArray#
bytes# ByteArray# -> Int# -> e
forall e. Unboxed e => ByteArray# -> Int# -> e
!#  (Int#
o#Int# -> Int# -> Int#
+#Int#
9#), ByteArray#
bytes# ByteArray# -> Int# -> e
forall e. Unboxed e => ByteArray# -> Int# -> e
!# (Int#
o#Int# -> Int# -> Int#
+#Int#
10#), ByteArray#
bytes# ByteArray# -> Int# -> e
forall e. Unboxed e => ByteArray# -> Int# -> e
!# (Int#
o#Int# -> Int# -> Int#
+#Int#
11#),
          ByteArray#
bytes# ByteArray# -> Int# -> e
forall e. Unboxed e => ByteArray# -> Int# -> e
!# (Int#
o#Int# -> Int# -> Int#
+#Int#
12#)
        )
    
    MutableByteArray# s
bytes# !># :: MutableByteArray# s -> Int# -> State# s -> (# State# s, T13 e #)
!># Int#
n# = let o# :: Int#
o# = Int#
13# Int# -> Int# -> Int#
*# Int#
n# in \ State# s
s1# -> case MutableByteArray# s -> Int# -> State# s -> (# State# s, e #)
forall e s.
Unboxed e =>
MutableByteArray# s -> Int# -> State# s -> (# State# s, e #)
(!>#) MutableByteArray# s
bytes# Int#
o# State# s
s1# of
      (# State# s
s2#, e
e1 #) -> case MutableByteArray# s -> Int# -> State# s -> (# State# s, e #)
forall e s.
Unboxed e =>
MutableByteArray# s -> Int# -> State# s -> (# State# s, e #)
(!>#) MutableByteArray# s
bytes# (Int#
o# Int# -> Int# -> Int#
+# Int#
1#) State# s
s2# of
        (# State# s
s3#, e
e2 #) -> case MutableByteArray# s -> Int# -> State# s -> (# State# s, e #)
forall e s.
Unboxed e =>
MutableByteArray# s -> Int# -> State# s -> (# State# s, e #)
(!>#) MutableByteArray# s
bytes# (Int#
o# Int# -> Int# -> Int#
+# Int#
2#) State# s
s3# of
          (# State# s
s4#, e
e3 #) -> case MutableByteArray# s -> Int# -> State# s -> (# State# s, e #)
forall e s.
Unboxed e =>
MutableByteArray# s -> Int# -> State# s -> (# State# s, e #)
(!>#) MutableByteArray# s
bytes# (Int#
o# Int# -> Int# -> Int#
+# Int#
3#) State# s
s4# of
            (# State# s
s5#, e
e4 #) -> case MutableByteArray# s -> Int# -> State# s -> (# State# s, e #)
forall e s.
Unboxed e =>
MutableByteArray# s -> Int# -> State# s -> (# State# s, e #)
(!>#) MutableByteArray# s
bytes# (Int#
o# Int# -> Int# -> Int#
+# Int#
4#) State# s
s5# of
              (# State# s
s6#, e
e5 #) -> case MutableByteArray# s -> Int# -> State# s -> (# State# s, e #)
forall e s.
Unboxed e =>
MutableByteArray# s -> Int# -> State# s -> (# State# s, e #)
(!>#) MutableByteArray# s
bytes# (Int#
o# Int# -> Int# -> Int#
+# Int#
5#) State# s
s6# of
                (# State# s
s7#, e
e6 #) -> case MutableByteArray# s -> Int# -> State# s -> (# State# s, e #)
forall e s.
Unboxed e =>
MutableByteArray# s -> Int# -> State# s -> (# State# s, e #)
(!>#) MutableByteArray# s
bytes# (Int#
o# Int# -> Int# -> Int#
+# Int#
6#) State# s
s7# of
                  (# State# s
s8#, e
e7 #) -> case MutableByteArray# s -> Int# -> State# s -> (# State# s, e #)
forall e s.
Unboxed e =>
MutableByteArray# s -> Int# -> State# s -> (# State# s, e #)
(!>#) MutableByteArray# s
bytes# (Int#
o# Int# -> Int# -> Int#
+# Int#
7#) State# s
s8# of
                    (# State# s
s9#, e
e8 #) -> case MutableByteArray# s -> Int# -> State# s -> (# State# s, e #)
forall e s.
Unboxed e =>
MutableByteArray# s -> Int# -> State# s -> (# State# s, e #)
(!>#) MutableByteArray# s
bytes# (Int#
o# Int# -> Int# -> Int#
+# Int#
8#) State# s
s9# of
                      (# State# s
s10#, e
e9 #) -> case MutableByteArray# s -> Int# -> State# s -> (# State# s, e #)
forall e s.
Unboxed e =>
MutableByteArray# s -> Int# -> State# s -> (# State# s, e #)
(!>#) MutableByteArray# s
bytes# (Int#
o# Int# -> Int# -> Int#
+# Int#
9#) State# s
s10# of
                        (# State# s
s11#, e
e10 #) -> case MutableByteArray# s -> Int# -> State# s -> (# State# s, e #)
forall e s.
Unboxed e =>
MutableByteArray# s -> Int# -> State# s -> (# State# s, e #)
(!>#) MutableByteArray# s
bytes# (Int#
o# Int# -> Int# -> Int#
+# Int#
10#) State# s
s11# of
                          (# State# s
s12#, e
e11 #) -> case MutableByteArray# s -> Int# -> State# s -> (# State# s, e #)
forall e s.
Unboxed e =>
MutableByteArray# s -> Int# -> State# s -> (# State# s, e #)
(!>#) MutableByteArray# s
bytes# (Int#
o# Int# -> Int# -> Int#
+# Int#
11#) State# s
s12# of
                            (# State# s
s13#, e
e12 #) -> case MutableByteArray# s -> Int# -> State# s -> (# State# s, e #)
forall e s.
Unboxed e =>
MutableByteArray# s -> Int# -> State# s -> (# State# s, e #)
(!>#) MutableByteArray# s
bytes# (Int#
o# Int# -> Int# -> Int#
+# Int#
12#) State# s
s13# of
                              (# State# s
s14#, e
e13 #) -> (# State# s
s14#, (e
e1,e
e2,e
e3,e
e4,e
e5,e
e6,e
e7,e
e8,e
e9,e
e10,e
e11,e
e12,e
e13) #)
    
    writeByteArray# :: MutableByteArray# s -> Int# -> T13 e -> State# s -> State# s
writeByteArray# MutableByteArray# s
mbytes# Int#
n# (e
e1,e
e2,e
e3,e
e4,e
e5,e
e6,e
e7,e
e8,e
e9,e
e10,e
e11,e
e12,e
e13) = let o# :: Int#
o# = Int#
13# Int# -> Int# -> Int#
*# Int#
n# in
      \ State# s
s1# -> case MutableByteArray# s -> Int# -> e -> State# s -> State# s
forall e s.
Unboxed e =>
MutableByteArray# s -> Int# -> e -> State# s -> State# s
writeByteArray# MutableByteArray# s
mbytes# Int#
o# e
e1 State# s
s1# of
        State# s
s2# -> case MutableByteArray# s -> Int# -> e -> State# s -> State# s
forall e s.
Unboxed e =>
MutableByteArray# s -> Int# -> e -> State# s -> State# s
writeByteArray# MutableByteArray# s
mbytes# (Int#
o# Int# -> Int# -> Int#
+# Int#
1#) e
e2 State# s
s2# of
          State# s
s3# -> case MutableByteArray# s -> Int# -> e -> State# s -> State# s
forall e s.
Unboxed e =>
MutableByteArray# s -> Int# -> e -> State# s -> State# s
writeByteArray# MutableByteArray# s
mbytes# (Int#
o# Int# -> Int# -> Int#
+# Int#
2#) e
e3 State# s
s3# of
            State# s
s4# -> case MutableByteArray# s -> Int# -> e -> State# s -> State# s
forall e s.
Unboxed e =>
MutableByteArray# s -> Int# -> e -> State# s -> State# s
writeByteArray# MutableByteArray# s
mbytes# (Int#
o# Int# -> Int# -> Int#
+# Int#
3#) e
e4 State# s
s4# of
              State# s
s5# -> case MutableByteArray# s -> Int# -> e -> State# s -> State# s
forall e s.
Unboxed e =>
MutableByteArray# s -> Int# -> e -> State# s -> State# s
writeByteArray# MutableByteArray# s
mbytes# (Int#
o# Int# -> Int# -> Int#
+# Int#
4#) e
e5 State# s
s5# of
                State# s
s6# -> case MutableByteArray# s -> Int# -> e -> State# s -> State# s
forall e s.
Unboxed e =>
MutableByteArray# s -> Int# -> e -> State# s -> State# s
writeByteArray# MutableByteArray# s
mbytes# (Int#
o# Int# -> Int# -> Int#
+# Int#
5#) e
e6 State# s
s6# of
                  State# s
s7# -> case MutableByteArray# s -> Int# -> e -> State# s -> State# s
forall e s.
Unboxed e =>
MutableByteArray# s -> Int# -> e -> State# s -> State# s
writeByteArray# MutableByteArray# s
mbytes# (Int#
o# Int# -> Int# -> Int#
+# Int#
6#) e
e7 State# s
s7# of
                    State# s
s8# -> case MutableByteArray# s -> Int# -> e -> State# s -> State# s
forall e s.
Unboxed e =>
MutableByteArray# s -> Int# -> e -> State# s -> State# s
writeByteArray# MutableByteArray# s
mbytes# (Int#
o# Int# -> Int# -> Int#
+# Int#
7#) e
e8 State# s
s8# of
                      State# s
s9# -> case MutableByteArray# s -> Int# -> e -> State# s -> State# s
forall e s.
Unboxed e =>
MutableByteArray# s -> Int# -> e -> State# s -> State# s
writeByteArray# MutableByteArray# s
mbytes# (Int#
o# Int# -> Int# -> Int#
+# Int#
8#) e
e9 State# s
s9# of
                        State# s
s10# -> case MutableByteArray# s -> Int# -> e -> State# s -> State# s
forall e s.
Unboxed e =>
MutableByteArray# s -> Int# -> e -> State# s -> State# s
writeByteArray# MutableByteArray# s
mbytes# (Int#
o# Int# -> Int# -> Int#
+# Int#
9#) e
e10 State# s
s10# of
                          State# s
s11# -> case MutableByteArray# s -> Int# -> e -> State# s -> State# s
forall e s.
Unboxed e =>
MutableByteArray# s -> Int# -> e -> State# s -> State# s
writeByteArray# MutableByteArray# s
mbytes# (Int#
o# Int# -> Int# -> Int#
+# Int#
10#) e
e11 State# s
s11# of
                            State# s
s12# -> case MutableByteArray# s -> Int# -> e -> State# s -> State# s
forall e s.
Unboxed e =>
MutableByteArray# s -> Int# -> e -> State# s -> State# s
writeByteArray# MutableByteArray# s
mbytes# (Int#
o# Int# -> Int# -> Int#
+# Int#
11#) e
e12 State# s
s12# of
                              State# s
s13# -> MutableByteArray# s -> Int# -> e -> State# s -> State# s
forall e s.
Unboxed e =>
MutableByteArray# s -> Int# -> e -> State# s -> State# s
writeByteArray# MutableByteArray# s
mbytes# (Int#
o# Int# -> Int# -> Int#
+# Int#
12#) e
e13 State# s
s13#
    
    newUnboxed :: T13 e -> Int# -> State# s -> (# State# s, MutableByteArray# s #)
newUnboxed T13 e
e Int#
n# = T13 e -> Int# -> State# s -> (# State# s, MutableByteArray# s #)
forall e (proxy :: * -> *) s.
Unboxed e =>
proxy e -> Int# -> State# s -> (# State# s, MutableByteArray# s #)
pnewUnboxed T13 e
e (Int#
13# Int# -> Int# -> Int#
*# Int#
n#)

instance (Unboxed e) => Unboxed (T14 e)
  where
    sizeof :: T14 e -> Int -> Int
sizeof  T14 e
e2 Int
n  = T14 e -> Int -> Int
forall e (proxy :: * -> *). Unboxed e => proxy e -> Int -> Int
psizeof  T14 e
e2 (Int
14  Int -> Int -> Int
forall a. Num a => a -> a -> a
*   Int
n)
    sizeof# :: T14 e -> Int# -> Int#
sizeof# T14 e
e2 Int#
n# = T14 e -> Int# -> Int#
forall e (proxy :: * -> *). Unboxed e => proxy e -> Int# -> Int#
psizeof# T14 e
e2 (Int#
14# Int# -> Int# -> Int#
*# Int#
n#)
    
    ByteArray#
bytes# !# :: ByteArray# -> Int# -> T14 e
!# Int#
n# =
      let o# :: Int#
o# = Int#
14# Int# -> Int# -> Int#
*# Int#
n#
      in
        (
          ByteArray#
bytes# ByteArray# -> Int# -> e
forall e. Unboxed e => ByteArray# -> Int# -> e
!#        Int#
o#, ByteArray#
bytes# ByteArray# -> Int# -> e
forall e. Unboxed e => ByteArray# -> Int# -> e
!#  (Int#
o#Int# -> Int# -> Int#
+#Int#
1#), ByteArray#
bytes# ByteArray# -> Int# -> e
forall e. Unboxed e => ByteArray# -> Int# -> e
!#  (Int#
o#Int# -> Int# -> Int#
+#Int#
2#),
          ByteArray#
bytes# ByteArray# -> Int# -> e
forall e. Unboxed e => ByteArray# -> Int# -> e
!#  (Int#
o#Int# -> Int# -> Int#
+#Int#
3#), ByteArray#
bytes# ByteArray# -> Int# -> e
forall e. Unboxed e => ByteArray# -> Int# -> e
!#  (Int#
o#Int# -> Int# -> Int#
+#Int#
4#), ByteArray#
bytes# ByteArray# -> Int# -> e
forall e. Unboxed e => ByteArray# -> Int# -> e
!#  (Int#
o#Int# -> Int# -> Int#
+#Int#
5#),
          ByteArray#
bytes# ByteArray# -> Int# -> e
forall e. Unboxed e => ByteArray# -> Int# -> e
!#  (Int#
o#Int# -> Int# -> Int#
+#Int#
6#), ByteArray#
bytes# ByteArray# -> Int# -> e
forall e. Unboxed e => ByteArray# -> Int# -> e
!#  (Int#
o#Int# -> Int# -> Int#
+#Int#
7#), ByteArray#
bytes# ByteArray# -> Int# -> e
forall e. Unboxed e => ByteArray# -> Int# -> e
!#  (Int#
o#Int# -> Int# -> Int#
+#Int#
8#),
          ByteArray#
bytes# ByteArray# -> Int# -> e
forall e. Unboxed e => ByteArray# -> Int# -> e
!#  (Int#
o#Int# -> Int# -> Int#
+#Int#
9#), ByteArray#
bytes# ByteArray# -> Int# -> e
forall e. Unboxed e => ByteArray# -> Int# -> e
!# (Int#
o#Int# -> Int# -> Int#
+#Int#
10#), ByteArray#
bytes# ByteArray# -> Int# -> e
forall e. Unboxed e => ByteArray# -> Int# -> e
!# (Int#
o#Int# -> Int# -> Int#
+#Int#
11#),
          ByteArray#
bytes# ByteArray# -> Int# -> e
forall e. Unboxed e => ByteArray# -> Int# -> e
!# (Int#
o#Int# -> Int# -> Int#
+#Int#
12#), ByteArray#
bytes# ByteArray# -> Int# -> e
forall e. Unboxed e => ByteArray# -> Int# -> e
!# (Int#
o#Int# -> Int# -> Int#
+#Int#
13#)
        )
    
    MutableByteArray# s
bytes# !># :: MutableByteArray# s -> Int# -> State# s -> (# State# s, T14 e #)
!># Int#
n# = let o# :: Int#
o# = Int#
14# Int# -> Int# -> Int#
*# Int#
n# in \ State# s
s1# -> case MutableByteArray# s -> Int# -> State# s -> (# State# s, e #)
forall e s.
Unboxed e =>
MutableByteArray# s -> Int# -> State# s -> (# State# s, e #)
(!>#) MutableByteArray# s
bytes# Int#
o# State# s
s1# of
      (# State# s
s2#, e
e1 #) -> case MutableByteArray# s -> Int# -> State# s -> (# State# s, e #)
forall e s.
Unboxed e =>
MutableByteArray# s -> Int# -> State# s -> (# State# s, e #)
(!>#) MutableByteArray# s
bytes# (Int#
o# Int# -> Int# -> Int#
+# Int#
1#) State# s
s2# of
        (# State# s
s3#, e
e2 #) -> case MutableByteArray# s -> Int# -> State# s -> (# State# s, e #)
forall e s.
Unboxed e =>
MutableByteArray# s -> Int# -> State# s -> (# State# s, e #)
(!>#) MutableByteArray# s
bytes# (Int#
o# Int# -> Int# -> Int#
+# Int#
2#) State# s
s3# of
          (# State# s
s4#, e
e3 #) -> case MutableByteArray# s -> Int# -> State# s -> (# State# s, e #)
forall e s.
Unboxed e =>
MutableByteArray# s -> Int# -> State# s -> (# State# s, e #)
(!>#) MutableByteArray# s
bytes# (Int#
o# Int# -> Int# -> Int#
+# Int#
3#) State# s
s4# of
            (# State# s
s5#, e
e4 #) -> case MutableByteArray# s -> Int# -> State# s -> (# State# s, e #)
forall e s.
Unboxed e =>
MutableByteArray# s -> Int# -> State# s -> (# State# s, e #)
(!>#) MutableByteArray# s
bytes# (Int#
o# Int# -> Int# -> Int#
+# Int#
4#) State# s
s5# of
              (# State# s
s6#, e
e5 #) -> case MutableByteArray# s -> Int# -> State# s -> (# State# s, e #)
forall e s.
Unboxed e =>
MutableByteArray# s -> Int# -> State# s -> (# State# s, e #)
(!>#) MutableByteArray# s
bytes# (Int#
o# Int# -> Int# -> Int#
+# Int#
5#) State# s
s6# of
                (# State# s
s7#, e
e6 #) -> case MutableByteArray# s -> Int# -> State# s -> (# State# s, e #)
forall e s.
Unboxed e =>
MutableByteArray# s -> Int# -> State# s -> (# State# s, e #)
(!>#) MutableByteArray# s
bytes# (Int#
o# Int# -> Int# -> Int#
+# Int#
6#) State# s
s7# of
                  (# State# s
s8#, e
e7 #) -> case MutableByteArray# s -> Int# -> State# s -> (# State# s, e #)
forall e s.
Unboxed e =>
MutableByteArray# s -> Int# -> State# s -> (# State# s, e #)
(!>#) MutableByteArray# s
bytes# (Int#
o# Int# -> Int# -> Int#
+# Int#
7#) State# s
s8# of
                    (# State# s
s9#, e
e8 #) -> case MutableByteArray# s -> Int# -> State# s -> (# State# s, e #)
forall e s.
Unboxed e =>
MutableByteArray# s -> Int# -> State# s -> (# State# s, e #)
(!>#) MutableByteArray# s
bytes# (Int#
o# Int# -> Int# -> Int#
+# Int#
8#) State# s
s9# of
                      (# State# s
s10#, e
e9 #) -> case MutableByteArray# s -> Int# -> State# s -> (# State# s, e #)
forall e s.
Unboxed e =>
MutableByteArray# s -> Int# -> State# s -> (# State# s, e #)
(!>#) MutableByteArray# s
bytes# (Int#
o# Int# -> Int# -> Int#
+# Int#
9#) State# s
s10# of
                        (# State# s
s11#, e
e10 #) -> case MutableByteArray# s -> Int# -> State# s -> (# State# s, e #)
forall e s.
Unboxed e =>
MutableByteArray# s -> Int# -> State# s -> (# State# s, e #)
(!>#) MutableByteArray# s
bytes# (Int#
o# Int# -> Int# -> Int#
+# Int#
10#) State# s
s11# of
                          (# State# s
s12#, e
e11 #) -> case MutableByteArray# s -> Int# -> State# s -> (# State# s, e #)
forall e s.
Unboxed e =>
MutableByteArray# s -> Int# -> State# s -> (# State# s, e #)
(!>#) MutableByteArray# s
bytes# (Int#
o# Int# -> Int# -> Int#
+# Int#
11#) State# s
s12# of
                            (# State# s
s13#, e
e12 #) -> case MutableByteArray# s -> Int# -> State# s -> (# State# s, e #)
forall e s.
Unboxed e =>
MutableByteArray# s -> Int# -> State# s -> (# State# s, e #)
(!>#) MutableByteArray# s
bytes# (Int#
o# Int# -> Int# -> Int#
+# Int#
12#) State# s
s13# of
                              (# State# s
s14#, e
e13 #) -> case MutableByteArray# s -> Int# -> State# s -> (# State# s, e #)
forall e s.
Unboxed e =>
MutableByteArray# s -> Int# -> State# s -> (# State# s, e #)
(!>#) MutableByteArray# s
bytes# (Int#
o# Int# -> Int# -> Int#
+# Int#
13#) State# s
s14# of
                                (# State# s
s15#, e
e14 #) -> (# State# s
s15#, (e
e1,e
e2,e
e3,e
e4,e
e5,e
e6,e
e7,e
e8,e
e9,e
e10,e
e11,e
e12,e
e13,e
e14) #)
    
    writeByteArray# :: MutableByteArray# s -> Int# -> T14 e -> State# s -> State# s
writeByteArray# MutableByteArray# s
mbytes# Int#
n# (e
e1,e
e2,e
e3,e
e4,e
e5,e
e6,e
e7,e
e8,e
e9,e
e10,e
e11,e
e12,e
e13,e
e14) =
      \ State# s
s1# -> let o# :: Int#
o# = Int#
14# Int# -> Int# -> Int#
*# Int#
n# in case MutableByteArray# s -> Int# -> e -> State# s -> State# s
forall e s.
Unboxed e =>
MutableByteArray# s -> Int# -> e -> State# s -> State# s
writeByteArray# MutableByteArray# s
mbytes# Int#
o# e
e1 State# s
s1# of
        State# s
s2# -> case MutableByteArray# s -> Int# -> e -> State# s -> State# s
forall e s.
Unboxed e =>
MutableByteArray# s -> Int# -> e -> State# s -> State# s
writeByteArray# MutableByteArray# s
mbytes# (Int#
o# Int# -> Int# -> Int#
+# Int#
1#) e
e2 State# s
s2# of
          State# s
s3# -> case MutableByteArray# s -> Int# -> e -> State# s -> State# s
forall e s.
Unboxed e =>
MutableByteArray# s -> Int# -> e -> State# s -> State# s
writeByteArray# MutableByteArray# s
mbytes# (Int#
o# Int# -> Int# -> Int#
+# Int#
2#) e
e3 State# s
s3# of
            State# s
s4# -> case MutableByteArray# s -> Int# -> e -> State# s -> State# s
forall e s.
Unboxed e =>
MutableByteArray# s -> Int# -> e -> State# s -> State# s
writeByteArray# MutableByteArray# s
mbytes# (Int#
o# Int# -> Int# -> Int#
+# Int#
3#) e
e4 State# s
s4# of
              State# s
s5# -> case MutableByteArray# s -> Int# -> e -> State# s -> State# s
forall e s.
Unboxed e =>
MutableByteArray# s -> Int# -> e -> State# s -> State# s
writeByteArray# MutableByteArray# s
mbytes# (Int#
o# Int# -> Int# -> Int#
+# Int#
4#) e
e5 State# s
s5# of
                State# s
s6# -> case MutableByteArray# s -> Int# -> e -> State# s -> State# s
forall e s.
Unboxed e =>
MutableByteArray# s -> Int# -> e -> State# s -> State# s
writeByteArray# MutableByteArray# s
mbytes# (Int#
o# Int# -> Int# -> Int#
+# Int#
5#) e
e6 State# s
s6# of
                  State# s
s7# -> case MutableByteArray# s -> Int# -> e -> State# s -> State# s
forall e s.
Unboxed e =>
MutableByteArray# s -> Int# -> e -> State# s -> State# s
writeByteArray# MutableByteArray# s
mbytes# (Int#
o# Int# -> Int# -> Int#
+# Int#
6#) e
e7 State# s
s7# of
                    State# s
s8# -> case MutableByteArray# s -> Int# -> e -> State# s -> State# s
forall e s.
Unboxed e =>
MutableByteArray# s -> Int# -> e -> State# s -> State# s
writeByteArray# MutableByteArray# s
mbytes# (Int#
o# Int# -> Int# -> Int#
+# Int#
7#) e
e8 State# s
s8# of
                      State# s
s9# -> case MutableByteArray# s -> Int# -> e -> State# s -> State# s
forall e s.
Unboxed e =>
MutableByteArray# s -> Int# -> e -> State# s -> State# s
writeByteArray# MutableByteArray# s
mbytes# (Int#
o# Int# -> Int# -> Int#
+# Int#
8#) e
e9 State# s
s9# of
                        State# s
s10# -> case MutableByteArray# s -> Int# -> e -> State# s -> State# s
forall e s.
Unboxed e =>
MutableByteArray# s -> Int# -> e -> State# s -> State# s
writeByteArray# MutableByteArray# s
mbytes# (Int#
o# Int# -> Int# -> Int#
+# Int#
9#) e
e10 State# s
s10# of
                          State# s
s11# -> case MutableByteArray# s -> Int# -> e -> State# s -> State# s
forall e s.
Unboxed e =>
MutableByteArray# s -> Int# -> e -> State# s -> State# s
writeByteArray# MutableByteArray# s
mbytes# (Int#
o# Int# -> Int# -> Int#
+# Int#
10#) e
e11 State# s
s11# of
                            State# s
s12# -> case MutableByteArray# s -> Int# -> e -> State# s -> State# s
forall e s.
Unboxed e =>
MutableByteArray# s -> Int# -> e -> State# s -> State# s
writeByteArray# MutableByteArray# s
mbytes# (Int#
o# Int# -> Int# -> Int#
+# Int#
11#) e
e12 State# s
s12# of
                              State# s
s13# -> case MutableByteArray# s -> Int# -> e -> State# s -> State# s
forall e s.
Unboxed e =>
MutableByteArray# s -> Int# -> e -> State# s -> State# s
writeByteArray# MutableByteArray# s
mbytes# (Int#
o# Int# -> Int# -> Int#
+# Int#
12#) e
e13 State# s
s13# of
                                State# s
s14# -> MutableByteArray# s -> Int# -> e -> State# s -> State# s
forall e s.
Unboxed e =>
MutableByteArray# s -> Int# -> e -> State# s -> State# s
writeByteArray# MutableByteArray# s
mbytes# (Int#
o# Int# -> Int# -> Int#
+# Int#
13#) e
e14 State# s
s14#
    
    newUnboxed :: T14 e -> Int# -> State# s -> (# State# s, MutableByteArray# s #)
newUnboxed T14 e
e Int#
n# = T14 e -> Int# -> State# s -> (# State# s, MutableByteArray# s #)
forall e (proxy :: * -> *) s.
Unboxed e =>
proxy e -> Int# -> State# s -> (# State# s, MutableByteArray# s #)
pnewUnboxed T14 e
e (Int#
14# Int# -> Int# -> Int#
*# Int#
n#)

instance (Unboxed e) => Unboxed (T15 e)
  where
    sizeof :: T15 e -> Int -> Int
sizeof  T15 e
e2 Int
n  = T15 e -> Int -> Int
forall e (proxy :: * -> *). Unboxed e => proxy e -> Int -> Int
psizeof  T15 e
e2 (Int
15  Int -> Int -> Int
forall a. Num a => a -> a -> a
*   Int
n)
    sizeof# :: T15 e -> Int# -> Int#
sizeof# T15 e
e2 Int#
n# = T15 e -> Int# -> Int#
forall e (proxy :: * -> *). Unboxed e => proxy e -> Int# -> Int#
psizeof# T15 e
e2 (Int#
15# Int# -> Int# -> Int#
*# Int#
n#)
    
    ByteArray#
bytes# !# :: ByteArray# -> Int# -> T15 e
!# Int#
n# =
      let o# :: Int#
o# = Int#
15# Int# -> Int# -> Int#
*# Int#
n#
      in
        (
          ByteArray#
bytes# ByteArray# -> Int# -> e
forall e. Unboxed e => ByteArray# -> Int# -> e
!#        Int#
o#, ByteArray#
bytes# ByteArray# -> Int# -> e
forall e. Unboxed e => ByteArray# -> Int# -> e
!#  (Int#
o#Int# -> Int# -> Int#
+#Int#
1#), ByteArray#
bytes# ByteArray# -> Int# -> e
forall e. Unboxed e => ByteArray# -> Int# -> e
!#  (Int#
o#Int# -> Int# -> Int#
+#Int#
2#),
          ByteArray#
bytes# ByteArray# -> Int# -> e
forall e. Unboxed e => ByteArray# -> Int# -> e
!#  (Int#
o#Int# -> Int# -> Int#
+#Int#
3#), ByteArray#
bytes# ByteArray# -> Int# -> e
forall e. Unboxed e => ByteArray# -> Int# -> e
!#  (Int#
o#Int# -> Int# -> Int#
+#Int#
4#), ByteArray#
bytes# ByteArray# -> Int# -> e
forall e. Unboxed e => ByteArray# -> Int# -> e
!#  (Int#
o#Int# -> Int# -> Int#
+#Int#
5#),
          ByteArray#
bytes# ByteArray# -> Int# -> e
forall e. Unboxed e => ByteArray# -> Int# -> e
!#  (Int#
o#Int# -> Int# -> Int#
+#Int#
6#), ByteArray#
bytes# ByteArray# -> Int# -> e
forall e. Unboxed e => ByteArray# -> Int# -> e
!#  (Int#
o#Int# -> Int# -> Int#
+#Int#
7#), ByteArray#
bytes# ByteArray# -> Int# -> e
forall e. Unboxed e => ByteArray# -> Int# -> e
!#  (Int#
o#Int# -> Int# -> Int#
+#Int#
8#),
          ByteArray#
bytes# ByteArray# -> Int# -> e
forall e. Unboxed e => ByteArray# -> Int# -> e
!#  (Int#
o#Int# -> Int# -> Int#
+#Int#
9#), ByteArray#
bytes# ByteArray# -> Int# -> e
forall e. Unboxed e => ByteArray# -> Int# -> e
!# (Int#
o#Int# -> Int# -> Int#
+#Int#
10#), ByteArray#
bytes# ByteArray# -> Int# -> e
forall e. Unboxed e => ByteArray# -> Int# -> e
!# (Int#
o#Int# -> Int# -> Int#
+#Int#
11#),
          ByteArray#
bytes# ByteArray# -> Int# -> e
forall e. Unboxed e => ByteArray# -> Int# -> e
!# (Int#
o#Int# -> Int# -> Int#
+#Int#
12#), ByteArray#
bytes# ByteArray# -> Int# -> e
forall e. Unboxed e => ByteArray# -> Int# -> e
!# (Int#
o#Int# -> Int# -> Int#
+#Int#
13#), ByteArray#
bytes# ByteArray# -> Int# -> e
forall e. Unboxed e => ByteArray# -> Int# -> e
!# (Int#
o#Int# -> Int# -> Int#
+#Int#
14#)
        )
    
    MutableByteArray# s
bytes# !># :: MutableByteArray# s -> Int# -> State# s -> (# State# s, T15 e #)
!># Int#
n# = let o# :: Int#
o# = Int#
15# Int# -> Int# -> Int#
*# Int#
n# in \ State# s
s1# -> case MutableByteArray# s -> Int# -> State# s -> (# State# s, e #)
forall e s.
Unboxed e =>
MutableByteArray# s -> Int# -> State# s -> (# State# s, e #)
(!>#) MutableByteArray# s
bytes# Int#
o# State# s
s1# of
      (# State# s
s2#, e
e1 #) -> case MutableByteArray# s -> Int# -> State# s -> (# State# s, e #)
forall e s.
Unboxed e =>
MutableByteArray# s -> Int# -> State# s -> (# State# s, e #)
(!>#) MutableByteArray# s
bytes# (Int#
o# Int# -> Int# -> Int#
+# Int#
1#) State# s
s2# of
        (# State# s
s3#, e
e2 #) -> case MutableByteArray# s -> Int# -> State# s -> (# State# s, e #)
forall e s.
Unboxed e =>
MutableByteArray# s -> Int# -> State# s -> (# State# s, e #)
(!>#) MutableByteArray# s
bytes# (Int#
o# Int# -> Int# -> Int#
+# Int#
2#) State# s
s3# of
          (# State# s
s4#, e
e3 #) -> case MutableByteArray# s -> Int# -> State# s -> (# State# s, e #)
forall e s.
Unboxed e =>
MutableByteArray# s -> Int# -> State# s -> (# State# s, e #)
(!>#) MutableByteArray# s
bytes# (Int#
o# Int# -> Int# -> Int#
+# Int#
3#) State# s
s4# of
            (# State# s
s5#, e
e4 #) -> case MutableByteArray# s -> Int# -> State# s -> (# State# s, e #)
forall e s.
Unboxed e =>
MutableByteArray# s -> Int# -> State# s -> (# State# s, e #)
(!>#) MutableByteArray# s
bytes# (Int#
o# Int# -> Int# -> Int#
+# Int#
4#) State# s
s5# of
              (# State# s
s6#, e
e5 #) -> case MutableByteArray# s -> Int# -> State# s -> (# State# s, e #)
forall e s.
Unboxed e =>
MutableByteArray# s -> Int# -> State# s -> (# State# s, e #)
(!>#) MutableByteArray# s
bytes# (Int#
o# Int# -> Int# -> Int#
+# Int#
5#) State# s
s6# of
                (# State# s
s7#, e
e6 #) -> case MutableByteArray# s -> Int# -> State# s -> (# State# s, e #)
forall e s.
Unboxed e =>
MutableByteArray# s -> Int# -> State# s -> (# State# s, e #)
(!>#) MutableByteArray# s
bytes# (Int#
o# Int# -> Int# -> Int#
+# Int#
6#) State# s
s7# of
                  (# State# s
s8#, e
e7 #) -> case MutableByteArray# s -> Int# -> State# s -> (# State# s, e #)
forall e s.
Unboxed e =>
MutableByteArray# s -> Int# -> State# s -> (# State# s, e #)
(!>#) MutableByteArray# s
bytes# (Int#
o# Int# -> Int# -> Int#
+# Int#
7#) State# s
s8# of
                    (# State# s
s9#, e
e8 #) -> case MutableByteArray# s -> Int# -> State# s -> (# State# s, e #)
forall e s.
Unboxed e =>
MutableByteArray# s -> Int# -> State# s -> (# State# s, e #)
(!>#) MutableByteArray# s
bytes# (Int#
o# Int# -> Int# -> Int#
+# Int#
8#) State# s
s9# of
                      (# State# s
s10#, e
e9 #) -> case MutableByteArray# s -> Int# -> State# s -> (# State# s, e #)
forall e s.
Unboxed e =>
MutableByteArray# s -> Int# -> State# s -> (# State# s, e #)
(!>#) MutableByteArray# s
bytes# (Int#
o# Int# -> Int# -> Int#
+# Int#
9#) State# s
s10# of
                        (# State# s
s11#, e
e10 #) -> case MutableByteArray# s -> Int# -> State# s -> (# State# s, e #)
forall e s.
Unboxed e =>
MutableByteArray# s -> Int# -> State# s -> (# State# s, e #)
(!>#) MutableByteArray# s
bytes# (Int#
o# Int# -> Int# -> Int#
+# Int#
10#) State# s
s11# of
                          (# State# s
s12#, e
e11 #) -> case MutableByteArray# s -> Int# -> State# s -> (# State# s, e #)
forall e s.
Unboxed e =>
MutableByteArray# s -> Int# -> State# s -> (# State# s, e #)
(!>#) MutableByteArray# s
bytes# (Int#
o# Int# -> Int# -> Int#
+# Int#
11#) State# s
s12# of
                            (# State# s
s13#, e
e12 #) -> case MutableByteArray# s -> Int# -> State# s -> (# State# s, e #)
forall e s.
Unboxed e =>
MutableByteArray# s -> Int# -> State# s -> (# State# s, e #)
(!>#) MutableByteArray# s
bytes# (Int#
o# Int# -> Int# -> Int#
+# Int#
12#) State# s
s13# of
                              (# State# s
s14#, e
e13 #) -> case MutableByteArray# s -> Int# -> State# s -> (# State# s, e #)
forall e s.
Unboxed e =>
MutableByteArray# s -> Int# -> State# s -> (# State# s, e #)
(!>#) MutableByteArray# s
bytes# (Int#
o# Int# -> Int# -> Int#
+# Int#
13#) State# s
s14# of
                                (# State# s
s15#, e
e14 #) -> case MutableByteArray# s -> Int# -> State# s -> (# State# s, e #)
forall e s.
Unboxed e =>
MutableByteArray# s -> Int# -> State# s -> (# State# s, e #)
(!>#) MutableByteArray# s
bytes# (Int#
o# Int# -> Int# -> Int#
+# Int#
14#) State# s
s15# of
                                  (# State# s
s16#, e
e15 #) -> (# State# s
s16#, (e
e1,e
e2,e
e3,e
e4,e
e5,e
e6,e
e7,e
e8,e
e9,e
e10,e
e11,e
e12,e
e13,e
e14,e
e15) #)
    
    writeByteArray# :: MutableByteArray# s -> Int# -> T15 e -> State# s -> State# s
writeByteArray# MutableByteArray# s
mbytes# Int#
n# (e
e1,e
e2,e
e3,e
e4,e
e5,e
e6,e
e7,e
e8,e
e9,e
e10,e
e11,e
e12,e
e13,e
e14,e
e15) =
      \ State# s
s1# -> let o# :: Int#
o# = Int#
15# Int# -> Int# -> Int#
*# Int#
n# in case MutableByteArray# s -> Int# -> e -> State# s -> State# s
forall e s.
Unboxed e =>
MutableByteArray# s -> Int# -> e -> State# s -> State# s
writeByteArray# MutableByteArray# s
mbytes# Int#
o# e
e1 State# s
s1# of
        State# s
s2# -> case MutableByteArray# s -> Int# -> e -> State# s -> State# s
forall e s.
Unboxed e =>
MutableByteArray# s -> Int# -> e -> State# s -> State# s
writeByteArray# MutableByteArray# s
mbytes# (Int#
o# Int# -> Int# -> Int#
+# Int#
1#) e
e2 State# s
s2# of
          State# s
s3# -> case MutableByteArray# s -> Int# -> e -> State# s -> State# s
forall e s.
Unboxed e =>
MutableByteArray# s -> Int# -> e -> State# s -> State# s
writeByteArray# MutableByteArray# s
mbytes# (Int#
o# Int# -> Int# -> Int#
+# Int#
2#) e
e3 State# s
s3# of
            State# s
s4# -> case MutableByteArray# s -> Int# -> e -> State# s -> State# s
forall e s.
Unboxed e =>
MutableByteArray# s -> Int# -> e -> State# s -> State# s
writeByteArray# MutableByteArray# s
mbytes# (Int#
o# Int# -> Int# -> Int#
+# Int#
3#) e
e4 State# s
s4# of
              State# s
s5# -> case MutableByteArray# s -> Int# -> e -> State# s -> State# s
forall e s.
Unboxed e =>
MutableByteArray# s -> Int# -> e -> State# s -> State# s
writeByteArray# MutableByteArray# s
mbytes# (Int#
o# Int# -> Int# -> Int#
+# Int#
4#) e
e5 State# s
s5# of
                State# s
s6# -> case MutableByteArray# s -> Int# -> e -> State# s -> State# s
forall e s.
Unboxed e =>
MutableByteArray# s -> Int# -> e -> State# s -> State# s
writeByteArray# MutableByteArray# s
mbytes# (Int#
o# Int# -> Int# -> Int#
+# Int#
5#) e
e6 State# s
s6# of
                  State# s
s7# -> case MutableByteArray# s -> Int# -> e -> State# s -> State# s
forall e s.
Unboxed e =>
MutableByteArray# s -> Int# -> e -> State# s -> State# s
writeByteArray# MutableByteArray# s
mbytes# (Int#
o# Int# -> Int# -> Int#
+# Int#
6#) e
e7 State# s
s7# of
                    State# s
s8# -> case MutableByteArray# s -> Int# -> e -> State# s -> State# s
forall e s.
Unboxed e =>
MutableByteArray# s -> Int# -> e -> State# s -> State# s
writeByteArray# MutableByteArray# s
mbytes# (Int#
o# Int# -> Int# -> Int#
+# Int#
7#) e
e8 State# s
s8# of
                      State# s
s9# -> case MutableByteArray# s -> Int# -> e -> State# s -> State# s
forall e s.
Unboxed e =>
MutableByteArray# s -> Int# -> e -> State# s -> State# s
writeByteArray# MutableByteArray# s
mbytes# (Int#
o# Int# -> Int# -> Int#
+# Int#
8#) e
e9 State# s
s9# of
                        State# s
s10# -> case MutableByteArray# s -> Int# -> e -> State# s -> State# s
forall e s.
Unboxed e =>
MutableByteArray# s -> Int# -> e -> State# s -> State# s
writeByteArray# MutableByteArray# s
mbytes# (Int#
o# Int# -> Int# -> Int#
+# Int#
9#) e
e10 State# s
s10# of
                          State# s
s11# -> case MutableByteArray# s -> Int# -> e -> State# s -> State# s
forall e s.
Unboxed e =>
MutableByteArray# s -> Int# -> e -> State# s -> State# s
writeByteArray# MutableByteArray# s
mbytes# (Int#
o# Int# -> Int# -> Int#
+# Int#
10#) e
e11 State# s
s11# of
                            State# s
s12# -> case MutableByteArray# s -> Int# -> e -> State# s -> State# s
forall e s.
Unboxed e =>
MutableByteArray# s -> Int# -> e -> State# s -> State# s
writeByteArray# MutableByteArray# s
mbytes# (Int#
o# Int# -> Int# -> Int#
+# Int#
11#) e
e12 State# s
s12# of
                              State# s
s13# -> case MutableByteArray# s -> Int# -> e -> State# s -> State# s
forall e s.
Unboxed e =>
MutableByteArray# s -> Int# -> e -> State# s -> State# s
writeByteArray# MutableByteArray# s
mbytes# (Int#
o# Int# -> Int# -> Int#
+# Int#
12#) e
e13 State# s
s13# of
                                State# s
s14# -> case MutableByteArray# s -> Int# -> e -> State# s -> State# s
forall e s.
Unboxed e =>
MutableByteArray# s -> Int# -> e -> State# s -> State# s
writeByteArray# MutableByteArray# s
mbytes# (Int#
o# Int# -> Int# -> Int#
+# Int#
13#) e
e14 State# s
s14# of
                                  State# s
s15# -> MutableByteArray# s -> Int# -> e -> State# s -> State# s
forall e s.
Unboxed e =>
MutableByteArray# s -> Int# -> e -> State# s -> State# s
writeByteArray# MutableByteArray# s
mbytes# (Int#
o# Int# -> Int# -> Int#
+# Int#
14#) e
e15 State# s
s15#
    
    newUnboxed :: T15 e -> Int# -> State# s -> (# State# s, MutableByteArray# s #)
newUnboxed T15 e
e Int#
n# = T15 e -> Int# -> State# s -> (# State# s, MutableByteArray# s #)
forall e (proxy :: * -> *) s.
Unboxed e =>
proxy e -> Int# -> State# s -> (# State# s, MutableByteArray# s #)
pnewUnboxed T15 e
e (Int#
15# Int# -> Int# -> Int#
*# Int#
n#)

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

-- | 'ByteArray#' wrapper.
data Wrap = Wrap {Wrap -> ByteArray#
unwrap :: ByteArray#}

{- |
  @since 0.2.1
  Wrapped empty 'ByteArray#'.
-}
lzero# :: Wrap
lzero# :: Wrap
lzero# =  (forall s. ST s Wrap) -> Wrap
forall a. (forall s. ST s a) -> a
runST ((forall s. ST s Wrap) -> Wrap) -> (forall s. ST s Wrap) -> Wrap
forall a b. (a -> b) -> a -> b
$ STRep s Wrap -> ST s Wrap
forall s a. STRep s a -> ST s a
ST (STRep s Wrap -> ST s Wrap) -> STRep s Wrap -> ST s Wrap
forall a b. (a -> b) -> a -> b
$ \ State# s
s1# -> case Int# -> State# s -> (# State# s, MutableByteArray# s #)
forall d. Int# -> State# d -> (# State# d, MutableByteArray# d #)
newByteArray# Int#
0# State# s
s1# of
  (# State# s
s2#, MutableByteArray# s
marr# #) -> case MutableByteArray# s -> State# s -> (# State# s, ByteArray# #)
forall d.
MutableByteArray# d -> State# d -> (# State# d, ByteArray# #)
unsafeFreezeByteArray# MutableByteArray# s
marr# State# s
s2# of
    (# State# s
s3#, ByteArray#
arr# #) -> (# State# s
s3#, ByteArray# -> Wrap
Wrap ByteArray#
arr# #)

{- |
  @since 0.2.1
  'ByteArray#' singleton.
-}
single# :: (Unboxed e) => e -> ByteArray#
single# :: e -> ByteArray#
single# e
e = Wrap -> ByteArray#
unwrap (Wrap -> ByteArray#) -> Wrap -> ByteArray#
forall a b. (a -> b) -> a -> b
$ (forall s. ST s Wrap) -> Wrap
forall a. (forall s. ST s a) -> a
runST ((forall s. ST s Wrap) -> Wrap) -> (forall s. ST s Wrap) -> Wrap
forall a b. (a -> b) -> a -> b
$ STRep s Wrap -> ST s Wrap
forall s a. STRep s a -> ST s a
ST (STRep s Wrap -> ST s Wrap) -> STRep s Wrap -> ST s Wrap
forall a b. (a -> b) -> a -> b
$ \ State# s
s1# -> case e -> Int# -> State# s -> (# State# s, MutableByteArray# s #)
forall e s.
Unboxed e =>
e -> Int# -> State# s -> (# State# s, MutableByteArray# s #)
newUnboxed' e
e Int#
1# State# s
s1# of
  (# State# s
s2#, MutableByteArray# s
marr# #) -> case MutableByteArray# s -> State# s -> (# State# s, ByteArray# #)
forall d.
MutableByteArray# d -> State# d -> (# State# d, ByteArray# #)
unsafeFreezeByteArray# MutableByteArray# s
marr# State# s
s2# of
    (# State# s
s3#, ByteArray#
arr# #) -> (# State# s
s3#, ByteArray# -> Wrap
Wrap ByteArray#
arr# #)

{- |
  @since 0.2.1
  Create immutable 'Unboxed' array from given list.
-}
fromList# :: (Unboxed e) => [e] -> ByteArray#
fromList# :: [e] -> ByteArray#
fromList# [e]
es = let !(I# Int#
n#) = [e] -> Int
forall (t :: * -> *) a. Foldable t => t a -> Int
length [e]
es in Int# -> [e] -> ByteArray#
forall e. Unboxed e => Int# -> [e] -> ByteArray#
fromListN# Int#
n# [e]
es

{- |
  @since 0.2.1
  Create immutable 'Unboxed' array from 'Foldable' stream.
-}
fromFoldable# :: (Foldable f, Unboxed e) => f e -> (# Int, ByteArray# #)
fromFoldable# :: f e -> (# Int, ByteArray# #)
fromFoldable# f e
es = (Int, Wrap) -> (# Int, ByteArray# #)
forall a. (a, Wrap) -> (# a, ByteArray# #)
unpack' ((Int, Wrap) -> (# Int, ByteArray# #))
-> (Int, Wrap) -> (# Int, ByteArray# #)
forall a b. (a -> b) -> a -> b
$ (forall s. ST s (Int, Wrap)) -> (Int, Wrap)
forall a. (forall s. ST s a) -> a
runST ((forall s. ST s (Int, Wrap)) -> (Int, Wrap))
-> (forall s. ST s (Int, Wrap)) -> (Int, Wrap)
forall a b. (a -> b) -> a -> b
$ STRep s (Int, Wrap) -> ST s (Int, Wrap)
forall s a. STRep s a -> ST s a
ST (STRep s (Int, Wrap) -> ST s (Int, Wrap))
-> STRep s (Int, Wrap) -> ST s (Int, Wrap)
forall a b. (a -> b) -> a -> b
$ \ State# s
s1# -> case f e -> State# s -> (# State# s, Int, MutableByteArray# s #)
forall (f :: * -> *) e s.
(Foldable f, Unboxed e) =>
f e -> State# s -> (# State# s, Int, MutableByteArray# s #)
fromFoldableM# f e
es State# s
s1# of
    (# State# s
s2#, Int
n, MutableByteArray# s
marr# #) -> case MutableByteArray# s -> State# s -> (# State# s, ByteArray# #)
forall d.
MutableByteArray# d -> State# d -> (# State# d, ByteArray# #)
unsafeFreezeByteArray# MutableByteArray# s
marr# State# s
s2# of
      (# State# s
s3#, ByteArray#
arr# #) -> (# State# s
s3#, (Int
n, ByteArray# -> Wrap
Wrap ByteArray#
arr#) #)
  where
    unpack' :: (a, Wrap) -> (# a, ByteArray# #)
unpack' (a
i, Wrap ByteArray#
arr#) = (# a
i, ByteArray#
arr# #)

{- |
  @since 0.2.1
  Create immutable 'Unboxed' array from known size list.
-}
fromListN# :: (Unboxed e) => Int# -> [e] -> ByteArray#
fromListN# :: Int# -> [e] -> ByteArray#
fromListN# Int#
n# [e]
es = Wrap -> ByteArray#
unwrap (Wrap -> ByteArray#) -> Wrap -> ByteArray#
forall a b. (a -> b) -> a -> b
$ (forall s. ST s Wrap) -> Wrap
forall a. (forall s. ST s a) -> a
runST ((forall s. ST s Wrap) -> Wrap) -> (forall s. ST s Wrap) -> Wrap
forall a b. (a -> b) -> a -> b
$ STRep s Wrap -> ST s Wrap
forall s a. STRep s a -> ST s a
ST (STRep s Wrap -> ST s Wrap) -> STRep s Wrap -> ST s Wrap
forall a b. (a -> b) -> a -> b
$ \ State# s
s1# -> case Int# -> [e] -> State# s -> (# State# s, MutableByteArray# s #)
forall e s.
Unboxed e =>
Int# -> [e] -> State# s -> (# State# s, MutableByteArray# s #)
newLinearN# Int#
n# [e]
es State# s
s1# of
  (# State# s
s2#, MutableByteArray# s
marr# #) -> case MutableByteArray# s -> State# s -> (# State# s, ByteArray# #)
forall d.
MutableByteArray# d -> State# d -> (# State# d, ByteArray# #)
unsafeFreezeByteArray# MutableByteArray# s
marr# State# s
s2# of
    (# State# s
s3#, ByteArray#
arr# #) -> (# State# s
s3#, ByteArray# -> Wrap
Wrap ByteArray#
arr# #)

{- |
  @since 0.2.1
  Create mutable 'Unboxed' array from given list.
-}
newLinear# :: (Unboxed e) => [e] -> State# s ->
  (# State# s, MutableByteArray# s #)
newLinear# :: [e] -> State# s -> (# State# s, MutableByteArray# s #)
newLinear# [e]
es = let !(I# Int#
n#) = [e] -> Int
forall (t :: * -> *) a. Foldable t => t a -> Int
length [e]
es in Int# -> [e] -> State# s -> (# State# s, MutableByteArray# s #)
forall e s.
Unboxed e =>
Int# -> [e] -> State# s -> (# State# s, MutableByteArray# s #)
newLinearN# Int#
n# [e]
es

{- |
  @since 0.2.1
  Create mutable 'Unboxed' array from known size list.
-}
newLinearN# :: (Unboxed e) => Int# -> [e] -> State# s ->
  (# State# s, MutableByteArray# s #)
newLinearN# :: Int# -> [e] -> State# s -> (# State# s, MutableByteArray# s #)
newLinearN# Int#
c# [e]
es = \ State# s
s1# -> case [e] -> Int# -> State# s -> (# State# s, MutableByteArray# s #)
forall e (proxy :: * -> *) s.
Unboxed e =>
proxy e -> Int# -> State# s -> (# State# s, MutableByteArray# s #)
pnewUnboxed [e]
es Int#
n# State# s
s1# of
    (# State# s
s2#, MutableByteArray# s
marr# #) ->
      let
        go :: e -> (Int# -> State# s -> State# s) -> Int# -> State# s -> State# s
go e
y Int# -> State# s -> State# s
r = \ Int#
i# State# s
s4# -> case MutableByteArray# s -> Int# -> e -> State# s -> State# s
forall e s.
Unboxed e =>
MutableByteArray# s -> Int# -> e -> State# s -> State# s
writeByteArray# MutableByteArray# s
marr# Int#
i# e
y State# s
s4# of
          State# s
s5# -> if Int# -> Bool
isTrue# (Int#
i# Int# -> Int# -> Int#
==# Int#
n# Int# -> Int# -> Int#
-# Int#
1#) then State# s
s5# else Int# -> State# s -> State# s
r (Int#
i# Int# -> Int# -> Int#
+# Int#
1#) State# s
s5#
      in case if Int
n Int -> Int -> Bool
forall a. Eq a => a -> a -> Bool
== Int
0 then State# s
s2# else (e
 -> (Int# -> State# s -> State# s) -> Int# -> State# s -> State# s)
-> (Int# -> State# s -> State# s)
-> [e]
-> Int#
-> State# s
-> State# s
forall (t :: * -> *) a b.
Foldable t =>
(a -> b -> b) -> b -> t a -> b
foldr e -> (Int# -> State# s -> State# s) -> Int# -> State# s -> State# s
forall e.
Unboxed e =>
e -> (Int# -> State# s -> State# s) -> Int# -> State# s -> State# s
go (\ Int#
_ State# s
s# -> State# s
s#) [e]
es Int#
0# State# s
s2# of
          State# s
s3# -> (# State# s
s3#, MutableByteArray# s
marr# #)
  where
    !n :: Int
n@(I# Int#
n#) = Int -> Int -> Int
forall a. Ord a => a -> a -> a
max Int
0 (Int# -> Int
I# Int#
c#)

{- |
  @since 0.2.1
  Create mutable 'Unboxed' array from 'Foldable' stream.
-}
fromFoldableM# :: (Foldable f, Unboxed e) => f e -> State# s ->
  (# State# s, Int, MutableByteArray# s #)
fromFoldableM# :: f e -> State# s -> (# State# s, Int, MutableByteArray# s #)
fromFoldableM# f e
es = \ State# s
s1# -> case f e -> Int# -> State# s -> (# State# s, MutableByteArray# s #)
forall e (proxy :: * -> *) s.
Unboxed e =>
proxy e -> Int# -> State# s -> (# State# s, MutableByteArray# s #)
pnewUnboxed f e
es Int#
n# State# s
s1# of
    (# State# s
s2#, MutableByteArray# s
marr# #) ->
      let
        go :: e -> (Int# -> State# s -> State# s) -> Int# -> State# s -> State# s
go e
y Int# -> State# s -> State# s
r = \ Int#
i# State# s
s4# -> case MutableByteArray# s -> Int# -> e -> State# s -> State# s
forall e s.
Unboxed e =>
MutableByteArray# s -> Int# -> e -> State# s -> State# s
writeByteArray# MutableByteArray# s
marr# Int#
i# e
y State# s
s4# of
          State# s
s5# -> if Int# -> Bool
isTrue# (Int#
i# Int# -> Int# -> Int#
==# Int#
n# Int# -> Int# -> Int#
-# Int#
1#) then State# s
s5# else Int# -> State# s -> State# s
r (Int#
i# Int# -> Int# -> Int#
+# Int#
1#) State# s
s5#
      in case if Int
n Int -> Int -> Bool
forall a. Eq a => a -> a -> Bool
== Int
0 then State# s
s2# else (e
 -> (Int# -> State# s -> State# s) -> Int# -> State# s -> State# s)
-> (Int# -> State# s -> State# s)
-> f e
-> Int#
-> State# s
-> State# s
forall (t :: * -> *) a b.
Foldable t =>
(a -> b -> b) -> b -> t a -> b
foldr e -> (Int# -> State# s -> State# s) -> Int# -> State# s -> State# s
forall e.
Unboxed e =>
e -> (Int# -> State# s -> State# s) -> Int# -> State# s -> State# s
go (\ Int#
_ State# s
s# -> State# s
s#) f e
es Int#
0# State# s
s2# of
          State# s
s3# -> (# State# s
s3#, Int
n, MutableByteArray# s
marr# #)
  where
    !n :: Int
n@(I# Int#
n#) = f e -> Int
forall (t :: * -> *) a. Foldable t => t a -> Int
length f e
es

{- |
  @since 0.2.1
  Concatenation of two 'Unboxed' arrays.
-}
concat# :: (Unboxed e) => e ->
  ByteArray# -> Int# -> Int# ->
  ByteArray# -> Int# -> Int# -> State# s ->
  (# State# s, Int#, MutableByteArray# s #)
concat# :: e
-> ByteArray#
-> Int#
-> Int#
-> ByteArray#
-> Int#
-> Int#
-> State# s
-> (# State# s, Int#, MutableByteArray# s #)
concat# e
e ByteArray#
arr1# Int#
n1# Int#
o1# ByteArray#
arr2# Int#
n2# Int#
o2# = \ State# s
s1# -> case e -> Int# -> State# s -> (# State# s, MutableByteArray# s #)
forall e s.
Unboxed e =>
e -> Int# -> State# s -> (# State# s, MutableByteArray# s #)
newUnboxed e
e Int#
n# State# s
s1# of
    (# State# s
s2#, MutableByteArray# s
marr# #) -> case e
-> ByteArray#
-> Int#
-> MutableByteArray# s
-> Int#
-> Int#
-> State# s
-> State# s
forall e s.
Unboxed e =>
e
-> ByteArray#
-> Int#
-> MutableByteArray# s
-> Int#
-> Int#
-> State# s
-> State# s
copyUnboxed# e
e ByteArray#
arr1# Int#
o1# MutableByteArray# s
marr# Int#
0# Int#
n1# State# s
s2# of
      State# s
s3# -> case e
-> ByteArray#
-> Int#
-> MutableByteArray# s
-> Int#
-> Int#
-> State# s
-> State# s
forall e s.
Unboxed e =>
e
-> ByteArray#
-> Int#
-> MutableByteArray# s
-> Int#
-> Int#
-> State# s
-> State# s
copyUnboxed# e
e ByteArray#
arr2# Int#
o2# MutableByteArray# s
marr# Int#
n1# Int#
n2# State# s
s3# of
        State# s
s4# -> (# State# s
s4#, Int#
n#, MutableByteArray# s
marr# #)
  where
    n# :: Int#
n# = Int#
n1# Int# -> Int# -> Int#
+# Int#
n2#

-- | Proxy concatenation of two byte arrays representing 'Unboxed' structures.
pconcat :: (Unboxed e) => proxy e ->
  ByteArray# -> Int# -> Int# -> ByteArray# -> Int# -> Int# ->
  State# s -> (# State# s, Int#, MutableByteArray# s #)
pconcat :: proxy e
-> ByteArray#
-> Int#
-> Int#
-> ByteArray#
-> Int#
-> Int#
-> State# s
-> (# State# s, Int#, MutableByteArray# s #)
pconcat = e
-> ByteArray#
-> Int#
-> Int#
-> ByteArray#
-> Int#
-> Int#
-> State# s
-> (# State# s, Int#, MutableByteArray# s #)
forall e s.
Unboxed e =>
e
-> ByteArray#
-> Int#
-> Int#
-> ByteArray#
-> Int#
-> Int#
-> State# s
-> (# State# s, Int#, MutableByteArray# s #)
concat# (e
 -> ByteArray#
 -> Int#
 -> Int#
 -> ByteArray#
 -> Int#
 -> Int#
 -> State# s
 -> (# State# s, Int#, MutableByteArray# s #))
-> (proxy e -> e)
-> proxy e
-> ByteArray#
-> Int#
-> Int#
-> ByteArray#
-> Int#
-> Int#
-> State# s
-> (# State# s, Int#, MutableByteArray# s #)
forall k (cat :: k -> k -> *) (b :: k) (c :: k) (a :: k).
Category cat =>
cat b c -> cat a b -> cat a c
. proxy e -> e
forall (proxy :: * -> *) e. proxy e -> e
fromProxy

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

rank# :: (Shape i) => i -> Int#
rank# :: i -> Int#
rank# i
i = case i -> Int
forall i. Shape i => i -> Int
rank i
i of I# Int#
r# -> Int#
r#

{-# INLINE bool_scale #-}
bool_scale :: Int# -> Int#
bool_scale :: Int# -> Int#
bool_scale Int#
n# = (Int#
n# Int# -> Int# -> Int#
+# Int#
7#) Int# -> Int# -> Int#
`uncheckedIShiftRA#` Int#
3#

{-# INLINE bool_bit #-}
bool_bit :: Int# -> Word#
bool_bit :: Int# -> Word#
bool_bit Int#
n# = case (SIZEOF_HSWORD * 8 - 1) of
  W# Word#
mask# -> Int# -> Word#
int2Word# Int#
1# Word# -> Int# -> Word#
`uncheckedShiftL#` Word# -> Int#
word2Int# (Int# -> Word#
int2Word# Int#
n# Word# -> Word# -> Word#
`and#` Word#
mask#)

{-# INLINE bool_not_bit #-}
bool_not_bit :: Int# -> Word#
bool_not_bit :: Int# -> Word#
bool_not_bit Int#
n# = case Word
forall a. Bounded a => a
maxBound of W# Word#
mb# -> Int# -> Word#
bool_bit Int#
n# Word# -> Word# -> Word#
`xor#` Word#
mb#

{-# INLINE bool_index #-}
bool_index :: Int# -> Int#
#if   SIZEOF_HSWORD == 4
bool_index =  (`uncheckedIShiftRA#` 5#)
#elif SIZEOF_HSWORD == 8
bool_index :: Int# -> Int#
bool_index =  (Int# -> Int# -> Int#
`uncheckedIShiftRA#` Int#
6#)
#endif

consSizeof :: (a -> b) -> b -> a
consSizeof :: (a -> b) -> b -> a
consSizeof =  \ a -> b
_ b
_ -> a
forall a. HasCallStack => a
undefined