| Safe Haskell | None |
|---|---|
| Language | Haskell2010 |
GHC.Exts.Heap.Closures
Synopsis
- type Closure = GenClosure Box
- data GenClosure b
- = ConstrClosure { }
- | FunClosure {
- info :: !StgInfoTable
- ptrArgs :: ![b]
- dataArgs :: ![Word]
- | ThunkClosure {
- info :: !StgInfoTable
- ptrArgs :: ![b]
- dataArgs :: ![Word]
- | SelectorClosure {
- info :: !StgInfoTable
- selectee :: !b
- | PAPClosure { }
- | APClosure { }
- | APStackClosure {
- info :: !StgInfoTable
- fun :: !b
- payload :: ![b]
- | IndClosure {
- info :: !StgInfoTable
- indirectee :: !b
- | BCOClosure { }
- | BlackholeClosure {
- info :: !StgInfoTable
- indirectee :: !b
- | ArrWordsClosure { }
- | MutArrClosure {
- info :: !StgInfoTable
- mccPtrs :: !Word
- mccSize :: !Word
- mccPayload :: ![b]
- | MVarClosure {
- info :: !StgInfoTable
- queueHead :: !b
- queueTail :: !b
- value :: !b
- | MutVarClosure {
- info :: !StgInfoTable
- var :: !b
- | BlockingQueueClosure { }
- | IntClosure { }
- | WordClosure { }
- | Int64Closure { }
- | Word64Closure { }
- | AddrClosure { }
- | FloatClosure { }
- | DoubleClosure { }
- | OtherClosure {
- info :: !StgInfoTable
- hvalues :: ![b]
- rawWords :: ![Word]
- | UnsupportedClosure {
- info :: !StgInfoTable
- data PrimType
- allClosures :: GenClosure b -> [b]
- data Box = Box Any
- areBoxesEqual :: Box -> Box -> IO Bool
- asBox :: a -> Box
Closures
type Closure = GenClosure Box Source #
data GenClosure b Source #
This is the representation of a Haskell value on the heap. It reflects http://ghc.haskell.org/trac/ghc/browser/includes/rts/storage/Closures.h
The data type is parametrized by the type to store references in. Usually
this is a Box with the type synonym Closure .
All Heap objects have the same basic layout. A header containing a pointer
to the info table and a payload with various fields. The info field below
always refers to the info table pointed to by the header. The remaining
fields are the payload.
See https://ghc.haskell.org/trac/ghc/wiki/Commentary/Rts/Storage/HeapObjects for more information.
Constructors
A data constructor
A function
Fields
- info :: !StgInfoTable
- ptrArgs :: ![b]
Pointer arguments
- dataArgs :: ![Word]
Non-pointer arguments
A thunk, an expression not obviously in head normal form
Fields
- info :: !StgInfoTable
- ptrArgs :: ![b]
Pointer arguments
- dataArgs :: ![Word]
Non-pointer arguments
A thunk which performs a simple selection operation
Fields
- info :: !StgInfoTable
- selectee :: !b
Pointer to the object being selected from
An unsaturated function application
Fields
- info :: !StgInfoTable
- arity :: !HalfWord
Arity of the partial application
- n_args :: !HalfWord
Size of the payload in words
- fun :: !b
Pointer to a
FunClosure - payload :: ![b]
Sequence of already applied arguments
A function application
Fields
- info :: !StgInfoTable
- arity :: !HalfWord
Arity of the partial application
- n_args :: !HalfWord
Size of the payload in words
- fun :: !b
Pointer to a
FunClosure - payload :: ![b]
Sequence of already applied arguments
A suspended thunk evaluation
Fields
- info :: !StgInfoTable
- fun :: !b
Pointer to a
FunClosure - payload :: ![b]
Sequence of already applied arguments
A pointer to another closure, introduced when a thunk is updated to point at its value
Fields
- info :: !StgInfoTable
- indirectee :: !b
Target closure
A byte-code object (BCO) which can be interpreted by GHC's byte-code interpreter (e.g. as used by GHCi)
Fields
- info :: !StgInfoTable
- instrs :: !b
A pointer to an ArrWords of instructions
- literals :: !b
A pointer to an ArrWords of literals
- bcoptrs :: !b
A pointer to an ArrWords of byte code objects
- arity :: !HalfWord
Arity of the partial application
- size :: !HalfWord
The size of this BCO in words
- bitmap :: ![Word]
An StgLargeBitmap describing the pointerhood of its args/free vars
A thunk under evaluation by another thread
Fields
- info :: !StgInfoTable
- indirectee :: !b
Target closure
A ByteArray#
A MutableByteArray#
Fields
- info :: !StgInfoTable
- mccPtrs :: !Word
Number of pointers
- mccSize :: !Word
?? Closures.h vs ClosureMacros.h
- mccPayload :: ![b]
Array payload Card table ignored
An MVar#, with a queue of thread state objects blocking on them
Fields
- info :: !StgInfoTable
- queueHead :: !b
Pointer to head of queue
- queueTail :: !b
Pointer to tail of queue
- value :: !b
Pointer to closure
A MutVar#
Fields
- info :: !StgInfoTable
- var :: !b
Pointer to contents
An STM blocking queue.
Primitive Int
Primitive Word
Primitive Int64
Primitive Word64
Primitive Addr
Primitive Float
Primitive Double
Another kind of closure
Fields
- info :: !StgInfoTable
- hvalues :: ![b]
- rawWords :: ![Word]
Fields
- info :: !StgInfoTable
Instances
Instance details
Defined in GHC.Exts.Heap.Closures
Methods
fmap :: (a -> b) -> GenClosure a -> GenClosure b #
(<$) :: a -> GenClosure b -> GenClosure a #
Instance details
Defined in GHC.Exts.Heap.Closures
Methods
fold :: Monoid m => GenClosure m -> m #
foldMap :: Monoid m => (a -> m) -> GenClosure a -> m #
foldr :: (a -> b -> b) -> b -> GenClosure a -> b #
foldr' :: (a -> b -> b) -> b -> GenClosure a -> b #
foldl :: (b -> a -> b) -> b -> GenClosure a -> b #
foldl' :: (b -> a -> b) -> b -> GenClosure a -> b #
foldr1 :: (a -> a -> a) -> GenClosure a -> a #
foldl1 :: (a -> a -> a) -> GenClosure a -> a #
toList :: GenClosure a -> [a] #
null :: GenClosure a -> Bool #
length :: GenClosure a -> Int #
elem :: Eq a => a -> GenClosure a -> Bool #
maximum :: Ord a => GenClosure a -> a #
minimum :: Ord a => GenClosure a -> a #
sum :: Num a => GenClosure a -> a #
product :: Num a => GenClosure a -> a #
Instance details
Defined in GHC.Exts.Heap.Closures
Methods
traverse :: Applicative f => (a -> f b) -> GenClosure a -> f (GenClosure b) #
sequenceA :: Applicative f => GenClosure (f a) -> f (GenClosure a) #
mapM :: Monad m => (a -> m b) -> GenClosure a -> m (GenClosure b) #
sequence :: Monad m => GenClosure (m a) -> m (GenClosure a) #
Instance details
Defined in GHC.Exts.Heap.Closures
Methods
showsPrec :: Int -> GenClosure b -> ShowS #
show :: GenClosure b -> String #
showList :: [GenClosure b] -> ShowS #
Instance details
Defined in GHC.Exts.Heap.Closures
Associated Types
type Rep (GenClosure b) :: Type -> Type #
Instance details
Defined in GHCi.Message
Instance details
Defined in GHC.Exts.Heap.Closures
Instances
Instance details
Defined in GHC.Exts.Heap.Closures
allClosures :: GenClosure b -> [b] Source #
For generic code, this function returns all referenced closures.
Boxes
An arbitrary Haskell value in a safe Box. The point is that even
unevaluated thunks can safely be moved around inside the Box, and when
required, e.g. in getBoxedClosureData, the function knows how far it has
to evaluate the argument.