machinecell 4.0.0 → 4.0.1
raw patch · 2 files changed
+49/−31 lines, 2 filesdep ~basedep ~free
Dependency ranges changed: base, free
Files
- machinecell.cabal +17/−17
- src/Control/Arrow/Machine/Types.hs +32/−14
machinecell.cabal view
@@ -1,13 +1,13 @@ name: machinecell-version: 4.0.0+version: 4.0.1 synopsis: Arrow based stream transducers license: BSD3 license-file: LICENSE author: Hidenori Azuma maintainer: Hidenori Azuma <as.capabl@gmail.com>-stability: experimental-homepage: http://github.com/as-capabl/machinecell-bug-reports: http://github.com/as-capabl/machinecell/issues+stability: experimental+homepage: http://github.com/as-capabl/machinecell+bug-reports: http://github.com/as-capabl/machinecell/issues copyright: Copyright (c) 2014 Hidenori Azuma category: Control, FRP, Reactivity build-type: Simple@@ -15,12 +15,12 @@ cabal-version: >=1.10 description:- Stream processing library similar to pipes, couduit, or machines.- .- Arrow combinatins are supported and can be used with the arrow notation.- AFRP-like utilities are also available.- .- A quick introduction is available in the Control.Arrow.Machine documentation.+ Stream processing library similar to pipes, couduit, or machines.+ .+ Arrow combinatins are supported and can be used with the arrow notation.+ AFRP-like utilities are also available.+ .+ A quick introduction is available in the Control.Arrow.Machine documentation. flag arrow-tr description:@@ -42,7 +42,7 @@ Control.Arrow.Machine.Misc.Discrete other-extensions: FlexibleInstances, Arrows, RankNTypes, TypeSynonymInstances, MultiParamTypeClasses, GADTs, FlexibleContexts, NoMonomorphismRestriction, RecursiveDo ghc-options: -Wall- build-depends: base >=4.7.0.0 && <5.0, mtl >=2.2.1 && <3, free >=4.12.3 && <5, semigroups >=0.18.1 && <1, profunctors >=5.2 && <6, transformers >=0.5.0.0 && <1+ build-depends: base >=4.8 && <5.0, mtl >=2.2.1 && <3, free >=4.12.3 && <5.1, semigroups >=0.18.1 && <1, profunctors >=5.2 && <6, transformers >=0.5.0.0 && <1 hs-source-dirs: src default-language: Haskell2010 @@ -74,11 +74,11 @@ Build-depends: base >=4.0 && <5.0, doctest >=0.3.0 source-repository head- type: git- location: https://github.com/as-capabl/machinecell.git- branch: master+ type: git+ location: https://github.com/as-capabl/machinecell.git+ branch: master source-repository this- type: git- location: https://github.com/as-capabl/machinecell.git- tag: release-4.0.0+ type: git+ location: https://github.com/as-capabl/machinecell.git+ tag: release-4.0.1
src/Control/Arrow/Machine/Types.hs view
@@ -123,7 +123,7 @@ import Control.Applicative import qualified Data.Foldable as Fd import Data.Traversable as Tv-import Data.Semigroup (Semigroup, (<>))+import Data.Semigroup (Semigroup ((<>))) import Data.Maybe (fromMaybe, isNothing, isJust) import qualified Control.Monad.Trans.Free.Church as F import GHC.Exts (build)@@ -135,15 +135,20 @@ data Phase = Feed | Sweep | Suspend deriving (Eq, Show) instance+ Semigroup Phase+ where+ (<>) Feed _ = Feed+ (<>) _ Feed = Feed+ (<>) Suspend _ = Suspend+ (<>) _ Suspend = Suspend+ (<>) Sweep Sweep = Sweep++instance Monoid Phase where mempty = Sweep - mappend Feed _ = Feed- mappend _ Feed = Feed- mappend Suspend _ = Suspend- mappend _ Suspend = Suspend- mappend Sweep Sweep = Sweep+ mappend = (<>) type ProcType a b c = ProcessT a b c@@ -375,6 +380,11 @@ pf <*> px = (pf &&& px) >>> arr (uncurry ($)) instance+ (Monad m, Semigroup o) => Semigroup (ProcessT m i o)+ where+ (<>) = liftA2 (<>)++instance (Monad m, Monoid o) => Monoid (ProcessT m i o) where mempty = pure mempty@@ -552,17 +562,20 @@ instance+ Semigroup a => Semigroup (Event a)+ where+ Event x <> Event y = Event (x <> y)+ Event x <> _ = Event x+ _ <> Event y = Event y+ NoEvent <> _ = NoEvent+ _ <> NoEvent = NoEvent+ _ <> _ = End++instance Semigroup a => Monoid (Event a) where mempty = End- Event x `mappend` Event y = Event (x <> y)- Event x `mappend` _ = Event x- _ `mappend` Event y = Event y- NoEvent `mappend` _ = NoEvent- _ `mappend` NoEvent = NoEvent- _ `mappend` _ = End--+ mappend = (<>) -- | Signals that can be absent(`NoEvent`) or end. -- For composite structure, `collapse` can be defined as monoid sum of all member occasionals.@@ -605,6 +618,11 @@ end = burst End data ZeroEvent = ZeroEvent deriving (Eq, Show, Enum, Bounded)++instance+ Semigroup ZeroEvent+ where+ _ <> _ = ZeroEvent instance Monoid ZeroEvent