packages feed

Yampa 0.14.9 → 0.14.10

raw patch · 4 files changed

+13/−1 lines, 4 filesPVP ok

version bump matches the API change (PVP)

API changes (from Hackage documentation)

+ FRP.Yampa: trapezoidIntegral :: (Fractional s, VectorSpace a s) => SF a a
+ FRP.Yampa.Integration: trapezoidIntegral :: (Fractional s, VectorSpace a s) => SF a a

Files

CHANGELOG view
@@ -1,3 +1,7 @@+2024-08-07 Ivan Perez <ivan.perez@keera.co.uk>+    * Version bump (0.14.10) (#302).+    * Implement integral using trapezoid rule (#263).+ 2024-06-08 Ivan Perez <ivan.perez@keera.co.uk>     * Version bump (0.14.9) (#299).     * Document FRP.Yampa.Random.streamToSF (#296).
Yampa.cabal view
@@ -30,7 +30,7 @@ build-type:    Simple  name:          Yampa-version:       0.14.9+version:       0.14.10 author:        Henrik Nilsson, Antony Courtney maintainer:    Ivan Perez (ivan.perez@keera.co.uk) homepage:      https://github.com/ivanperez-keera/Yampa/
src/FRP/Yampa.hs view
@@ -280,6 +280,7 @@       -- ** Integration and differentiation     , integral     , imIntegral+    , trapezoidIntegral     , impulseIntegral     , count     , derivative
src/FRP/Yampa/Integration.hs view
@@ -32,6 +32,7 @@       -- * Integration       integral     , imIntegral+    , trapezoidIntegral     , impulseIntegral     , count @@ -70,6 +71,12 @@ -- | \"Immediate\" integration (using the function's value at the current time). imIntegral :: (Fractional s, VectorSpace a s) => a -> SF a a imIntegral = ((\_ a' dt v -> v ^+^ realToFrac dt *^ a') `iterFrom`)++-- | Trapezoid integral (using the average between the value at the last time+-- and the value at the current time).+trapezoidIntegral :: (Fractional s, VectorSpace a s) => SF a a+trapezoidIntegral =+  iterFrom (\a a' dt v -> v ^+^ (realToFrac dt / 2) *^ (a ^+^ a')) zeroVector  -- | Integrate the first input signal and add the /discrete/ accumulation (sum) -- of the second, discrete, input signal.