Portability | portable |
---|---|

Stability | provisional |

Maintainer | nilsson@cs.yale.edu |

Derived utility definitions.

ToDo:

- Possibly add impulse :: VectorSpace a k => a -> Event a But to do that, we need access to Event, which we currently do not have.
- The general arrow utilities should be moved to a module FRP.Animas.Utilities.
- I'm not sure structuring the Animas "core" according to what is
core functionality and what's not is all that useful. There are
many cases where we want to implement combinators that fairly
easily could be implemented in terms of others as primitives simply
because we expect that that implementation is going to be much more
efficient, and that the combinators are used sufficiently often to
warrant doing this. E.g.
`switch`

should be a primitive, even though it could be derived from`pSwitch`

. - Reconsider
`recur`

. If an event source has an immediate occurrence, we'll get into a loop. For example: recur now. Maybe suppress initial occurrences? Initial occurrences are rather pointless in this case anyway.

- arr2 :: Arrow a => (b -> c -> d) -> a (b, c) d
- arr3 :: Arrow a => (b -> c -> d -> e) -> a (b, c, d) e
- arr4 :: Arrow a => (b -> c -> d -> e -> f) -> a (b, c, d, e) f
- arr5 :: Arrow a => (b -> c -> d -> e -> f -> g) -> a (b, c, d, e, f) g
- lift0 :: Arrow a => c -> a b c
- lift1 :: Arrow a => (c -> d) -> a b c -> a b d
- lift2 :: Arrow a => (c -> d -> e) -> a b c -> a b d -> a b e
- lift3 :: Arrow a => (c -> d -> e -> f) -> a b c -> a b d -> a b e -> a b f
- lift4 :: Arrow a => (c -> d -> e -> f -> g) -> a b c -> a b d -> a b e -> a b f -> a b g
- lift5 :: Arrow a => (c -> d -> e -> f -> g -> h) -> a b c -> a b d -> a b e -> a b f -> a b g -> a b h
- snap :: SF a (Event a)
- snapAfter :: Time -> SF a (Event a)
- sample :: Time -> SF a (Event a)
- recur :: SF a (Event b) -> SF a (Event b)
- andThen :: SF a (Event b) -> SF a (Event b) -> SF a (Event b)
- sampleWindow :: Int -> Time -> SF a (Event [a])
- parZ :: [SF a b] -> SF [a] [b]
- pSwitchZ :: [SF a b] -> SF ([a], [b]) (Event c) -> ([SF a b] -> c -> SF [a] [b]) -> SF [a] [b]
- dpSwitchZ :: [SF a b] -> SF ([a], [b]) (Event c) -> ([SF a b] -> c -> SF [a] [b]) -> SF [a] [b]
- rpSwitchZ :: [SF a b] -> SF ([a], Event ([SF a b] -> [SF a b])) [b]
- drpSwitchZ :: [SF a b] -> SF ([a], Event ([SF a b] -> [SF a b])) [b]
- provided :: (a -> Bool) -> SF a b -> SF a b -> SF a b
- old_dHold :: a -> SF (Event a) a
- dTrackAndHold :: a -> SF (Maybe a) a
- old_accumHold :: a -> SF (Event (a -> a)) a
- old_dAccumHold :: a -> SF (Event (a -> a)) a
- old_accumHoldBy :: (b -> a -> b) -> b -> SF (Event a) b
- old_dAccumHoldBy :: (b -> a -> b) -> b -> SF (Event a) b
- count :: Integral b => SF (Event a) (Event b)
- fby :: b -> SF a b -> SF a b
- impulseIntegral :: VectorSpace a k => SF (a, Event a) a
- old_impulseIntegral :: VectorSpace a k => SF (a, Event a) a

# Documentation

lift5 :: Arrow a => (c -> d -> e -> f -> g -> h) -> a b c -> a b d -> a b e -> a b f -> a b g -> a b hSource

snapAfter :: Time -> SF a (Event a)Source

Produce an event with the input value at or as soon after the specified time delay.

recur :: SF a (Event b) -> SF a (Event b)Source

Restart an event source directly after its first event occurence

pSwitchZ :: [SF a b] -> SF ([a], [b]) (Event c) -> ([SF a b] -> c -> SF [a] [b]) -> SF [a] [b]Source

dpSwitchZ :: [SF a b] -> SF ([a], [b]) (Event c) -> ([SF a b] -> c -> SF [a] [b]) -> SF [a] [b]Source

:: (a -> Bool) | Predicate on input values |

-> SF a b | SF if predicate is true |

-> SF a b | SF if predicate is false |

-> SF a b | SF total |

Run one SF if a predicate is true, otherwise run another SF.

dTrackAndHold :: a -> SF (Maybe a) aSource

old_accumHold :: a -> SF (Event (a -> a)) aSource

old_dAccumHold :: a -> SF (Event (a -> a)) aSource

old_accumHoldBy :: (b -> a -> b) -> b -> SF (Event a) bSource

old_dAccumHoldBy :: (b -> a -> b) -> b -> SF (Event a) bSource

count :: Integral b => SF (Event a) (Event b)Source

Count the number of event occurences, producing a new event occurence with each updated count.

impulseIntegral :: VectorSpace a k => SF (a, Event a) aSource

old_impulseIntegral :: VectorSpace a k => SF (a, Event a) aSource