Skip to content

Commit

Permalink
Merge branch 'release-0.14.5'. Refs #278.
Browse files Browse the repository at this point in the history
  • Loading branch information
ivanperez-keera committed Oct 8, 2023
2 parents 0e1c722 + 977932e commit c24510f
Show file tree
Hide file tree
Showing 8 changed files with 35 additions and 26 deletions.
4 changes: 4 additions & 0 deletions yampa-test/CHANGELOG
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
2023-10-07 Ivan Perez <[email protected]>
* Version bump (0.14.5) (#278).
* Move test for consistency with module tested (#267).

2023-08-07 Ivan Perez <[email protected]>
* Version bump (0.14.4) (#274).
* Add version bounds to dependencies (#273).
Expand Down
18 changes: 9 additions & 9 deletions yampa-test/tests/Test/FRP/Yampa/Event.hs
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,6 @@ tests = testGroup "Regression tests for FRP.Yampa.Event"
, testApplicative
, testMonad
, testAlternative
, testProperty "maybeToEvent" testMaybeToEvent
, testEvent
, testProperty "fromEvent" testFromEvent
, testProperty "isEvent" testIsEvent
Expand All @@ -58,6 +57,7 @@ tests = testGroup "Regression tests for FRP.Yampa.Event"
, testProperty "filterE" testFilterE
, testProperty "mapFilterE" testMapFilterE
, testProperty "gate" testGate
, testProperty "maybeToEvent" testMaybeToEvent
]

-- * The Event type
Expand Down Expand Up @@ -227,14 +227,6 @@ testAlternative = testGroup "alternative"
testAlternativeEmptyIdRight =
forAll randomEvent $ \e ->
(e <|> noEvent ) == e

-- * Internal utilities for event construction

-- | maybeToEvent
testMaybeToEvent :: Property
testMaybeToEvent =
forAll randomMaybe $ \m ->
event Nothing Just (maybeToEvent m) == m
-- * Utility functions similar to those available for Maybe

-- | event
Expand Down Expand Up @@ -438,6 +430,14 @@ testGate =
forAll randomBool $ \b ->
gate e b == filterE (const b) e

-- * Utilities for easy event construction

-- | maybeToEvent
testMaybeToEvent :: Property
testMaybeToEvent =
forAll randomMaybe $ \m ->
event Nothing Just (maybeToEvent m) == m

-- * Arbitrary value generation

instance Arbitrary a => Arbitrary (Event a) where
Expand Down
4 changes: 2 additions & 2 deletions yampa-test/yampa-test.cabal
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ cabal-version: >= 1.10
build-type: Simple

name: yampa-test
version: 0.14.4
version: 0.14.5
author: Ivan Perez
maintainer: [email protected]
homepage: http://github.com/ivanperez-keera/Yampa
Expand Down Expand Up @@ -84,7 +84,7 @@ library
base >= 4 && < 5
, normaldistribution >= 1.1.0.1 && < 1.2
, QuickCheck >= 2.12 && < 2.15
, Yampa >= 0.14.4 && < 0.15
, Yampa >= 0.14.5 && < 0.15

default-language:
Haskell2010
Expand Down
6 changes: 6 additions & 0 deletions yampa/CHANGELOG
Original file line number Diff line number Diff line change
@@ -1,3 +1,9 @@
2023-10-07 Ivan Perez <[email protected]>
* Version bump (0.14.5) (#278).
* Define Yampa.FRP.Task.return in terms of pure (#276).
* Add link to new publication (#277).
* Make FRP.Yampa.Event.maybeToEvent public (#267).

2023-08-07 Ivan Perez <[email protected]>
* Version bump (0.14.4) (#274).
* Introduce benchmark (#167).
Expand Down
1 change: 1 addition & 0 deletions yampa/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -351,6 +351,7 @@ Documentation is also available in the
## Publications
<sup>[(Back to top)](#table-of-contents)</sup>

* [The Beauty and Elegance of Functional Reactive Animation](https://dl.acm.org/doi/10.1145/3609023.3609806?cid=99658741366) (Ivan Perez; 2023)
* [Extensible and Robust Functional Reactive Programming](http://www.cs.nott.ac.uk/~psxip1/papers/2017-Perez-thesis-latest.pdf) (Ivan Perez; 2017)
* [Testing and Debugging Functional Reactive Programming](http://dl.acm.org/authorize?N46564) (Ivan Perez and Henrik Nilsson; 2017)
* [Functional Reactive Programming, Refactored](http://dl.acm.org/authorize?N34896) (Ivan Perez, Manuel Bärenz, and Henrik Nilsson; 2016)
Expand Down
2 changes: 1 addition & 1 deletion yampa/Yampa.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: Yampa
version: 0.14.4
version: 0.14.5
author: Henrik Nilsson, Antony Courtney
maintainer: Ivan Perez ([email protected])
homepage: https://github.com/ivanperez-keera/Yampa/
Expand Down
24 changes: 11 additions & 13 deletions yampa/src/FRP/Yampa/Event.hs
Original file line number Diff line number Diff line change
Expand Up @@ -35,9 +35,6 @@ module FRP.Yampa.Event
, noEventFst
, noEventSnd

-- * Internal utilities for event construction
, maybeToEvent

-- * Utility functions similar to those available for Maybe
, event
, fromEvent
Expand All @@ -64,6 +61,10 @@ module FRP.Yampa.Event
, filterE
, mapFilterE
, gate

-- * Utilities for easy event construction
, maybeToEvent

)
where

Expand Down Expand Up @@ -167,16 +168,6 @@ instance NFData a => NFData (Event a) where
rnf NoEvent = ()
rnf (Event a) = rnf a `seq` ()

-- * Internal utilities for event construction

-- These utilities are to be considered strictly internal to Yampa for the time
-- being.

-- | Convert a maybe value into a event ('Event' is isomorphic to 'Maybe').
maybeToEvent :: Maybe a -> Event a
maybeToEvent Nothing = NoEvent
maybeToEvent (Just a) = Event a

-- * Utility functions similar to those available for Maybe

-- | An event-based version of the maybe function.
Expand Down Expand Up @@ -304,3 +295,10 @@ mapFilterE f e = e >>= (maybeToEvent . f)
gate :: Event a -> Bool -> Event a
_ `gate` False = NoEvent
e `gate` True = e

-- * Utilities for easy event construction

-- | Convert a maybe value into a event ('Event' is isomorphic to 'Maybe').
maybeToEvent :: Maybe a -> Event a
maybeToEvent Nothing = NoEvent
maybeToEvent (Just a) = Event a
2 changes: 1 addition & 1 deletion yampa/src/FRP/Yampa/Task.hs
Original file line number Diff line number Diff line change
Expand Up @@ -110,7 +110,7 @@ instance Applicative (Task a b) where

instance Monad (Task a b) where
tk >>= f = Task (\k -> unTask tk (\c -> unTask (f c) k))
return x = Task (\k -> k x)
return = pure

-- Let's check the monad laws:
--
Expand Down

0 comments on commit c24510f

Please sign in to comment.