Safe Haskell | Trustworthy |
---|---|
Language | Haskell98 |
- type Pointer = Word32
- data SeekableStream m c = SeekableStream {
- __consumeToken :: !(m (Maybe c))
- __consumeIntegralToken :: !(m (Maybe Word32))
- __seek :: !(Pointer -> m ())
- __getPosition :: !(m Pointer)
- __seekAtEnd :: !(m ())
- __isLockLive :: !(m Bool)
- data SeekableWriter m c = SeekableWriter {
- _putToken :: !(c -> m ())
- _putIntegralToken :: !(Word32 -> m ())
- stream :: !(SeekableStream m c)
- class Typeable t => RW t where
- data RWCtx a = RW a => RWCtx
- type PolyTraversal ctx m d = Proxy ctx -> (forall a. Data ctx a => ReaderT (SeekableStream m Word8) m a) -> ReaderT (SeekableStream m Word8) m d
- type PolyTraversalW ctx m d = Proxy ctx -> (forall a. Data ctx a => a -> ReaderT (SeekableWriter m Word8) m ()) -> d -> ReaderT (SeekableWriter m Word8) m ()
- data LazyFix f = LazyFix (Rep f (LazyFix f))
- data LazyMap k v
- = BinPrime {
- lazy_map_size :: Int
- lazy_map_key :: k
- lazy_map_value :: v
- lazy_map_bin1 :: WithAddress (LazyMap k v)
- lazy_map_bin2 :: WithAddress (LazyMap k v)
- | TipPrime
- = BinPrime {
- class KeyComparable t where
- data KeyCtx t = KeyComparable t => KeyCtx
- data WithAddress t = WithAddress Pointer t
- data Header = Header !Word8 !ConIndex !Int
- isUArray :: Header -> Bool
- isArray :: Header -> Bool
- isPrimtype :: Header -> Bool
- isAlgtype :: Header -> Bool
- getConIndex :: Header -> ConIndex
- getNFields :: Header -> Int
Documentation
data SeekableStream m c Source #
SeekableStream | |
|
Functor m => Functor (SeekableStream m) Source # | |
data SeekableWriter m c Source #
SeekableWriter | |
|
class Typeable t => RW t where Source #
The RW
class describes operations that can locate entities in a stream by seeking,
and also read and write primitive types.
type PolyTraversal ctx m d = Proxy ctx -> (forall a. Data ctx a => ReaderT (SeekableStream m Word8) m a) -> ReaderT (SeekableStream m Word8) m d Source #
A PolyTraversal
is a reader method over a data type, parameterized over a method to read components.
It can be seen as a curried form of the gmapM
operator from Data.Data, in like manner as the
Traversal
is a curried form of traverse
.
type PolyTraversalW ctx m d = Proxy ctx -> (forall a. Data ctx a => a -> ReaderT (SeekableWriter m Word8) m ()) -> d -> ReaderT (SeekableWriter m Word8) m () Source #
This is a variant of PolyTraversal
purposed for writing. By convention, strategies with this type
require the stream to be seeked at an *address*, which the strategy will then dereference to access the
corresponding data.
The standard Fix
constructor is too strict for some things this library has to do, hence the alias.
This type alias exposes an alternate view of the data constructors of a dictionary type. Why break abstraction????because I need the structure sharing.
BinPrime | |
| |
TipPrime |
class KeyComparable t where Source #
isKeyed
may always return false, but if it returns true ever, keyCompare
must be well-defined and a valid equivalence relation on values for which
isKeyed
returns true (i.e. where all values concerned have isKeyed x=true).
The default is to have isKeyed
return false on all values.
Ord k => KeyComparable (Pair k v) Source # | |
KeyComparable t => KeyCtx |
data WithAddress t Source #
Data type for a piece of data that may or may not have an explicit address associated with it. This is nice because I can play with these in pure code to manipulate data, while still remembering all of the explicit term structure.
Eq t => Eq (WithAddress t) Source # | |
Ord t => Ord (WithAddress t) Source # | |
Show t => Show (WithAddress t) Source # | |
isPrimtype :: Header -> Bool Source #
getConIndex :: Header -> ConIndex Source #
getNFields :: Header -> Int Source #