diff --git a/.travis.yml b/.travis.yml index 2d104b18..585467fe 100644 --- a/.travis.yml +++ b/.travis.yml @@ -17,6 +17,11 @@ env: # Note: the distinction between `before_install` and `install` is not important. before_install: + # We remove the pgdg.list file because it's there to add the postgresql + # repository, and we don't need it. Leaving it in causes problems with Ubuntu + # Bionic (the distro is no longer supported by postgresql). + - sudo rm /etc/apt/sources.list.d/pgdg.list + - travis_retry sudo add-apt-repository -y ppa:hvr/ghc - travis_retry sudo apt-get update - travis_retry sudo apt-get install --yes libcwiid-dev libsdl1.2-dev diff --git a/yampa-test/CHANGELOG b/yampa-test/CHANGELOG index 70ea900d..e39431b5 100644 --- a/yampa-test/CHANGELOG +++ b/yampa-test/CHANGELOG @@ -1,3 +1,6 @@ +2024-02-09 Ivan Perez + * Version bump (0.14.7) (#289). + 2023-12-07 Ivan Perez * Version bump (0.14.6) (#282). diff --git a/yampa-test/yampa-test.cabal b/yampa-test/yampa-test.cabal index 5678a2e3..be20f441 100644 --- a/yampa-test/yampa-test.cabal +++ b/yampa-test/yampa-test.cabal @@ -31,7 +31,7 @@ cabal-version: >= 1.10 build-type: Simple name: yampa-test -version: 0.14.6 +version: 0.14.7 author: Ivan Perez maintainer: ivan.perez@keera.co.uk homepage: http://github.com/ivanperez-keera/Yampa @@ -84,7 +84,7 @@ library base >= 4 && < 5 , normaldistribution >= 1.1.0.1 && < 1.2 , QuickCheck >= 2.12 && < 2.15 - , Yampa >= 0.14.6 && < 0.15 + , Yampa >= 0.14.7 && < 0.15 default-language: Haskell2010 diff --git a/yampa/CHANGELOG b/yampa/CHANGELOG index bdfb0030..1e7c4ba3 100644 --- a/yampa/CHANGELOG +++ b/yampa/CHANGELOG @@ -1,3 +1,11 @@ +2024-02-09 Ivan Perez + * Version bump (0.14.7) (#289). + * Remove postgresql repo before installation in CI script (#284). + * Simplify definition of FRP.Yampa.Event.joinE (#285). + * Simplify definition of FRP.Yampa.EventS.isJustEdge (#286). + * Simplify definition of FRP.Yampa.Task.isEdge (#287). + * Remove redundant imports from examples (#288). + 2023-12-07 Ivan Perez * Version bump (0.14.6) (#282). * Document HTML + WebAssembly backend in README (#34). diff --git a/yampa/Yampa.cabal b/yampa/Yampa.cabal index e1778e10..17125c7a 100644 --- a/yampa/Yampa.cabal +++ b/yampa/Yampa.cabal @@ -30,7 +30,7 @@ cabal-version: >= 1.10 build-type: Simple name: Yampa -version: 0.14.6 +version: 0.14.7 author: Henrik Nilsson, Antony Courtney maintainer: Ivan Perez (ivan.perez@keera.co.uk) homepage: https://github.com/ivanperez-keera/Yampa/ @@ -72,6 +72,24 @@ flag examples default: False manual: True +-- WARNING: The following flag exposes Yampa's core. You should avoid using +-- this at all. The only reason to expose it is that we are using Yampa for +-- research, and many extensions require that we expose the constructors. No +-- released project should depend on this. In general, you should always +-- install Yampa with this flag disabled. +flag expose-core + description: + You can enable exposing some of Yampa's core constructs using + -fexpose-core. + . + Enabling this is an unsupported configuration, but it may be useful if you + are building an extension of Yampa for research and do not wish to fork + Yampa completely. + . + No released project should ever depend on this. + default: False + manual: True + library exposed-modules: @@ -95,7 +113,6 @@ library other-modules: -- Auxiliary (commonly used) types FRP.Yampa.Diagnostics - FRP.Yampa.InternalCore build-depends: base < 6 @@ -117,6 +134,14 @@ library build-depends: fail == 4.9.* + if flag(expose-core) + exposed-modules: + FRP.Yampa.InternalCore + else + other-modules: + FRP.Yampa.InternalCore + + test-suite hlint type: exitcode-stdio-1.0 diff --git a/yampa/examples/yampa-game/MainBouncingBox.hs b/yampa/examples/yampa-game/MainBouncingBox.hs index 6165cbfa..e315d7f7 100644 --- a/yampa/examples/yampa-game/MainBouncingBox.hs +++ b/yampa/examples/yampa-game/MainBouncingBox.hs @@ -1,6 +1,4 @@ {-# LANGUAGE Arrows #-} -import Data.IORef -import Debug.Trace import FRP.Yampa as Yampa import Graphics.UI.SDL as SDL diff --git a/yampa/examples/yampa-game/MainCircleMouse.hs b/yampa/examples/yampa-game/MainCircleMouse.hs index aba035b8..fbeb6ee5 100644 --- a/yampa/examples/yampa-game/MainCircleMouse.hs +++ b/yampa/examples/yampa-game/MainCircleMouse.hs @@ -1,6 +1,5 @@ {-# LANGUAGE Arrows #-} import Data.IORef -import Debug.Trace import FRP.Yampa as Yampa import Graphics.UI.SDL as SDL diff --git a/yampa/examples/yampa-game/MainWiimote.hs b/yampa/examples/yampa-game/MainWiimote.hs index ebae199a..9b9a68eb 100644 --- a/yampa/examples/yampa-game/MainWiimote.hs +++ b/yampa/examples/yampa-game/MainWiimote.hs @@ -2,7 +2,6 @@ import Control.Monad import Data.IORef import Data.Maybe -import Debug.Trace import FRP.Yampa as Yampa import Graphics.UI.SDL as SDL import System.CWiid diff --git a/yampa/src/FRP/Yampa/Event.hs b/yampa/src/FRP/Yampa/Event.hs index 4b4fb566..816b56e2 100644 --- a/yampa/src/FRP/Yampa/Event.hs +++ b/yampa/src/FRP/Yampa/Event.hs @@ -270,9 +270,8 @@ catEvents eas = case [ a | Event a <- eas ] of -- Applicative-based definition: -- joinE = liftA2 (,) joinE :: Event a -> Event b -> Event (a, b) -joinE NoEvent _ = NoEvent -joinE _ NoEvent = NoEvent joinE (Event l) (Event r) = Event (l, r) +joinE _ _ = NoEvent -- | Split event carrying pairs into two events. splitE :: Event (a, b) -> (Event a, Event b) diff --git a/yampa/src/FRP/Yampa/EventS.hs b/yampa/src/FRP/Yampa/EventS.hs index b97299ce..52c86259 100644 --- a/yampa/src/FRP/Yampa/EventS.hs +++ b/yampa/src/FRP/Yampa/EventS.hs @@ -249,10 +249,8 @@ edgeTag a = edge >>> arr (`tag` a) edgeJust :: SF (Maybe a) (Event a) edgeJust = edgeBy isJustEdge (Just undefined) where - isJustEdge Nothing Nothing = Nothing isJustEdge Nothing ma@(Just _) = ma - isJustEdge (Just _) (Just _) = Nothing - isJustEdge (Just _) Nothing = Nothing + isJustEdge _ _ = Nothing -- | Edge detector parameterized on the edge detection function and initial -- state, i.e., the previous input sample. The first argument to the edge diff --git a/yampa/src/FRP/Yampa/Task.hs b/yampa/src/FRP/Yampa/Task.hs index bde214eb..a6a03585 100644 --- a/yampa/src/FRP/Yampa/Task.hs +++ b/yampa/src/FRP/Yampa/Task.hs @@ -94,10 +94,8 @@ taskToSF tk = runTask tk "Task terminated!")) &&& edgeBy isEdge (Left undefined)) where - isEdge (Left _) (Left _) = Nothing - isEdge (Left _) (Right c) = Just c - isEdge (Right _) (Right _) = Nothing - isEdge (Right _) (Left _) = Nothing + isEdge (Left _) (Right c) = Just c + isEdge _ _ = Nothing -- * Functor, Applicative and Monad instance