-- Hoogle documentation, generated by Haddock -- See Hoogle, http://www.haskell.org/hoogle/ -- | RON -- -- Replicated Object Notation (RON), data types (RDT), and RON-Schema -- -- Typical usage: -- --
--   import RON.Data
--   import RON.Schema.TH
--   import RON.Storage.IO as Storage
--   
--   [mkReplicated|
--       (struct_lww Note
--           active Boole
--           text RgaString)
--   |]
--   
--   instance Collection Note where
--       collectionName = "note"
--   
--   main :: IO ()
--   main = do
--       let dataDir = "./data/"
--       h <- Storage.newHandle dataDir
--       runStorage h $ do
--           obj <- newObject
--               Note{active = True, text = "Write a task manager"}
--           createDocument obj
--   
@package ron @version 0.6 -- | Common types for binary format (parser and serializer) module RON.Binary.Types type Size = Word32 -- | Data block descriptor data Desc DOpClosed :: Desc DOpReduced :: Desc DOpHeader :: Desc DOpQueryHeader :: Desc DUuidReducer :: Desc DUuidObject :: Desc DUuidOp :: Desc DUuidRef :: Desc DAtomUuidZip :: Desc DUuidZipObject :: Desc DUuidZipOp :: Desc DUuidZipRef :: Desc DAtomUuid :: Desc DAtomInteger :: Desc DAtomString :: Desc DAtomFloat :: Desc -- | Does the descriptor refer to an op descIsOp :: Desc -> Bool instance GHC.Show.Show RON.Binary.Types.Desc instance GHC.Classes.Eq RON.Binary.Types.Desc instance GHC.Enum.Enum RON.Binary.Types.Desc module RON.Error data Error Error :: Text -> [Error] -> Error ErrorContext :: Text -> Error -> Error type MonadE = MonadError Error errorContext :: MonadE m => Text -> m a -> m a -- | Lifts an Either e into any MonadError -- e. -- --
--   do { val <- liftEither =<< action1; action2 }
--   
-- -- where action1 returns an Either to represent errors. liftEither :: MonadError e m => Either e a -> m a liftEitherString :: (MonadError e m, IsString e) => Either String a -> m a liftMaybe :: MonadE m => Text -> Maybe a -> m a throwErrorString :: (MonadError e m, IsString e) => String -> m a throwErrorText :: MonadE m => Text -> m a instance GHC.Show.Show RON.Error.Error instance GHC.Classes.Eq RON.Error.Error instance GHC.Exception.Type.Exception RON.Error.Error instance Data.String.IsString RON.Error.Error module RON.Util type ByteStringL = ByteString data Instance c Instance :: a -> Instance c module RON.Util.Word data Word2 b00 :: Word2 b01 :: Word2 b10 :: Word2 b11 :: Word2 pattern B00 :: Word2 pattern B01 :: Word2 pattern B10 :: Word2 pattern B11 :: Word2 -- | Word2 smart constructor dropping upper bits leastSignificant2 :: Integral integral => integral -> Word2 data Word4 b0000 :: Word4 b0001 :: Word4 b0010 :: Word4 b0011 :: Word4 b0100 :: Word4 b0101 :: Word4 b0110 :: Word4 b0111 :: Word4 b1000 :: Word4 b1001 :: Word4 b1010 :: Word4 b1011 :: Word4 b1100 :: Word4 b1101 :: Word4 b1110 :: Word4 b1111 :: Word4 pattern B0000 :: Word4 -- | Word4 smart constructor dropping upper bits leastSignificant4 :: Integral integral => integral -> Word4 newtype Word6 W6 :: Word8 -> Word6 -- | Word6 smart constructor dropping upper bits leastSignificant6 :: Integral integral => integral -> Word6 -- | leastSignificant6 specialized for Word8 ls6 :: Word8 -> Word6 -- | 8-bit unsigned integer type data Word8 data Word12 -- | Word12 smart constructor dropping upper bits leastSignificant12 :: Integral integral => integral -> Word12 -- | leastSignificant12 specialized for Word16 ls12 :: Word16 -> Word12 -- | 16-bit unsigned integer type data Word16 data Word24 -- | Word24 smart constructor dropping upper bits leastSignificant24 :: Integral integral => integral -> Word24 -- | leastSignificant24 specialized for Word32 ls24 :: Word32 -> Word24 -- | 32-bit unsigned integer type data Word32 data Word60 -- | Word60 smart constructor dropping upper bits leastSignificant60 :: Integral integral => integral -> Word60 -- | leastSignificant60 specialized for Word64 ls60 :: Word64 -> Word60 -- | Word60 smart constructor checking domain toWord60 :: Word64 -> Maybe Word60 word60add :: Word60 -> Word60 -> Word60 -- | 64-bit unsigned integer type data Word64 class SafeCast v w safeCast :: SafeCast v w => v -> w instance GHC.Show.Show RON.Util.Word.Word60 instance GHC.Classes.Ord RON.Util.Word.Word60 instance GHC.Classes.Eq RON.Util.Word.Word60 instance GHC.Enum.Enum RON.Util.Word.Word60 instance GHC.Show.Show RON.Util.Word.Word24 instance GHC.Classes.Ord RON.Util.Word.Word24 instance GHC.Classes.Eq RON.Util.Word.Word24 instance GHC.Show.Show RON.Util.Word.Word12 instance GHC.Classes.Ord RON.Util.Word.Word12 instance GHC.Classes.Eq RON.Util.Word.Word12 instance GHC.Show.Show RON.Util.Word.Word6 instance GHC.Classes.Ord RON.Util.Word.Word6 instance GHC.Classes.Eq RON.Util.Word.Word6 instance GHC.Show.Show RON.Util.Word.Word4 instance GHC.Classes.Ord RON.Util.Word.Word4 instance GHC.Classes.Eq RON.Util.Word.Word4 instance GHC.Show.Show RON.Util.Word.Word2 instance GHC.Classes.Ord RON.Util.Word.Word2 instance GHC.Classes.Eq RON.Util.Word.Word2 instance RON.Util.Word.SafeCast RON.Util.Word.Word2 GHC.Types.Int instance RON.Util.Word.SafeCast RON.Util.Word.Word2 RON.Util.Word.Word4 instance RON.Util.Word.SafeCast RON.Util.Word.Word2 GHC.Word.Word8 instance RON.Util.Word.SafeCast RON.Util.Word.Word2 GHC.Word.Word64 instance RON.Util.Word.SafeCast RON.Util.Word.Word4 GHC.Types.Int instance RON.Util.Word.SafeCast RON.Util.Word.Word4 GHC.Word.Word64 instance RON.Util.Word.SafeCast RON.Util.Word.Word4 GHC.Word.Word8 instance RON.Util.Word.SafeCast RON.Util.Word.Word6 GHC.Types.Int instance RON.Util.Word.SafeCast RON.Util.Word.Word6 GHC.Word.Word8 instance RON.Util.Word.SafeCast RON.Util.Word.Word6 RON.Util.Word.Word60 instance RON.Util.Word.SafeCast RON.Util.Word.Word6 GHC.Word.Word64 instance RON.Util.Word.SafeCast GHC.Word.Word8 GHC.Word.Word32 instance RON.Util.Word.SafeCast GHC.Word.Word8 GHC.Word.Word64 instance RON.Util.Word.SafeCast RON.Util.Word.Word12 GHC.Word.Word64 instance RON.Util.Word.SafeCast RON.Util.Word.Word24 GHC.Word.Word64 instance RON.Util.Word.SafeCast RON.Util.Word.Word24 GHC.Word.Word32 instance RON.Util.Word.SafeCast RON.Util.Word.Word60 GHC.Word.Word64 instance RON.Util.Word.SafeCast GHC.Word.Word64 GHC.Integer.Type.Integer instance Data.Fixed.HasResolution e => RON.Util.Word.SafeCast GHC.Word.Word64 (Data.Fixed.Fixed e) instance GHC.Enum.Bounded RON.Util.Word.Word60 instance Data.Hashable.Class.Hashable RON.Util.Word.Word60 -- | RON version of Base64 encoding module RON.Base64 -- | Base64 alphabet alphabet :: ByteString -- | Decode a blob from a Base64 string decode :: ByteStringL -> Maybe ByteStringL -- | Decode a 60-bit number from a Base64 string decode60 :: ByteString -> Maybe Word60 -- | Decode a 60-bit number from a Base32 string decode60base32 :: ByteString -> Maybe Word60 -- | Decode a 64-bit number from a Base64 string decode64 :: ByteString -> Maybe Word64 -- | Decode a 64-bit number from a Base32 string decode64base32 :: ByteString -> Maybe Word64 -- | Convert a Base64 letter to a number [0-63] decodeLetter :: Word8 -> Maybe Word6 -- | Convert a subset [0-F] of Base64 letters to a number [0-15] decodeLetter4 :: Word8 -> Maybe Word4 -- | Encode a blob to a Base64 string encode :: ByteStringL -> ByteStringL -- | Encode a 60-bit number to a Base64 string encode60 :: Word60 -> ByteString -- | Encode a 60-bit number to a Base64 string, dropping trailing zeroes encode60short :: Word60 -> ByteString -- | Encode a 64-bit number to a Base64 string encode64 :: Word64 -> ByteString -- | Encode a 64-bit number to a Base32 string, dropping trailing zeroes encode64base32short :: Word64 -> ByteString -- | Convert a number from [0..63] to a single letter encodeLetter :: Word6 -> Word8 -- | Convert a number from [0..15] to a single letter encodeLetter4 :: Word4 -> Word8 -- | Check if a character is in the Base64 alphabet. isLetter :: Word8 -> Bool module RON.UUID -- | Universally unique identifier of anything data UUID UUID :: {-# UNPACK #-} !Word64 -> {-# UNPACK #-} !Word64 -> UUID -- | UUID split in parts data UuidFields UuidFields :: !Word4 -> !Word60 -> !Word2 -> !Word2 -> !Word60 -> UuidFields [uuidVariety] :: UuidFields -> !Word4 [uuidValue] :: UuidFields -> !Word60 [uuidVariant] :: UuidFields -> !Word2 [uuidVersion] :: UuidFields -> !Word2 [uuidOrigin] :: UuidFields -> !Word60 -- | Build UUID from parts build :: UuidFields -> UUID -- | Build former 64 bits of UUID from parts buildX :: Word4 -> Word60 -> Word64 -- | Build latter 64 bits of UUID from parts buildY :: Word2 -> Word2 -> Word60 -> Word64 -- | Split UUID into parts split :: UUID -> UuidFields -- | Increment field uuidValue of a UUID succValue :: UUID -> UUID -- | UUID with all zero fields zero :: UUID -- | UUID with all zero fields pattern Zero :: UUID -- | Convert UUID to a name getName :: UUID -> Maybe (ByteString, ByteString) -- | Contruct a UUID name in compile-time liftName :: ByteString -> Q Exp -- | Make an unscoped (unqualified) name mkName :: MonadFail m => ByteString -> m UUID -- | Make a scoped (qualified) name mkScopedName :: MonadFail m => ByteString -> ByteString -> m UUID -- | Decode a UUID from a Base32 string decodeBase32 :: FilePath -> Maybe UUID -- | Encode a UUID to a Base32 string encodeBase32 :: UUID -> FilePath instance GHC.Show.Show RON.UUID.UuidFields instance GHC.Classes.Eq RON.UUID.UuidFields instance GHC.Classes.Ord RON.UUID.UUID instance Data.Hashable.Class.Hashable RON.UUID.UUID instance GHC.Generics.Generic RON.UUID.UUID instance GHC.Classes.Eq RON.UUID.UUID instance Data.Data.Data RON.UUID.UUID instance GHC.Show.Show RON.UUID.UUID -- | RON model types module RON.Types pattern AckP :: (Word2, Word2) pattern AnnotationDerivedP :: (Word2, Word2) pattern AnnotationP :: (Word2, Word2) pattern CreateP :: (Word2, Word2) pattern DeleteP :: (Word2, Word2) pattern RegularP :: (Word2, Word2) pattern UndeleteP :: (Word2, Word2) -- | Atom — a payload element data Atom AFloat :: Double -> Atom AInteger :: Int64 -> Atom AString :: Text -> Atom AUuid :: UUID -> Atom -- | Closed op data ClosedOp ClosedOp :: UUID -> UUID -> Op -> ClosedOp -- | type [$sel:reducerId:ClosedOp] :: ClosedOp -> UUID -- | object id [$sel:objectId:ClosedOp] :: ClosedOp -> UUID -- | other keys and payload, that are common with reduced op [$sel:op:ClosedOp] :: ClosedOp -> Op -- | Reference to an object inside a frame. data Object a Object :: UUID -> StateFrame -> Object a [$sel:id:Object] :: Object a -> UUID [$sel:frame:Object] :: Object a -> StateFrame -- | Specific field or item in an object, identified by UUID. data ObjectPart obj part ObjectPart :: UUID -> UUID -> StateFrame -> ObjectPart obj part [$sel:partObject:ObjectPart] :: ObjectPart obj part -> UUID [$sel:partLocation:ObjectPart] :: ObjectPart obj part -> UUID [$sel:partFrame:ObjectPart] :: ObjectPart obj part -> StateFrame -- | Open op (operation) data Op Op :: UUID -> UUID -> [Atom] -> Op -- | event id (usually timestamp) [$sel:opId:Op] :: Op -> UUID -- | reference to other op; actual semantics depends on the type [$sel:refId:Op] :: Op -> UUID -- | payload [$sel:payload:Op] :: Op -> [Atom] data OpPattern Regular :: OpPattern Delete :: OpPattern Undelete :: OpPattern Create :: OpPattern Ack :: OpPattern Annotation :: OpPattern AnnotationDerived :: OpPattern -- | Op terminator data OpTerm TClosed :: OpTerm TReduced :: OpTerm THeader :: OpTerm TQuery :: OpTerm -- | Reduced chunk representing an object state (i. e. high-level value) data StateChunk StateChunk :: UUID -> UUID -> [Op] -> StateChunk [$sel:stateType:StateChunk] :: StateChunk -> UUID [$sel:stateVersion:StateChunk] :: StateChunk -> UUID [$sel:stateBody:StateChunk] :: StateChunk -> [Op] -- | Frame containing only state chunks type StateFrame = Map UUID StateChunk -- | Universally unique identifier of anything data UUID UUID :: {-# UNPACK #-} !Word64 -> {-# UNPACK #-} !Word64 -> UUID -- | Common chunk data WireChunk Closed :: ClosedOp -> WireChunk Value :: WireReducedChunk -> WireChunk Query :: WireReducedChunk -> WireChunk -- | Common frame type WireFrame = [WireChunk] -- | Common reduced chunk data WireReducedChunk WireReducedChunk :: ClosedOp -> [Op] -> WireReducedChunk [$sel:wrcHeader:WireReducedChunk] :: WireReducedChunk -> ClosedOp [$sel:wrcBody:WireReducedChunk] :: WireReducedChunk -> [Op] opPattern :: Op -> Maybe OpPattern instance GHC.Show.Show (RON.Types.Object a) instance GHC.Classes.Eq (RON.Types.Object a) instance GHC.Show.Show RON.Types.StateChunk instance GHC.Classes.Eq RON.Types.StateChunk instance GHC.Show.Show RON.Types.OpTerm instance GHC.Classes.Eq RON.Types.OpTerm instance GHC.Show.Show RON.Types.WireChunk instance GHC.Generics.Generic RON.Types.WireChunk instance GHC.Classes.Eq RON.Types.WireChunk instance Data.Data.Data RON.Types.WireChunk instance GHC.Show.Show RON.Types.WireReducedChunk instance GHC.Generics.Generic RON.Types.WireReducedChunk instance GHC.Classes.Eq RON.Types.WireReducedChunk instance Data.Data.Data RON.Types.WireReducedChunk instance GHC.Generics.Generic RON.Types.ClosedOp instance GHC.Classes.Eq RON.Types.ClosedOp instance Data.Data.Data RON.Types.ClosedOp instance GHC.Show.Show RON.Types.Op instance Data.Hashable.Class.Hashable RON.Types.Op instance GHC.Generics.Generic RON.Types.Op instance GHC.Classes.Eq RON.Types.Op instance Data.Data.Data RON.Types.Op instance GHC.Show.Show RON.Types.Atom instance Data.Hashable.Class.Hashable RON.Types.Atom instance GHC.Generics.Generic RON.Types.Atom instance GHC.Classes.Eq RON.Types.Atom instance Data.Data.Data RON.Types.Atom instance GHC.Show.Show RON.Types.ClosedOp -- | Binary serializer elements module RON.Binary.Serialize -- | Serialize a frame serialize :: WireFrame -> Either String ByteStringL -- | Serialize an Atom serializeAtom :: Atom -> Either String ByteStringL -- | Serialize a string atom serializeString :: Text -> ByteStringL -- | Binary parser elements module RON.Binary.Parse -- | Parse frame parse :: ByteStringL -> Either String WireFrame -- | Parse an Atom parseAtom :: ByteStringL -> Either String Atom -- | Parse a string atom parseString :: ByteStringL -> Either String Text -- | RON-Binary wire format module RON.Binary -- | Parse frame parse :: ByteStringL -> Either String WireFrame -- | Serialize a frame serialize :: WireFrame -> Either String ByteStringL module RON.Event -- | Calendar format. See https://github.com/gritzko/ron/issues/19. -- Year range is 2010—2350. Precision is 100 ns. data CalendarTime CalendarTime :: Word12 -> Word6 -> Word6 -> Word6 -> Word6 -> Word24 -> CalendarTime [months] :: CalendarTime -> Word12 [days] :: CalendarTime -> Word6 [hours] :: CalendarTime -> Word6 [minutes] :: CalendarTime -> Word6 [seconds] :: CalendarTime -> Word6 [nanosecHundreds] :: CalendarTime -> Word24 -- | Calendar-based Lamport time event, specific case of Event. data CalendarEvent CalendarEvent :: !CalendarTime -> !ReplicaId -> CalendarEvent -- | Epoch-based Lamport time event, specific case of Event. data EpochEvent EpochEvent :: !EpochTime -> !ReplicaId -> EpochEvent -- | RFC 4122 epoch, hundreds of nanoseconds since 1582. Year range is -- 1582—5235. type EpochTime = Word60 -- | Generic Lamport time event. Cannot be Ord because we can't -- compare different types of clocks. If you want comparable events, use -- specific EpochEvent. data Event Event :: !LocalTime -> !ReplicaId -> Event -- | Clock type is encoded in 2 higher bits of variety, value in uuidValue data LocalTime TCalendar :: !CalendarTime -> LocalTime -- | https://en.wikipedia.org/wiki/Logical_clock TLogical :: !Word60 -> LocalTime TEpoch :: !EpochTime -> LocalTime TUnknown :: !Word60 -> LocalTime -- | Replica id assignment style data Naming TrieForked :: Naming CryptoForked :: Naming RecordForked :: Naming ApplicationSpecific :: Naming class Monad m => ReplicaClock m -- | Get current replica id getPid :: ReplicaClock m => m ReplicaId -- | Get sequential timestamps. -- -- Laws: -- --
    --
  1.  t <- getEvents n (t !! i) == head t + i 
  2. --
  3.  t1 <- getEvent t2 <- getEvent t2 >=
    --   t1 + 1 
  4. --
  5. getEvents 0 == getEvents 1
  6. --
getEvents :: ReplicaClock m => EpochTime -> m [EpochEvent] -- | Make local time not less than this advance :: ReplicaClock m => EpochTime -> m () -- | Replica identifier data ReplicaId ReplicaId :: !Naming -> !Word60 -> ReplicaId -- | advance variant for any UUID advanceToUuid :: ReplicaClock clock => UUID -> clock () -- | Make an ApplicationSpecific replica id from arbitrary number applicationSpecific :: Word64 -> ReplicaId decodeEvent :: UUID -> Event encodeEvent :: Event -> UUID fromCalendarEvent :: CalendarEvent -> Event fromEpochEvent :: EpochEvent -> Event -- | Get a single event getEvent :: (HasCallStack, ReplicaClock m) => m EpochEvent -- | Get a single event as UUID getEventUuid :: ReplicaClock m => m UUID -- | Get event sequence as UUIDs getEventUuids :: ReplicaClock m => Word60 -> m [UUID] -- | Make a calendar timestamp from a date mkCalendarDate :: (Word16, Word16, Word8) -> Maybe CalendarTime -- | Make a calendar timestamp from a date and a day time mkCalendarDateTime :: (Word16, Word16, Word8) -> (Word8, Word8, Word8) -> Maybe CalendarTime -- | Make a calendar timestamp from a date, a day time, and a second -- fraction mkCalendarDateTimeNano :: (Word16, Word16, Word8) -> (Word8, Word8, Word8) -> Word32 -> Maybe CalendarTime toEpochEvent :: Event -> Maybe EpochEvent instance GHC.Show.Show RON.Event.EpochEvent instance GHC.Classes.Eq RON.Event.EpochEvent instance GHC.Show.Show RON.Event.CalendarEvent instance GHC.Classes.Eq RON.Event.CalendarEvent instance GHC.Show.Show RON.Event.Event instance GHC.Classes.Eq RON.Event.Event instance Data.Hashable.Class.Hashable RON.Event.ReplicaId instance GHC.Generics.Generic RON.Event.ReplicaId instance GHC.Show.Show RON.Event.ReplicaId instance GHC.Classes.Eq RON.Event.ReplicaId instance GHC.Show.Show RON.Event.Naming instance GHC.Classes.Eq RON.Event.Naming instance GHC.Enum.Enum RON.Event.Naming instance GHC.Enum.Bounded RON.Event.Naming instance GHC.Show.Show RON.Event.LocalTime instance GHC.Classes.Eq RON.Event.LocalTime instance GHC.Show.Show RON.Event.CalendarTime instance GHC.Classes.Ord RON.Event.CalendarTime instance GHC.Classes.Eq RON.Event.CalendarTime instance RON.Event.ReplicaClock m => RON.Event.ReplicaClock (Control.Monad.Trans.Except.ExceptT e m) instance RON.Event.ReplicaClock m => RON.Event.ReplicaClock (Control.Monad.Trans.State.Strict.StateT s m) instance GHC.Classes.Ord RON.Event.EpochEvent instance GHC.Classes.Ord RON.Event.CalendarEvent instance Data.Hashable.Class.Hashable RON.Event.Naming -- | Lamport clock network simulation. ReplicaSimT provides -- Replica and Clock instances, replicas may -- interchange data while they are connected in a NetworkSimT. module RON.Event.Simulation type NetworkSim = NetworkSimT Identity -- | Lamport clock simulation. Key is ReplicaId. Non-present value -- is equivalent to (0, initial). data NetworkSimT m a type ReplicaSim = ReplicaSimT Identity -- | ReplicaSim inside Lamport clock simulation. data ReplicaSimT m a -- | Execute network simulation -- -- Usage: -- --
--   runNetworkSim $ do
--       runReplicaSim r1 $ do
--           actions...
--       runReplicaSim r2 $ do
--           actions...
--       runReplicaSim r1 $ ...
--   
-- -- Each runNetworkSim starts its own networks. One shouldn't use -- in one network events generated in another. runNetworkSim :: NetworkSim a -> a runNetworkSimT :: Monad m => NetworkSimT m a -> m a runReplicaSim :: ReplicaId -> ReplicaSim a -> NetworkSim a runReplicaSimT :: ReplicaId -> ReplicaSimT m a -> NetworkSimT m a instance Control.Monad.Error.Class.MonadError e m => Control.Monad.Error.Class.MonadError e (RON.Event.Simulation.ReplicaSimT m) instance GHC.Base.Monad m => GHC.Base.Monad (RON.Event.Simulation.ReplicaSimT m) instance GHC.Base.Functor m => GHC.Base.Functor (RON.Event.Simulation.ReplicaSimT m) instance GHC.Base.Monad m => GHC.Base.Applicative (RON.Event.Simulation.ReplicaSimT m) instance Control.Monad.Error.Class.MonadError e m => Control.Monad.Error.Class.MonadError e (RON.Event.Simulation.NetworkSimT m) instance GHC.Base.Monad m => GHC.Base.Monad (RON.Event.Simulation.NetworkSimT m) instance GHC.Base.Functor m => GHC.Base.Functor (RON.Event.Simulation.NetworkSimT m) instance GHC.Base.Monad m => GHC.Base.Applicative (RON.Event.Simulation.NetworkSimT m) instance Control.Monad.Trans.Class.MonadTrans RON.Event.Simulation.ReplicaSimT instance GHC.Base.Monad m => RON.Event.ReplicaClock (RON.Event.Simulation.ReplicaSimT m) instance Control.Monad.Trans.Class.MonadTrans RON.Event.Simulation.NetworkSimT module RON.Epoch -- | Real epoch clock. Uses kind of global variable to ensure strict -- monotonicity. data EpochClock a -- | Decode date and time from UUID epoch timestamp decode :: EpochTime -> UTCTime encode :: POSIXTime -> EpochTime -- | Get current time in EpochTime format (with 100 ns resolution). -- Monotonicity is not guaranteed. getCurrentEpochTime :: IO EpochTime -- | Convert unix time in hundreds of milliseconds to RFC 4122 time. localEpochTimeFromUnix :: Word64 -> LocalTime -- | Run EpochClock action with explicit time variable. runEpochClock :: ReplicaId -> IORef EpochTime -> EpochClock a -> IO a -- | Like runEpochClock, but initialize time variable with current -- wall time. runEpochClockFromCurrentTime :: ReplicaId -> EpochClock a -> IO a instance Control.Monad.IO.Class.MonadIO RON.Epoch.EpochClock instance GHC.Base.Monad RON.Epoch.EpochClock instance GHC.Base.Functor RON.Epoch.EpochClock instance GHC.Base.Applicative RON.Epoch.EpochClock instance RON.Event.ReplicaClock RON.Epoch.EpochClock module RON.Text.Serialize.UUID -- | Serialize UUID without context (used for test) serializeUuid :: UUID -> ByteStringL -- | Serialize UUID in op value (atom) context serializeUuidAtom :: UUID -> UUID -> ByteStringL -- | Serialize UUID in op key context serializeUuidKey :: UUID -> UUID -> UUID -> ByteStringL -- | RON-Text serialization module RON.Text.Serialize -- | Serialize a context-free atom serializeAtom :: Atom -> ByteStringL -- | Serialize an object. Return object id that must be stored separately. serializeObject :: Object a -> (UUID, ByteStringL) -- | Serialize a context-free raw op serializeRawOp :: ClosedOp -> ByteStringL -- | Serialize a state frame serializeStateFrame :: StateFrame -> ByteStringL -- | Serialize a string atom serializeString :: Text -> ByteStringL -- | Serialize UUID without context (used for test) serializeUuid :: UUID -> ByteStringL -- | Serialize a common frame serializeWireFrame :: WireFrame -> ByteStringL -- | Serialize a sequence of common frames serializeWireFrames :: [WireFrame] -> ByteStringL -- | RON-Text parsing module RON.Text.Parse -- | Parse an atom parseAtom :: ByteStringL -> Either String Atom -- | Parse a state frame as an object parseObject :: UUID -> ByteStringL -> Either String (Object a) -- | Parse a single context-free op parseOp :: ByteStringL -> Either String ClosedOp -- | Parse a state frame parseStateFrame :: ByteStringL -> Either String StateFrame -- | Parse a string atom parseString :: ByteStringL -> Either String Text -- | Parse a single context-free UUID parseUuid :: ByteStringL -> Either String UUID -- | Parse a UUID in key position parseUuidKey :: UUID -> UUID -> ByteStringL -> Either String UUID -- | Parse a UUID in value (atom) position parseUuidAtom :: UUID -> ByteStringL -> Either String UUID -- | Parse a common frame parseWireFrame :: ByteStringL -> Either String WireFrame -- | Parse a sequence of common frames parseWireFrames :: ByteStringL -> Either String [WireFrame] -- | RON-Text wire format module RON.Text -- | Parse a state frame as an object parseObject :: UUID -> ByteStringL -> Either String (Object a) -- | Parse a state frame parseStateFrame :: ByteStringL -> Either String StateFrame -- | Parse a common frame parseWireFrame :: ByteStringL -> Either String WireFrame -- | Parse a sequence of common frames parseWireFrames :: ByteStringL -> Either String [WireFrame] -- | Serialize an object. Return object id that must be stored separately. serializeObject :: Object a -> (UUID, ByteStringL) -- | Serialize a state frame serializeStateFrame :: StateFrame -> ByteStringL -- | Serialize a common frame serializeWireFrame :: WireFrame -> ByteStringL -- | Serialize a sequence of common frames serializeWireFrames :: [WireFrame] -> ByteStringL