-- Hoogle documentation, generated by Haddock -- See Hoogle, http://www.haskell.org/hoogle/ -- | Automatically generate status for typed-session. -- -- Consider the communication process as a state machine, and this lib -- will generate the required states. @package typed-session-state-algorithm @version 0.4.2.1 module TypedSession.State.Constraint type SubMap = IntMap Int -- | Constraint 1 ~ 2 = Constraint 1 2 2 ~ 3 = Constraint 2 3 data Constraint Constraint :: Int -> Int -> Constraint -- | constrToSubMap >>> constrToSubMap [Constraint 3 1, Constraint -- 4 2, Constraint 4 3] fromList [(2,1),(3,1),(4,1)] constrToSubMap :: [Constraint] -> SubMap instance GHC.Classes.Eq TypedSession.State.Constraint.Constraint instance GHC.Classes.Ord TypedSession.State.Constraint.Constraint instance GHC.Internal.Show.Show TypedSession.State.Constraint.Constraint module TypedSession.State.Type type family XMsg eta type family XLabel eta type family XBranch eta type family XBranchSt eta type family XGoto eta type family XTerminal eta -- | ForallX type ForallX (f :: Type -> Constraint) eta = (f XMsg eta, f XLabel eta, f XBranch eta, f XBranchSt eta, f XGoto eta, f XTerminal eta) -- | BranchSt data BranchSt eta r bst BranchSt :: XBranchSt eta -> bst -> [[String]] -> Protocol eta r bst -> BranchSt eta r bst -- | MsgOrLabel data MsgOrLabel eta r Msg :: XMsg eta -> String -> [[String]] -> r -> r -> MsgOrLabel eta r Label :: XLabel eta -> Int -> MsgOrLabel eta r -- | Protocol data Protocol eta r bst (:>) :: MsgOrLabel eta r -> Protocol eta r bst -> Protocol eta r bst Branch :: XBranch eta -> r -> String -> [BranchSt eta r bst] -> Protocol eta r bst Goto :: XGoto eta -> Int -> Protocol eta r bst Terminal :: XTerminal eta -> Protocol eta r bst infixr 5 :> -- | XTraverse type XTraverse (m :: Type -> Type) eta gama r bst = ((XMsg eta, (String, [[String]], r, r, Protocol eta r bst)) -> m XMsg gama, (XLabel eta, (Int, Protocol eta r bst)) -> m XLabel gama, (XBranch eta, (r, String, [BranchSt eta r bst])) -> m (XBranch gama, m Protocol gama r bst -> m Protocol gama r bst), (XBranchSt eta, (bst, [[String]], Protocol eta r bst)) -> m XBranchSt gama, (XGoto eta, Int) -> m XGoto gama, XTerminal eta -> m XTerminal gama) -- | xtraverse xtraverse :: Monad m => XTraverse m eta gama r bst -> Protocol eta r bst -> m (Protocol gama r bst) -- | XFold type XFold (m :: Type -> Type) eta r bst = ((XMsg eta, (String, [[String]], r, r, Protocol eta r bst)) -> m (), (XLabel eta, Int) -> m (), (XBranch eta, (r, String, [BranchSt eta r bst])) -> m m () -> m (), (XBranchSt eta, (bst, [[String]], Protocol eta r bst)) -> m (), (XGoto eta, Int) -> m (), XTerminal eta -> m ()) -- | xfold xfold :: Monad m => XFold m eta r bst -> Protocol eta r bst -> m () -- | ProtocolError data ProtocolError r bst DefLabelMultTimes :: Int -> ProtocolError r bst LabelUndefined :: Int -> ProtocolError r bst BranchFirstMsgMustHaveTheSameSender :: r -> String -> r -> ProtocolError r bst UndecideStateCanNotSendMsg :: String -> ProtocolError r bst UndecideStateCanNotStartBranch :: [BranchSt (GenConst r) r bst] -> ProtocolError r bst TerminalNeedAllRoleDecide :: String -> ProtocolError r bst BranchAtLeastOneBranch :: ProtocolError r bst AStateOnlyBeUsedForTheSamePair :: ProtocolError r bst MsgDoNotExistBeforeNextTerm :: String -> ProtocolError r bst internalError :: String data Tracer r bst TracerProtocolCreat :: Protocol Creat r bst -> Tracer r bst TracerProtocolIdx :: Protocol Idx r bst -> Tracer r bst TracerReRank :: IntMap Int -> Tracer r bst TracerProtocolAddNum :: Protocol AddNums r bst -> Tracer r bst TracerProtocolGenConst :: Protocol (GenConst r) r bst -> Tracer r bst TracerConstraints :: Seq Constraint -> Tracer r bst TracerSubMap :: SubMap -> Tracer r bst TracerProtocolGenConstN :: Protocol (GenConst r) r bst -> Tracer r bst TracerVerifyResult :: IntMap (r, r) -> Tracer r bst TracerCollectBranchDynVal :: Set Int -> Tracer r bst TracerProtocolMsgT :: Protocol (MsgT r bst) r bst -> Tracer r bst TracerProtocolMsgT1 :: Protocol (MsgT1 r bst) r bst -> Tracer r bst TracerBranchResultTI :: [(r, String, T bst)] -> Map String [(bst, [[String]], T bst)] -> Tracer r bst traceWrapper :: String -> String -> String data Creat data Idx data AddNums data GenConst r data T bst TNum :: Int -> T bst BstList :: Int -> bst -> T bst TAny :: Int -> T bst TEnd :: T bst data MsgT r bst data MsgT1 r bst instance GHC.Internal.Base.Functor (TypedSession.State.Type.BranchSt eta r) instance GHC.Internal.Base.Functor (TypedSession.State.Type.MsgOrLabel eta) instance GHC.Internal.Base.Functor (TypedSession.State.Type.Protocol eta r) instance (Prettyprinter.Internal.Pretty (TypedSession.State.Type.Protocol eta r bst), GHC.Internal.Show.Show (TypedSession.State.Type.XBranchSt eta), GHC.Internal.Show.Show bst) => Prettyprinter.Internal.Pretty (TypedSession.State.Type.BranchSt eta r bst) instance (GHC.Internal.Show.Show (TypedSession.State.Type.XMsg eta), GHC.Internal.Show.Show (TypedSession.State.Type.XLabel eta), GHC.Internal.Show.Show r) => Prettyprinter.Internal.Pretty (TypedSession.State.Type.MsgOrLabel eta r) instance (TypedSession.State.Type.ForallX GHC.Internal.Show.Show eta, GHC.Internal.Show.Show r, GHC.Internal.Show.Show bst) => Prettyprinter.Internal.Pretty (TypedSession.State.Type.Protocol eta r bst) instance (Prettyprinter.Internal.Pretty (TypedSession.State.Type.Protocol eta r bst), GHC.Internal.Show.Show (TypedSession.State.Type.XBranchSt eta), GHC.Internal.Show.Show bst) => GHC.Internal.Show.Show (TypedSession.State.Type.BranchSt eta r bst) instance (GHC.Internal.Show.Show (TypedSession.State.Type.XMsg eta), GHC.Internal.Show.Show (TypedSession.State.Type.XLabel eta), GHC.Internal.Show.Show r) => GHC.Internal.Show.Show (TypedSession.State.Type.MsgOrLabel eta r) instance (TypedSession.State.Type.ForallX GHC.Internal.Show.Show eta, GHC.Internal.Show.Show r, GHC.Internal.Show.Show bst) => GHC.Internal.Show.Show (TypedSession.State.Type.Protocol eta r bst) instance (GHC.Internal.Show.Show r, GHC.Internal.Show.Show bst) => GHC.Internal.Show.Show (TypedSession.State.Type.ProtocolError r bst) instance GHC.Internal.Show.Show bst => GHC.Internal.Show.Show (TypedSession.State.Type.T bst) instance (GHC.Internal.Show.Show r, GHC.Internal.Show.Show bst) => GHC.Internal.Show.Show (TypedSession.State.Type.Tracer r bst) module TypedSession.State.Parser runProtocolParser :: (Enum r, Enum bst, Bounded r, Bounded bst, Show r, Show bst) => String -> Either String (Protocol Creat r bst) module TypedSession.State.Render runRender :: (Enum r, Bounded r, Ord r, Show bst, Show r) => Protocol (MsgT r bst) r bst -> String instance GHC.Internal.Enum.Bounded TypedSession.State.Render.LV instance GHC.Internal.Enum.Bounded TypedSession.State.Render.RV instance GHC.Classes.Eq TypedSession.State.Render.LV instance GHC.Classes.Eq TypedSession.State.Render.RV instance GHC.Internal.Num.Num TypedSession.State.Render.LV instance GHC.Internal.Num.Num TypedSession.State.Render.RV instance GHC.Classes.Ord TypedSession.State.Render.LV instance GHC.Classes.Ord TypedSession.State.Render.RV instance GHC.Internal.Show.Show TypedSession.State.Render.LV instance GHC.Internal.Show.Show TypedSession.State.Render.RV module TypedSession.State.Pipeline pipe :: (Enum r, Bounded r, Eq r, Ord r, Show bst) => Protocol Creat r bst -> Either (ProtocolError r bst) (PipeResult r bst) pipeWithTracer :: (Enum r, Bounded r, Eq r, Ord r, Show bst) => Protocol Creat r bst -> (Seq (Tracer r bst), Either (ProtocolError r bst) (PipeResult r bst)) genGraph :: (Enum r, Bounded r, Show bst, Ord r, Show r) => PipeResult r bst -> String data PipeResult r bst PipeResult :: Protocol (MsgT r bst) r bst -> Protocol (MsgT1 r bst) r bst -> Set Int -> (Int, Int) -> [(String, [(bst, [[String]], T bst)])] -> [(r, String, T bst)] -> [(String, [T bst], [T bst])] -> PipeResult r bst [msgT] :: PipeResult r bst -> Protocol (MsgT r bst) r bst [msgT1] :: PipeResult r bst -> Protocol (MsgT1 r bst) r bst [dnySet] :: PipeResult r bst -> Set Int [stBound] :: PipeResult r bst -> (Int, Int) [branchResultTypeInfo] :: PipeResult r bst -> [(String, [(bst, [[String]], T bst)])] [branchFunList] :: PipeResult r bst -> [(r, String, T bst)] [allMsgBATypes] :: PipeResult r bst -> [(String, [T bst], [T bst])] instance GHC.Classes.Eq TypedSession.State.Pipeline.CurrSt instance GHC.Classes.Eq TypedSession.State.Pipeline.Index instance GHC.Internal.Num.Num TypedSession.State.Pipeline.Index instance GHC.Classes.Ord TypedSession.State.Pipeline.CurrSt instance GHC.Classes.Ord TypedSession.State.Pipeline.Index instance GHC.Internal.Show.Show TypedSession.State.Pipeline.CurrSt instance GHC.Internal.Show.Show TypedSession.State.Pipeline.Index