primal-0.3.0.0: Primeval world of Haskell.
Copyright(c) Alexey Kuleshevich 2020
LicenseBSD3
MaintainerAlexey Kuleshevich <alexey@kuleshevi.ch>
Stabilityexperimental
Portabilitynon-portable
Safe HaskellNone
LanguageHaskell2010

Control.Prim.Monad

Contents

Description

 
Synopsis

Documentation

type RW = RealWorld Source #

A shorter synonym for the magical RealWorld

data RealWorld #

RealWorld is deeply magical. It is primitive, but it is not unlifted (hence ptrArg). We never manipulate values of type RealWorld; it's only used in the type system, to parameterise State#.

Instances

Instances details
MonadPrimBase RealWorld IO Source # 
Instance details

Defined in Control.Prim.Monad.Internal

Methods

primBase :: IO a -> State# RealWorld -> (# State# RealWorld, a #) Source #

MonadUnliftPrim RealWorld IO Source # 
Instance details

Defined in Control.Prim.Monad.Internal

Methods

withRunInST :: ((forall a. IO a -> ST RealWorld a) -> ST RealWorld b) -> IO b Source #

runInPrimBase1 :: (a -> IO b) -> ((a -> State# RealWorld -> (# State# RealWorld, b #)) -> State# RealWorld -> (# State# RealWorld, c #)) -> IO c Source #

runInPrimBase2 :: (a -> IO b) -> (c -> IO d) -> ((a -> State# RealWorld -> (# State# RealWorld, b #)) -> (c -> State# RealWorld -> (# State# RealWorld, d #)) -> State# RealWorld -> (# State# RealWorld, e #)) -> IO e Source #

MonadPrim RealWorld IO Source # 
Instance details

Defined in Control.Prim.Monad.Internal

Methods

prim :: (State# RealWorld -> (# State# RealWorld, a #)) -> IO a Source #

class MonadThrow m => MonadPrim s m | m -> s where Source #

Methods

prim :: (State# s -> (# State# s, a #)) -> m a Source #

Construct a primitive action

Instances

Instances details
MonadPrim RealWorld IO Source # 
Instance details

Defined in Control.Prim.Monad.Internal

Methods

prim :: (State# RealWorld -> (# State# RealWorld, a #)) -> IO a Source #

MonadPrim s m => MonadPrim s (MaybeT m) Source # 
Instance details

Defined in Control.Prim.Monad.Internal

Methods

prim :: (State# s -> (# State# s, a #)) -> MaybeT m a Source #

MonadPrim s (ST s) Source # 
Instance details

Defined in Control.Prim.Monad.Internal

Methods

prim :: (State# s -> (# State# s, a #)) -> ST s a Source #

MonadPrim s m => MonadPrim s (WriterT w m) Source # 
Instance details

Defined in Control.Prim.Monad.Internal

Methods

prim :: (State# s -> (# State# s, a #)) -> WriterT w m a Source #

MonadPrim s m => MonadPrim s (SelectT r m) Source # 
Instance details

Defined in Control.Prim.Monad.Internal

Methods

prim :: (State# s -> (# State# s, a #)) -> SelectT r m a Source #

(Monoid w, MonadPrim s m) => MonadPrim s (AccumT w m) Source # 
Instance details

Defined in Control.Prim.Monad.Internal

Methods

prim :: (State# s -> (# State# s, a #)) -> AccumT w m a Source #

(Monoid w, MonadPrim s m) => MonadPrim s (WriterT w m) Source # 
Instance details

Defined in Control.Prim.Monad.Internal

Methods

prim :: (State# s -> (# State# s, a #)) -> WriterT w m a Source #

(Monoid w, MonadPrim s m) => MonadPrim s (WriterT w m) Source # 
Instance details

Defined in Control.Prim.Monad.Internal

Methods

prim :: (State# s -> (# State# s, a #)) -> WriterT w m a Source #

MonadPrim s m => MonadPrim s (StateT st m) Source # 
Instance details

Defined in Control.Prim.Monad.Internal

Methods

prim :: (State# s -> (# State# s, a #)) -> StateT st m a Source #

MonadPrim s m => MonadPrim s (StateT st m) Source # 
Instance details

Defined in Control.Prim.Monad.Internal

Methods

prim :: (State# s -> (# State# s, a #)) -> StateT st m a Source #

MonadPrim s m => MonadPrim s (ReaderT r m) Source # 
Instance details

Defined in Control.Prim.Monad.Internal

Methods

prim :: (State# s -> (# State# s, a #)) -> ReaderT r m a Source #

MonadPrim s m => MonadPrim s (IdentityT m) Source # 
Instance details

Defined in Control.Prim.Monad.Internal

Methods

prim :: (State# s -> (# State# s, a #)) -> IdentityT m a Source #

(e ~ SomeException, MonadPrim s m) => MonadPrim s (ExceptT e m) Source # 
Instance details

Defined in Control.Prim.Monad.Internal

Methods

prim :: (State# s -> (# State# s, a #)) -> ExceptT e m a Source #

MonadPrim s m => MonadPrim s (ContT r m) Source # 
Instance details

Defined in Control.Prim.Monad.Internal

Methods

prim :: (State# s -> (# State# s, a #)) -> ContT r m a Source #

MonadPrim s m => MonadPrim s (RWST r w st m) Source # 
Instance details

Defined in Control.Prim.Monad.Internal

Methods

prim :: (State# s -> (# State# s, a #)) -> RWST r w st m a Source #

(Monoid w, MonadPrim s m) => MonadPrim s (RWST r w st m) Source # 
Instance details

Defined in Control.Prim.Monad.Internal

Methods

prim :: (State# s -> (# State# s, a #)) -> RWST r w st m a Source #

(Monoid w, MonadPrim s m) => MonadPrim s (RWST r w st m) Source # 
Instance details

Defined in Control.Prim.Monad.Internal

Methods

prim :: (State# s -> (# State# s, a #)) -> RWST r w st m a Source #

class MonadUnliftPrim s m => MonadPrimBase s m where Source #

Methods

primBase :: m a -> State# s -> (# State# s, a #) Source #

Unwrap a primitive action

Instances

Instances details
MonadPrimBase RealWorld IO Source # 
Instance details

Defined in Control.Prim.Monad.Internal

Methods

primBase :: IO a -> State# RealWorld -> (# State# RealWorld, a #) Source #

MonadPrimBase s (ST s) Source # 
Instance details

Defined in Control.Prim.Monad.Internal

Methods

primBase :: ST s a -> State# s -> (# State# s, a #) Source #

MonadPrimBase s m => MonadPrimBase s (IdentityT m) Source # 
Instance details

Defined in Control.Prim.Monad.Internal

Methods

primBase :: IdentityT m a -> State# s -> (# State# s, a #) Source #

class MonadPrim s m => MonadUnliftPrim s m where Source #

Minimal complete definition

withRunInST

Methods

withRunInST :: ((forall a. m a -> ST s a) -> ST s b) -> m b Source #

runInPrimBase1 :: (a -> m b) -> ((a -> State# s -> (# State# s, b #)) -> State# s -> (# State# s, c #)) -> m c Source #

runInPrimBase2 :: (a -> m b) -> (c -> m d) -> ((a -> State# s -> (# State# s, b #)) -> (c -> State# s -> (# State# s, d #)) -> State# s -> (# State# s, e #)) -> m e Source #

Instances

Instances details
MonadUnliftPrim RealWorld IO Source # 
Instance details

Defined in Control.Prim.Monad.Internal

Methods

withRunInST :: ((forall a. IO a -> ST RealWorld a) -> ST RealWorld b) -> IO b Source #

runInPrimBase1 :: (a -> IO b) -> ((a -> State# RealWorld -> (# State# RealWorld, b #)) -> State# RealWorld -> (# State# RealWorld, c #)) -> IO c Source #

runInPrimBase2 :: (a -> IO b) -> (c -> IO d) -> ((a -> State# RealWorld -> (# State# RealWorld, b #)) -> (c -> State# RealWorld -> (# State# RealWorld, d #)) -> State# RealWorld -> (# State# RealWorld, e #)) -> IO e Source #

MonadUnliftPrim s (ST s) Source # 
Instance details

Defined in Control.Prim.Monad.Internal

Methods

withRunInST :: ((forall a. ST s a -> ST s a) -> ST s b) -> ST s b Source #

runInPrimBase1 :: (a -> ST s b) -> ((a -> State# s -> (# State# s, b #)) -> State# s -> (# State# s, c #)) -> ST s c Source #

runInPrimBase2 :: (a -> ST s b) -> (c -> ST s d) -> ((a -> State# s -> (# State# s, b #)) -> (c -> State# s -> (# State# s, d #)) -> State# s -> (# State# s, e #)) -> ST s e Source #

MonadUnliftPrim s m => MonadUnliftPrim s (ReaderT r m) Source # 
Instance details

Defined in Control.Prim.Monad.Internal

Methods

withRunInST :: ((forall a. ReaderT r m a -> ST s a) -> ST s b) -> ReaderT r m b Source #

runInPrimBase1 :: (a -> ReaderT r m b) -> ((a -> State# s -> (# State# s, b #)) -> State# s -> (# State# s, c #)) -> ReaderT r m c Source #

runInPrimBase2 :: (a -> ReaderT r m b) -> (c -> ReaderT r m d) -> ((a -> State# s -> (# State# s, b #)) -> (c -> State# s -> (# State# s, d #)) -> State# s -> (# State# s, e #)) -> ReaderT r m e Source #

MonadUnliftPrim s m => MonadUnliftPrim s (IdentityT m) Source # 
Instance details

Defined in Control.Prim.Monad.Internal

Methods

withRunInST :: ((forall a. IdentityT m a -> ST s a) -> ST s b) -> IdentityT m b Source #

runInPrimBase1 :: (a -> IdentityT m b) -> ((a -> State# s -> (# State# s, b #)) -> State# s -> (# State# s, c #)) -> IdentityT m c Source #

runInPrimBase2 :: (a -> IdentityT m b) -> (c -> IdentityT m d) -> ((a -> State# s -> (# State# s, b #)) -> (c -> State# s -> (# State# s, d #)) -> State# s -> (# State# s, e #)) -> IdentityT m e Source #

data ST s a #

The strict ST monad. The ST monad allows for destructive updates, but is escapable (unlike IO). A computation of type ST s a returns a value of type a, and execute in "thread" s. The s parameter is either

  • an uninstantiated type variable (inside invocations of runST), or
  • RealWorld (inside invocations of stToIO).

It serves to keep the internal states of different invocations of runST separate from each other and from invocations of stToIO.

The >>= and >> operations are strict in the state (though not in values stored in the state). For example,

runST (writeSTRef _|_ v >>= f) = _|_

Instances

Instances details
MonadPrimBase s (ST s) Source # 
Instance details

Defined in Control.Prim.Monad.Internal

Methods

primBase :: ST s a -> State# s -> (# State# s, a #) Source #

MonadUnliftPrim s (ST s) Source # 
Instance details

Defined in Control.Prim.Monad.Internal

Methods

withRunInST :: ((forall a. ST s a -> ST s a) -> ST s b) -> ST s b Source #

runInPrimBase1 :: (a -> ST s b) -> ((a -> State# s -> (# State# s, b #)) -> State# s -> (# State# s, c #)) -> ST s c Source #

runInPrimBase2 :: (a -> ST s b) -> (c -> ST s d) -> ((a -> State# s -> (# State# s, b #)) -> (c -> State# s -> (# State# s, d #)) -> State# s -> (# State# s, e #)) -> ST s e Source #

MonadPrim s (ST s) Source # 
Instance details

Defined in Control.Prim.Monad.Internal

Methods

prim :: (State# s -> (# State# s, a #)) -> ST s a Source #

Monad (ST s)

Since: base-2.1

Instance details

Defined in GHC.ST

Methods

(>>=) :: ST s a -> (a -> ST s b) -> ST s b #

(>>) :: ST s a -> ST s b -> ST s b #

return :: a -> ST s a #

Functor (ST s)

Since: base-2.1

Instance details

Defined in GHC.ST

Methods

fmap :: (a -> b) -> ST s a -> ST s b #

(<$) :: a -> ST s b -> ST s a #

MonadFail (ST s)

Since: base-4.11.0.0

Instance details

Defined in GHC.ST

Methods

fail :: String -> ST s a #

Applicative (ST s)

Since: base-4.4.0.0

Instance details

Defined in GHC.ST

Methods

pure :: a -> ST s a #

(<*>) :: ST s (a -> b) -> ST s a -> ST s b #

liftA2 :: (a -> b -> c) -> ST s a -> ST s b -> ST s c #

(*>) :: ST s a -> ST s b -> ST s b #

(<*) :: ST s a -> ST s b -> ST s a #

MonadThrow (ST s) Source # 
Instance details

Defined in Control.Prim.Monad.Throw

Methods

throwM :: Exception e => e -> ST s a Source #

MArray (STUArray s) Word (ST s) 
Instance details

Defined in Data.Array.Base

Methods

getBounds :: Ix i => STUArray s i Word -> ST s (i, i) #

getNumElements :: Ix i => STUArray s i Word -> ST s Int

newArray :: Ix i => (i, i) -> Word -> ST s (STUArray s i Word) #

newArray_ :: Ix i => (i, i) -> ST s (STUArray s i Word) #

unsafeNewArray_ :: Ix i => (i, i) -> ST s (STUArray s i Word)

unsafeRead :: Ix i => STUArray s i Word -> Int -> ST s Word

unsafeWrite :: Ix i => STUArray s i Word -> Int -> Word -> ST s ()

MArray (STUArray s) Word8 (ST s) 
Instance details

Defined in Data.Array.Base

Methods

getBounds :: Ix i => STUArray s i Word8 -> ST s (i, i) #

getNumElements :: Ix i => STUArray s i Word8 -> ST s Int

newArray :: Ix i => (i, i) -> Word8 -> ST s (STUArray s i Word8) #

newArray_ :: Ix i => (i, i) -> ST s (STUArray s i Word8) #

unsafeNewArray_ :: Ix i => (i, i) -> ST s (STUArray s i Word8)

unsafeRead :: Ix i => STUArray s i Word8 -> Int -> ST s Word8

unsafeWrite :: Ix i => STUArray s i Word8 -> Int -> Word8 -> ST s ()

MArray (STUArray s) Word64 (ST s) 
Instance details

Defined in Data.Array.Base

Methods

getBounds :: Ix i => STUArray s i Word64 -> ST s (i, i) #

getNumElements :: Ix i => STUArray s i Word64 -> ST s Int

newArray :: Ix i => (i, i) -> Word64 -> ST s (STUArray s i Word64) #

newArray_ :: Ix i => (i, i) -> ST s (STUArray s i Word64) #

unsafeNewArray_ :: Ix i => (i, i) -> ST s (STUArray s i Word64)

unsafeRead :: Ix i => STUArray s i Word64 -> Int -> ST s Word64

unsafeWrite :: Ix i => STUArray s i Word64 -> Int -> Word64 -> ST s ()

MArray (STUArray s) Word32 (ST s) 
Instance details

Defined in Data.Array.Base

Methods

getBounds :: Ix i => STUArray s i Word32 -> ST s (i, i) #

getNumElements :: Ix i => STUArray s i Word32 -> ST s Int

newArray :: Ix i => (i, i) -> Word32 -> ST s (STUArray s i Word32) #

newArray_ :: Ix i => (i, i) -> ST s (STUArray s i Word32) #

unsafeNewArray_ :: Ix i => (i, i) -> ST s (STUArray s i Word32)

unsafeRead :: Ix i => STUArray s i Word32 -> Int -> ST s Word32

unsafeWrite :: Ix i => STUArray s i Word32 -> Int -> Word32 -> ST s ()

MArray (STUArray s) Word16 (ST s) 
Instance details

Defined in Data.Array.Base

Methods

getBounds :: Ix i => STUArray s i Word16 -> ST s (i, i) #

getNumElements :: Ix i => STUArray s i Word16 -> ST s Int

newArray :: Ix i => (i, i) -> Word16 -> ST s (STUArray s i Word16) #

newArray_ :: Ix i => (i, i) -> ST s (STUArray s i Word16) #

unsafeNewArray_ :: Ix i => (i, i) -> ST s (STUArray s i Word16)

unsafeRead :: Ix i => STUArray s i Word16 -> Int -> ST s Word16

unsafeWrite :: Ix i => STUArray s i Word16 -> Int -> Word16 -> ST s ()

MArray (STUArray s) Int (ST s) 
Instance details

Defined in Data.Array.Base

Methods

getBounds :: Ix i => STUArray s i Int -> ST s (i, i) #

getNumElements :: Ix i => STUArray s i Int -> ST s Int

newArray :: Ix i => (i, i) -> Int -> ST s (STUArray s i Int) #

newArray_ :: Ix i => (i, i) -> ST s (STUArray s i Int) #

unsafeNewArray_ :: Ix i => (i, i) -> ST s (STUArray s i Int)

unsafeRead :: Ix i => STUArray s i Int -> Int -> ST s Int

unsafeWrite :: Ix i => STUArray s i Int -> Int -> Int -> ST s ()

MArray (STUArray s) Int8 (ST s) 
Instance details

Defined in Data.Array.Base

Methods

getBounds :: Ix i => STUArray s i Int8 -> ST s (i, i) #

getNumElements :: Ix i => STUArray s i Int8 -> ST s Int

newArray :: Ix i => (i, i) -> Int8 -> ST s (STUArray s i Int8) #

newArray_ :: Ix i => (i, i) -> ST s (STUArray s i Int8) #

unsafeNewArray_ :: Ix i => (i, i) -> ST s (STUArray s i Int8)

unsafeRead :: Ix i => STUArray s i Int8 -> Int -> ST s Int8

unsafeWrite :: Ix i => STUArray s i Int8 -> Int -> Int8 -> ST s ()

MArray (STUArray s) Int64 (ST s) 
Instance details

Defined in Data.Array.Base

Methods

getBounds :: Ix i => STUArray s i Int64 -> ST s (i, i) #

getNumElements :: Ix i => STUArray s i Int64 -> ST s Int

newArray :: Ix i => (i, i) -> Int64 -> ST s (STUArray s i Int64) #

newArray_ :: Ix i => (i, i) -> ST s (STUArray s i Int64) #

unsafeNewArray_ :: Ix i => (i, i) -> ST s (STUArray s i Int64)

unsafeRead :: Ix i => STUArray s i Int64 -> Int -> ST s Int64

unsafeWrite :: Ix i => STUArray s i Int64 -> Int -> Int64 -> ST s ()

MArray (STUArray s) Int32 (ST s) 
Instance details

Defined in Data.Array.Base

Methods

getBounds :: Ix i => STUArray s i Int32 -> ST s (i, i) #

getNumElements :: Ix i => STUArray s i Int32 -> ST s Int

newArray :: Ix i => (i, i) -> Int32 -> ST s (STUArray s i Int32) #

newArray_ :: Ix i => (i, i) -> ST s (STUArray s i Int32) #

unsafeNewArray_ :: Ix i => (i, i) -> ST s (STUArray s i Int32)

unsafeRead :: Ix i => STUArray s i Int32 -> Int -> ST s Int32

unsafeWrite :: Ix i => STUArray s i Int32 -> Int -> Int32 -> ST s ()

MArray (STUArray s) Int16 (ST s) 
Instance details

Defined in Data.Array.Base

Methods

getBounds :: Ix i => STUArray s i Int16 -> ST s (i, i) #

getNumElements :: Ix i => STUArray s i Int16 -> ST s Int

newArray :: Ix i => (i, i) -> Int16 -> ST s (STUArray s i Int16) #

newArray_ :: Ix i => (i, i) -> ST s (STUArray s i Int16) #

unsafeNewArray_ :: Ix i => (i, i) -> ST s (STUArray s i Int16)

unsafeRead :: Ix i => STUArray s i Int16 -> Int -> ST s Int16

unsafeWrite :: Ix i => STUArray s i Int16 -> Int -> Int16 -> ST s ()

MArray (STUArray s) Float (ST s) 
Instance details

Defined in Data.Array.Base

Methods

getBounds :: Ix i => STUArray s i Float -> ST s (i, i) #

getNumElements :: Ix i => STUArray s i Float -> ST s Int

newArray :: Ix i => (i, i) -> Float -> ST s (STUArray s i Float) #

newArray_ :: Ix i => (i, i) -> ST s (STUArray s i Float) #

unsafeNewArray_ :: Ix i => (i, i) -> ST s (STUArray s i Float)

unsafeRead :: Ix i => STUArray s i Float -> Int -> ST s Float

unsafeWrite :: Ix i => STUArray s i Float -> Int -> Float -> ST s ()

MArray (STUArray s) Double (ST s) 
Instance details

Defined in Data.Array.Base

Methods

getBounds :: Ix i => STUArray s i Double -> ST s (i, i) #

getNumElements :: Ix i => STUArray s i Double -> ST s Int

newArray :: Ix i => (i, i) -> Double -> ST s (STUArray s i Double) #

newArray_ :: Ix i => (i, i) -> ST s (STUArray s i Double) #

unsafeNewArray_ :: Ix i => (i, i) -> ST s (STUArray s i Double)

unsafeRead :: Ix i => STUArray s i Double -> Int -> ST s Double

unsafeWrite :: Ix i => STUArray s i Double -> Int -> Double -> ST s ()

MArray (STUArray s) Char (ST s) 
Instance details

Defined in Data.Array.Base

Methods

getBounds :: Ix i => STUArray s i Char -> ST s (i, i) #

getNumElements :: Ix i => STUArray s i Char -> ST s Int

newArray :: Ix i => (i, i) -> Char -> ST s (STUArray s i Char) #

newArray_ :: Ix i => (i, i) -> ST s (STUArray s i Char) #

unsafeNewArray_ :: Ix i => (i, i) -> ST s (STUArray s i Char)

unsafeRead :: Ix i => STUArray s i Char -> Int -> ST s Char

unsafeWrite :: Ix i => STUArray s i Char -> Int -> Char -> ST s ()

MArray (STUArray s) Bool (ST s) 
Instance details

Defined in Data.Array.Base

Methods

getBounds :: Ix i => STUArray s i Bool -> ST s (i, i) #

getNumElements :: Ix i => STUArray s i Bool -> ST s Int

newArray :: Ix i => (i, i) -> Bool -> ST s (STUArray s i Bool) #

newArray_ :: Ix i => (i, i) -> ST s (STUArray s i Bool) #

unsafeNewArray_ :: Ix i => (i, i) -> ST s (STUArray s i Bool)

unsafeRead :: Ix i => STUArray s i Bool -> Int -> ST s Bool

unsafeWrite :: Ix i => STUArray s i Bool -> Int -> Bool -> ST s ()

MArray (STArray s) e (ST s) 
Instance details

Defined in Data.Array.Base

Methods

getBounds :: Ix i => STArray s i e -> ST s (i, i) #

getNumElements :: Ix i => STArray s i e -> ST s Int

newArray :: Ix i => (i, i) -> e -> ST s (STArray s i e) #

newArray_ :: Ix i => (i, i) -> ST s (STArray s i e) #

unsafeNewArray_ :: Ix i => (i, i) -> ST s (STArray s i e)

unsafeRead :: Ix i => STArray s i e -> Int -> ST s e

unsafeWrite :: Ix i => STArray s i e -> Int -> e -> ST s ()

MArray (STUArray s) (StablePtr a) (ST s) 
Instance details

Defined in Data.Array.Base

Methods

getBounds :: Ix i => STUArray s i (StablePtr a) -> ST s (i, i) #

getNumElements :: Ix i => STUArray s i (StablePtr a) -> ST s Int

newArray :: Ix i => (i, i) -> StablePtr a -> ST s (STUArray s i (StablePtr a)) #

newArray_ :: Ix i => (i, i) -> ST s (STUArray s i (StablePtr a)) #

unsafeNewArray_ :: Ix i => (i, i) -> ST s (STUArray s i (StablePtr a))

unsafeRead :: Ix i => STUArray s i (StablePtr a) -> Int -> ST s (StablePtr a)

unsafeWrite :: Ix i => STUArray s i (StablePtr a) -> Int -> StablePtr a -> ST s ()

MArray (STUArray s) (Ptr a) (ST s) 
Instance details

Defined in Data.Array.Base

Methods

getBounds :: Ix i => STUArray s i (Ptr a) -> ST s (i, i) #

getNumElements :: Ix i => STUArray s i (Ptr a) -> ST s Int

newArray :: Ix i => (i, i) -> Ptr a -> ST s (STUArray s i (Ptr a)) #

newArray_ :: Ix i => (i, i) -> ST s (STUArray s i (Ptr a)) #

unsafeNewArray_ :: Ix i => (i, i) -> ST s (STUArray s i (Ptr a))

unsafeRead :: Ix i => STUArray s i (Ptr a) -> Int -> ST s (Ptr a)

unsafeWrite :: Ix i => STUArray s i (Ptr a) -> Int -> Ptr a -> ST s ()

MArray (STUArray s) (FunPtr a) (ST s) 
Instance details

Defined in Data.Array.Base

Methods

getBounds :: Ix i => STUArray s i (FunPtr a) -> ST s (i, i) #

getNumElements :: Ix i => STUArray s i (FunPtr a) -> ST s Int

newArray :: Ix i => (i, i) -> FunPtr a -> ST s (STUArray s i (FunPtr a)) #

newArray_ :: Ix i => (i, i) -> ST s (STUArray s i (FunPtr a)) #

unsafeNewArray_ :: Ix i => (i, i) -> ST s (STUArray s i (FunPtr a))

unsafeRead :: Ix i => STUArray s i (FunPtr a) -> Int -> ST s (FunPtr a)

unsafeWrite :: Ix i => STUArray s i (FunPtr a) -> Int -> FunPtr a -> ST s ()

Show (ST s a)

Since: base-2.1

Instance details

Defined in GHC.ST

Methods

showsPrec :: Int -> ST s a -> ShowS #

show :: ST s a -> String #

showList :: [ST s a] -> ShowS #

Semigroup a => Semigroup (ST s a)

Since: base-4.11.0.0

Instance details

Defined in GHC.ST

Methods

(<>) :: ST s a -> ST s a -> ST s a #

sconcat :: NonEmpty (ST s a) -> ST s a #

stimes :: Integral b => b -> ST s a -> ST s a #

Monoid a => Monoid (ST s a)

Since: base-4.11.0.0

Instance details

Defined in GHC.ST

Methods

mempty :: ST s a #

mappend :: ST s a -> ST s a -> ST s a #

mconcat :: [ST s a] -> ST s a #

unIO :: IO a -> State# RealWorld -> (# State# RealWorld, a #) #

unIO_ :: IO () -> State# RW -> State# RW Source #

Unwrap IO that returns unit

unST :: ST s a -> State# s -> (# State# s, a #) Source #

Unwrap ST

unST_ :: ST s () -> State# s -> State# s Source #

Unwrap ST that returns unit

runST :: (forall s. ST s a) -> a #

Return the value computed by a state thread. The forall ensures that the internal state used by the ST computation is inaccessible to the rest of the program.

prim_ :: MonadPrim s m => (State# s -> State# s) -> m () Source #

Construct a primitive action that does not return anything.

primBase_ :: MonadPrimBase s m => m () -> State# s -> State# s Source #

withRunInIO :: forall m b. MonadUnliftPrim RW m => ((forall a. m a -> IO a) -> IO b) -> m b Source #

withRunInPrimBase :: (MonadUnliftPrim s m, MonadPrimBase s n) => ((forall a. m a -> n a) -> n b) -> m b Source #

runInPrimBase :: forall s m a b. MonadUnliftPrim s m => m a -> ((State# s -> (# State# s, a #)) -> State# s -> (# State# s, b #)) -> m b Source #

liftIO :: MonadPrim RW m => IO a -> m a Source #

Lift an IO action to MonadPrim with the RealWorld state token. Type restricted synonym for liftPrimBase

liftST :: MonadPrim s m => ST s a -> m a Source #

Lift an ST action to MonadPrim with the same state token. Type restricted synonym for liftPrimBase

liftPrimBase :: (MonadPrimBase s n, MonadPrim s m) => n a -> m a Source #

Lift an action from the MonadPrimBase to another MonadPrim with the same state token.

primBaseToIO :: MonadPrimBase RealWorld m => m a -> IO a Source #

Restrict a MonadPrimBase action that works with RealWorld to IO.

primBaseToST :: MonadPrimBase s m => m a -> ST s a Source #

Restrict a MonadPrimBase action that works in ST.

eval :: MonadPrim s m => a -> m a Source #

An action that evaluates a value to Weak Head Normal Form (WHNF). Same as evaluate, except it works in MonadPrim. This function provides stronger guarantees than seq with respect to ordering of operations, but it does have a slightly higher overhead.

Since: 0.3.0

evalM :: MonadPrim s m => m a -> m a Source #

Run the action and then use eval to ensure its result is evaluated to Weak Head Normal Form (WHNF)

Since: 0.3.0

class NFData a #

A class of types that can be fully evaluated.

Since: deepseq-1.1.0.0

Instances

Instances details
NFData Bool 
Instance details

Defined in Control.DeepSeq

Methods

rnf :: Bool -> () #

NFData Char 
Instance details

Defined in Control.DeepSeq

Methods

rnf :: Char -> () #

NFData Double 
Instance details

Defined in Control.DeepSeq

Methods

rnf :: Double -> () #

NFData Float 
Instance details

Defined in Control.DeepSeq

Methods

rnf :: Float -> () #

NFData Int 
Instance details

Defined in Control.DeepSeq

Methods

rnf :: Int -> () #

NFData Int8 
Instance details

Defined in Control.DeepSeq

Methods

rnf :: Int8 -> () #

NFData Int16 
Instance details

Defined in Control.DeepSeq

Methods

rnf :: Int16 -> () #

NFData Int32 
Instance details

Defined in Control.DeepSeq

Methods

rnf :: Int32 -> () #

NFData Int64 
Instance details

Defined in Control.DeepSeq

Methods

rnf :: Int64 -> () #

NFData Integer 
Instance details

Defined in Control.DeepSeq

Methods

rnf :: Integer -> () #

NFData Natural

Since: deepseq-1.4.0.0

Instance details

Defined in Control.DeepSeq

Methods

rnf :: Natural -> () #

NFData Ordering 
Instance details

Defined in Control.DeepSeq

Methods

rnf :: Ordering -> () #

NFData Word 
Instance details

Defined in Control.DeepSeq

Methods

rnf :: Word -> () #

NFData Word8 
Instance details

Defined in Control.DeepSeq

Methods

rnf :: Word8 -> () #

NFData Word16 
Instance details

Defined in Control.DeepSeq

Methods

rnf :: Word16 -> () #

NFData Word32 
Instance details

Defined in Control.DeepSeq

Methods

rnf :: Word32 -> () #

NFData Word64 
Instance details

Defined in Control.DeepSeq

Methods

rnf :: Word64 -> () #

NFData CallStack

Since: deepseq-1.4.2.0

Instance details

Defined in Control.DeepSeq

Methods

rnf :: CallStack -> () #

NFData () 
Instance details

Defined in Control.DeepSeq

Methods

rnf :: () -> () #

NFData TyCon

NOTE: Prior to deepseq-1.4.4.0 this instance was only defined for base-4.8.0.0 and later.

Since: deepseq-1.4.0.0

Instance details

Defined in Control.DeepSeq

Methods

rnf :: TyCon -> () #

NFData Void

Defined as rnf = absurd.

Since: deepseq-1.4.0.0

Instance details

Defined in Control.DeepSeq

Methods

rnf :: Void -> () #

NFData Unique

Since: deepseq-1.4.0.0

Instance details

Defined in Control.DeepSeq

Methods

rnf :: Unique -> () #

NFData Version

Since: deepseq-1.3.0.0

Instance details

Defined in Control.DeepSeq

Methods

rnf :: Version -> () #

NFData ThreadId

Since: deepseq-1.4.0.0

Instance details

Defined in Control.DeepSeq

Methods

rnf :: ThreadId -> () #

NFData ExitCode

Since: deepseq-1.4.2.0

Instance details

Defined in Control.DeepSeq

Methods

rnf :: ExitCode -> () #

NFData MaskingState

Since: deepseq-1.4.4.0

Instance details

Defined in Control.DeepSeq

Methods

rnf :: MaskingState -> () #

NFData TypeRep

NOTE: Prior to deepseq-1.4.4.0 this instance was only defined for base-4.8.0.0 and later.

Since: deepseq-1.4.0.0

Instance details

Defined in Control.DeepSeq

Methods

rnf :: TypeRep -> () #

NFData All

Since: deepseq-1.4.0.0

Instance details

Defined in Control.DeepSeq

Methods

rnf :: All -> () #

NFData Any

Since: deepseq-1.4.0.0

Instance details

Defined in Control.DeepSeq

Methods

rnf :: Any -> () #

NFData CChar

Since: deepseq-1.4.0.0

Instance details

Defined in Control.DeepSeq

Methods

rnf :: CChar -> () #

NFData CSChar

Since: deepseq-1.4.0.0

Instance details

Defined in Control.DeepSeq

Methods

rnf :: CSChar -> () #

NFData CUChar

Since: deepseq-1.4.0.0

Instance details

Defined in Control.DeepSeq

Methods

rnf :: CUChar -> () #

NFData CShort

Since: deepseq-1.4.0.0

Instance details

Defined in Control.DeepSeq

Methods

rnf :: CShort -> () #

NFData CUShort

Since: deepseq-1.4.0.0

Instance details

Defined in Control.DeepSeq

Methods

rnf :: CUShort -> () #

NFData CInt

Since: deepseq-1.4.0.0

Instance details

Defined in Control.DeepSeq

Methods

rnf :: CInt -> () #

NFData CUInt

Since: deepseq-1.4.0.0

Instance details

Defined in Control.DeepSeq

Methods

rnf :: CUInt -> () #

NFData CLong

Since: deepseq-1.4.0.0

Instance details

Defined in Control.DeepSeq

Methods

rnf :: CLong -> () #

NFData CULong

Since: deepseq-1.4.0.0

Instance details

Defined in Control.DeepSeq

Methods

rnf :: CULong -> () #

NFData CLLong

Since: deepseq-1.4.0.0

Instance details

Defined in Control.DeepSeq

Methods

rnf :: CLLong -> () #

NFData CULLong

Since: deepseq-1.4.0.0

Instance details

Defined in Control.DeepSeq

Methods

rnf :: CULLong -> () #

NFData CBool

Since: deepseq-1.4.3.0

Instance details

Defined in Control.DeepSeq

Methods

rnf :: CBool -> () #

NFData CFloat

Since: deepseq-1.4.0.0

Instance details

Defined in Control.DeepSeq

Methods

rnf :: CFloat -> () #

NFData CDouble

Since: deepseq-1.4.0.0

Instance details

Defined in Control.DeepSeq

Methods

rnf :: CDouble -> () #

NFData CPtrdiff

Since: deepseq-1.4.0.0

Instance details

Defined in Control.DeepSeq

Methods

rnf :: CPtrdiff -> () #

NFData CSize

Since: deepseq-1.4.0.0

Instance details

Defined in Control.DeepSeq

Methods

rnf :: CSize -> () #

NFData CWchar

Since: deepseq-1.4.0.0

Instance details

Defined in Control.DeepSeq

Methods

rnf :: CWchar -> () #

NFData CSigAtomic

Since: deepseq-1.4.0.0

Instance details

Defined in Control.DeepSeq

Methods

rnf :: CSigAtomic -> () #

NFData CClock

Since: deepseq-1.4.0.0

Instance details

Defined in Control.DeepSeq

Methods

rnf :: CClock -> () #

NFData CTime

Since: deepseq-1.4.0.0

Instance details

Defined in Control.DeepSeq

Methods

rnf :: CTime -> () #

NFData CUSeconds

Since: deepseq-1.4.0.0

Instance details

Defined in Control.DeepSeq

Methods

rnf :: CUSeconds -> () #

NFData CSUSeconds

Since: deepseq-1.4.0.0

Instance details

Defined in Control.DeepSeq

Methods

rnf :: CSUSeconds -> () #

NFData CFile

Since: deepseq-1.4.0.0

Instance details

Defined in Control.DeepSeq

Methods

rnf :: CFile -> () #

NFData CFpos

Since: deepseq-1.4.0.0

Instance details

Defined in Control.DeepSeq

Methods

rnf :: CFpos -> () #

NFData CJmpBuf

Since: deepseq-1.4.0.0

Instance details

Defined in Control.DeepSeq

Methods

rnf :: CJmpBuf -> () #

NFData CIntPtr

Since: deepseq-1.4.0.0

Instance details

Defined in Control.DeepSeq

Methods

rnf :: CIntPtr -> () #

NFData CUIntPtr

Since: deepseq-1.4.0.0

Instance details

Defined in Control.DeepSeq

Methods

rnf :: CUIntPtr -> () #

NFData CIntMax

Since: deepseq-1.4.0.0

Instance details

Defined in Control.DeepSeq

Methods

rnf :: CIntMax -> () #

NFData CUIntMax

Since: deepseq-1.4.0.0

Instance details

Defined in Control.DeepSeq

Methods

rnf :: CUIntMax -> () #

NFData Fingerprint

Since: deepseq-1.4.0.0

Instance details

Defined in Control.DeepSeq

Methods

rnf :: Fingerprint -> () #

NFData SrcLoc

Since: deepseq-1.4.2.0

Instance details

Defined in Control.DeepSeq

Methods

rnf :: SrcLoc -> () #

NFData a => NFData [a] 
Instance details

Defined in Control.DeepSeq

Methods

rnf :: [a] -> () #

NFData a => NFData (Maybe a) 
Instance details

Defined in Control.DeepSeq

Methods

rnf :: Maybe a -> () #

NFData a => NFData (Ratio a) 
Instance details

Defined in Control.DeepSeq

Methods

rnf :: Ratio a -> () #

NFData (StablePtr a) Source # 
Instance details

Defined in Foreign.Prim.StablePtr

Methods

rnf :: StablePtr a -> () #

NFData (Ptr a)

Since: deepseq-1.4.2.0

Instance details

Defined in Control.DeepSeq

Methods

rnf :: Ptr a -> () #

NFData (FunPtr a)

Since: deepseq-1.4.2.0

Instance details

Defined in Control.DeepSeq

Methods

rnf :: FunPtr a -> () #

NFData a => NFData (Complex a) 
Instance details

Defined in Control.DeepSeq

Methods

rnf :: Complex a -> () #

NFData a => NFData (Min a)

Since: deepseq-1.4.2.0

Instance details

Defined in Control.DeepSeq

Methods

rnf :: Min a -> () #

NFData a => NFData (Max a)

Since: deepseq-1.4.2.0

Instance details

Defined in Control.DeepSeq

Methods

rnf :: Max a -> () #

NFData a => NFData (First a)

Since: deepseq-1.4.2.0

Instance details

Defined in Control.DeepSeq

Methods

rnf :: First a -> () #

NFData a => NFData (Last a)

Since: deepseq-1.4.2.0

Instance details

Defined in Control.DeepSeq

Methods

rnf :: Last a -> () #

NFData m => NFData (WrappedMonoid m)

Since: deepseq-1.4.2.0

Instance details

Defined in Control.DeepSeq

Methods

rnf :: WrappedMonoid m -> () #

NFData a => NFData (Option a)

Since: deepseq-1.4.2.0

Instance details

Defined in Control.DeepSeq

Methods

rnf :: Option a -> () #

NFData (StableName a)

Since: deepseq-1.4.0.0

Instance details

Defined in Control.DeepSeq

Methods

rnf :: StableName a -> () #

NFData a => NFData (ZipList a)

Since: deepseq-1.4.0.0

Instance details

Defined in Control.DeepSeq

Methods

rnf :: ZipList a -> () #

NFData a => NFData (Identity a)

Since: deepseq-1.4.0.0

Instance details

Defined in Control.DeepSeq

Methods

rnf :: Identity a -> () #

NFData (IORef a)

NOTE: Only strict in the reference and not the referenced value.

Since: deepseq-1.4.2.0

Instance details

Defined in Control.DeepSeq

Methods

rnf :: IORef a -> () #

NFData a => NFData (First a)

Since: deepseq-1.4.0.0

Instance details

Defined in Control.DeepSeq

Methods

rnf :: First a -> () #

NFData a => NFData (Last a)

Since: deepseq-1.4.0.0

Instance details

Defined in Control.DeepSeq

Methods

rnf :: Last a -> () #

NFData a => NFData (Dual a)

Since: deepseq-1.4.0.0

Instance details

Defined in Control.DeepSeq

Methods

rnf :: Dual a -> () #

NFData a => NFData (Sum a)

Since: deepseq-1.4.0.0

Instance details

Defined in Control.DeepSeq

Methods

rnf :: Sum a -> () #

NFData a => NFData (Product a)

Since: deepseq-1.4.0.0

Instance details

Defined in Control.DeepSeq

Methods

rnf :: Product a -> () #

NFData a => NFData (Down a)

Since: deepseq-1.4.0.0

Instance details

Defined in Control.DeepSeq

Methods

rnf :: Down a -> () #

NFData (MVar a)

NOTE: Only strict in the reference and not the referenced value.

Since: deepseq-1.4.2.0

Instance details

Defined in Control.DeepSeq

Methods

rnf :: MVar a -> () #

NFData a => NFData (NonEmpty a)

Since: deepseq-1.4.2.0

Instance details

Defined in Control.DeepSeq

Methods

rnf :: NonEmpty a -> () #

NFData (BNF a) Source #

Unlawful instance that only evaluates its contents to WHNF

Since: 0.3.0

Instance details

Defined in Control.Prim.Eval

Methods

rnf :: BNF a -> () #

NFData a => NFData (Atom a) Source # 
Instance details

Defined in Data.Prim.Atom

Methods

rnf :: Atom a -> () #

NFData (Off e) Source # 
Instance details

Defined in Data.Prim

Methods

rnf :: Off e -> () #

NFData (Count e) Source # 
Instance details

Defined in Data.Prim

Methods

rnf :: Count e -> () #

NFData (UArray e) Source #

O(1) - UArray is always in NF

Instance details

Defined in Data.Prim.Array

Methods

rnf :: UArray e -> () #

NFData e => NFData (SBArray e) Source # 
Instance details

Defined in Data.Prim.Array

Methods

rnf :: SBArray e -> () #

NFData e => NFData (BArray e) Source # 
Instance details

Defined in Data.Prim.Array

Methods

rnf :: BArray e -> () #

NFData (a -> b)

This instance is for convenience and consistency with seq. This assumes that WHNF is equivalent to NF for functions.

Since: deepseq-1.3.0.0

Instance details

Defined in Control.DeepSeq

Methods

rnf :: (a -> b) -> () #

(NFData a, NFData b) => NFData (Either a b) 
Instance details

Defined in Control.DeepSeq

Methods

rnf :: Either a b -> () #

(NFData a, NFData b) => NFData (a, b) 
Instance details

Defined in Control.DeepSeq

Methods

rnf :: (a, b) -> () #

(NFData a, NFData b) => NFData (Array a b) 
Instance details

Defined in Control.DeepSeq

Methods

rnf :: Array a b -> () #

NFData (Fixed a)

Since: deepseq-1.3.0.0

Instance details

Defined in Control.DeepSeq

Methods

rnf :: Fixed a -> () #

(NFData a, NFData b) => NFData (Arg a b)

Since: deepseq-1.4.2.0

Instance details

Defined in Control.DeepSeq

Methods

rnf :: Arg a b -> () #

NFData (Proxy a)

Since: deepseq-1.4.0.0

Instance details

Defined in Control.DeepSeq

Methods

rnf :: Proxy a -> () #

NFData (STRef s a)

NOTE: Only strict in the reference and not the referenced value.

Since: deepseq-1.4.2.0

Instance details

Defined in Control.DeepSeq

Methods

rnf :: STRef s a -> () #

NFData (UMArray e s) Source #

O(1) - UMArray is always in NF

Instance details

Defined in Data.Prim.Array

Methods

rnf :: UMArray e s -> () #

(NFData a1, NFData a2, NFData a3) => NFData (a1, a2, a3) 
Instance details

Defined in Control.DeepSeq

Methods

rnf :: (a1, a2, a3) -> () #

NFData a => NFData (Const a b)

Since: deepseq-1.4.0.0

Instance details

Defined in Control.DeepSeq

Methods

rnf :: Const a b -> () #

NFData (a :~: b)

Since: deepseq-1.4.3.0

Instance details

Defined in Control.DeepSeq

Methods

rnf :: (a :~: b) -> () #

(NFData a1, NFData a2, NFData a3, NFData a4) => NFData (a1, a2, a3, a4) 
Instance details

Defined in Control.DeepSeq

Methods

rnf :: (a1, a2, a3, a4) -> () #

(NFData1 f, NFData1 g, NFData a) => NFData (Product f g a)

Since: deepseq-1.4.3.0

Instance details

Defined in Control.DeepSeq

Methods

rnf :: Product f g a -> () #

(NFData1 f, NFData1 g, NFData a) => NFData (Sum f g a)

Since: deepseq-1.4.3.0

Instance details

Defined in Control.DeepSeq

Methods

rnf :: Sum f g a -> () #

NFData (a :~~: b)

Since: deepseq-1.4.3.0

Instance details

Defined in Control.DeepSeq

Methods

rnf :: (a :~~: b) -> () #

(NFData a1, NFData a2, NFData a3, NFData a4, NFData a5) => NFData (a1, a2, a3, a4, a5) 
Instance details

Defined in Control.DeepSeq

Methods

rnf :: (a1, a2, a3, a4, a5) -> () #

(NFData1 f, NFData1 g, NFData a) => NFData (Compose f g a)

Since: deepseq-1.4.3.0

Instance details

Defined in Control.DeepSeq

Methods

rnf :: Compose f g a -> () #

(NFData a1, NFData a2, NFData a3, NFData a4, NFData a5, NFData a6) => NFData (a1, a2, a3, a4, a5, a6) 
Instance details

Defined in Control.DeepSeq

Methods

rnf :: (a1, a2, a3, a4, a5, a6) -> () #

(NFData a1, NFData a2, NFData a3, NFData a4, NFData a5, NFData a6, NFData a7) => NFData (a1, a2, a3, a4, a5, a6, a7) 
Instance details

Defined in Control.DeepSeq

Methods

rnf :: (a1, a2, a3, a4, a5, a6, a7) -> () #

(NFData a1, NFData a2, NFData a3, NFData a4, NFData a5, NFData a6, NFData a7, NFData a8) => NFData (a1, a2, a3, a4, a5, a6, a7, a8) 
Instance details

Defined in Control.DeepSeq

Methods

rnf :: (a1, a2, a3, a4, a5, a6, a7, a8) -> () #

(NFData a1, NFData a2, NFData a3, NFData a4, NFData a5, NFData a6, NFData a7, NFData a8, NFData a9) => NFData (a1, a2, a3, a4, a5, a6, a7, a8, a9) 
Instance details

Defined in Control.DeepSeq

Methods

rnf :: (a1, a2, a3, a4, a5, a6, a7, a8, a9) -> () #

deepeval :: (MonadPrim s m, NFData a) => a -> m a Source #

An action that evaluates a value to Normal Form (NF). This function provides stronger guarantees than deepseq with respect to ordering of operations.

Since: 0.3.0

deepevalM :: (MonadPrim s m, NFData a) => m a -> m a Source #

Run the action and the using deepeval ensure its result is evaluated to Normal Form (NF)

Since: 0.3.0

whenM :: Monad m => m Bool -> m () -> m () Source #

Similar to when, but condional is supplied in a form of monadic action rather than a pure value.

Since: 0.3.0

unlessM :: Monad m => m Bool -> m () -> m () Source #

Similar to unless, but condional is supplied in a form of monadic action rather than a pure value.

Since: 0.3.0

Re-export