netwire 4.0.1 → 4.0.2
raw patch · 4 files changed
+80/−11 lines, 4 filesPVP: major bump suggested
API removals or changes: PVP suggests a major version bump
API changes (from Hackage documentation)
- Control.Wire: Proxy :: Proxy
- Control.Wire: data Proxy (t :: k) :: k -> *
- Control.Wire.Prefab.Move: instance Typeable ObjectDiff
- Control.Wire.Prefab.Move: instance Typeable ObjectState
- Control.Wire.TimedMap: instance Typeable TimedMap
+ Control.Wire: class Profunctor (h :: * -> * -> *)
+ Control.Wire: lmap :: Profunctor h => (a -> b) -> h b c -> h a c
+ Control.Wire: rmap :: Profunctor h => (b -> c) -> h a b -> h a c
+ Control.Wire.Prefab.Accum: accum1 :: (b -> a -> b) -> b -> Wire e m a b
+ Control.Wire.Prefab.Accum: accumT1 :: (Time -> b -> a -> b) -> b -> Wire e m a b
+ Control.Wire.Prefab.Move: instance Typeable1 ObjectDiff
+ Control.Wire.Prefab.Move: instance Typeable1 ObjectState
+ Control.Wire.Prefab.Move: integral1 :: VectorSpace b => b -> Wire e m (b, Scalar b) b
+ Control.Wire.Prefab.Move: integral1_ :: (Monad m, VectorSpace b, Scalar b ~ Time) => b -> Wire e m b b
+ Control.Wire.Prefab.Move: integralLim1 :: VectorSpace b => (w -> b -> b -> b) -> b -> Wire e m ((b, w), Scalar b) b
+ Control.Wire.Prefab.Move: integralLim1_ :: (VectorSpace b, Scalar b ~ Time) => (w -> b -> b -> b) -> b -> Wire e m (b, w) b
+ Control.Wire.TimedMap: instance Typeable3 TimedMap
- Control.Wire: class (Typeable * e, Show e) => Exception e
+ Control.Wire: class (Typeable e, Show e) => Exception e
- Control.Wire.Prefab.Move: integralLim_ :: (Monad m, VectorSpace b, Scalar b ~ Time) => (w -> b -> b -> b) -> b -> Wire e m (b, w) b
+ Control.Wire.Prefab.Move: integralLim_ :: (VectorSpace b, Scalar b ~ Time) => (w -> b -> b -> b) -> b -> Wire e m (b, w) b
- Control.Wire.Prefab.Move: integral_ :: (Monad m, VectorSpace b, Scalar b ~ Time) => b -> Wire e m b b
+ Control.Wire.Prefab.Move: integral_ :: (VectorSpace b, Scalar b ~ Time) => b -> Wire e m b b
Files
- Control/Wire.hs +3/−3
- Control/Wire/Prefab/Accum.hs +23/−4
- Control/Wire/Prefab/Move.hs +53/−3
- netwire.cabal +1/−1
Control/Wire.hs view
@@ -50,9 +50,9 @@ module Control.Applicative, module Control.Arrow, module Control.Category,- module Data.Profunctor,+ module Data.Proxy, module System.Random,- Proxy(..),+ Profunctor(..), Exception(..), SomeException(..) )@@ -68,7 +68,7 @@ import Control.Wire.Trans import Control.Wire.Types import Control.Wire.Wire hiding (constant, identity, never)-import Data.Profunctor hiding (WrappedArrow(..))+import Data.Profunctor import Data.Proxy (Proxy(..)) import System.Random
Control/Wire/Prefab/Accum.hs view
@@ -12,6 +12,8 @@ -- ** Accumulation accum, accumT,+ accum1,+ accumT1, -- ** Function iteration iterateW, iterateWT,@@ -41,10 +43,18 @@ accum f = accumT (const f) +-- | Non-delaying variant of 'accum'.+--+-- * Depends: current instant.++accum1 :: (b -> a -> b) -> b -> Wire e m a b+accum1 f = accumT1 (const f)++ -- | Like 'accum', but the accumulation function also receives the -- current time delta. ----- * Depends: previous instant, time.+-- * Depends: previous instant. accumT :: (Time -> b -> a -> b) -> b -> Wire e m a b accumT f x' =@@ -52,6 +62,17 @@ x' `seq` (Right x', accumT f (f dt x' x)) +-- | Non-delaying variant of 'accumT'.+--+-- * Depends: current instant.++accumT1 :: (Time -> b -> a -> b) -> b -> Wire e m a b+accumT1 f x' =+ mkPure $ \dt x ->+ let y = f dt x' x in+ y `seq` (Right y, accumT f y)++ -- | Counts from the given vector adding the current input for the next -- instant. --@@ -76,8 +97,6 @@ -- | Like 'iterate', but the accumulation function also receives the -- current time delta.------ * Depends: time. iterateWT :: (Time -> b -> b) -> b -> Wire e m a b iterateWT f = accumT (\dt x _ -> f dt x)@@ -104,7 +123,7 @@ -- current time delta. -- -- * Depends: current instant, if the unfolding function is strict in--- its third argument, time.+-- its third argument. unfoldT :: (Time -> s -> a -> (b, s)) -> s -> Wire e m a b unfoldT f s' =
Control/Wire/Prefab/Move.hs view
@@ -15,6 +15,10 @@ integral_, integralLim, integralLim_,+ integral1,+ integral1_,+ integralLim1,+ integralLim1_, -- ** Differentials derivative, derivative_,@@ -110,15 +114,37 @@ integral = accum (\x (dx, dt) -> x ^+^ dt *^ dx) +-- | Non-delaying variant of 'integral'.+--+-- * Depends: current instant.++integral1 ::+ (VectorSpace b)+ => b+ -> Wire e m (b, Scalar b) b+integral1 = accum1 (\x (dx, dt) -> x ^+^ dt *^ dx)++ -- | Same as 'integral', but with respect to time. -- -- * Depends: previous instant. integral_ ::+ (VectorSpace b, Scalar b ~ Time)+ => b+ -> Wire e m b b+integral_ = accumT (\dt x dx -> x ^+^ dt *^ dx)+++-- | Non-delaying variant of 'integral_'.+--+-- * Depends: current instant.++integral1_ :: (Monad m, VectorSpace b, Scalar b ~ Time) => b -> Wire e m b b-integral_ x = integral x . (id &&& dtime)+integral1_ = accumT1 (\dt x dx -> x ^+^ dt *^ dx) -- | Variant of 'integral', where you can specify a post-update@@ -137,16 +163,40 @@ integralLim uf = accum (\x ((dx, w), dt) -> uf w x (x ^+^ dt *^ dx)) +-- | Non-delaying variant of 'integralLim'.+--+-- * Depends: current instant.++integralLim1 ::+ (VectorSpace b)+ => (w -> b -> b -> b) -- ^ Post-update function.+ -> b -- ^ Initial value.+ -> Wire e m ((b, w), Scalar b) b+integralLim1 uf = accum1 (\x ((dx, w), dt) -> uf w x (x ^+^ dt *^ dx))++ -- | Same as 'integralLim', but with respect to time. -- -- * Depends: previous instant. integralLim_ ::- (Monad m, VectorSpace b, Scalar b ~ Time)+ (VectorSpace b, Scalar b ~ Time) => (w -> b -> b -> b) -> b -> Wire e m (b, w) b-integralLim_ uf x0 = integralLim uf x0 . (id &&& dtime)+integralLim_ uf = accumT (\dt x (dx, w) -> uf w x (x ^+^ dt *^ dx))+++-- | Non-delaying variant of 'integralLim_'.+--+-- * Depends: current instant.++integralLim1_ ::+ (VectorSpace b, Scalar b ~ Time)+ => (w -> b -> b -> b)+ -> b+ -> Wire e m (b, w) b+integralLim1_ uf = accumT1 (\dt x (dx, w) -> uf w x (x ^+^ dt *^ dx)) -- | Objects are generalized integrals. They are controlled through
netwire.cabal view
@@ -1,5 +1,5 @@ Name: netwire-Version: 4.0.1+Version: 4.0.2 Category: Control, FRP Synopsis: Flexible wire arrows for FRP Maintainer: Ertugrul Söylemez <es@ertes.de>