Skip to content

Commit

Permalink
Merge branch 'release-0.10.0'. Refs #342.
Browse files Browse the repository at this point in the history
  • Loading branch information
ivanperez-keera committed Feb 22, 2023
2 parents 4dcd776 + 629fa31 commit f0585fe
Show file tree
Hide file tree
Showing 8 changed files with 27 additions and 16 deletions.
3 changes: 3 additions & 0 deletions dunai-frp-bearriver/CHANGELOG
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
2023-02-21 Ivan Perez <[email protected]>
* Version bump (0.14.1) (#342).

2022-12-21 Ivan Perez <[email protected]>
* bearriver.cabal: Version bump (0.14) (#340).
* Bump version bounds for MonadRandom (#337).
Expand Down
4 changes: 2 additions & 2 deletions dunai-frp-bearriver/bearriver.cabal
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ cabal-version: >= 1.10
build-type: Simple

name: bearriver
version: 0.14
version: 0.14.1
author: Ivan Perez, Manuel Bärenz
maintainer: [email protected]
homepage: https://github.com/ivanperez-keera/dunai
Expand Down Expand Up @@ -81,7 +81,7 @@ library
build-depends:
base >= 4.6 && <5
, deepseq >= 1.3.0.0 && < 1.5
, dunai >= 0.6.0 && < 0.10
, dunai >= 0.6.0 && < 0.11
, MonadRandom >= 0.2 && < 0.7
, mtl >= 2.1.2 && < 2.3
, simple-affine-space >= 0.1 && < 0.3
Expand Down
4 changes: 4 additions & 0 deletions dunai-test/CHANGELOG
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
2023-02-21 Ivan Perez <[email protected]>
* Version bump (0.10.0) (#342).
* Remove the function FRP.Dunai.LTLPast.prev (#341).

2022-12-21 Ivan Perez <[email protected]>
* Version bump (0.9.2) (#340).

Expand Down
4 changes: 2 additions & 2 deletions dunai-test/dunai-test.cabal
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ cabal-version: >= 1.10
build-type: Simple

name: dunai-test
version: 0.9.2
version: 0.10.0
author: Ivan Perez
maintainer: [email protected]
homepage: https://github.com/ivanperez-keera/dunai
Expand Down Expand Up @@ -74,7 +74,7 @@ library

build-depends:
base >= 4 && < 5
, dunai >= 0.5 && < 0.10
, dunai >= 0.5 && < 0.11
, normaldistribution
, QuickCheck

Expand Down
8 changes: 1 addition & 7 deletions dunai-test/src/FRP/Dunai/LTLPast.hs
Original file line number Diff line number Diff line change
Expand Up @@ -138,12 +138,6 @@ ever' sf = feedback False $ proc (a, last) -> do

-- | Output True at a time if the input at the last time was True.
prev' :: Monad m => SPred m a -> SPred m a
prev' = prev True

-- | Delay output of an MSF by one sample, using the provided argument for the
-- first sample.
{-# DEPRECATED prev "This function is deprecated in dunai-test 0.9 and will be removed." #-}
prev :: Monad m => b -> MSF m a b -> MSF m a b
prev b sf = feedback b $ proc (a, last) -> do
prev' sf = feedback True $ proc (a, last) -> do
b <- sf -< a
returnA -< (last, b)
4 changes: 4 additions & 0 deletions dunai/CHANGELOG
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
2023-02-21 Ivan Perez <[email protected]>
* Version bump (0.10.0) (#342).
* Implement dot in MSF's instance of VectorSpace (#298).

2022-12-21 Ivan Perez <[email protected]>
* Version bump (0.9.2) (#340).
* Bump version bounds for MonadRandom (#337).
Expand Down
2 changes: 1 addition & 1 deletion dunai/dunai.cabal
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ cabal-version: >= 1.10
build-type: Simple

name: dunai
version: 0.9.2
version: 0.10.0
author: Ivan Perez, Manuel Bärenz
maintainer: [email protected]
homepage: https://github.com/ivanperez-keera/dunai
Expand Down
14 changes: 10 additions & 4 deletions dunai/src/Data/MonadicStreamFunction/Instances/VectorSpace.hs
Original file line number Diff line number Diff line change
Expand Up @@ -43,12 +43,18 @@ import Control.Arrow.Util (constantly, elementwise2)
import Data.MonadicStreamFunction.Core (MSF)

-- | Vector-space instance for 'MSF's.
instance (Monad m, VectorSpace v s, Eq s, Floating s)
=> VectorSpace (MSF m a v) s
instance (Monad m, Eq s, Num s, VectorSpace v s, Floating (MSF m a s))
=> VectorSpace (MSF m a v) (MSF m a s)
where
zeroVector = constantly zeroVector
r *^ msf = msf >>^ (r *^)
msf ^/ r = msf >>^ (^/ r)
(*^) = elementwise2 (*^)
(^/) = elementwise2 (^/)
(^+^) = elementwise2 (^+^)
(^-^) = elementwise2 (^-^)
negateVector = (>>^ negateVector)
dot = elementwise2 dot
normalize v = elementwise2 f v (norm v)
where
f v' nv'
| nv' /= 0 = v' ^/ nv'
| otherwise = error "normalize: zero vector"

0 comments on commit f0585fe

Please sign in to comment.