Safe Haskell | Safe-Inferred |
---|---|
Language | Haskell2010 |
This module exports some internal modules *for use in testing only*.
Synopsis
- parseMetadataBlock :: Int -> ValueTable -> [Entry] -> Parse ParsedMetadata
- parseMetadataKindEntry :: Record -> Parse ()
- data PartialUnnamedMd = PartialUnnamedMd {
- pumIndex :: Int
- pumValues :: PValMd
- pumDistinct :: Bool
- finalizePartialUnnamedMd :: PartialUnnamedMd -> Finalize UnnamedMd
- finalizePValMd :: PValMd -> Finalize ValMd
- dedupMetadata :: Seq PartialUnnamedMd -> Seq PartialUnnamedMd
- type InstrMdAttachments = Map Int [(KindMd, PValMd)]
- type PFnMdAttachments = Map PKindMd PValMd
- type PKindMd = Int
- type PGlobalAttachments = Map Symbol (Map KindMd PValMd)
Documentation
:: Int | globals seen so far |
-> ValueTable | |
-> [Entry] | |
-> Parse ParsedMetadata |
parseMetadataKindEntry :: Record -> Parse () Source #
data PartialUnnamedMd Source #
PartialUnnamedMd | |
|
Instances
finalizePartialUnnamedMd :: PartialUnnamedMd -> Finalize UnnamedMd Source #
finalizePValMd :: PValMd -> Finalize ValMd Source #
dedupMetadata :: Seq PartialUnnamedMd -> Seq PartialUnnamedMd Source #
This function generically traverses the given unnamed metadata values.
When it encounters one with a PValMd
inside of it, it looks up that
value in the list. If found, it replaces the value with a reference to it.
Such de-duplication is necessary because the fallback
of
mdForwardRefOrNull
is often called when it is in fact unnecessary, just
because the appropriate references aren't available yet.
This function is concise at the cost of efficiency: In the worst case, every
metadata node contains a reference to every other metadata node, and the
cost is O(n^2*log(n)) where
* n^2 comes from looking at every PValMd
inside every PartialUnnamedMd
* log(n) is the cost of looking them up in a Map
.
type PFnMdAttachments = Map PKindMd PValMd Source #