packages feed

machinecell 3.0.0 → 3.0.1

raw patch · 3 files changed

+44/−20 lines, 3 filesPVP: major bump suggested

API removals or changes: PVP suggests a major version bump

API changes (from Hackage documentation)

- Control.Arrow.Machine.Types: pSwitch :: (ArrowApply a, Traversable col) => (forall sf. (b -> col sf -> col (ext, sf))) -> col (ProcessA a ext c) -> ProcessA a (b, col c) (Event mng) -> (col (ProcessA a ext c) -> mng -> ProcessA a b (col c)) -> ProcessA a b (col c)
+ Control.Arrow.Machine.Types: pSwitch :: (ArrowApply a, Traversable col) => (forall sf. b -> col sf -> col (ext, sf)) -> col (ProcessA a ext c) -> ProcessA a (b, col c) (Event mng) -> (col (ProcessA a ext c) -> mng -> ProcessA a b (col c)) -> ProcessA a b (col c)
- Control.Arrow.Machine.Types: par :: (ArrowApply a, Traversable col) => (forall sf. (b -> col sf -> col (ext, sf))) -> col (ProcessA a ext c) -> ProcessA a b (col c)
+ Control.Arrow.Machine.Types: par :: (ArrowApply a, Traversable col) => (forall sf. b -> col sf -> col (ext, sf)) -> col (ProcessA a ext c) -> ProcessA a b (col c)
- Control.Arrow.Machine.Types: rpSwitch :: (ArrowApply a, Traversable col) => (forall sf. (b -> col sf -> col (ext, sf))) -> col (ProcessA a ext c) -> ProcessA a (b, Event (col (ProcessA a ext c) -> col (ProcessA a ext c))) (col c)
+ Control.Arrow.Machine.Types: rpSwitch :: (ArrowApply a, Traversable col) => (forall sf. b -> col sf -> col (ext, sf)) -> col (ProcessA a ext c) -> ProcessA a (b, Event (col (ProcessA a ext c) -> col (ProcessA a ext c))) (col c)
- Control.Arrow.Machine.Utils: pSwitch :: (ArrowApply a, Traversable col) => (forall sf. (b -> col sf -> col (ext, sf))) -> col (ProcessA a ext c) -> ProcessA a (b, col c) (Event mng) -> (col (ProcessA a ext c) -> mng -> ProcessA a b (col c)) -> ProcessA a b (col c)
+ Control.Arrow.Machine.Utils: pSwitch :: (ArrowApply a, Traversable col) => (forall sf. b -> col sf -> col (ext, sf)) -> col (ProcessA a ext c) -> ProcessA a (b, col c) (Event mng) -> (col (ProcessA a ext c) -> mng -> ProcessA a b (col c)) -> ProcessA a b (col c)
- Control.Arrow.Machine.Utils: par :: (ArrowApply a, Traversable col) => (forall sf. (b -> col sf -> col (ext, sf))) -> col (ProcessA a ext c) -> ProcessA a b (col c)
+ Control.Arrow.Machine.Utils: par :: (ArrowApply a, Traversable col) => (forall sf. b -> col sf -> col (ext, sf)) -> col (ProcessA a ext c) -> ProcessA a b (col c)
- Control.Arrow.Machine.Utils: rpSwitch :: (ArrowApply a, Traversable col) => (forall sf. (b -> col sf -> col (ext, sf))) -> col (ProcessA a ext c) -> ProcessA a (b, Event (col (ProcessA a ext c) -> col (ProcessA a ext c))) (col c)
+ Control.Arrow.Machine.Utils: rpSwitch :: (ArrowApply a, Traversable col) => (forall sf. b -> col sf -> col (ext, sf)) -> col (ProcessA a ext c) -> ProcessA a (b, Event (col (ProcessA a ext c) -> col (ProcessA a ext c))) (col c)

Files

CHANGELOG.md view
@@ -1,3 +1,20 @@+3.0.1+-----------+* Fix performance issue of switch, dSwitch, accum, dAccum.++3.0.0+-----------+* ArrowLoop instance now independent of base arrow's+* Make PlanT newtype and add stop handling MonadPlus instance+* API changes+    * Added `filterJust`, `filterLeft`, `filterRight`+    * Deleted Show and Eq instance of Event type+    * Added Isos of ArrowUtil module+    * Delete state monad handling.+    * Delete unsafe primitives `cycleDelay`, `fitEx`, `unsafeSteady`, `loop'`+    * Delete deperecated `passRecent`, `withRecent`+    * Delete ProcessA ArrowReader instance and added `readerProc`+  2.1.0 -----------
machinecell.cabal view
@@ -1,5 +1,5 @@ name:                machinecell-version:             3.0.0+version:             3.0.1 synopsis:            Arrow based stream transducers license:             BSD3 license-file:        LICENSE@@ -53,4 +53,4 @@ source-repository this   type:		git   location:	https://github.com/as-capabl/machinecell.git-  tag:		release-3.0.0+  tag:		release-3.0.1
src/Control/Arrow/Machine/Types.hs view
@@ -1,6 +1,7 @@ {-# LANGUAGE Trustworthy #-} -- Safe if eliminate GeneralizedNewtypeInstance {-# LANGUAGE Arrows #-} {-# LANGUAGE RankNTypes #-}+{-# LANGUAGE BangPatterns #-} {-# LANGUAGE FlexibleInstances #-} {-# LANGUAGE UndecidableInstances #-} {-# LANGUAGE MultiParamTypeClasses #-}@@ -180,7 +181,7 @@         a b (f c, ProcessA a b c)) ->     (b -> c) ->     ProcessA a b c-makePA h sus = ProcessA {+makePA h !sus = ProcessA {     feed = h >>> first (arr runIdentity),     sweep = h,     suspend = sus@@ -707,26 +708,22 @@ -- -- Switches ---switchCore ::-    (Arrow cat, Arrow a2, Arrow cat1, Occasional t3) =>-    (t4-     -> a2 (t5, (t6, c1)) c1-     -> (t -> t1 -> cat a (t2, t3))-     -> cat1 a1 (c, b))-     -> t4 -> (t1 -> cat a t2) -> cat1 a1 c--switchCore sw cur cont = sw cur (arr test) cont' >>> arr fst-  where-    test (_, (_, evt)) = evt-    cont' _ t = cont t >>> arr (\y -> (y, noEvent))- switch ::      ArrowApply a =>      ProcessA a b (c, Event t) ->      (t -> ProcessA a b c) ->     ProcessA a b c--switch = switchCore kSwitch+switch sf k = makePA+    (proc x ->+      do+        (hy, sf') <- step sf -< x+        let hevt = fmap snd hy+        (case (helperToMaybe hevt)+          of+            Just (Event t) -> step (k t)+            _ -> arr $ const (fst <$> hy, switch sf' k))+                -<< x)+    (fst . suspend sf)   dSwitch :: @@ -734,8 +731,18 @@     ProcessA a b (c, Event t) ->      (t -> ProcessA a b c) ->     ProcessA a b c--dSwitch = switchCore dkSwitch+dSwitch sf k = makePA+    (proc x ->+      do+        (hyevt, sf') <- step sf -< x+        let hevt = fmap snd hyevt+            hy = fmap fst hyevt+        (case (helperToMaybe hevt)+          of+            Just (Event t) -> arr $ const (hy, k t)+            _ -> arr $ const (hy, dSwitch sf' k))+                -<< x)+    (fst . suspend sf)   rSwitch ::