Safe Haskell | Trustworthy |
---|---|
Language | Haskell98 |
PolyTraversals that add cycle detection and fixed point construction to any R/W strategy.
- class Monad m => StateM m where
- get' :: StateM m => m (StateOf m)
- put' :: StateM m => StateOf m -> m ()
- class KeyComparable t where
- data KeyCtx t = KeyComparable t => KeyCtx
- data DynamicWithCtx ctx = (ctx t, Typeable t) => DynamicWithCtx !t
- dynamicWithCtx :: (ctx t, Typeable t) => t -> DynamicWithCtx ctx
- type CycleDetectionR m = StateT (Map Word32 Dynamic) m
- type CycleDetectionW m = StateT (Map (DynamicWithCtx KeyComparable) Word32) m
- type CycleDetectionRIO = ReaderT (IORef (Map Word32 Dynamic)) IO
- type CycleDetectionWIO = ReaderT (IORef (Map (DynamicWithCtx KeyComparable) Word32)) IO
- cycleDetect :: forall ctx m t. (MonadFix m, StateM m, StateOf m ~ Map Word32 Dynamic, HasField ctx RWCtx, Data ctx t) => PolyTraversal ctx m t
- cycleDetectW :: forall ctx m t. (StateM m, StateOf m ~ Map (DynamicWithCtx KeyComparable) Word32, HasField ctx RWCtx, HasField ctx KeyCtx, Data ctx t) => PolyTraversalW ctx m t
- runCycleDetectionR :: Monad m => ReaderT (SeekableStream (CycleDetectionR m) Word8) (CycleDetectionR m) t -> ReaderT (SeekableStream m Word8) m t
- runCycleDetectionW :: Monad m => ReaderT (SeekableWriter (CycleDetectionW m) Word8) (CycleDetectionW m) t -> ReaderT (SeekableWriter m Word8) m t
- data Pair k v = Pair k v
- pairCtor :: Constr
- pairDataType :: DataType
Documentation
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.
data DynamicWithCtx ctx Source #
(ctx t, Typeable t) => DynamicWithCtx !t |
dynamicWithCtx :: (ctx t, Typeable t) => t -> DynamicWithCtx ctx Source #
type CycleDetectionW m = StateT (Map (DynamicWithCtx KeyComparable) Word32) m Source #
type CycleDetectionWIO = ReaderT (IORef (Map (DynamicWithCtx KeyComparable) Word32)) IO Source #
cycleDetect :: forall ctx m t. (MonadFix m, StateM m, StateOf m ~ Map Word32 Dynamic, HasField ctx RWCtx, Data ctx t) => PolyTraversal ctx m t Source #
cycleDetectW :: forall ctx m t. (StateM m, StateOf m ~ Map (DynamicWithCtx KeyComparable) Word32, HasField ctx RWCtx, HasField ctx KeyCtx, Data ctx t) => PolyTraversalW ctx m t Source #
runCycleDetectionR :: Monad m => ReaderT (SeekableStream (CycleDetectionR m) Word8) (CycleDetectionR m) t -> ReaderT (SeekableStream m Word8) m t Source #
runCycleDetectionW :: Monad m => ReaderT (SeekableWriter (CycleDetectionW m) Word8) (CycleDetectionW m) t -> ReaderT (SeekableWriter m Word8) m t Source #
A Pair
is a good data structures for associating a key and a value.
Pair k v |
(Sat (ctx (Pair k v)), Data ctx k, Data ctx v) => Data ctx (Pair k v) Source # | |
ToRep (Pair k) Source # | |
(Eq v, Eq k) => Eq (Pair k v) Source # | |
(Ord v, Ord k) => Ord (Pair k v) Source # | |
(Read v, Read k) => Read (Pair k v) Source # | |
(Show v, Show k) => Show (Pair k v) Source # | |
(Typeable * k, Typeable * v) => RW (Pair k v) Source # | |
Ord k => KeyComparable (Pair k v) Source # | |
type Rep (Pair k) v Source # | |