{-# LANGUAGE DataKinds                  #-}
{-# LANGUAGE DeriveDataTypeable         #-}
{-# LANGUAGE GeneralizedNewtypeDeriving #-}
{-# LANGUAGE KindSignatures             #-}
{-# OPTIONS_HADDOCK not-home            #-}

module Data.Vector.Generic.Mutable.Sized.Internal
  ( MVector(..)
  )
where

import           GHC.TypeLits
import           Control.DeepSeq                ( NFData )
import           Data.Data
import           Foreign.Storable

-- | A wrapper to tag mutable vectors with a type level length.
--
-- Be careful when using the constructor here to not construct sized vectors
-- which have a different length than that specified in the type parameter!
newtype MVector v (n :: Nat) s a = MVector (v s a)
  deriving ( Typeable, Typeable (MVector v n s a)
Typeable (MVector v n s a) =>
(forall (c :: * -> *).
 (forall d b. Data d => c (d -> b) -> d -> c b)
 -> (forall g. g -> c g) -> MVector v n s a -> c (MVector v n s a))
-> (forall (c :: * -> *).
    (forall b r. Data b => c (b -> r) -> c r)
    -> (forall r. r -> c r) -> Constr -> c (MVector v n s a))
-> (MVector v n s a -> Constr)
-> (MVector v n s a -> DataType)
-> (forall (t :: * -> *) (c :: * -> *).
    Typeable t =>
    (forall d. Data d => c (t d)) -> Maybe (c (MVector v n s a)))
-> (forall (t :: * -> * -> *) (c :: * -> *).
    Typeable t =>
    (forall d e. (Data d, Data e) => c (t d e))
    -> Maybe (c (MVector v n s a)))
-> ((forall b. Data b => b -> b)
    -> MVector v n s a -> MVector v n s a)
-> (forall r r'.
    (r -> r' -> r)
    -> r -> (forall d. Data d => d -> r') -> MVector v n s a -> r)
-> (forall r r'.
    (r' -> r -> r)
    -> r -> (forall d. Data d => d -> r') -> MVector v n s a -> r)
-> (forall u.
    (forall d. Data d => d -> u) -> MVector v n s a -> [u])
-> (forall u.
    Int -> (forall d. Data d => d -> u) -> MVector v n s a -> u)
-> (forall (m :: * -> *).
    Monad m =>
    (forall d. Data d => d -> m d)
    -> MVector v n s a -> m (MVector v n s a))
-> (forall (m :: * -> *).
    MonadPlus m =>
    (forall d. Data d => d -> m d)
    -> MVector v n s a -> m (MVector v n s a))
-> (forall (m :: * -> *).
    MonadPlus m =>
    (forall d. Data d => d -> m d)
    -> MVector v n s a -> m (MVector v n s a))
-> Data (MVector v n s a)
MVector v n s a -> Constr
MVector v n s a -> DataType
(forall b. Data b => b -> b) -> MVector v n s a -> MVector v n s a
forall a.
Typeable a =>
(forall (c :: * -> *).
 (forall d b. Data d => c (d -> b) -> d -> c b)
 -> (forall g. g -> c g) -> a -> c a)
-> (forall (c :: * -> *).
    (forall b r. Data b => c (b -> r) -> c r)
    -> (forall r. r -> c r) -> Constr -> c a)
-> (a -> Constr)
-> (a -> DataType)
-> (forall (t :: * -> *) (c :: * -> *).
    Typeable t =>
    (forall d. Data d => c (t d)) -> Maybe (c a))
-> (forall (t :: * -> * -> *) (c :: * -> *).
    Typeable t =>
    (forall d e. (Data d, Data e) => c (t d e)) -> Maybe (c a))
-> ((forall b. Data b => b -> b) -> a -> a)
-> (forall r r'.
    (r -> r' -> r) -> r -> (forall d. Data d => d -> r') -> a -> r)
-> (forall r r'.
    (r' -> r -> r) -> r -> (forall d. Data d => d -> r') -> a -> r)
-> (forall u. (forall d. Data d => d -> u) -> a -> [u])
-> (forall u. Int -> (forall d. Data d => d -> u) -> a -> u)
-> (forall (m :: * -> *).
    Monad m =>
    (forall d. Data d => d -> m d) -> a -> m a)
-> (forall (m :: * -> *).
    MonadPlus m =>
    (forall d. Data d => d -> m d) -> a -> m a)
-> (forall (m :: * -> *).
    MonadPlus m =>
    (forall d. Data d => d -> m d) -> a -> m a)
-> Data a
forall u.
Int -> (forall d. Data d => d -> u) -> MVector v n s a -> u
forall u. (forall d. Data d => d -> u) -> MVector v n s a -> [u]
forall r r'.
(r -> r' -> r)
-> r -> (forall d. Data d => d -> r') -> MVector v n s a -> r
forall r r'.
(r' -> r -> r)
-> r -> (forall d. Data d => d -> r') -> MVector v n s a -> r
forall (m :: * -> *).
Monad m =>
(forall d. Data d => d -> m d)
-> MVector v n s a -> m (MVector v n s a)
forall (m :: * -> *).
MonadPlus m =>
(forall d. Data d => d -> m d)
-> MVector v n s a -> m (MVector v n s a)
forall (c :: * -> *).
(forall b r. Data b => c (b -> r) -> c r)
-> (forall r. r -> c r) -> Constr -> c (MVector v n s a)
forall (c :: * -> *).
(forall d b. Data d => c (d -> b) -> d -> c b)
-> (forall g. g -> c g) -> MVector v n s a -> c (MVector v n s a)
forall (t :: * -> *) (c :: * -> *).
Typeable t =>
(forall d. Data d => c (t d)) -> Maybe (c (MVector v n s a))
forall (v :: * -> * -> *) (n :: Nat) s a.
(KnownNat n, Typeable v, Typeable s, Typeable a, Data (v s a)) =>
Typeable (MVector v n s a)
forall (v :: * -> * -> *) (n :: Nat) s a.
(KnownNat n, Typeable v, Typeable s, Typeable a, Data (v s a)) =>
MVector v n s a -> Constr
forall (v :: * -> * -> *) (n :: Nat) s a.
(KnownNat n, Typeable v, Typeable s, Typeable a, Data (v s a)) =>
MVector v n s a -> DataType
forall (v :: * -> * -> *) (n :: Nat) s a.
(KnownNat n, Typeable v, Typeable s, Typeable a, Data (v s a)) =>
(forall b. Data b => b -> b) -> MVector v n s a -> MVector v n s a
forall (v :: * -> * -> *) (n :: Nat) s a u.
(KnownNat n, Typeable v, Typeable s, Typeable a, Data (v s a)) =>
Int -> (forall d. Data d => d -> u) -> MVector v n s a -> u
forall (v :: * -> * -> *) (n :: Nat) s a u.
(KnownNat n, Typeable v, Typeable s, Typeable a, Data (v s a)) =>
(forall d. Data d => d -> u) -> MVector v n s a -> [u]
forall (v :: * -> * -> *) (n :: Nat) s a r r'.
(KnownNat n, Typeable v, Typeable s, Typeable a, Data (v s a)) =>
(r -> r' -> r)
-> r -> (forall d. Data d => d -> r') -> MVector v n s a -> r
forall (v :: * -> * -> *) (n :: Nat) s a r r'.
(KnownNat n, Typeable v, Typeable s, Typeable a, Data (v s a)) =>
(r' -> r -> r)
-> r -> (forall d. Data d => d -> r') -> MVector v n s a -> r
forall (v :: * -> * -> *) (n :: Nat) s a (m :: * -> *).
(KnownNat n, Typeable v, Typeable s, Typeable a, Data (v s a),
 Monad m) =>
(forall d. Data d => d -> m d)
-> MVector v n s a -> m (MVector v n s a)
forall (v :: * -> * -> *) (n :: Nat) s a (m :: * -> *).
(KnownNat n, Typeable v, Typeable s, Typeable a, Data (v s a),
 MonadPlus m) =>
(forall d. Data d => d -> m d)
-> MVector v n s a -> m (MVector v n s a)
forall (v :: * -> * -> *) (n :: Nat) s a (c :: * -> *).
(KnownNat n, Typeable v, Typeable s, Typeable a, Data (v s a)) =>
(forall b r. Data b => c (b -> r) -> c r)
-> (forall r. r -> c r) -> Constr -> c (MVector v n s a)
forall (v :: * -> * -> *) (n :: Nat) s a (c :: * -> *).
(KnownNat n, Typeable v, Typeable s, Typeable a, Data (v s a)) =>
(forall d b. Data d => c (d -> b) -> d -> c b)
-> (forall g. g -> c g) -> MVector v n s a -> c (MVector v n s a)
forall (v :: * -> * -> *) (n :: Nat) s a (t :: * -> *)
       (c :: * -> *).
(KnownNat n, Typeable v, Typeable s, Typeable a, Data (v s a),
 Typeable t) =>
(forall d. Data d => c (t d)) -> Maybe (c (MVector v n s a))
forall (v :: * -> * -> *) (n :: Nat) s a (t :: * -> * -> *)
       (c :: * -> *).
(KnownNat n, Typeable v, Typeable s, Typeable a, Data (v s a),
 Typeable t) =>
(forall d e. (Data d, Data e) => c (t d e))
-> Maybe (c (MVector v n s a))
forall (t :: * -> * -> *) (c :: * -> *).
Typeable t =>
(forall d e. (Data d, Data e) => c (t d e))
-> Maybe (c (MVector v n s a))
$cgfoldl :: forall (v :: * -> * -> *) (n :: Nat) s a (c :: * -> *).
(KnownNat n, Typeable v, Typeable s, Typeable a, Data (v s a)) =>
(forall d b. Data d => c (d -> b) -> d -> c b)
-> (forall g. g -> c g) -> MVector v n s a -> c (MVector v n s a)
gfoldl :: forall (c :: * -> *).
(forall d b. Data d => c (d -> b) -> d -> c b)
-> (forall g. g -> c g) -> MVector v n s a -> c (MVector v n s a)
$cgunfold :: forall (v :: * -> * -> *) (n :: Nat) s a (c :: * -> *).
(KnownNat n, Typeable v, Typeable s, Typeable a, Data (v s a)) =>
(forall b r. Data b => c (b -> r) -> c r)
-> (forall r. r -> c r) -> Constr -> c (MVector v n s a)
gunfold :: forall (c :: * -> *).
(forall b r. Data b => c (b -> r) -> c r)
-> (forall r. r -> c r) -> Constr -> c (MVector v n s a)
$ctoConstr :: forall (v :: * -> * -> *) (n :: Nat) s a.
(KnownNat n, Typeable v, Typeable s, Typeable a, Data (v s a)) =>
MVector v n s a -> Constr
toConstr :: MVector v n s a -> Constr
$cdataTypeOf :: forall (v :: * -> * -> *) (n :: Nat) s a.
(KnownNat n, Typeable v, Typeable s, Typeable a, Data (v s a)) =>
MVector v n s a -> DataType
dataTypeOf :: MVector v n s a -> DataType
$cdataCast1 :: forall (v :: * -> * -> *) (n :: Nat) s a (t :: * -> *)
       (c :: * -> *).
(KnownNat n, Typeable v, Typeable s, Typeable a, Data (v s a),
 Typeable t) =>
(forall d. Data d => c (t d)) -> Maybe (c (MVector v n s a))
dataCast1 :: forall (t :: * -> *) (c :: * -> *).
Typeable t =>
(forall d. Data d => c (t d)) -> Maybe (c (MVector v n s a))
$cdataCast2 :: forall (v :: * -> * -> *) (n :: Nat) s a (t :: * -> * -> *)
       (c :: * -> *).
(KnownNat n, Typeable v, Typeable s, Typeable a, Data (v s a),
 Typeable t) =>
(forall d e. (Data d, Data e) => c (t d e))
-> Maybe (c (MVector v n s a))
dataCast2 :: forall (t :: * -> * -> *) (c :: * -> *).
Typeable t =>
(forall d e. (Data d, Data e) => c (t d e))
-> Maybe (c (MVector v n s a))
$cgmapT :: forall (v :: * -> * -> *) (n :: Nat) s a.
(KnownNat n, Typeable v, Typeable s, Typeable a, Data (v s a)) =>
(forall b. Data b => b -> b) -> MVector v n s a -> MVector v n s a
gmapT :: (forall b. Data b => b -> b) -> MVector v n s a -> MVector v n s a
$cgmapQl :: forall (v :: * -> * -> *) (n :: Nat) s a r r'.
(KnownNat n, Typeable v, Typeable s, Typeable a, Data (v s a)) =>
(r -> r' -> r)
-> r -> (forall d. Data d => d -> r') -> MVector v n s a -> r
gmapQl :: forall r r'.
(r -> r' -> r)
-> r -> (forall d. Data d => d -> r') -> MVector v n s a -> r
$cgmapQr :: forall (v :: * -> * -> *) (n :: Nat) s a r r'.
(KnownNat n, Typeable v, Typeable s, Typeable a, Data (v s a)) =>
(r' -> r -> r)
-> r -> (forall d. Data d => d -> r') -> MVector v n s a -> r
gmapQr :: forall r r'.
(r' -> r -> r)
-> r -> (forall d. Data d => d -> r') -> MVector v n s a -> r
$cgmapQ :: forall (v :: * -> * -> *) (n :: Nat) s a u.
(KnownNat n, Typeable v, Typeable s, Typeable a, Data (v s a)) =>
(forall d. Data d => d -> u) -> MVector v n s a -> [u]
gmapQ :: forall u. (forall d. Data d => d -> u) -> MVector v n s a -> [u]
$cgmapQi :: forall (v :: * -> * -> *) (n :: Nat) s a u.
(KnownNat n, Typeable v, Typeable s, Typeable a, Data (v s a)) =>
Int -> (forall d. Data d => d -> u) -> MVector v n s a -> u
gmapQi :: forall u.
Int -> (forall d. Data d => d -> u) -> MVector v n s a -> u
$cgmapM :: forall (v :: * -> * -> *) (n :: Nat) s a (m :: * -> *).
(KnownNat n, Typeable v, Typeable s, Typeable a, Data (v s a),
 Monad m) =>
(forall d. Data d => d -> m d)
-> MVector v n s a -> m (MVector v n s a)
gmapM :: forall (m :: * -> *).
Monad m =>
(forall d. Data d => d -> m d)
-> MVector v n s a -> m (MVector v n s a)
$cgmapMp :: forall (v :: * -> * -> *) (n :: Nat) s a (m :: * -> *).
(KnownNat n, Typeable v, Typeable s, Typeable a, Data (v s a),
 MonadPlus m) =>
(forall d. Data d => d -> m d)
-> MVector v n s a -> m (MVector v n s a)
gmapMp :: forall (m :: * -> *).
MonadPlus m =>
(forall d. Data d => d -> m d)
-> MVector v n s a -> m (MVector v n s a)
$cgmapMo :: forall (v :: * -> * -> *) (n :: Nat) s a (m :: * -> *).
(KnownNat n, Typeable v, Typeable s, Typeable a, Data (v s a),
 MonadPlus m) =>
(forall d. Data d => d -> m d)
-> MVector v n s a -> m (MVector v n s a)
gmapMo :: forall (m :: * -> *).
MonadPlus m =>
(forall d. Data d => d -> m d)
-> MVector v n s a -> m (MVector v n s a)
Data, Ptr (MVector v n s a) -> IO (MVector v n s a)
Ptr (MVector v n s a) -> Int -> IO (MVector v n s a)
Ptr (MVector v n s a) -> Int -> MVector v n s a -> IO ()
Ptr (MVector v n s a) -> MVector v n s a -> IO ()
MVector v n s a -> Int
(MVector v n s a -> Int)
-> (MVector v n s a -> Int)
-> (Ptr (MVector v n s a) -> Int -> IO (MVector v n s a))
-> (Ptr (MVector v n s a) -> Int -> MVector v n s a -> IO ())
-> (forall b. Ptr b -> Int -> IO (MVector v n s a))
-> (forall b. Ptr b -> Int -> MVector v n s a -> IO ())
-> (Ptr (MVector v n s a) -> IO (MVector v n s a))
-> (Ptr (MVector v n s a) -> MVector v n s a -> IO ())
-> Storable (MVector v n s a)
forall b. Ptr b -> Int -> IO (MVector v n s a)
forall b. Ptr b -> Int -> MVector v n s a -> IO ()
forall a.
(a -> Int)
-> (a -> Int)
-> (Ptr a -> Int -> IO a)
-> (Ptr a -> Int -> a -> IO ())
-> (forall b. Ptr b -> Int -> IO a)
-> (forall b. Ptr b -> Int -> a -> IO ())
-> (Ptr a -> IO a)
-> (Ptr a -> a -> IO ())
-> Storable a
forall (v :: * -> * -> *) (n :: Nat) s a.
Storable (v s a) =>
Ptr (MVector v n s a) -> IO (MVector v n s a)
forall (v :: * -> * -> *) (n :: Nat) s a.
Storable (v s a) =>
Ptr (MVector v n s a) -> Int -> IO (MVector v n s a)
forall (v :: * -> * -> *) (n :: Nat) s a.
Storable (v s a) =>
Ptr (MVector v n s a) -> Int -> MVector v n s a -> IO ()
forall (v :: * -> * -> *) (n :: Nat) s a.
Storable (v s a) =>
Ptr (MVector v n s a) -> MVector v n s a -> IO ()
forall (v :: * -> * -> *) (n :: Nat) s a.
Storable (v s a) =>
MVector v n s a -> Int
forall (v :: * -> * -> *) (n :: Nat) s a b.
Storable (v s a) =>
Ptr b -> Int -> IO (MVector v n s a)
forall (v :: * -> * -> *) (n :: Nat) s a b.
Storable (v s a) =>
Ptr b -> Int -> MVector v n s a -> IO ()
$csizeOf :: forall (v :: * -> * -> *) (n :: Nat) s a.
Storable (v s a) =>
MVector v n s a -> Int
sizeOf :: MVector v n s a -> Int
$calignment :: forall (v :: * -> * -> *) (n :: Nat) s a.
Storable (v s a) =>
MVector v n s a -> Int
alignment :: MVector v n s a -> Int
$cpeekElemOff :: forall (v :: * -> * -> *) (n :: Nat) s a.
Storable (v s a) =>
Ptr (MVector v n s a) -> Int -> IO (MVector v n s a)
peekElemOff :: Ptr (MVector v n s a) -> Int -> IO (MVector v n s a)
$cpokeElemOff :: forall (v :: * -> * -> *) (n :: Nat) s a.
Storable (v s a) =>
Ptr (MVector v n s a) -> Int -> MVector v n s a -> IO ()
pokeElemOff :: Ptr (MVector v n s a) -> Int -> MVector v n s a -> IO ()
$cpeekByteOff :: forall (v :: * -> * -> *) (n :: Nat) s a b.
Storable (v s a) =>
Ptr b -> Int -> IO (MVector v n s a)
peekByteOff :: forall b. Ptr b -> Int -> IO (MVector v n s a)
$cpokeByteOff :: forall (v :: * -> * -> *) (n :: Nat) s a b.
Storable (v s a) =>
Ptr b -> Int -> MVector v n s a -> IO ()
pokeByteOff :: forall b. Ptr b -> Int -> MVector v n s a -> IO ()
$cpeek :: forall (v :: * -> * -> *) (n :: Nat) s a.
Storable (v s a) =>
Ptr (MVector v n s a) -> IO (MVector v n s a)
peek :: Ptr (MVector v n s a) -> IO (MVector v n s a)
$cpoke :: forall (v :: * -> * -> *) (n :: Nat) s a.
Storable (v s a) =>
Ptr (MVector v n s a) -> MVector v n s a -> IO ()
poke :: Ptr (MVector v n s a) -> MVector v n s a -> IO ()
Storable, MVector v n s a -> ()
(MVector v n s a -> ()) -> NFData (MVector v n s a)
forall a. (a -> ()) -> NFData a
forall (v :: * -> * -> *) (n :: Nat) s a.
NFData (v s a) =>
MVector v n s a -> ()
$crnf :: forall (v :: * -> * -> *) (n :: Nat) s a.
NFData (v s a) =>
MVector v n s a -> ()
rnf :: MVector v n s a -> ()
NFData )