packages feed

typed-session-state-algorithm 0.4.2.1 → 0.4.2.2

raw patch · 2 files changed

+5/−25 lines, 2 files

Files

src/TypedSession/State/Pipeline.hs view
@@ -49,7 +49,7 @@  addIdxXTraverse   :: forall r bst sig m-   . ( Has (State Int :+: State Index :+: State (Set Int)) sig m+   . ( Has (State Int :+: State Index) sig m      , Enum r      , Bounded r      , Ord r@@ -66,7 +66,6 @@   , const get   , \(_, _) -> do       inputIdx <- get @Int-      modify (Set.insert inputIdx)       pure (inputIdx, id)   , \_ -> do       put (Index 0)@@ -75,22 +74,6 @@   , const get   ) -reRank :: Set Int -> Int -> IntMap Int-reRank branchValSet maxSize =-  let allSet = Set.insert 0 branchValSet-      restList = [i | i <- [0 .. maxSize], i `Set.notMember` allSet]-   in IntMap.fromList $ zip (Set.toList allSet ++ restList) [0 ..]--reRankXTraverse :: (Monad m) => IntMap Int -> XTraverse m Idx Idx r bst-reRankXTraverse sbm =-  ( \((a, b, idx), _) -> pure (replaceVal sbm a, replaceVal sbm b, idx)-  , \(xs, _) -> pure (replaceVal sbm xs)-  , \(a, _) -> pure (replaceVal sbm a, id)-  , \_ -> pure ()-  , \(xs, _) -> pure (replaceVal sbm xs)-  , \xs -> pure (replaceVal sbm xs)-  )- addNumsXTraverse   :: forall r bst sig m    . ( Has (Error (ProtocolError r bst)) sig m@@ -388,16 +371,13 @@   -> m (PipeResult r bst) pipe' trace prot0 = do   trace (TracerProtocolCreat prot0)-  (brSet, (maxSzie, (_, idxProt))) <--    runState @(Set Int) Set.empty+  idxProt <-+    fmap (snd . snd)       . runState @Int 0       . runState @Index (Index 100)       $ (xtraverse addIdxXTraverse prot0)   trace (TracerProtocolIdx idxProt)-  trace (TracerReRank (reRank brSet maxSzie))-  idxProt1 <- xtraverse (reRankXTraverse (reRank brSet maxSzie)) idxProt-  trace (TracerProtocolIdx idxProt1)-  prot1 <- xtraverse addNumsXTraverse idxProt1+  prot1 <- xtraverse addNumsXTraverse idxProt   trace (TracerProtocolAddNum prot1)   prot2 <- xtraverse toGenConstrXTraverse prot1   trace (TracerProtocolGenConst prot2)
typed-session-state-algorithm.cabal view
@@ -20,7 +20,7 @@ -- PVP summary:     +-+------- breaking API changes --                  | | +----- non-breaking API additions --                  | | | +--- code changes with no API change-version:            0.4.2.1+version:            0.4.2.2  -- A short (one-line) description of the package. synopsis: Automatically generate status for typed-session.