Yampa 0.11 → 0.11.1
raw patch · 5 files changed
+50/−20 lines, 5 filesPVP: major bump suggested
API removals or changes: PVP suggests a major version bump
API changes (from Hackage documentation)
- FRP.Yampa.Core: (>>>) :: Category k cat => cat a b -> cat b c -> cat a c
+ FRP.Yampa.Core: (>>>) :: Category cat => cat a b -> cat b c -> cat a c
- FRP.Yampa.Core: arr :: Arrow a => forall b c. () => (b -> c) -> a b c
+ FRP.Yampa.Core: arr :: Arrow a => b -> c -> a b c
- FRP.Yampa.Core: first :: Arrow a => forall b c d. () => a b c -> a (b, d) (c, d)
+ FRP.Yampa.Core: first :: Arrow a => a b c -> a (b, d) (c, d)
- FRP.Yampa.Core: loop :: ArrowLoop a => forall b d c. () => a (b, d) (c, d) -> a b c
+ FRP.Yampa.Core: loop :: ArrowLoop a => a (b, d) (c, d) -> a b c
Files
- CHANGELOG +6/−0
- Yampa.cabal +1/−1
- src/FRP/Yampa/InternalCore.hs +40/−16
- src/FRP/Yampa/Simulation.hs +2/−2
- src/FRP/Yampa/Switches.hs +1/−1
CHANGELOG view
@@ -1,3 +1,9 @@+2018-08-11 Ivan Perez <ivan.perez@keera.co.uk>+ * Yampa.cabal: Version bump (0.11.1).+ * README.md: Documents papers.+ * src/: Fixes leak.+ * Thanks to @tresormuta, @chriz-keera.+ 2018-04-05 Ivan Perez <ivan.perez@keera.co.uk> * Yampa.cabal: Version bump (0.11). * src/: Adds documentation; makes type synonym a newtype.
Yampa.cabal view
@@ -1,5 +1,5 @@ name: Yampa-version: 0.11+version: 0.11.1 cabal-version: >= 1.8 license: BSD3 license-file: LICENSE
src/FRP/Yampa/InternalCore.hs view
@@ -534,22 +534,46 @@ -- | Choice of which SF to run based on the value of a signal. instance ArrowChoice SF where- left sf = SF $ \a ->- -- NOTE: there might be a problem with choice here.- -- Do the delta times accumulate for the unused branch?- -- Recommendation by Olivier Charles: take a look- -- at Settable Signals paper, it discusses which- -- option would be best.- case a of- Left x -> let (sf', b') = sfTF sf x- in (futureArrowLeft sf', Left b')- Right x -> let sf' = SF' $ \_ -> sfTF sf- in (futureArrowLeft sf', Right x)- where futureArrowLeft fSF = SF' $ \dt a ->- case a of- Left x -> let (sf', b') = sfTF' fSF dt x- in (futureArrowLeft sf', Left b')- Right x -> (futureArrowLeft fSF, Right x)+ -- (+++) :: forall b c b' c' . SF b c -> SF d e -> SF (Either b d) (Either c e)+ sfL +++ sfR = SF $ \a ->+ case a of+ Left b -> let (sf', c) = sfTF sfL b+ in (chooseL sf' sfR, Left c)+ Right d -> let (sf', e) = sfTF sfR d+ in (chooseR sfL sf', Right e)++ where++ -- (+++) for an initialized SF and an SF+ --+ -- chooseL :: SF' b c -> SF d e -> SF' (Either b d) (Either c e)+ chooseL sfCL sfR = SF' $ \dt a ->+ case a of+ Left b -> let (sf', c) = sfTF' sfCL dt b+ in (chooseL sf' sfR, Left c)+ Right d -> let (sf', e) = sfTF sfR d+ in (choose sfCL sf', Right e)++ -- (+++) for an SF and an initialized SF+ --+ -- chooseR :: SF b c -> SF' d e -> SF' (Either b d) (Either c e)+ chooseR sfL sfCR = SF' $ \dt a ->+ case a of+ Left b -> let (sf', c) = sfTF sfL b+ in (choose sf' sfCR, Left c)+ Right d -> let (sf', e) = sfTF' sfCR dt d+ in (chooseR sfL sf', Right e)++ -- (+++) for initialized SFs+ --+ -- choose :: SF' b c -> SF' d e -> SF' (Either b d) (Either c e)+ choose sfCL sfCR = SF' $ \dt a ->+ case a of+ Left b -> let (sf', c) = sfTF' sfCL dt b+ in (choose sf' sfCR, Left c)+ Right d -> let (sf', e) = sfTF' sfCR dt d+ in (choose sfCL sf', Right e)+ -- | Signal Functions as Arrows. See "The Yampa Arcade", by Courtney, Nilsson
src/FRP/Yampa/Simulation.hs view
@@ -17,7 +17,7 @@ -- called /reactimation/, and the latter is called /embedding/. -- -- Normally, to run an SF, you would use 'reactimate', providing input samples,--- and consuming the putput samples in the 'IO' monad. This function takes over+-- and consuming the output samples in the 'IO' monad. This function takes over -- the program, implementing a "main loop". If you want more control over the -- evaluation loop (for instance, if you are using Yampa in combination with a -- backend that also implements some main loop), you may want to use the@@ -125,7 +125,7 @@ reactimate :: Monad m => m a -- ^ Initialization action -> (Bool -> m (DTime, Maybe a)) -- ^ Input sensing action- -> (Bool -> b -> m Bool) -- ^ Actuaction (output processing) action+ -> (Bool -> b -> m Bool) -- ^ Actuation (output processing) action -> SF a b -- ^ Signal function -> m () reactimate init sense actuate (SF {sfTF = tf0}) =
src/FRP/Yampa/Switches.hs view
@@ -51,7 +51,7 @@ --'Functor' or a list ('[]'). -- -- - How the input is router /(B\/Z\/ )/: when multiple SFs are being combined,--- a decision needs to be made about how the input is passed ot the internal+-- a decision needs to be made about how the input is passed to the internal -- SFs. In some cases, broadcasting is used to pass the same input to all -- internal SFs. In others, the input is itself a collection, and each element -- is passed to one internal SF (i.e., /zipping/). In others, an auxiliary