-- Hoogle documentation, generated by Haddock -- See Hoogle, http://www.haskell.org/hoogle/ -- | Simple foundation for functional reactive programming -- -- Reactive is a simple foundation for programming reactive -- systems functionally. Like Fran/FRP, it has a notions of (reactive) -- behaviors and events. Unlike most previous FRP implementations, -- Reactive has a hybrid demand/data-driven implementation, as described -- in the paper "Simply efficient functional reactivity", -- http://conal.net/papers/simply-reactive/. -- -- Import FRP.Reactive for FRP client apps. To make an Reactive -- adapter for an imperative library, import -- FRP.Reactive.LegacyAdapters. -- -- Please see the project wiki page: -- http://haskell.org/haskellwiki/reactive -- -- © 2007-2008 by Conal Elliott; BSD3 license. -- -- With contributions from: Robin Green, Thomas Davie, Luke Palmer, David -- Sankel, Jules Bean, Creighton Hogg, Chuan-kai Lin, and Richard Smith. -- Please let me know if I've forgotten to list you. @package reactive @version 0.10.2 -- | Serialize actions. module FRP.Reactive.Internal.Serial -- | Serializer. Turns actions into equivalent but serialized actions type Serial = forall a. IO a -> IO a -- | Make a locking serializer makeSerial :: IO Serial -- | Make a locking serializer with a given lock locking :: MVar () -> Serial -- | Write-once variables. module FRP.Reactive.Internal.IVar data IVar a newEmptyIVar :: IO (IVar a) -- | Returns the value in the IVar. The *value* will block until the -- variable becomes filled. readIVar :: IVar a -> a -- | Returns Nothing if the IVar has no value yet, otherwise returns the -- value. tryReadIVar :: IVar a -> IO (Maybe a) -- | Puts the value of the IVar. If it already has a value, block forever. writeIVar :: IVar a -> a -> IO () -- | Writer monad as a pair. Until it's in Control.Monad.Instances. -- -- Use import Data.PairMonad () module Data.PairMonad instance (Monoid o) => Monad ((,) o) -- | Max monoid module Data.Max -- | Ordered monoid under max. newtype Max a Max :: a -> Max a getMax :: Max a -> a instance (Eq a) => Eq (Max a) instance (Ord a) => Ord (Max a) instance (Bounded a) => Bounded (Max a) instance (Read a) => Read (Max a) instance (Show a) => Show (Max a) instance (EqProp a) => EqProp (Max a) instance (Arbitrary a) => Arbitrary (Max a) instance (Ord a, Bounded a) => Monoid (Max a) -- | Min monoid module Data.Min -- | Ordered monoid under min. newtype Min a Min :: a -> Min a getMin :: Min a -> a instance (Eq a) => Eq (Min a) instance (Ord a) => Ord (Min a) instance (Read a) => Read (Min a) instance (Show a) => Show (Min a) instance (Bounded a) => Bounded (Min a) instance (EqProp a) => EqProp (Min a) instance (Arbitrary a) => Arbitrary (Min a) instance (Ord a, Bounded a) => Monoid (Min a) -- | Add bounds to an ordered type module Data.AddBounds -- | Wrap a type into one having new least and greatest elements, -- preserving the existing ordering. data AddBounds a MinBound :: AddBounds a NoBound :: a -> AddBounds a MaxBound :: AddBounds a instance (Eq a) => Eq (AddBounds a) instance (Read a) => Read (AddBounds a) instance (Show a) => Show (AddBounds a) instance (EqProp a, Eq a) => EqProp (AddBounds a) instance (Arbitrary a) => Arbitrary (AddBounds a) instance (Ord a) => Ord (AddBounds a) instance Bounded (AddBounds a) -- | Constant-optimized representation of functions. module FRP.Reactive.Internal.Fun -- | Constant-optimized functions data Fun t a -- | constant function K :: a -> Fun t a -- | non-constant function Fun :: (t -> a) -> Fun t a -- | Misc Reactive internal defs module FRP.Reactive.Internal.Misc -- | Convenient alias for dropping parentheses. type Action = IO () -- | Value consumer type Sink a = a -> Action -- | Representation of future values module FRP.Reactive.Internal.Future -- | Time used in futures. The parameter t can be any Ord -- type. The added bounds represent -Infinity and +Infinity. Pure values -- have time minBound (-Infinity), while never-occurring futures have -- time maxBound (+Infinity). type Time t = Max (AddBounds t) -- | A future value of type a with time type t. Simply a -- time/value pair. Particularly useful with time types that have -- non-flat structure. newtype FutureG t a Future :: (Time t, a) -> FutureG t a unFuture :: FutureG t a -> (Time t, a) -- | Apply a unary function within the FutureG representation. inFuture :: ((Time t, a) -> (Time t', b)) -> FutureG t a -> FutureG t' b -- | Apply a binary function within the FutureG representation. inFuture2 :: ((Time t, a) -> (Time t', b) -> (Time t', c)) -> FutureG t a -> FutureG t' b -> FutureG t' c -- | Run a future in the current thread. Use the given time sink to sync -- time, i.e., to wait for an output time before performing the action. runF :: (Ord t) => Sink t -> FutureG t (IO a) -> IO a instance Functor (FutureG t) instance (Ord t) => Applicative (FutureG t) instance (Ord t) => Monad (FutureG t) instance Copointed (FutureG t) instance Comonad (FutureG t) instance (Show t, Show a) => Show (FutureG t a) instance (Arbitrary t, Arbitrary a) => Arbitrary (FutureG t a) -- | Representation for Reactive and Event types. Combined here, -- because they're mutually recursive. -- -- The representation used in this module is based on a close connection -- between these two types. A reactive value is defined by an initial -- value and an event that yields future values; while an event is given -- as a future reactive value. module FRP.Reactive.Internal.Reactive -- | Events. Semantically: time-ordered list of future values. Instances: -- --
-- withTimeE :: Event a -> Event (a, TimeT) --withTimeE :: (Ord t) => EventG (Improving t) d -> EventG (Improving t) (d, t) -- | Access occurrence times in an event. Discard the rest. See also -- withTimeE. -- --
-- withTimeE_ :: Event a -> Event TimeT --withTimeE_ :: (Ord t) => EventG (Improving t) d -> EventG (Improving t) t -- | Single-occurrence event at given time. See atTimes and -- atTimeG. atTime :: TimeT -> Event () -- | Event occuring at given times. See also atTime and -- atTimeG. atTimes :: [TimeT] -> Event () -- | Convert a temporally monotonic list of timed values to an event. See -- also the generalization listEG listE :: [(TimeT, a)] -> Event a -- | Generate a pair-valued event, given a pair of initial values and a -- pair of events. See also pair on Reactive. Not quite a -- zip, because of the initial pair required. zipE :: (Ord t) => (c, d) -> (EventG t c, EventG t d) -> EventG t (c, d) -- | Like scanl for events. scanlE :: (Ord t) => (a -> b -> a) -> a -> EventG t b -> EventG t a -- | Accumulate values from a monoid-typed event. Specialization of -- scanlE, using mappend and mempty. monoidE :: (Ord t, Monoid o) => EventG t o -> EventG t o -- | Decompose an event into its first occurrence value and a remainder -- event. See also firstE and restE. firstRestE :: (Ord t) => EventG t a -> (a, EventG t a) -- | Extract the first occurrence value of an event. See also -- firstRestE and restE. firstE :: (Ord t) => EventG t a -> a -- | Extract the remainder an event, after its first occurrence. See also -- firstRestE and firstE. restE :: (Ord t) => EventG t a -> EventG t a -- | Remaining part of an event. See also withRestE. remainderR :: (Ord t) => EventG t a -> ReactiveG t (EventG t a) -- | Tack remainders a second event onto values of a first event. Occurs -- when the first event occurs. snapRemainderE :: (Ord t) => EventG t b -> EventG t a -> EventG t (a, EventG t b) -- | Convert an event into a single-occurrence event, whose occurrence -- contains the remainder. onceRestE :: (Ord t) => EventG t a -> EventG t (a, EventG t a) -- | Pair each event value with the previous one. The second result is the -- old one. Nothing will come out for the first occurrence of e, -- but if you have an initial value a, you can do withPrevE -- (pure a mappend e). withPrevE :: (Ord t) => EventG t a -> EventG t (a, a) -- | Same as withPrevE, but allow a function to combine the values. -- Provided for convenience. withPrevEWith :: (Ord t) => (a -> a -> b) -> EventG t a -> EventG t b -- | Pair each event value with the next one one. The second result is the -- next one. withNextE :: (Ord t) => EventG t a -> EventG t (a, a) -- | Same as withNextE, but allow a function to combine the values. -- Provided for convenience. withNextEWith :: (Ord t) => (a -> a -> b) -> EventG t a -> EventG t b -- | Mealy-style state machine, given initial value and transition -- function. Carries along event data. See also mealy_. mealy :: (Ord t) => s -> (s -> s) -> EventG t b -> EventG t (b, s) -- | Mealy-style state machine, given initial value and transition -- function. Forgetful version of mealy. mealy_ :: (Ord t) => s -> (s -> s) -> EventG t b -> EventG t s -- | Count occurrences of an event, remembering the occurrence values. See -- also countE_. countE :: (Ord t, Num n) => EventG t b -> EventG t (b, n) -- | Count occurrences of an event, forgetting the occurrence values. See -- also countE. countE_ :: (Ord t, Num n) => EventG t b -> EventG t n -- | Difference of successive event occurrences. See withPrevE for a -- trick to supply an initial previous value. diffE :: (Ord t, Num n) => EventG t n -> EventG t n -- | Reactive values, specialized to improving doubles for time type Reactive = ReactiveG ITime -- | Like snapshot but discarding event data (often a is -- '()'). snapshot_ :: (Ord t) => ReactiveG t b -> EventG t a -> EventG t b -- | Snapshot a reactive value whenever an event occurs. snapshot :: (Ord t) => ReactiveG t b -> EventG t a -> EventG t (a, b) -- | Filter an event according to whether a reactive boolean is true. whenE :: (Ord t) => EventG t a -> ReactiveG t Bool -> EventG t a -- | Like scanl for reactive values. See also scanlE. scanlR :: (Ord t) => (a -> b -> a) -> a -> EventG t b -> ReactiveG t a -- | Accumulate values from a monoid-valued event. Specialization of -- scanlE, using mappend and mempty. See also -- monoidE. monoidR :: (Ord t, Monoid a) => EventG t a -> ReactiveG t a -- | Combine two events into one. eitherE :: (Ord t) => EventG t a -> EventG t b -> EventG t (Either a b) -- | Start out blank (Nothing), latching onto each new a, -- and blanking on each b. If you just want to latch and not -- blank, then use mempty for lose. maybeR :: (Ord t) => EventG t a -> EventG t b -> ReactiveG t (Maybe a) -- | Flip-flopping reactive value. Turns true when ea occurs and -- false when eb occurs. flipFlop :: (Ord t) => EventG t a -> EventG t b -> ReactiveG t Bool -- | Count occurrences of an event. See also countE. countR :: (Ord t, Num n) => EventG t a -> ReactiveG t n -- | Partition an event into segments. splitE :: (Ord t) => EventG t b -> EventG t a -> EventG t (a, EventG t b) -- | Switch from one event to another, as they occur. (Doesn't merge, as -- join does.) switchE :: (Ord t) => EventG t (EventG t a) -> EventG t a -- | Euler integral. integral :: (VectorSpace v, t ~ (Scalar v), Num t) => t -> Event t -> Reactive v -> Reactive v sumR :: (Ord t) => (AdditiveGroup v) => EventG t v -> ReactiveG t v exact :: Improving a -> a batch :: TestBatch -- | Representation of reactive behaviors module FRP.Reactive.Internal.Behavior -- | Reactive behaviors. They can be understood in terms of a simple model -- (denotational semantics) as functions of time, namely at :: -- BehaviorG t a -> (t -> a). -- -- The semantics of BehaviorG instances are given by corresponding -- instances for the semantic model (functions). See -- http://conal.net/blog/posts/simplifying-semantics-with-type-class-morphisms/. -- --
-- time :: Behavior TimeT --time :: (Ord t) => BehaviorI t t -- | Discretely changing behavior, based on an initial value and a -- new-value event. -- --
-- stepper :: a -> Event a -> Behavior a --stepper :: a -> EventI t a -> BehaviorI t a -- | Switch between behaviors. -- --
-- switcher :: Behavior a -> Event (Behavior a) -> Behavior a --switcher :: (Ord tr) => BehaviorG tr tf a -> EventG tr (BehaviorG tr tf a) -> BehaviorG tr tf a -- | Snapshots a behavior whenever an event occurs and combines the values -- using the combining function passed. Take careful note of the order of -- arguments and results. -- --
-- snapshotWith :: (a -> b -> c) -> Behavior b -> Event a -> Event c --snapshotWith :: (Ord t) => (a -> b -> c) -> BehaviorI t b -> EventI t a -> EventI t c -- | Snapshot a behavior whenever an event occurs. See also -- snapshotWith. Take careful note of the order of arguments and -- results. -- --
-- snapshot :: Behavior b -> Event a -> Event (a,b) --snapshot :: (Ord t) => BehaviorI t b -> EventI t a -> EventI t (a, b) -- | Like snapshot but discarding event data (often a is -- '()'). -- --
-- snapshot_ :: Behavior b -> Event a -> Event b --snapshot_ :: (Ord t) => BehaviorI t b -> EventI t a -> EventI t b -- | Filter an event according to whether a reactive boolean is true. -- --
-- whenE :: Event a -> Behavior Bool -> Event a --whenE :: (Ord t) => EventI t a -> BehaviorI t Bool -> EventI t a -- | Behavior from an initial value and an updater event. See also accumE. -- --
-- accumB :: a -> Event (a -> a) -> Behavior a --accumB :: a -> EventI t (a -> a) -> BehaviorI t a -- | Like scanl for behaviors. See also scanlE. -- --
-- scanlB :: forall a. (Behavior a -> Behavior a -> Behavior a) -> Behavior a -- -> Event (Behavior a) -> Behavior a --scanlB :: (Ord tr) => (b -> BehaviorG tr tf a -> BehaviorG tr tf a) -> BehaviorG tr tf a -> EventG tr b -> BehaviorG tr tf a -- | Accumulate values from a monoid-valued event. Specialization of -- scanlB, using mappend and mempty. See also -- monoidE. -- --
-- monoidB :: Monoid a => Event (Behavior a) -> Behavior a --monoidB :: (Ord tr, Monoid a) => EventG tr (BehaviorG tr tf a) -> BehaviorG tr tf a -- | Start out blank (Nothing), latching onto each new a, -- and blanking on each b. If you just want to latch and not -- blank, then use mempty for the second event. -- --
-- maybeB :: Event a -> Event b -> Behavior (Maybe a) --maybeB :: (Ord t) => EventI t a -> EventI t b -> BehaviorI t (Maybe a) -- | Flip-flopping behavior. Turns true whenever first event occurs and -- false whenever the second event occurs. -- --
-- flipFlop :: Event a -> Event b -> Behavior Bool --flipFlop :: (Ord t) => EventI t a -> EventI t b -> BehaviorI t Bool -- | Count occurrences of an event. See also countE. -- --
-- countB :: Num n => Event a -> Behavior n --countB :: (Ord t, Num n) => EventI t a -> BehaviorI t n -- | Like sum for behaviors. -- --
-- sumB :: AdditiveGroup a => Event a -> Behavior a --sumB :: (Ord t, AdditiveGroup a) => EventI t a -> BehaviorI t a -- | Euler integral. -- --
-- integral :: (VectorSpace v, Scalar v ~ TimeT) => -- Event () -> Behavior v -> Behavior v --integral :: ((Scalar v) ~ t, Ord t, VectorSpace v, Num t) => EventI t a -> BehaviorI t v -> BehaviorI t v instance (Monoid tr, Monoid tf) => Copointed (BehaviorG tr tf) instance (Functor g, Functor f, Copointed g, Copointed f) => Copointed (g :. f) -- | Numeric class instances for behaviors module FRP.Reactive.Num instance (RealFloat a) => RealFloat (Behavior a) instance (RealFrac a) => RealFrac (Behavior a) instance (Floating b) => Floating (Behavior b) instance (Fractional b) => Fractional (Behavior b) instance (Integral a) => Integral (Behavior a) instance (Num a, Ord a) => Real (Behavior a) instance (Num b) => Num (Behavior b) instance Show (Behavior b) instance (Enum a) => Enum (Behavior a) instance (Ord b) => Ord (Behavior b) instance Eq (Behavior b) module FRP.Reactive.VectorSpace instance (VectorSpace v) => VectorSpace (Behavior v) instance (AdditiveGroup v) => AdditiveGroup (Behavior v) -- | Serializing clocks -- -- Thanks to Luke Palmer for help with this module. module FRP.Reactive.Internal.Clock -- | Waits a specified duration and then execute an action type Delay t = t -- -> forall a. IO a -> IO a -- -- Waits until just after a specified time and then execute an action, -- passing in the actual time. type Schedule t = t -> Sink (Sink t) -- -- A serializing clock. Can (a) produce a time and (b) serialize an -- action. data Clock t Clock :: IO t -> Serial -> Clock t cGetTime :: Clock t -> IO t cSerialize :: Clock t -> Serial -- | Make a clock makeClock :: IO (Clock TimeT) module FRP.Reactive.Internal.Timing -- | Execute an action-valued event. adaptE :: Sink (Event Action) -- | Make an action to be executed regularly, given a time-source and a -- action-behavior. The generated action is optimized to do almost no -- work during known-constant phases of the given behavior. mkUpdater :: IO TimeT -> Behavior Action -> IO Action -- | Sleep past a given time sleepPast :: IO TimeT -> Sink TimeT -- | Timed values. A primitive interface for futures. module FRP.Reactive.Internal.TVal -- | Make a new event and a sink that writes to it. Uses the given clock to -- serialize and time-stamp. makeEvent :: Clock TimeT -> MkFed (Event a) a -- | An a that's fed by a b type Fed a b = (a, Sink b) -- | Make a Fed. type MkFed a b = IO (Fed a b) -- | Tools for making Reactive adapters for imperative ("legacy") -- libraries. module FRP.Reactive.LegacyAdapters -- | Value consumer type Sink a = a -> Action -- | Convenient alias for dropping parentheses. type Action = IO () -- | Waits a specified duration and then execute an action type Delay t = t -- -> forall a. IO a -> IO a -- -- Waits until just after a specified time and then execute an action, -- passing in the actual time. type Schedule t = t -> Sink (Sink t) -- -- A serializing clock. Can (a) produce a time and (b) serialize an -- action. data Clock t -- | Make a clock makeClock :: IO (Clock TimeT) cGetTime :: Clock t -> IO t -- | Execute an action-valued event. adaptE :: Sink (Event Action) -- | Make a new event and a sink that writes to it. Uses the given clock to -- serialize and time-stamp. makeEvent :: Clock TimeT -> MkFed (Event a) a -- | Make an action to be executed regularly, given a time-source and a -- action-behavior. The generated action is optimized to do almost no -- work during known-constant phases of the given behavior. mkUpdater :: IO TimeT -> Behavior Action -> IO Action -- | A library for programming with functional reactive behaviors. module FRP.Reactive -- | The type of finite time values. type TimeT = Double -- | Improving doubles, as used for time values in Event, -- Reactive, and ReactiveB. type ITime = Improving TimeT -- | Events. Semantically: time-ordered list of future values. Instances: -- --
-- withTimeE :: Event a -> Event (a, TimeT) --withTimeE :: (Ord t) => EventG (Improving t) d -> EventG (Improving t) (d, t) -- | Access occurrence times in an event. Discard the rest. See also -- withTimeE. -- --
-- withTimeE_ :: Event a -> Event TimeT --withTimeE_ :: (Ord t) => EventG (Improving t) d -> EventG (Improving t) t -- | Generate a pair-valued event, given a pair of initial values and a -- pair of events. See also pair on Reactive. Not quite a -- zip, because of the initial pair required. zipE :: (Ord t) => (c, d) -> (EventG t c, EventG t d) -> EventG t (c, d) -- | Like scanl for events. scanlE :: (Ord t) => (a -> b -> a) -> a -> EventG t b -> EventG t a -- | Accumulate values from a monoid-typed event. Specialization of -- scanlE, using mappend and mempty. monoidE :: (Ord t, Monoid o) => EventG t o -> EventG t o -- | Mealy-style state machine, given initial value and transition -- function. Carries along event data. See also mealy_. mealy :: (Ord t) => s -> (s -> s) -> EventG t b -> EventG t (b, s) -- | Mealy-style state machine, given initial value and transition -- function. Forgetful version of mealy. mealy_ :: (Ord t) => s -> (s -> s) -> EventG t b -> EventG t s -- | Count occurrences of an event, remembering the occurrence values. See -- also countE_. countE :: (Ord t, Num n) => EventG t b -> EventG t (b, n) -- | Count occurrences of an event, forgetting the occurrence values. See -- also countE. countE_ :: (Ord t, Num n) => EventG t b -> EventG t n -- | Difference of successive event occurrences. See withPrevE for a -- trick to supply an initial previous value. diffE :: (Ord t, Num n) => EventG t n -> EventG t n -- | Pair each event value with the previous one. The second result is the -- old one. Nothing will come out for the first occurrence of e, -- but if you have an initial value a, you can do withPrevE -- (pure a mappend e). withPrevE :: (Ord t) => EventG t a -> EventG t (a, a) -- | Same as withPrevE, but allow a function to combine the values. -- Provided for convenience. withPrevEWith :: (Ord t) => (a -> a -> b) -> EventG t a -> EventG t b -- | Combine two events into one. eitherE :: (Ord t) => EventG t a -> EventG t b -> EventG t (Either a b) -- | Convert a temporally monotonic list of timed values to an event. See -- also the generalization listEG listE :: [(TimeT, a)] -> Event a -- | Event occuring at given times. See also atTime and -- atTimeG. atTimes :: [TimeT] -> Event () -- | Single-occurrence event at given time. See atTimes and -- atTimeG. atTime :: TimeT -> Event () -- | Just the first occurrence of an event. once :: (Ord t) => EventG t a -> EventG t a -- | Decompose an event into its first occurrence value and a remainder -- event. See also firstE and restE. firstRestE :: (Ord t) => EventG t a -> (a, EventG t a) -- | Extract the first occurrence value of an event. See also -- firstRestE and restE. firstE :: (Ord t) => EventG t a -> a -- | Extract the remainder an event, after its first occurrence. See also -- firstRestE and firstE. restE :: (Ord t) => EventG t a -> EventG t a -- | Tack remainders a second event onto values of a first event. Occurs -- when the first event occurs. snapRemainderE :: (Ord t) => EventG t b -> EventG t a -> EventG t (a, EventG t b) -- | Access the remainder with each event occurrence. withRestE :: EventG t a -> EventG t (a, EventG t a) -- | Truncate first event at first occurrence of second event. untilE :: (Ord t) => EventG t a -> EventG t b -> EventG t a -- | Partition an event into segments. splitE :: (Ord t) => EventG t b -> EventG t a -> EventG t (a, EventG t b) -- | Switch from one event to another, as they occur. (Doesn't merge, as -- join does.) switchE :: (Ord t) => EventG t (EventG t a) -> EventG t a -- | Pass through the Just occurrences, stripped. Experimental -- specialization of joinMaybes. justE :: (Ord t) => EventG t (Maybe a) -> EventG t a -- | Pass through values satisfying a given predicate. Experimental -- specialization of filterMP. filterE :: (Ord t, Show a) => (a -> Bool) -> EventG t a -> EventG t a -- | Pass through Just occurrences. joinMaybes :: (MonadPlus m) => m (Maybe a) -> m a -- | Pass through values satisfying p. filterMP :: (MonadPlus m) => (a -> Bool) -> m a -> m a -- | Reactive behaviors. They can be understood in terms of a simple model -- (denotational semantics) as functions of time, namely at :: -- BehaviorG t a -> (t -> a). -- -- The semantics of BehaviorG instances are given by corresponding -- instances for the semantic model (functions). See -- http://conal.net/blog/posts/simplifying-semantics-with-type-class-morphisms/. -- --
-- time :: Behavior TimeT --time :: (Ord t) => BehaviorI t t -- | Discretely changing behavior, based on an initial value and a -- new-value event. -- --
-- stepper :: a -> Event a -> Behavior a --stepper :: a -> EventI t a -> BehaviorI t a -- | Switch between behaviors. -- --
-- switcher :: Behavior a -> Event (Behavior a) -> Behavior a --switcher :: (Ord tr) => BehaviorG tr tf a -> EventG tr (BehaviorG tr tf a) -> BehaviorG tr tf a -- | Snapshots a behavior whenever an event occurs and combines the values -- using the combining function passed. Take careful note of the order of -- arguments and results. -- --
-- snapshotWith :: (a -> b -> c) -> Behavior b -> Event a -> Event c --snapshotWith :: (Ord t) => (a -> b -> c) -> BehaviorI t b -> EventI t a -> EventI t c -- | Snapshot a behavior whenever an event occurs. See also -- snapshotWith. Take careful note of the order of arguments and -- results. -- --
-- snapshot :: Behavior b -> Event a -> Event (a,b) --snapshot :: (Ord t) => BehaviorI t b -> EventI t a -> EventI t (a, b) -- | Like snapshot but discarding event data (often a is -- '()'). -- --
-- snapshot_ :: Behavior b -> Event a -> Event b --snapshot_ :: (Ord t) => BehaviorI t b -> EventI t a -> EventI t b -- | Filter an event according to whether a reactive boolean is true. -- --
-- whenE :: Event a -> Behavior Bool -> Event a --whenE :: (Ord t) => EventI t a -> BehaviorI t Bool -> EventI t a -- | Behavior from an initial value and an updater event. See also accumE. -- --
-- accumB :: a -> Event (a -> a) -> Behavior a --accumB :: a -> EventI t (a -> a) -> BehaviorI t a -- | Like scanl for behaviors. See also scanlE. -- --
-- scanlB :: forall a. (Behavior a -> Behavior a -> Behavior a) -> Behavior a -- -> Event (Behavior a) -> Behavior a --scanlB :: (Ord tr) => (b -> BehaviorG tr tf a -> BehaviorG tr tf a) -> BehaviorG tr tf a -> EventG tr b -> BehaviorG tr tf a -- | Accumulate values from a monoid-valued event. Specialization of -- scanlB, using mappend and mempty. See also -- monoidE. -- --
-- monoidB :: Monoid a => Event (Behavior a) -> Behavior a --monoidB :: (Ord tr, Monoid a) => EventG tr (BehaviorG tr tf a) -> BehaviorG tr tf a -- | Start out blank (Nothing), latching onto each new a, -- and blanking on each b. If you just want to latch and not -- blank, then use mempty for the second event. -- --
-- maybeB :: Event a -> Event b -> Behavior (Maybe a) --maybeB :: (Ord t) => EventI t a -> EventI t b -> BehaviorI t (Maybe a) -- | Flip-flopping behavior. Turns true whenever first event occurs and -- false whenever the second event occurs. -- --
-- flipFlop :: Event a -> Event b -> Behavior Bool --flipFlop :: (Ord t) => EventI t a -> EventI t b -> BehaviorI t Bool -- | Count occurrences of an event. See also countE. -- --
-- countB :: Num n => Event a -> Behavior n --countB :: (Ord t, Num n) => EventI t a -> BehaviorI t n -- | Like sum for behaviors. -- --
-- sumB :: AdditiveGroup a => Event a -> Behavior a --sumB :: (Ord t, AdditiveGroup a) => EventI t a -> BehaviorI t a -- | Euler integral. -- --
-- integral :: (VectorSpace v, Scalar v ~ TimeT) => -- Event () -> Behavior v -> Behavior v --integral :: ((Scalar v) ~ t, Ord t, VectorSpace v, Num t) => EventI t a -> BehaviorI t v -> BehaviorI t v