-- Hoogle documentation, generated by Haddock
-- See Hoogle, http://www.haskell.org/hoogle/
-- | Higher-order Functional Reactive Programming
--
-- Reflex is a high-performance, deterministic, higher-order Functional
-- Reactive Programming system
@package reflex
@version 0.3.2
module Data.Functor.Misc
data WrapArg :: (k -> *) -> (k -> *) -> * -> *
WrapArg :: f a -> WrapArg g f (g a)
data Const2 :: * -> * -> * -> *
Const2 :: k -> Const2 k v v
sequenceDmap :: (Monad m, GCompare f) => DMap (WrapArg m f) -> m (DMap f)
combineDMapsWithKey :: GCompare f => (forall a. f a -> These (g a) (h a) -> i a) -> DMap (WrapArg g f) -> DMap (WrapArg h f) -> DMap (WrapArg i f)
wrapDMap :: (forall a. a -> f a) -> DMap k -> DMap (WrapArg f k)
rewrapDMap :: (forall a. f a -> g a) -> DMap (WrapArg f k) -> DMap (WrapArg g k)
unwrapDMap :: (forall a. f a -> a) -> DMap (WrapArg f k) -> DMap k
unwrapDMapMaybe :: (forall a. f a -> Maybe a) -> DMap (WrapArg f k) -> DMap k
mapToDMap :: Map k v -> DMap (Const2 k v)
mapWithFunctorToDMap :: Map k (f v) -> DMap (WrapArg f (Const2 k v))
dmapToMap :: DMap (Const2 k v) -> Map k v
instance forall (k :: BOX) (g :: k -> *) (f :: k -> *). Data.GADT.Compare.GEq f => Data.GADT.Compare.GEq (Data.Functor.Misc.WrapArg g f)
instance forall (k :: BOX) (g :: k -> *) (f :: k -> *). Data.GADT.Compare.GCompare f => Data.GADT.Compare.GCompare (Data.Functor.Misc.WrapArg g f)
instance GHC.Classes.Eq k => Data.GADT.Compare.GEq (Data.Functor.Misc.Const2 k v)
instance GHC.Classes.Ord k => Data.GADT.Compare.GCompare (Data.Functor.Misc.Const2 k v)
module Reflex.Class
class (MonadHold t (PushM t), MonadSample t (PullM t), MonadFix (PushM t), Functor (Event t), Functor (Behavior t)) => Reflex t where data family Behavior t :: * -> * data family Event t :: * -> * type family PushM t :: * -> * type family PullM t :: * -> *
-- | An Event with no occurrences
never :: Reflex t => Event t a
-- | Create a Behavior that always has the given value
constant :: Reflex t => a -> Behavior t a
-- | Create an Event from another Event; the provided function can sample
-- Behaviors and hold Events, and use the results to produce a occurring
-- (Just) or non-occurring (Nothing) result
push :: Reflex t => (a -> PushM t (Maybe b)) -> Event t a -> Event t b
-- | Create a Behavior by reading from other Behaviors; the result will be
-- recomputed whenever any of the read Behaviors changes
pull :: Reflex t => PullM t a -> Behavior t a
-- | Merge a collection of events; the resulting Event will only occur if
-- at least one input event is occuring, and will contain all of the
-- input keys that are occurring simultaneously
merge :: (Reflex t, GCompare k) => DMap (WrapArg (Event t) k) -> Event t (DMap k)
-- | Efficiently fan-out an event to many destinations. This function
-- should be partially applied, and then the result applied repeatedly to
-- create child events
fan :: (Reflex t, GCompare k) => Event t (DMap k) -> EventSelector t k
-- | Create an Event that will occur whenever the currently-selected input
-- Event occurs
switch :: Reflex t => Behavior t (Event t a) -> Event t a
-- | Create an Event that will occur whenever the input event is occurring
-- and its occurrence value, another Event, is also occurring
coincidence :: Reflex t => Event t (Event t a) -> Event t a
class (Applicative m, Monad m) => MonadSample t m | m -> t
-- | Get the current value in the Behavior
sample :: MonadSample t m => Behavior t a -> m a
class MonadSample t m => MonadHold t m
-- | Create a new Behavior whose value will initially be equal to the given
-- value and will be updated whenever the given Event occurs
hold :: MonadHold t m => a -> Event t a -> m (Behavior t a)
newtype EventSelector t k
EventSelector :: (forall a. k a -> Event t a) -> EventSelector t k
[select] :: EventSelector t k -> forall a. k a -> Event t a
-- | Create an Event from another Event. The provided function can sample
-- Behaviors and hold Events.
pushAlways :: Reflex t => (a -> PushM t b) -> Event t a -> Event t b
-- | Flipped version of fmap.
ffor :: Functor f => f a -> (a -> b) -> f b
-- | A class for values that combines filtering and mapping using
-- Maybe.
class FunctorMaybe f
-- | Combined mapping and filtering function.
fmapMaybe :: FunctorMaybe f => (a -> Maybe b) -> f a -> f b
-- | Flipped version of fmapMaybe.
fforMaybe :: FunctorMaybe f => f a -> (a -> Maybe b) -> f b
-- | Filter 'f a' using the provided predicate. Relies on fforMaybe.
ffilter :: FunctorMaybe f => (a -> Bool) -> f a -> f a
-- | Create a new Event by combining each occurence with the next
-- value of the list using the supplied function. If the list runs out of
-- items, all subsequent Event occurrences will be ignored.
zipListWithEvent :: (Reflex t, MonadHold t m, MonadFix m) => (a -> b -> c) -> [a] -> Event t b -> m (Event t c)
-- | Replace each occurrence value of the Event with the value of
-- the Behavior at the time of that occurrence.
tag :: Reflex t => Behavior t b -> Event t a -> Event t b
-- | Create a new Event that combines occurences of supplied
-- Event with the current value of the Behavior.
attach :: Reflex t => Behavior t a -> Event t b -> Event t (a, b)
-- | Create a new Event that occurs when the supplied Event
-- occurs by combining it with the current value of the Behavior.
attachWith :: Reflex t => (a -> b -> c) -> Behavior t a -> Event t b -> Event t c
-- | Create a new Event by combining each occurence with the current
-- value of the Behavior. The occurrence is discarded if the
-- combining function returns Nothing
attachWithMaybe :: Reflex t => (a -> b -> Maybe c) -> Behavior t a -> Event t b -> Event t c
-- | Alias for headE
onceE :: (Reflex t, MonadHold t m, MonadFix m) => Event t a -> m (Event t a)
-- | Create a new Event that only occurs on the first occurence of
-- the supplied Event.
headE :: (Reflex t, MonadHold t m, MonadFix m) => Event t a -> m (Event t a)
-- | Create a new Event that occurs on all but the first occurence
-- of the supplied Event.
tailE :: (Reflex t, MonadHold t m, MonadFix m) => Event t a -> m (Event t a)
-- | Create a tuple of two Events with the first one occuring only
-- the first time the supplied Event occurs and the second
-- occuring on all but the first occurence.
headTailE :: (Reflex t, MonadHold t m, MonadFix m) => Event t a -> m (Event t a, Event t a)
-- | Split the supplied Event into two individual Events
-- occuring at the same time with the respective values from the tuple.
splitE :: Reflex t => Event t (a, b) -> (Event t a, Event t b)
-- | Print the supplied String and the value of the Event on
-- each occurence. This should only be used for debugging.
--
-- Note: As with Debug.Trace.trace, the message will only be printed if
-- the Event is actually used.
traceEvent :: (Reflex t, Show a) => String -> Event t a -> Event t a
-- | Print the output of the supplied function on each occurence of the
-- Event. This should only be used for debugging.
--
-- Note: As with Debug.Trace.trace, the message will only be printed if
-- the Event is actually used.
traceEventWith :: Reflex t => (a -> String) -> Event t a -> Event t a
-- | Tag type for Either to use it as a DSum.
data EitherTag l r a
LeftTag :: EitherTag l r l
RightTag :: EitherTag l r r
-- | Convert Either to a DSum. Inverse of
-- dsumToEither.
eitherToDSum :: Either a b -> DSum (EitherTag a b)
-- | Convert DSum to Either. Inverse of eitherToDSum.
dsumToEither :: DSum (EitherTag a b) -> Either a b
-- | Extract the values of a DMap of EitherTags.
dmapToThese :: DMap (EitherTag a b) -> Maybe (These a b)
-- | Create a new Event that occurs if at least one of the supplied
-- Events occurs. If both occur at the same time they are combined
-- using mappend.
appendEvents :: (Reflex t, Monoid a) => Event t a -> Event t a -> Event t a
-- | Deprecated: Use bisequenceA or bisequence from the bifunctors
-- package instead
sequenceThese :: Monad m => These (m a) (m b) -> m (These a b)
-- | Create a new Event that occurs if at least one of the
-- Events in the list occurs. If multiple occur at the same time
-- they are folded from the left with the given function.
mergeWith :: Reflex t => (a -> a -> a) -> [Event t a] -> Event t a
-- | Create a new Event that occurs if at least one of the
-- Events in the list occurs. If multiple occur at the same time
-- the value is the value of the leftmost event.
leftmost :: Reflex t => [Event t a] -> Event t a
-- | Create a new Event that occurs if at least one of the
-- Events in the list occurs and has a list of the values of all
-- Events occuring at that time.
mergeList :: Reflex t => [Event t a] -> Event t (NonEmpty a)
-- | Create a new Event combining the map of Events into an
-- Event that occurs if at least one of them occurs and has a map
-- of values of all Events occuring at that time.
mergeMap :: (Reflex t, Ord k) => Map k (Event t a) -> Event t (Map k a)
-- | Split the event into an EventSelector that allows efficient
-- selection of the individual Events.
fanMap :: (Reflex t, Ord k) => Event t (Map k a) -> EventSelector t (Const2 k a)
-- | Switches to the new event whenever it receives one; the new event is
-- used immediately, on the same frame that it is switched to
switchPromptly :: (Reflex t, MonadHold t m) => Event t a -> Event t (Event t a) -> m (Event t a)
-- | Create a new Event that only occurs if the supplied
-- Event occurs and the Behavior is true at the time of
-- occurence.
gate :: Reflex t => Behavior t Bool -> Event t a -> Event t a
-- | Create a new behavior given a starting behavior and switch to a the
-- behvior carried by the event when it fires.
switcher :: (Reflex t, MonadHold t m) => Behavior t a -> Event t (Behavior t a) -> m (Behavior t a)
instance Reflex.Class.MonadSample t m => Reflex.Class.MonadSample t (Control.Monad.Trans.Reader.ReaderT r m)
instance Reflex.Class.MonadHold t m => Reflex.Class.MonadHold t (Control.Monad.Trans.Reader.ReaderT r m)
instance (Reflex.Class.MonadSample t m, GHC.Base.Monoid r) => Reflex.Class.MonadSample t (Control.Monad.Trans.Writer.Lazy.WriterT r m)
instance (Reflex.Class.MonadHold t m, GHC.Base.Monoid r) => Reflex.Class.MonadHold t (Control.Monad.Trans.Writer.Lazy.WriterT r m)
instance Reflex.Class.MonadSample t m => Reflex.Class.MonadSample t (Control.Monad.Trans.State.Strict.StateT s m)
instance Reflex.Class.MonadHold t m => Reflex.Class.MonadHold t (Control.Monad.Trans.State.Strict.StateT s m)
instance Reflex.Class.MonadSample t m => Reflex.Class.MonadSample t (Control.Monad.Trans.Except.ExceptT e m)
instance Reflex.Class.MonadHold t m => Reflex.Class.MonadHold t (Control.Monad.Trans.Except.ExceptT e m)
instance (Reflex.Class.MonadSample t m, GHC.Base.Monoid w) => Reflex.Class.MonadSample t (Control.Monad.Trans.RWS.Lazy.RWST r w s m)
instance (Reflex.Class.MonadHold t m, GHC.Base.Monoid w) => Reflex.Class.MonadHold t (Control.Monad.Trans.RWS.Lazy.RWST r w s m)
instance Reflex.Class.MonadSample t m => Reflex.Class.MonadSample t (Control.Monad.Trans.Cont.ContT r m)
instance Reflex.Class.MonadHold t m => Reflex.Class.MonadHold t (Control.Monad.Trans.Cont.ContT r m)
instance Reflex.Class.Reflex t => GHC.Base.Functor (Reflex.Class.Behavior t)
instance Reflex.Class.Reflex t => GHC.Base.Applicative (Reflex.Class.Behavior t)
instance Reflex.Class.Reflex t => GHC.Base.Monad (Reflex.Class.Behavior t)
instance (Reflex.Class.Reflex t, Data.Semigroup.Semigroup a) => Data.Semigroup.Semigroup (Reflex.Class.Behavior t a)
instance (Reflex.Class.Reflex t, GHC.Base.Monoid a) => GHC.Base.Monoid (Reflex.Class.Behavior t a)
instance Reflex.Class.Reflex t => Reflex.Class.FunctorMaybe (Reflex.Class.Event t)
instance Reflex.Class.Reflex t => GHC.Base.Functor (Reflex.Class.Event t)
instance Data.GADT.Compare.GEq (Reflex.Class.EitherTag l r)
instance Data.GADT.Compare.GCompare (Reflex.Class.EitherTag l r)
instance Data.GADT.Show.GShow (Reflex.Class.EitherTag l r)
instance (GHC.Show.Show l, GHC.Show.Show r) => Data.Dependent.Sum.ShowTag (Reflex.Class.EitherTag l r)
instance (Data.Semigroup.Semigroup a, Reflex.Class.Reflex t) => GHC.Base.Monoid (Reflex.Class.Event t a)
instance Reflex.Class.Reflex t => Data.Align.Align (Reflex.Class.Event t)
module Reflex.Dynamic
-- | A container for a value that can change over time and allows
-- notifications on changes. Basically a combination of a Behavior
-- and an Event, with a rule that the Behavior will change if and
-- only if the Event fires.
data Dynamic t a
-- | Extract the Behavior of a Dynamic.
current :: Dynamic t a -> Behavior t a
-- | Extract the Event of the Dynamic.
updated :: Dynamic t a -> Event t a
-- | Dynamic with the constant supplied value.
constDyn :: Reflex t => a -> Dynamic t a
-- | Create a Dynamic using the initial value that changes every
-- time the Event occurs.
holdDyn :: MonadHold t m => a -> Event t a -> m (Dynamic t a)
-- | Create a new Dynamic that only signals changes if the values
-- actually changed.
nubDyn :: (Reflex t, Eq a) => Dynamic t a -> Dynamic t a
-- | Create a new Dynamic that counts the occurences of the
-- Event.
count :: (Reflex t, MonadHold t m, MonadFix m, Num b) => Event t a -> m (Dynamic t b)
-- | Create a new Dynamic using the initial value that flips its
-- value every time the Event occurs.
toggle :: (Reflex t, MonadHold t m, MonadFix m) => Bool -> Event t a -> m (Dynamic t Bool)
-- | Switches to the new Event whenever it receives one. Switching
-- occurs *before* the inner Event fires - so if the
-- Dynamic changes and both the old and new inner Events fire
-- simultaneously, the output will fire with the value of the *new*
-- Event.
switchPromptlyDyn :: Reflex t => Dynamic t (Event t a) -> Event t a
-- | Replace the value of the Event with the current value of the
-- Dynamic each time the Event occurs.
--
-- Note: `tagDyn d e` differs from `tag (current d) e` in the case that
-- e is firing at the same time that d is changing.
-- With `tagDyn d e`, the *new* value of d will replace the
-- value of e, whereas with `tag (current d) e`, the *old* value
-- will be used, since the Behavior won't be updated until the end
-- of the frame. Additionally, this means that the output Event
-- may not be used to directly change the input Dynamic, because
-- that would mean its value depends on itself. When creating cyclic data
-- flows, generally `tag (current d) e` is preferred.
tagDyn :: Reflex t => Dynamic t a -> Event t b -> Event t a
-- | Attach the current value of the Dynamic to the value of the
-- Event each time it occurs.
--
-- Note: `attachDyn d` is not the same as `attach (current d)`. See
-- tagDyn for details.
attachDyn :: Reflex t => Dynamic t a -> Event t b -> Event t (a, b)
-- | Combine the current value of the Dynamic with the value of the
-- Event each time it occurs.
--
-- Note: `attachDynWith f d` is not the same as `attachWith f (current
-- d)`. See tagDyn for details.
attachDynWith :: Reflex t => (a -> b -> c) -> Dynamic t a -> Event t b -> Event t c
-- | Create a new Event by combining the value at each occurence
-- with the current value of the Dynamic value and possibly
-- filtering if the combining function returns Nothing.
--
-- Note: `attachDynWithMaybe f d` is not the same as `attachWithMaybe f
-- (current d)`. See tagDyn for details.
attachDynWithMaybe :: Reflex t => (a -> b -> Maybe c) -> Dynamic t a -> Event t b -> Event t c
-- | Map a function over a Dynamic.
mapDyn :: (Reflex t, MonadHold t m) => (a -> b) -> Dynamic t a -> m (Dynamic t b)
-- | Flipped version of mapDyn.
forDyn :: (Reflex t, MonadHold t m) => Dynamic t a -> (a -> b) -> m (Dynamic t b)
-- | Map a monadic function over a Dynamic. The only monadic action
-- that the given function can perform is sample.
mapDynM :: (Reflex t, MonadHold t m) => (forall m'. MonadSample t m' => a -> m' b) -> Dynamic t a -> m (Dynamic t b)
-- | Create a Dynamic using the initial value and change it each
-- time the Event occurs using a folding function on the previous
-- value and the value of the Event.
foldDyn :: (Reflex t, MonadHold t m, MonadFix m) => (a -> b -> b) -> b -> Event t a -> m (Dynamic t b)
-- | Create a Dynamic using the initial value and change it each
-- time the Event occurs using a monadic folding function on the
-- previous value and the value of the Event.
foldDynM :: (Reflex t, MonadHold t m, MonadFix m) => (a -> b -> PushM t b) -> b -> Event t a -> m (Dynamic t b)
foldDynMaybe :: (Reflex t, MonadHold t m, MonadFix m) => (a -> b -> Maybe b) -> b -> Event t a -> m (Dynamic t b)
foldDynMaybeM :: (Reflex t, MonadHold t m, MonadFix m) => (a -> b -> PushM t (Maybe b)) -> b -> Event t a -> m (Dynamic t b)
-- | Merge two Dynamics into a new one using the provided function.
-- The new Dynamic changes its value each time one of the original
-- Dynamics changes its value.
combineDyn :: (Reflex t, MonadHold t m) => (a -> b -> c) -> Dynamic t a -> Dynamic t b -> m (Dynamic t c)
collectDyn :: (RebuildSortedHList (HListElems b), IsHList a, IsHList b, AllAreFunctors (Dynamic t) (HListElems b), Reflex t, MonadHold t m, HListElems a ~ FunctorList (Dynamic t) (HListElems b)) => a -> m (Dynamic t b)
-- | Merge the Dynamic values using their Monoid instance.
mconcatDyn :: (Reflex t, MonadHold t m, Monoid a) => [Dynamic t a] -> m (Dynamic t a)
-- | Create a Dynamic with a DMap of values out of a
-- DMap of Dynamic values.
distributeDMapOverDyn :: (Reflex t, MonadHold t m, GCompare k) => DMap (WrapArg (Dynamic t) k) -> m (Dynamic t (DMap k))
-- | Join a nested Dynamic into a new Dynamic that has the
-- value of the inner Dynamic.
joinDyn :: (Reflex t) => Dynamic t (Dynamic t a) -> Dynamic t a
-- | Combine a Dynamic of a Map of Dynamics into a
-- Dynamic with the current values of the Dynamics in a
-- map.
joinDynThroughMap :: (Reflex t, Ord k) => Dynamic t (Map k (Dynamic t a)) -> Dynamic t (Map k a)
-- | Print the value of the Dynamic on each change and prefix it
-- with the provided string. This should only be used for
-- debugging.
--
-- Note: Just like Debug.Trace.trace, the value will only be shown if
-- something else in the system is depending on it.
traceDyn :: (Reflex t, Show a) => String -> Dynamic t a -> Dynamic t a
-- | Print the result of applying the provided function to the value of the
-- Dynamic on each change. This should only be used for
-- debugging.
--
-- Note: Just like Debug.Trace.trace, the value will only be shown if
-- something else in the system is depending on it.
traceDynWith :: Reflex t => (a -> String) -> Dynamic t a -> Dynamic t a
-- | Split the Dynamic into two Dynamics, each taking the
-- respective value of the tuple.
splitDyn :: (Reflex t, MonadHold t m) => Dynamic t (a, b) -> m (Dynamic t a, Dynamic t b)
-- | Represents a time changing value together with an EventSelector
-- that can efficiently detect when the underlying Dynamic has a
-- particular value. This is useful for representing data like the
-- current selection of a long list.
--
-- Semantically, > getDemuxed (demux d) k === mapDyn (== k) d However,
-- the when getDemuxed is used multiple times, the complexity is only
-- O(log(n)), rather than O(n) for mapDyn.
data Demux t k
-- | Demultiplex an input value to a Demux with many outputs. At any
-- given time, whichever output is indicated by the given Dynamic
-- will be True.
demux :: (Reflex t, Ord k) => Dynamic t k -> Demux t k
-- | Select a particular output of the Demux; this is equivalent to
-- (but much faster than) mapping over the original Dynamic and
-- checking whether it is equal to the given key.
getDemuxed :: (Reflex t, MonadHold t m, Eq k) => Demux t k -> k -> m (Dynamic t Bool)
data HList (l :: [*])
HNil :: HList '[]
HCons :: e -> HList l -> HList (e : l)
data FHList f l
FHNil :: FHList f '[]
FHCons :: f e -> FHList f l -> FHList f (e : l)
distributeFHListOverDyn :: (Reflex t, MonadHold t m, RebuildSortedHList l) => FHList (Dynamic t) l -> m (Dynamic t (HList l))
unsafeDynamic :: Behavior t a -> Event t a -> Dynamic t a
instance (l' ~ Reflex.Dynamic.HRevApp l '[]) => Reflex.Dynamic.HBuild' l (Reflex.Dynamic.HList l')
instance Reflex.Dynamic.HBuild' (a : l) r => Reflex.Dynamic.HBuild' l (a -> r)
instance forall (k :: BOX) (l :: [k]). Data.GADT.Compare.GEq (Reflex.Dynamic.HListPtr l)
instance forall (k :: BOX) (l :: [k]). Data.GADT.Compare.GCompare (Reflex.Dynamic.HListPtr l)
instance Reflex.Dynamic.RebuildSortedHList '[]
instance Reflex.Dynamic.RebuildSortedHList t => Reflex.Dynamic.RebuildSortedHList (h : t)
instance forall (k :: BOX) (f :: k -> *). Reflex.Dynamic.AllAreFunctors f '[]
instance forall (k :: BOX) (f :: k -> *) (h :: k) (t :: [k]). Reflex.Dynamic.AllAreFunctors f t => Reflex.Dynamic.AllAreFunctors f (h : t)
instance Reflex.Dynamic.IsHList (a, b)
instance Reflex.Dynamic.IsHList (a, b, c, d)
instance Reflex.Dynamic.IsHList (a, b, c, d, e, f)
module Reflex.Dynamic.TH
-- | Quote a Dynamic expression. Within the quoted expression, you can use
-- '$(unqDyn [| x |])' to refer to any expression x of type
-- 'Dynamic t a'; the unquoted result will be of type a
qDyn :: Q Exp -> Q Exp
unqDyn :: Q Exp -> Q Exp
mkDyn :: QuasiQuoter
module Reflex.Host.Class
-- | Framework implementation support class for the reflex implementation
-- represented by t.
class (Reflex t, MonadReflexCreateTrigger t (HostFrame t), MonadSample t (HostFrame t), MonadHold t (HostFrame t), MonadFix (HostFrame t), MonadSubscribeEvent t (HostFrame t)) => ReflexHost t where type family EventTrigger t :: * -> * type family EventHandle t :: * -> * type family HostFrame t :: * -> *
-- | Monad in which Events can be subscribed. This forces all
-- underlying event sources to be initialized, so that the event will
-- fire whenever it ought to. Events must be subscribed before they are
-- read using readEvent
class (Reflex t, Monad m) => MonadSubscribeEvent t m | m -> t
-- | Subscribe to an event and set it up if needed.
--
-- This function will create a new EventHandle from an
-- Event. This handle may then be used via readEvent in the
-- read callback of fireEventsAndRead.
--
-- If the event wasn't subscribed to before (either manually or through a
-- dependent event or behavior) then this function will cause the event
-- and all dependencies of this event to be set up. For example, if the
-- event was created by newEventWithTrigger, then it's callback
-- will be executed.
--
-- It's safe to call this function multiple times.
subscribeEvent :: MonadSubscribeEvent t m => Event t a -> m (EventHandle t a)
-- | Monad that allows to read events' values.
class (ReflexHost t, Applicative m, Monad m) => MonadReadEvent t m | m -> t
-- | Read the value of an Event from an EventHandle (created
-- by calling subscribeEvent).
--
-- After event propagation is done, all events can be in two states:
-- either they are firing with some value or they are not firing. In the
-- former case, this function returns Just act, where
-- act in an action to read the current value of the event. In
-- the latter case, the function returns Nothing.
--
-- This function is normally used in the calllback for
-- fireEventsAndRead.
readEvent :: MonadReadEvent t m => EventHandle t a -> m (Maybe (m a))
-- | A monad where new events feed from external sources can be created.
class (Applicative m, Monad m) => MonadReflexCreateTrigger t m | m -> t
-- | Creates a root Event (one that is not based on any other
-- event).
--
-- When a subscriber first subscribes to an event (building another event
-- that depends on the subscription) the given callback function is run
-- and passed a trigger. The callback function can then set up the event
-- source in IO. After this is done, the callback function must return an
-- accompanying teardown action.
--
-- Any time between setup and teardown the trigger can be used to fire
-- the event, by passing it to fireEventsAndRead.
--
-- Note: An event may be set up multiple times. So after the teardown
-- action is executed, the event may still be set up again in the future.
newEventWithTrigger :: MonadReflexCreateTrigger t m => (EventTrigger t a -> IO (IO ())) -> m (Event t a)
newFanEventWithTrigger :: (MonadReflexCreateTrigger t m, GCompare k) => (forall a. k a -> EventTrigger t a -> IO (IO ())) -> m (EventSelector t k)
class (ReflexHost t, MonadReflexCreateTrigger t m, MonadSubscribeEvent t m, MonadReadEvent t (ReadPhase m), MonadSample t (ReadPhase m), MonadHold t (ReadPhase m)) => MonadReflexHost t m | m -> t where type family ReadPhase m :: * -> *
-- | Propagate some events firings and read the values of events
-- afterwards.
--
-- This function will create a new frame to fire the given events. It
-- will then update all dependent events and behaviors. After that is
-- done, the given callback is executed which allows to read the final
-- values of events and check whether they have fired in this frame or
-- not.
--
-- All events that are given are fired at the same time.
--
-- This function is typically used in the main loop of a reflex framework
-- implementation. The main loop waits for external events to happen
-- (such as keyboard input or a mouse click) and then fires the
-- corresponding events using this function. The read callback can be
-- used to read output events and perform a corresponding response action
-- to the external event.
fireEventsAndRead :: MonadReflexHost t m => [DSum (EventTrigger t)] -> (ReadPhase m a) -> m a
-- | Run a frame without any events firing.
--
-- This function should be used when you want to use sample and
-- hold when no events are currently firing. Using this function
-- in that case can improve performance, since the implementation can
-- assume that no events are firing when sample or hold are
-- called.
--
-- This function is commonly used to set up the basic event network when
-- the application starts up.
runHostFrame :: MonadReflexHost t m => HostFrame t a -> m a
-- | Like fireEventsAndRead, but without reading any events.
fireEvents :: MonadReflexHost t m => [DSum (EventTrigger t)] -> m ()
-- | Create a new event and store its trigger in an IORef while
-- it's active.
--
-- An event is only active between the set up (when it's first subscribed
-- to) and the teardown phases (when noboby is subscribing the event
-- anymore). This function returns an Event and an IORef. As
-- long as the event is active, the IORef will contain
-- Just the event trigger to trigger this event. When the event is
-- not active, the IORef will contain Nothing. This
-- allows event sources to be more efficient, since they don't need to
-- produce events when nobody is listening.
newEventWithTriggerRef :: (MonadReflexCreateTrigger t m, MonadRef m, Ref m ~ Ref IO) => m (Event t a, Ref m (Maybe (EventTrigger t a)))
fireEventRef :: (MonadReflexHost t m, MonadRef m, Ref m ~ Ref IO) => Ref m (Maybe (EventTrigger t a)) -> a -> m ()
fireEventRefAndRead :: (MonadReflexHost t m, MonadRef m, Ref m ~ Ref IO) => Ref m (Maybe (EventTrigger t a)) -> a -> EventHandle t b -> m (Maybe b)
instance Reflex.Host.Class.MonadReflexCreateTrigger t m => Reflex.Host.Class.MonadReflexCreateTrigger t (Control.Monad.Trans.Reader.ReaderT r m)
instance Reflex.Host.Class.MonadSubscribeEvent t m => Reflex.Host.Class.MonadSubscribeEvent t (Control.Monad.Trans.Reader.ReaderT r m)
instance Reflex.Host.Class.MonadReflexHost t m => Reflex.Host.Class.MonadReflexHost t (Control.Monad.Trans.Reader.ReaderT r m)
instance (Reflex.Host.Class.MonadReflexCreateTrigger t m, GHC.Base.Monoid w) => Reflex.Host.Class.MonadReflexCreateTrigger t (Control.Monad.Trans.Writer.Lazy.WriterT w m)
instance (Reflex.Host.Class.MonadSubscribeEvent t m, GHC.Base.Monoid w) => Reflex.Host.Class.MonadSubscribeEvent t (Control.Monad.Trans.Writer.Lazy.WriterT w m)
instance (Reflex.Host.Class.MonadReflexHost t m, GHC.Base.Monoid w) => Reflex.Host.Class.MonadReflexHost t (Control.Monad.Trans.Writer.Lazy.WriterT w m)
instance Reflex.Host.Class.MonadReflexCreateTrigger t m => Reflex.Host.Class.MonadReflexCreateTrigger t (Control.Monad.Trans.State.Lazy.StateT s m)
instance Reflex.Host.Class.MonadSubscribeEvent t m => Reflex.Host.Class.MonadSubscribeEvent t (Control.Monad.Trans.State.Lazy.StateT r m)
instance Reflex.Host.Class.MonadReflexHost t m => Reflex.Host.Class.MonadReflexHost t (Control.Monad.Trans.State.Lazy.StateT s m)
instance Reflex.Host.Class.MonadReflexCreateTrigger t m => Reflex.Host.Class.MonadReflexCreateTrigger t (Control.Monad.Trans.State.Strict.StateT s m)
instance Reflex.Host.Class.MonadSubscribeEvent t m => Reflex.Host.Class.MonadSubscribeEvent t (Control.Monad.Trans.State.Strict.StateT r m)
instance Reflex.Host.Class.MonadReflexHost t m => Reflex.Host.Class.MonadReflexHost t (Control.Monad.Trans.State.Strict.StateT s m)
instance Reflex.Host.Class.MonadReflexCreateTrigger t m => Reflex.Host.Class.MonadReflexCreateTrigger t (Control.Monad.Trans.Cont.ContT r m)
instance Reflex.Host.Class.MonadSubscribeEvent t m => Reflex.Host.Class.MonadSubscribeEvent t (Control.Monad.Trans.Cont.ContT r m)
instance Reflex.Host.Class.MonadReflexHost t m => Reflex.Host.Class.MonadReflexHost t (Control.Monad.Trans.Cont.ContT r m)
instance Reflex.Host.Class.MonadReflexCreateTrigger t m => Reflex.Host.Class.MonadReflexCreateTrigger t (Control.Monad.Trans.Except.ExceptT e m)
instance Reflex.Host.Class.MonadSubscribeEvent t m => Reflex.Host.Class.MonadSubscribeEvent t (Control.Monad.Trans.Except.ExceptT r m)
instance Reflex.Host.Class.MonadReflexHost t m => Reflex.Host.Class.MonadReflexHost t (Control.Monad.Trans.Except.ExceptT e m)
instance (Reflex.Host.Class.MonadReflexCreateTrigger t m, GHC.Base.Monoid w) => Reflex.Host.Class.MonadReflexCreateTrigger t (Control.Monad.Trans.RWS.Lazy.RWST r w s m)
instance (Reflex.Host.Class.MonadSubscribeEvent t m, GHC.Base.Monoid w) => Reflex.Host.Class.MonadSubscribeEvent t (Control.Monad.Trans.RWS.Lazy.RWST r w s m)
instance (Reflex.Host.Class.MonadReflexHost t m, GHC.Base.Monoid w) => Reflex.Host.Class.MonadReflexHost t (Control.Monad.Trans.RWS.Lazy.RWST r w s m)
module Reflex.Spider.Internal
debugPropagate :: Bool
debugInvalidateHeight :: Bool
showNodeId :: a -> String
data Hold a
Hold :: !(IORef a) -> !(IORef [Weak Invalidator]) -> !(IORef Any) -> !(IORef Any) -> Hold a
[holdValue] :: Hold a -> !(IORef a)
[holdInvalidators] :: Hold a -> !(IORef [Weak Invalidator])
[holdSubscriber] :: Hold a -> !(IORef Any)
[holdParent] :: Hold a -> !(IORef Any)
data EventEnv
EventEnv :: !(IORef [SomeAssignment]) -> !(IORef [SomeHoldInit]) -> !(IORef [SomeMaybeIORef]) -> !(IORef [SomeDMapIORef]) -> !(IORef Int) -> !(IORef [SomeCoincidenceInfo]) -> !(IORef (IntMap [DelayedMerge])) -> EventEnv
[eventEnvAssignments] :: EventEnv -> !(IORef [SomeAssignment])
[eventEnvHoldInits] :: EventEnv -> !(IORef [SomeHoldInit])
[eventEnvClears] :: EventEnv -> !(IORef [SomeMaybeIORef])
[eventEnvRootClears] :: EventEnv -> !(IORef [SomeDMapIORef])
[eventEnvCurrentHeight] :: EventEnv -> !(IORef Int)
[eventEnvCoincidenceInfos] :: EventEnv -> !(IORef [SomeCoincidenceInfo])
[eventEnvDelayedMerges] :: EventEnv -> !(IORef (IntMap [DelayedMerge]))
runEventM :: EventM a -> EventEnv -> IO a
askToAssignRef :: EventM (IORef [SomeAssignment])
askHoldInitRef :: EventM (IORef [SomeHoldInit])
getCurrentHeight :: EventM Int
putCurrentHeight :: Int -> EventM ()
scheduleClear :: IORef (Maybe a) -> EventM ()
scheduleRootClear :: IORef (DMap k) -> EventM ()
scheduleMerge :: Int -> MergeSubscribed a -> EventM ()
emitCoincidenceInfo :: SomeCoincidenceInfo -> EventM ()
hold :: a -> Event a -> EventM (Behavior a)
subscribeHold :: Event a -> Hold a -> EventM ()
newtype BehaviorM a
BehaviorM :: ReaderT (Maybe (Weak Invalidator, IORef [SomeBehaviorSubscribed])) IO a -> BehaviorM a
[unBehaviorM] :: BehaviorM a -> ReaderT (Maybe (Weak Invalidator, IORef [SomeBehaviorSubscribed])) IO a
data BehaviorSubscribed a
BehaviorSubscribedHold :: (Hold a) -> BehaviorSubscribed a
BehaviorSubscribedPull :: (PullSubscribed a) -> BehaviorSubscribed a
data SomeBehaviorSubscribed
SomeBehaviorSubscribed :: (BehaviorSubscribed a) -> SomeBehaviorSubscribed
data PullSubscribed a
PullSubscribed :: !a -> !(IORef [Weak Invalidator]) -> !Invalidator -> ![SomeBehaviorSubscribed] -> PullSubscribed a
[pullSubscribedValue] :: PullSubscribed a -> !a
[pullSubscribedInvalidators] :: PullSubscribed a -> !(IORef [Weak Invalidator])
[pullSubscribedOwnInvalidator] :: PullSubscribed a -> !Invalidator
[pullSubscribedParents] :: PullSubscribed a -> ![SomeBehaviorSubscribed]
data Pull a
Pull :: !(IORef (Maybe (PullSubscribed a))) -> !(BehaviorM a) -> Pull a
[pullValue] :: Pull a -> !(IORef (Maybe (PullSubscribed a)))
[pullCompute] :: Pull a -> !(BehaviorM a)
data Invalidator
InvalidatorPull :: (Pull a) -> Invalidator
InvalidatorSwitch :: (SwitchSubscribed a) -> Invalidator
data RootSubscribed a
RootSubscribed :: !(IORef [WeakSubscriber a]) -> !(IO (Maybe a)) -> RootSubscribed a
[rootSubscribedSubscribers] :: RootSubscribed a -> !(IORef [WeakSubscriber a])
[rootSubscribedOccurrence] :: RootSubscribed a -> !(IO (Maybe a))
data Root (k :: * -> *)
Root :: !(IORef (DMap k)) -> !(IORef (DMap (WrapArg RootSubscribed k))) -> !(forall a. k a -> RootTrigger a -> IO (IO ())) -> Root
[rootOccurrence] :: Root -> !(IORef (DMap k))
[rootSubscribed] :: Root -> !(IORef (DMap (WrapArg RootSubscribed k)))
[rootInit] :: Root -> !(forall a. k a -> RootTrigger a -> IO (IO ()))
data SomeHoldInit
SomeHoldInit :: (Event a) -> (Hold a) -> SomeHoldInit
newtype EventM a
EventM :: ReaderT EventEnv IO a -> EventM a
[unEventM] :: EventM a -> ReaderT EventEnv IO a
data PushSubscribed a b
PushSubscribed :: !(IORef (Maybe b)) -> !(IORef Int) -> !(IORef [WeakSubscriber b]) -> !(Subscriber a) -> !(EventSubscribed a) -> PushSubscribed a b
[pushSubscribedOccurrence] :: PushSubscribed a b -> !(IORef (Maybe b))
[pushSubscribedHeight] :: PushSubscribed a b -> !(IORef Int)
[pushSubscribedSubscribers] :: PushSubscribed a b -> !(IORef [WeakSubscriber b])
[pushSubscribedSelf] :: PushSubscribed a b -> !(Subscriber a)
[pushSubscribedParent] :: PushSubscribed a b -> !(EventSubscribed a)
data Push a b
Push :: !(a -> EventM (Maybe b)) -> !(Event a) -> !(IORef (Maybe (PushSubscribed a b))) -> Push a b
[pushCompute] :: Push a b -> !(a -> EventM (Maybe b))
[pushParent] :: Push a b -> !(Event a)
[pushSubscribed] :: Push a b -> !(IORef (Maybe (PushSubscribed a b)))
data MergeSubscribed k
MergeSubscribed :: !(IORef (Maybe (DMap k))) -> !(IORef (DMap k)) -> !(IORef Int) -> !(IORef [WeakSubscriber (DMap k)]) -> !Any -> !(DMap (WrapArg EventSubscribed k)) -> MergeSubscribed k
[mergeSubscribedOccurrence] :: MergeSubscribed k -> !(IORef (Maybe (DMap k)))
[mergeSubscribedAccum] :: MergeSubscribed k -> !(IORef (DMap k))
[mergeSubscribedHeight] :: MergeSubscribed k -> !(IORef Int)
[mergeSubscribedSubscribers] :: MergeSubscribed k -> !(IORef [WeakSubscriber (DMap k)])
[mergeSubscribedSelf] :: MergeSubscribed k -> !Any
[mergeSubscribedParents] :: MergeSubscribed k -> !(DMap (WrapArg EventSubscribed k))
data Merge k
Merge :: !(DMap (WrapArg Event k)) -> !(IORef (Maybe (MergeSubscribed k))) -> Merge k
[mergeParents] :: Merge k -> !(DMap (WrapArg Event k))
[mergeSubscribed] :: Merge k -> !(IORef (Maybe (MergeSubscribed k)))
data FanSubscriberKey k a
FanSubscriberKey :: k a -> FanSubscriberKey k [WeakSubscriber a]
data FanSubscribed k
FanSubscribed :: !(IORef (DMap (FanSubscriberKey k))) -> !(EventSubscribed (DMap k)) -> {-# NOUNPACK #-}(Subscriber (DMap k)) -> FanSubscribed k
[fanSubscribedSubscribers] :: FanSubscribed k -> !(IORef (DMap (FanSubscriberKey k)))
[fanSubscribedParent] :: FanSubscribed k -> !(EventSubscribed (DMap k))
[fanSubscribedSelf] :: FanSubscribed k -> {-# NOUNPACK #-}(Subscriber (DMap k))
data Fan k
Fan :: !(Event (DMap k)) -> !(IORef (Maybe (FanSubscribed k))) -> Fan k
[fanParent] :: Fan k -> !(Event (DMap k))
[fanSubscribed] :: Fan k -> !(IORef (Maybe (FanSubscribed k)))
data SwitchSubscribed a
SwitchSubscribed :: !(IORef (Maybe a)) -> !(IORef Int) -> !(IORef [WeakSubscriber a]) -> {-# NOUNPACK #-}(Subscriber a) -> !(IORef (Weak (Subscriber a))) -> {-# NOUNPACK #-}Invalidator -> !(IORef (Weak Invalidator)) -> !(IORef [SomeBehaviorSubscribed]) -> !(Behavior (Event a)) -> !(IORef (EventSubscribed a)) -> SwitchSubscribed a
[switchSubscribedOccurrence] :: SwitchSubscribed a -> !(IORef (Maybe a))
[switchSubscribedHeight] :: SwitchSubscribed a -> !(IORef Int)
[switchSubscribedSubscribers] :: SwitchSubscribed a -> !(IORef [WeakSubscriber a])
[switchSubscribedSelf] :: SwitchSubscribed a -> {-# NOUNPACK #-}(Subscriber a)
[switchSubscribedSelfWeak] :: SwitchSubscribed a -> !(IORef (Weak (Subscriber a)))
[switchSubscribedOwnInvalidator] :: SwitchSubscribed a -> {-# NOUNPACK #-}Invalidator
[switchSubscribedOwnWeakInvalidator] :: SwitchSubscribed a -> !(IORef (Weak Invalidator))
[switchSubscribedBehaviorParents] :: SwitchSubscribed a -> !(IORef [SomeBehaviorSubscribed])
[switchSubscribedParent] :: SwitchSubscribed a -> !(Behavior (Event a))
[switchSubscribedCurrentParent] :: SwitchSubscribed a -> !(IORef (EventSubscribed a))
data Switch a
Switch :: !(Behavior (Event a)) -> !(IORef (Maybe (SwitchSubscribed a))) -> Switch a
[switchParent] :: Switch a -> !(Behavior (Event a))
[switchSubscribed] :: Switch a -> !(IORef (Maybe (SwitchSubscribed a)))
data CoincidenceSubscribed a
CoincidenceSubscribed :: !(IORef (Maybe a)) -> !(IORef [WeakSubscriber a]) -> !(IORef Int) -> {-# NOUNPACK #-}(Subscriber (Event a)) -> !(EventSubscribed (Event a)) -> !(IORef (Maybe (EventSubscribed a))) -> CoincidenceSubscribed a
[coincidenceSubscribedOccurrence] :: CoincidenceSubscribed a -> !(IORef (Maybe a))
[coincidenceSubscribedSubscribers] :: CoincidenceSubscribed a -> !(IORef [WeakSubscriber a])
[coincidenceSubscribedHeight] :: CoincidenceSubscribed a -> !(IORef Int)
[coincidenceSubscribedOuter] :: CoincidenceSubscribed a -> {-# NOUNPACK #-}(Subscriber (Event a))
[coincidenceSubscribedOuterParent] :: CoincidenceSubscribed a -> !(EventSubscribed (Event a))
[coincidenceSubscribedInnerParent] :: CoincidenceSubscribed a -> !(IORef (Maybe (EventSubscribed a)))
data Coincidence a
Coincidence :: !(Event (Event a)) -> !(IORef (Maybe (CoincidenceSubscribed a))) -> Coincidence a
[coincidenceParent] :: Coincidence a -> !(Event (Event a))
[coincidenceSubscribed] :: Coincidence a -> !(IORef (Maybe (CoincidenceSubscribed a)))
data Box a
Box :: a -> Box a
[unBox] :: Box a -> a
data WeakSubscriber a
WeakSubscriberMerge :: !(k a) -> !(Weak (Box (MergeSubscribed k))) -> WeakSubscriber a
WeakSubscriberSimple :: !(Weak (Subscriber a)) -> WeakSubscriber a
showWeakSubscriberType :: WeakSubscriber a -> String
deRefWeakSubscriber :: WeakSubscriber a -> IO (Maybe (Subscriber a))
data Subscriber a
SubscriberPush :: !(a -> EventM (Maybe b)) -> (PushSubscribed a b) -> Subscriber a
SubscriberMerge :: !(k a) -> (MergeSubscribed k) -> Subscriber a
SubscriberFan :: (FanSubscribed k) -> Subscriber a
SubscriberHold :: !(Hold a) -> Subscriber a
SubscriberSwitch :: (SwitchSubscribed a) -> Subscriber a
SubscriberCoincidenceOuter :: (CoincidenceSubscribed b) -> Subscriber a
SubscriberCoincidenceInner :: (CoincidenceSubscribed a) -> Subscriber a
showSubscriberType :: Subscriber a -> String
data Event a
EventRoot :: !(k a) -> !(Root k) -> Event a
EventNever :: Event a
EventPush :: !(Push b a) -> Event a
EventMerge :: !(Merge k) -> Event a
EventFan :: !(k a) -> !(Fan k) -> Event a
EventSwitch :: !(Switch a) -> Event a
EventCoincidence :: !(Coincidence a) -> Event a
showEventType :: Event a -> String
data EventSubscribed a
EventSubscribedRoot :: {-# NOUNPACK #-}(RootSubscribed a) -> EventSubscribed a
EventSubscribedNever :: EventSubscribed a
EventSubscribedPush :: !(PushSubscribed b a) -> EventSubscribed a
EventSubscribedMerge :: !(MergeSubscribed k) -> EventSubscribed a
EventSubscribedFan :: !(k a) -> !(FanSubscribed k) -> EventSubscribed a
EventSubscribedSwitch :: !(SwitchSubscribed a) -> EventSubscribed a
EventSubscribedCoincidence :: !(CoincidenceSubscribed a) -> EventSubscribed a
newRootSubscribed :: IO (Maybe a) -> IORef [WeakSubscriber a] -> IO (RootSubscribed a)
newSubscriberPush :: (a -> EventM (Maybe b)) -> PushSubscribed a b -> IO (Subscriber a)
newSubscriberHold :: Hold a -> IO (Subscriber a)
newSubscriberFan :: GCompare k => FanSubscribed k -> IO (Subscriber (DMap k))
newSubscriberSwitch :: SwitchSubscribed a -> IO (Subscriber a)
newSubscriberCoincidenceOuter :: CoincidenceSubscribed b -> IO (Subscriber (Event b))
newSubscriberCoincidenceInner :: CoincidenceSubscribed a -> IO (Subscriber a)
newInvalidatorSwitch :: SwitchSubscribed a -> IO Invalidator
newInvalidatorPull :: Pull a -> IO Invalidator
newBox :: a -> IO (Box a)
data Behavior a
BehaviorHold :: !(Hold a) -> Behavior a
BehaviorConst :: !a -> Behavior a
BehaviorPull :: !(Pull a) -> Behavior a
type ResultM = EventM
unsafeNewIORef :: a -> b -> IORef b
push :: (a -> EventM (Maybe b)) -> Event a -> Event b
pull :: BehaviorM a -> Behavior a
switch :: Behavior (Event a) -> Event a
coincidence :: Event (Event a) -> Event a
newRoot :: IO (Root k)
propagateAndUpdateSubscribersRef :: IORef [WeakSubscriber a] -> a -> EventM ()
run :: [DSum RootTrigger] -> ResultM b -> IO b
data SomeMaybeIORef
SomeMaybeIORef :: (IORef (Maybe a)) -> SomeMaybeIORef
data SomeDMapIORef
SomeDMapIORef :: (IORef (DMap k)) -> SomeDMapIORef
data SomeAssignment
SomeAssignment :: (Hold a) -> a -> SomeAssignment
data DelayedMerge
DelayedMerge :: (MergeSubscribed k) -> DelayedMerge
debugFinalize :: Bool
mkWeakPtrWithDebug :: a -> String -> IO (Weak a)
type WeakList a = [Weak a]
traverseAndCleanWeakList_ :: Monad m => (wa -> m (Maybe a)) -> [wa] -> (a -> m ()) -> m [wa]
-- | Propagate everything at the current height
propagate :: a -> [WeakSubscriber a] -> EventM [WeakSubscriber a]
data SomeCoincidenceInfo
SomeCoincidenceInfo :: (Weak (Subscriber a)) -> (Subscriber a) -> (Maybe (CoincidenceSubscribed a)) -> SomeCoincidenceInfo
subscribeCoincidenceInner :: Event a -> Int -> CoincidenceSubscribed a -> EventM (Maybe a, Int, EventSubscribed a)
readBehavior :: Behavior a -> IO a
runBehaviorM :: BehaviorM a -> Maybe (Weak Invalidator, IORef [SomeBehaviorSubscribed]) -> IO a
askInvalidator :: BehaviorM (Maybe (Weak Invalidator))
askParentsRef :: BehaviorM (Maybe (IORef [SomeBehaviorSubscribed]))
readBehaviorTracked :: Behavior a -> BehaviorM a
readEvent :: Event a -> ResultM (Maybe a)
zeroRef :: IORef Int
getEventSubscribed :: Event a -> EventM (EventSubscribed a)
debugSubscribe :: Bool
subscribeEventSubscribed :: EventSubscribed a -> WeakSubscriber a -> IO ()
getEventSubscribedOcc :: EventSubscribed a -> IO (Maybe a)
eventSubscribedHeightRef :: EventSubscribed a -> IORef Int
subscribe :: Event a -> WeakSubscriber a -> EventM (EventSubscribed a)
noinlineFalse :: Bool
getRootSubscribed :: GCompare k => k a -> Root k -> EventM (RootSubscribed a)
getPushSubscribed :: Push a b -> EventM (PushSubscribed a b)
getMergeSubscribed :: GCompare k => Merge k -> EventM (MergeSubscribed k)
getFanSubscribed :: GCompare k => Fan k -> EventM (FanSubscribed k)
getSwitchSubscribed :: Switch a -> EventM (SwitchSubscribed a)
getCoincidenceSubscribed :: Coincidence a -> EventM (CoincidenceSubscribed a)
merge :: GCompare k => DMap (WrapArg Event k) -> Event (DMap k)
newtype EventSelector k
EventSelector :: (forall a. k a -> Event a) -> EventSelector k
[select] :: EventSelector k -> forall a. k a -> Event a
fan :: GCompare k => Event (DMap k) -> EventSelector k
-- | Run an event action outside of a frame
runFrame :: EventM a -> IO a
invalidHeight :: Int
invalidateSubscriberHeight :: WeakSubscriber a -> IO ()
invalidateCoincidenceHeight :: CoincidenceSubscribed a -> IO ()
recalculateSubscriberHeight :: WeakSubscriber a -> IO ()
recalculateCoincidenceHeight :: CoincidenceSubscribed a -> IO ()
calculateMergeHeight :: MergeSubscribed k -> IO Int
calculateSwitchHeight :: SwitchSubscribed a -> IO Int
calculateCoincidenceHeight :: CoincidenceSubscribed a -> IO Int
data SomeSwitchSubscribed
SomeSwitchSubscribed :: (SwitchSubscribed a) -> SomeSwitchSubscribed
debugInvalidate :: Bool
invalidate :: IORef [SomeSwitchSubscribed] -> WeakList Invalidator -> IO (WeakList Invalidator)
data Spider
data RootTrigger a
RootTrigger :: (IORef [WeakSubscriber a], IORef (DMap k), k a) -> RootTrigger a
newtype SpiderEventHandle a
SpiderEventHandle :: Event a -> SpiderEventHandle a
[unEventHandle] :: SpiderEventHandle a -> Event a
newtype SpiderHost a
SpiderHost :: IO a -> SpiderHost a
[runSpiderHost] :: SpiderHost a -> IO a
newtype SpiderHostFrame a
SpiderHostFrame :: EventM a -> SpiderHostFrame a
[runSpiderHostFrame] :: SpiderHostFrame a -> EventM a
newEventWithTriggerIO :: (RootTrigger a -> IO (IO ())) -> IO (Event a)
newFanEventWithTriggerIO :: GCompare k => (forall a. k a -> RootTrigger a -> IO (IO ())) -> IO (EventSelector k)
newtype ReadPhase a
ReadPhase :: ResultM a -> ReadPhase a
[runReadPhase] :: ReadPhase a -> ResultM a
instance Reflex.Class.MonadHold Reflex.Spider.Internal.Spider Reflex.Spider.Internal.ReadPhase
instance Reflex.Class.MonadSample Reflex.Spider.Internal.Spider Reflex.Spider.Internal.ReadPhase
instance Control.Monad.Fix.MonadFix Reflex.Spider.Internal.ReadPhase
instance GHC.Base.Monad Reflex.Spider.Internal.ReadPhase
instance GHC.Base.Applicative Reflex.Spider.Internal.ReadPhase
instance GHC.Base.Functor Reflex.Spider.Internal.ReadPhase
instance Control.Monad.Exception.MonadAsyncException Reflex.Spider.Internal.SpiderHostFrame
instance Control.Monad.Exception.MonadException Reflex.Spider.Internal.SpiderHostFrame
instance Control.Monad.IO.Class.MonadIO Reflex.Spider.Internal.SpiderHostFrame
instance Control.Monad.Fix.MonadFix Reflex.Spider.Internal.SpiderHostFrame
instance GHC.Base.Monad Reflex.Spider.Internal.SpiderHostFrame
instance GHC.Base.Applicative Reflex.Spider.Internal.SpiderHostFrame
instance GHC.Base.Functor Reflex.Spider.Internal.SpiderHostFrame
instance Control.Monad.Exception.MonadAsyncException Reflex.Spider.Internal.SpiderHost
instance Control.Monad.Exception.MonadException Reflex.Spider.Internal.SpiderHost
instance Control.Monad.IO.Class.MonadIO Reflex.Spider.Internal.SpiderHost
instance Control.Monad.Fix.MonadFix Reflex.Spider.Internal.SpiderHost
instance GHC.Base.Monad Reflex.Spider.Internal.SpiderHost
instance GHC.Base.Applicative Reflex.Spider.Internal.SpiderHost
instance GHC.Base.Functor Reflex.Spider.Internal.SpiderHost
instance Control.Monad.Exception.MonadAsyncException Reflex.Spider.Internal.EventM
instance Control.Monad.Exception.MonadException Reflex.Spider.Internal.EventM
instance Control.Monad.IO.Class.MonadIO Reflex.Spider.Internal.EventM
instance Control.Monad.Fix.MonadFix Reflex.Spider.Internal.EventM
instance GHC.Base.Monad Reflex.Spider.Internal.EventM
instance GHC.Base.Applicative Reflex.Spider.Internal.EventM
instance GHC.Base.Functor Reflex.Spider.Internal.EventM
instance Control.Monad.Fix.MonadFix Reflex.Spider.Internal.BehaviorM
instance Control.Monad.IO.Class.MonadIO Reflex.Spider.Internal.BehaviorM
instance GHC.Base.Monad Reflex.Spider.Internal.BehaviorM
instance GHC.Base.Applicative Reflex.Spider.Internal.BehaviorM
instance GHC.Base.Functor Reflex.Spider.Internal.BehaviorM
instance Data.GADT.Compare.GEq k => Data.GADT.Compare.GEq (Reflex.Spider.Internal.FanSubscriberKey k)
instance Data.GADT.Compare.GCompare k => Data.GADT.Compare.GCompare (Reflex.Spider.Internal.FanSubscriberKey k)
instance GHC.Base.Functor Reflex.Spider.Internal.Event
instance GHC.Base.Functor Reflex.Spider.Internal.Behavior
instance Reflex.Class.Reflex Reflex.Spider.Internal.Spider
instance Reflex.Class.MonadSample Reflex.Spider.Internal.Spider Reflex.Spider.Internal.SpiderHost
instance Reflex.Class.MonadHold Reflex.Spider.Internal.Spider Reflex.Spider.Internal.SpiderHost
instance Reflex.Class.MonadSample Reflex.Spider.Internal.Spider Reflex.Spider.Internal.BehaviorM
instance Reflex.Class.MonadSample Reflex.Spider.Internal.Spider Reflex.Spider.Internal.EventM
instance Reflex.Class.MonadHold Reflex.Spider.Internal.Spider Reflex.Spider.Internal.EventM
instance Reflex.Host.Class.MonadSubscribeEvent Reflex.Spider.Internal.Spider Reflex.Spider.Internal.SpiderHostFrame
instance Reflex.Host.Class.ReflexHost Reflex.Spider.Internal.Spider
instance Reflex.Host.Class.MonadReadEvent Reflex.Spider.Internal.Spider Reflex.Spider.Internal.ReadPhase
instance Control.Monad.Ref.MonadRef Reflex.Spider.Internal.EventM
instance Control.Monad.Ref.MonadAtomicRef Reflex.Spider.Internal.EventM
instance Reflex.Class.MonadSample Reflex.Spider.Internal.Spider Reflex.Spider.Internal.SpiderHostFrame
instance Reflex.Class.MonadHold Reflex.Spider.Internal.Spider Reflex.Spider.Internal.SpiderHostFrame
instance Reflex.Host.Class.MonadReflexCreateTrigger Reflex.Spider.Internal.Spider Reflex.Spider.Internal.SpiderHost
instance Reflex.Host.Class.MonadReflexCreateTrigger Reflex.Spider.Internal.Spider Reflex.Spider.Internal.SpiderHostFrame
instance Reflex.Host.Class.MonadSubscribeEvent Reflex.Spider.Internal.Spider Reflex.Spider.Internal.SpiderHost
instance Reflex.Host.Class.MonadReflexHost Reflex.Spider.Internal.Spider Reflex.Spider.Internal.SpiderHost
instance Control.Monad.Ref.MonadRef Reflex.Spider.Internal.SpiderHost
instance Control.Monad.Ref.MonadAtomicRef Reflex.Spider.Internal.SpiderHost
instance Control.Monad.Ref.MonadRef Reflex.Spider.Internal.SpiderHostFrame
instance Control.Monad.Ref.MonadAtomicRef Reflex.Spider.Internal.SpiderHostFrame
module Reflex.Spider
data Spider
newtype SpiderHost a
SpiderHost :: IO a -> SpiderHost a
[runSpiderHost] :: SpiderHost a -> IO a
module Reflex