Safe Haskell | None |
---|---|
Language | Haskell2010 |
Synopsis
- newtype BitDataM d a = BitDataM {
- runBitDataM :: StateT d (WriterT [String] Id) a
- clear :: BitData d => BitDataM d ()
- setBit :: BitData d => BitDataField d Bit -> BitDataM d ()
- clearBit :: BitData d => BitDataField d Bit -> BitDataM d ()
- setField :: (BitData d, BitData b, SafeCast (BitDataRep b) (BitDataRep d)) => BitDataField d b -> b -> BitDataM d ()
- runBits :: BitData d => BitDataRep d -> BitDataM d a -> (a, BitDataRep d, [String])
- withBits :: BitData d => BitDataRep d -> BitDataM d () -> BitDataRep d
- withBitsRef :: BitData d => Ref s1 (Stored (BitDataRep d)) -> BitDataM d a -> Ivory eff a
Documentation
An action that modifies a bit data value of type "d" and returns a "a" in the "Ivory s r" monad. Values of this type are passed as the "body" argument to "withBits" etc.
setBit :: BitData d => BitDataField d Bit -> BitDataM d () Source #
Set a single bit field in the current bit data value.
setField :: (BitData d, BitData b, SafeCast (BitDataRep b) (BitDataRep d)) => BitDataField d b -> b -> BitDataM d () Source #
Set a field to a value.
runBits :: BitData d => BitDataRep d -> BitDataM d a -> (a, BitDataRep d, [String]) Source #
Execute a bitdata action given an initial value, returning the new bitdata value and the result of the action.
withBits :: BitData d => BitDataRep d -> BitDataM d () -> BitDataRep d Source #
Execute a bitdata action given an initial value, returning the new bitdata value.
withBitsRef :: BitData d => Ref s1 (Stored (BitDataRep d)) -> BitDataM d a -> Ivory eff a Source #
Execute a bit data action given a reference to a value, writing the resulting value back to the reference upon completion and returning the result of the action.