packages feed

bearriver 0.14.7 → 0.14.8

raw patch · 3 files changed

+41/−1 lines, 3 filesPVP ok

version bump matches the API change (PVP)

API changes (from Hackage documentation)

+ FRP.BearRiver.Loop: loopIntegral :: (MonadFix m, Fractional s, VectorSpace c s) => SF m (a, c) (b, c) -> SF m a b
+ FRP.BearRiver.Loop: loopPre :: MonadFix m => c -> SF m (a, c) (b, c) -> SF m a b

Files

CHANGELOG view
@@ -1,3 +1,7 @@+2024-04-23 Ivan Perez <ivan.perez@keera.co.uk>+        * Version bump (0.14.8) (#411).+        * Offer all definitions from FRP.Yampa.Loop (#407).+ 2024-02-21 Ivan Perez <ivan.perez@keera.co.uk>         * Version bump (0.14.7) (#398).         * Limit version of transformers to < 0.6 (#405).
bearriver.cabal view
@@ -30,7 +30,7 @@ build-type:    Simple  name:          bearriver-version:       0.14.7+version:       0.14.8 author:        Ivan Perez, Manuel Bärenz maintainer:    ivan.perez@keera.co.uk homepage:      https://github.com/ivanperez-keera/dunai@@ -87,6 +87,7 @@     FRP.BearRiver.EventS     FRP.BearRiver.Hybrid     FRP.BearRiver.Integration+    FRP.BearRiver.Loop     FRP.BearRiver.Scan     FRP.BearRiver.Switches     FRP.BearRiver.Time
+ src/FRP/BearRiver/Loop.hs view
@@ -0,0 +1,35 @@+-- |+-- Copyright  : (c) Ivan Perez, 2019-2022+--              (c) Ivan Perez and Manuel Baerenz, 2016-2018+-- License    : BSD3+-- Maintainer : ivan.perez@keera.co.uk+--+-- Well-initialised loops.+module FRP.BearRiver.Loop+    (+      -- * Loops with guaranteed well-defined feedback+      loopPre+    , loopIntegral+    )+  where++-- External imports+import Control.Arrow     (loop, second, (>>>))+import Control.Monad.Fix (MonadFix)+import Data.VectorSpace  (VectorSpace)++-- Internal imports+import FRP.BearRiver.Delays       (iPre)+import FRP.BearRiver.Integration  (integral)+import FRP.BearRiver.InternalCore (SF)++-- * Loops with guaranteed well-defined feedback++-- | Loop with an initial value for the signal being fed back.+loopPre :: MonadFix m => c -> SF m (a, c) (b, c) -> SF m a b+loopPre cInit sf = loop (second (iPre cInit) >>> sf)++-- | Loop by integrating the second value in the pair and feeding the result+-- back. Because the integral at time 0 is zero, this is always well defined.+loopIntegral :: (MonadFix m, Fractional s, VectorSpace c s) => SF m (a, c) (b, c) -> SF m a b+loopIntegral sf = loop (second integral >>> sf)