reflex-0.5: Higher-order Functional Reactive Programming

Safe HaskellNone
LanguageHaskell98

Reflex.Spider.Internal

Description

This module is the implementation of the Spider Reflex engine. It uses a graph traversal algorithm to propagate Events and Behaviors.

Synopsis

Documentation

pattern SpiderEvent :: Event x a -> Event (SpiderTimeline x) a Source #

newtype ReadPhase x a Source #

Constructors

ReadPhase (ResultM x a) 
Instances
Monad (ReadPhase x) Source # 
Instance details

Defined in Reflex.Spider.Internal

Methods

(>>=) :: ReadPhase x a -> (a -> ReadPhase x b) -> ReadPhase x b #

(>>) :: ReadPhase x a -> ReadPhase x b -> ReadPhase x b #

return :: a -> ReadPhase x a #

fail :: String -> ReadPhase x a #

Functor (ReadPhase x) Source # 
Instance details

Defined in Reflex.Spider.Internal

Methods

fmap :: (a -> b) -> ReadPhase x a -> ReadPhase x b #

(<$) :: a -> ReadPhase x b -> ReadPhase x a #

MonadFix (ReadPhase x) Source # 
Instance details

Defined in Reflex.Spider.Internal

Methods

mfix :: (a -> ReadPhase x a) -> ReadPhase x a #

Applicative (ReadPhase x) Source # 
Instance details

Defined in Reflex.Spider.Internal

Methods

pure :: a -> ReadPhase x a #

(<*>) :: ReadPhase x (a -> b) -> ReadPhase x a -> ReadPhase x b #

liftA2 :: (a -> b -> c) -> ReadPhase x a -> ReadPhase x b -> ReadPhase x c #

(*>) :: ReadPhase x a -> ReadPhase x b -> ReadPhase x b #

(<*) :: ReadPhase x a -> ReadPhase x b -> ReadPhase x a #

HasSpiderTimeline x => MonadReadEvent (SpiderTimeline x) (ReadPhase x) Source # 
Instance details

Defined in Reflex.Spider.Internal

HasSpiderTimeline x => MonadHold (SpiderTimeline x :: Type) (ReadPhase x) Source # 
Instance details

Defined in Reflex.Spider.Internal

HasSpiderTimeline x => MonadSample (SpiderTimeline x :: Type) (ReadPhase x) Source # 
Instance details

Defined in Reflex.Spider.Internal

newtype SpiderHostFrame x a Source #

Constructors

SpiderHostFrame 

Fields

Instances
Monad (SpiderHostFrame x) Source # 
Instance details

Defined in Reflex.Spider.Internal

Functor (SpiderHostFrame x) Source # 
Instance details

Defined in Reflex.Spider.Internal

Methods

fmap :: (a -> b) -> SpiderHostFrame x a -> SpiderHostFrame x b #

(<$) :: a -> SpiderHostFrame x b -> SpiderHostFrame x a #

MonadFix (SpiderHostFrame x) Source # 
Instance details

Defined in Reflex.Spider.Internal

Methods

mfix :: (a -> SpiderHostFrame x a) -> SpiderHostFrame x a #

Applicative (SpiderHostFrame x) Source # 
Instance details

Defined in Reflex.Spider.Internal

MonadIO (SpiderHostFrame x) Source # 
Instance details

Defined in Reflex.Spider.Internal

Methods

liftIO :: IO a -> SpiderHostFrame x a #

MonadException (SpiderHostFrame x) Source # 
Instance details

Defined in Reflex.Spider.Internal

MonadAsyncException (SpiderHostFrame x) Source # 
Instance details

Defined in Reflex.Spider.Internal

Methods

mask :: ((forall a. SpiderHostFrame x a -> SpiderHostFrame x a) -> SpiderHostFrame x b) -> SpiderHostFrame x b #

PrimMonad (SpiderHostFrame x) Source # 
Instance details

Defined in Reflex.Spider.Internal

Associated Types

type PrimState (SpiderHostFrame x) :: Type #

MonadRef (SpiderHostFrame x) Source # 
Instance details

Defined in Reflex.Spider.Internal

Associated Types

type Ref (SpiderHostFrame x) :: Type -> Type #

Methods

newRef :: a -> SpiderHostFrame x (Ref (SpiderHostFrame x) a) #

readRef :: Ref (SpiderHostFrame x) a -> SpiderHostFrame x a #

writeRef :: Ref (SpiderHostFrame x) a -> a -> SpiderHostFrame x () #

modifyRef :: Ref (SpiderHostFrame x) a -> (a -> a) -> SpiderHostFrame x () #

modifyRef' :: Ref (SpiderHostFrame x) a -> (a -> a) -> SpiderHostFrame x () #

MonadAtomicRef (SpiderHostFrame x) Source # 
Instance details

Defined in Reflex.Spider.Internal

Methods

atomicModifyRef :: Ref (SpiderHostFrame x) a -> (a -> (a, b)) -> SpiderHostFrame x b #

atomicModifyRef' :: Ref (SpiderHostFrame x) a -> (a -> (a, b)) -> SpiderHostFrame x b #

MonadReflexCreateTrigger (SpiderTimeline x) (SpiderHostFrame x) Source # 
Instance details

Defined in Reflex.Spider.Internal

HasSpiderTimeline x => MonadSubscribeEvent (SpiderTimeline x) (SpiderHostFrame x) Source # 
Instance details

Defined in Reflex.Spider.Internal

NotReady (SpiderTimeline x) (SpiderHostFrame x) Source # 
Instance details

Defined in Reflex.Spider.Internal

HasSpiderTimeline x => MonadHold (SpiderTimeline x :: Type) (SpiderHostFrame x) Source # 
Instance details

Defined in Reflex.Spider.Internal

HasSpiderTimeline x => MonadSample (SpiderTimeline x :: Type) (SpiderHostFrame x) Source # 
Instance details

Defined in Reflex.Spider.Internal

type PrimState (SpiderHostFrame x) Source # 
Instance details

Defined in Reflex.Spider.Internal

type Ref (SpiderHostFrame x) Source # 
Instance details

Defined in Reflex.Spider.Internal

newtype SpiderHost x a Source #

The monad for actions that manipulate a Spider timeline identified by x

Constructors

SpiderHost 

Fields

Instances
Monad (SpiderHost x) Source # 
Instance details

Defined in Reflex.Spider.Internal

Methods

(>>=) :: SpiderHost x a -> (a -> SpiderHost x b) -> SpiderHost x b #

(>>) :: SpiderHost x a -> SpiderHost x b -> SpiderHost x b #

return :: a -> SpiderHost x a #

fail :: String -> SpiderHost x a #

Functor (SpiderHost x) Source # 
Instance details

Defined in Reflex.Spider.Internal

Methods

fmap :: (a -> b) -> SpiderHost x a -> SpiderHost x b #

(<$) :: a -> SpiderHost x b -> SpiderHost x a #

MonadFix (SpiderHost x) Source # 
Instance details

Defined in Reflex.Spider.Internal

Methods

mfix :: (a -> SpiderHost x a) -> SpiderHost x a #

Applicative (SpiderHost x) Source # 
Instance details

Defined in Reflex.Spider.Internal

Methods

pure :: a -> SpiderHost x a #

(<*>) :: SpiderHost x (a -> b) -> SpiderHost x a -> SpiderHost x b #

liftA2 :: (a -> b -> c) -> SpiderHost x a -> SpiderHost x b -> SpiderHost x c #

(*>) :: SpiderHost x a -> SpiderHost x b -> SpiderHost x b #

(<*) :: SpiderHost x a -> SpiderHost x b -> SpiderHost x a #

MonadIO (SpiderHost x) Source # 
Instance details

Defined in Reflex.Spider.Internal

Methods

liftIO :: IO a -> SpiderHost x a #

MonadException (SpiderHost x) Source # 
Instance details

Defined in Reflex.Spider.Internal

Methods

throw :: Exception e => e -> SpiderHost x a #

catch :: Exception e => SpiderHost x a -> (e -> SpiderHost x a) -> SpiderHost x a #

finally :: SpiderHost x a -> SpiderHost x b -> SpiderHost x a #

MonadAsyncException (SpiderHost x) Source # 
Instance details

Defined in Reflex.Spider.Internal

Methods

mask :: ((forall a. SpiderHost x a -> SpiderHost x a) -> SpiderHost x b) -> SpiderHost x b #

MonadRef (SpiderHost x) Source # 
Instance details

Defined in Reflex.Spider.Internal

Associated Types

type Ref (SpiderHost x) :: Type -> Type #

Methods

newRef :: a -> SpiderHost x (Ref (SpiderHost x) a) #

readRef :: Ref (SpiderHost x) a -> SpiderHost x a #

writeRef :: Ref (SpiderHost x) a -> a -> SpiderHost x () #

modifyRef :: Ref (SpiderHost x) a -> (a -> a) -> SpiderHost x () #

modifyRef' :: Ref (SpiderHost x) a -> (a -> a) -> SpiderHost x () #

MonadAtomicRef (SpiderHost x) Source # 
Instance details

Defined in Reflex.Spider.Internal

Methods

atomicModifyRef :: Ref (SpiderHost x) a -> (a -> (a, b)) -> SpiderHost x b #

atomicModifyRef' :: Ref (SpiderHost x) a -> (a -> (a, b)) -> SpiderHost x b #

HasSpiderTimeline x => MonadReflexHost (SpiderTimeline x) (SpiderHost x) Source # 
Instance details

Defined in Reflex.Spider.Internal

Associated Types

type ReadPhase (SpiderHost x) :: Type -> Type Source #

MonadReflexCreateTrigger (SpiderTimeline x) (SpiderHost x) Source # 
Instance details

Defined in Reflex.Spider.Internal

HasSpiderTimeline x => MonadSubscribeEvent (SpiderTimeline x) (SpiderHost x) Source # 
Instance details

Defined in Reflex.Spider.Internal

HasSpiderTimeline x => MonadHold (SpiderTimeline x :: Type) (SpiderHost x) Source # 
Instance details

Defined in Reflex.Spider.Internal

HasSpiderTimeline x => MonadSample (SpiderTimeline x :: Type) (SpiderHost x) Source # 
Instance details

Defined in Reflex.Spider.Internal

type Ref (SpiderHost x) Source # 
Instance details

Defined in Reflex.Spider.Internal

type Ref (SpiderHost x) = Ref IO
type ReadPhase (SpiderHost x) Source # 
Instance details

Defined in Reflex.Spider.Internal

data RootTrigger x a Source #

Constructors

GCompare k => RootTrigger (WeakBag (Subscriber x a), IORef (DMap k Identity), k a) 

newtype SpiderPushM x a Source #

Constructors

SpiderPushM (ComputeM x a) 
Instances
Monad (SpiderPushM x) Source # 
Instance details

Defined in Reflex.Spider.Internal

Methods

(>>=) :: SpiderPushM x a -> (a -> SpiderPushM x b) -> SpiderPushM x b #

(>>) :: SpiderPushM x a -> SpiderPushM x b -> SpiderPushM x b #

return :: a -> SpiderPushM x a #

fail :: String -> SpiderPushM x a #

Functor (SpiderPushM x) Source # 
Instance details

Defined in Reflex.Spider.Internal

Methods

fmap :: (a -> b) -> SpiderPushM x a -> SpiderPushM x b #

(<$) :: a -> SpiderPushM x b -> SpiderPushM x a #

MonadFix (SpiderPushM x) Source # 
Instance details

Defined in Reflex.Spider.Internal

Methods

mfix :: (a -> SpiderPushM x a) -> SpiderPushM x a #

Applicative (SpiderPushM x) Source # 
Instance details

Defined in Reflex.Spider.Internal

Methods

pure :: a -> SpiderPushM x a #

(<*>) :: SpiderPushM x (a -> b) -> SpiderPushM x a -> SpiderPushM x b #

liftA2 :: (a -> b -> c) -> SpiderPushM x a -> SpiderPushM x b -> SpiderPushM x c #

(*>) :: SpiderPushM x a -> SpiderPushM x b -> SpiderPushM x b #

(<*) :: SpiderPushM x a -> SpiderPushM x b -> SpiderPushM x a #

MonadIO (SpiderPushM x) Source # 
Instance details

Defined in Reflex.Spider.Internal

Methods

liftIO :: IO a -> SpiderPushM x a #

HasSpiderTimeline x => MonadHold (SpiderTimeline x :: Type) (SpiderPushM x) Source # 
Instance details

Defined in Reflex.Spider.Internal

HasSpiderTimeline x => MonadSample (SpiderTimeline x :: Type) (SpiderPushM x) Source # 
Instance details

Defined in Reflex.Spider.Internal

newtype SpiderPullM x a Source #

Constructors

SpiderPullM (BehaviorM x a) 
Instances
Monad (SpiderPullM x) Source # 
Instance details

Defined in Reflex.Spider.Internal

Methods

(>>=) :: SpiderPullM x a -> (a -> SpiderPullM x b) -> SpiderPullM x b #

(>>) :: SpiderPullM x a -> SpiderPullM x b -> SpiderPullM x b #

return :: a -> SpiderPullM x a #

fail :: String -> SpiderPullM x a #

Functor (SpiderPullM x) Source # 
Instance details

Defined in Reflex.Spider.Internal

Methods

fmap :: (a -> b) -> SpiderPullM x a -> SpiderPullM x b #

(<$) :: a -> SpiderPullM x b -> SpiderPullM x a #

MonadFix (SpiderPullM x) Source # 
Instance details

Defined in Reflex.Spider.Internal

Methods

mfix :: (a -> SpiderPullM x a) -> SpiderPullM x a #

Applicative (SpiderPullM x) Source # 
Instance details

Defined in Reflex.Spider.Internal

Methods

pure :: a -> SpiderPullM x a #

(<*>) :: SpiderPullM x (a -> b) -> SpiderPullM x a -> SpiderPullM x b #

liftA2 :: (a -> b -> c) -> SpiderPullM x a -> SpiderPullM x b -> SpiderPullM x c #

(*>) :: SpiderPullM x a -> SpiderPullM x b -> SpiderPullM x b #

(<*) :: SpiderPullM x a -> SpiderPullM x b -> SpiderPullM x a #

MonadIO (SpiderPullM x) Source # 
Instance details

Defined in Reflex.Spider.Internal

Methods

liftIO :: IO a -> SpiderPullM x a #

MonadSample (SpiderTimeline x :: Type) (SpiderPullM x) Source # 
Instance details

Defined in Reflex.Spider.Internal

type SpiderEnv = SpiderTimeline Source #

Deprecated: Use SpiderTimelineEnv instead

SpiderEnv is the old name for SpiderTimeline

type Spider = SpiderTimeline Global Source #

The default, global Spider environment

data SpiderTimeline x Source #

Designates the default, global Spider timeline

Instances
HasSpiderTimeline x => ReflexHost (SpiderTimeline x) Source # 
Instance details

Defined in Reflex.Spider.Internal

HasSpiderTimeline x => Reflex (SpiderTimeline x :: Type) Source # 
Instance details

Defined in Reflex.Spider.Internal

Methods

never :: Event (SpiderTimeline x) a Source #

constant :: a -> Behavior (SpiderTimeline x) a Source #

push :: (a -> PushM (SpiderTimeline x) (Maybe b)) -> Event (SpiderTimeline x) a -> Event (SpiderTimeline x) b Source #

pushCheap :: (a -> PushM (SpiderTimeline x) (Maybe b)) -> Event (SpiderTimeline x) a -> Event (SpiderTimeline x) b Source #

pull :: PullM (SpiderTimeline x) a -> Behavior (SpiderTimeline x) a Source #

merge :: GCompare k => DMap k (Event (SpiderTimeline x)) -> Event (SpiderTimeline x) (DMap k Identity) Source #

fan :: GCompare k => Event (SpiderTimeline x) (DMap k Identity) -> EventSelector (SpiderTimeline x) k Source #

switch :: Behavior (SpiderTimeline x) (Event (SpiderTimeline x) a) -> Event (SpiderTimeline x) a Source #

coincidence :: Event (SpiderTimeline x) (Event (SpiderTimeline x) a) -> Event (SpiderTimeline x) a Source #

current :: Dynamic (SpiderTimeline x) a -> Behavior (SpiderTimeline x) a Source #

updated :: Dynamic (SpiderTimeline x) a -> Event (SpiderTimeline x) a Source #

unsafeBuildDynamic :: PullM (SpiderTimeline x) a -> Event (SpiderTimeline x) a -> Dynamic (SpiderTimeline x) a Source #

unsafeBuildIncremental :: Patch p => PullM (SpiderTimeline x) (PatchTarget p) -> Event (SpiderTimeline x) p -> Incremental (SpiderTimeline x) p Source #

mergeIncremental :: GCompare k => Incremental (SpiderTimeline x) (PatchDMap k (Event (SpiderTimeline x))) -> Event (SpiderTimeline x) (DMap k Identity) Source #

mergeIncrementalWithMove :: GCompare k => Incremental (SpiderTimeline x) (PatchDMapWithMove k (Event (SpiderTimeline x))) -> Event (SpiderTimeline x) (DMap k Identity) Source #

currentIncremental :: Patch p => Incremental (SpiderTimeline x) p -> Behavior (SpiderTimeline x) (PatchTarget p) Source #

updatedIncremental :: Patch p => Incremental (SpiderTimeline x) p -> Event (SpiderTimeline x) p Source #

incrementalToDynamic :: Patch p => Incremental (SpiderTimeline x) p -> Dynamic (SpiderTimeline x) (PatchTarget p) Source #

behaviorCoercion :: Coercion a b -> Coercion (Behavior (SpiderTimeline x) a) (Behavior (SpiderTimeline x) b) Source #

eventCoercion :: Coercion a b -> Coercion (Event (SpiderTimeline x) a) (Event (SpiderTimeline x) b) Source #

dynamicCoercion :: Coercion a b -> Coercion (Dynamic (SpiderTimeline x) a) (Dynamic (SpiderTimeline x) b) Source #

mergeIntIncremental :: Incremental (SpiderTimeline x) (PatchIntMap (Event (SpiderTimeline x) a)) -> Event (SpiderTimeline x) (IntMap a) Source #

fanInt :: Event (SpiderTimeline x) (IntMap a) -> EventSelectorInt (SpiderTimeline x) a Source #

HasSpiderTimeline x => MonadReflexHost (SpiderTimeline x) (SpiderHost x) Source # 
Instance details

Defined in Reflex.Spider.Internal

Associated Types

type ReadPhase (SpiderHost x) :: Type -> Type Source #

MonadReflexCreateTrigger (SpiderTimeline x) (SpiderHostFrame x) Source # 
Instance details

Defined in Reflex.Spider.Internal

MonadReflexCreateTrigger (SpiderTimeline x) (SpiderHost x) Source # 
Instance details

Defined in Reflex.Spider.Internal

HasSpiderTimeline x => MonadReadEvent (SpiderTimeline x) (ReadPhase x) Source # 
Instance details

Defined in Reflex.Spider.Internal

HasSpiderTimeline x => MonadSubscribeEvent (SpiderTimeline x) (SpiderHost x) Source # 
Instance details

Defined in Reflex.Spider.Internal

HasSpiderTimeline x => MonadSubscribeEvent (SpiderTimeline x) (SpiderHostFrame x) Source # 
Instance details

Defined in Reflex.Spider.Internal

NotReady (SpiderTimeline x) (SpiderHostFrame x) Source # 
Instance details

Defined in Reflex.Spider.Internal

HasSpiderTimeline x => MonadHold (SpiderTimeline x :: Type) (ReadPhase x) Source # 
Instance details

Defined in Reflex.Spider.Internal

HasSpiderTimeline x => MonadHold (SpiderTimeline x :: Type) (SpiderHostFrame x) Source # 
Instance details

Defined in Reflex.Spider.Internal

HasSpiderTimeline x => MonadHold (SpiderTimeline x :: Type) (SpiderHost x) Source # 
Instance details

Defined in Reflex.Spider.Internal

HasSpiderTimeline x => MonadHold (SpiderTimeline x :: Type) (SpiderPushM x) Source # 
Instance details

Defined in Reflex.Spider.Internal

HasSpiderTimeline x => MonadHold (SpiderTimeline x :: Type) (EventM x) Source # 
Instance details

Defined in Reflex.Spider.Internal

HasSpiderTimeline x => MonadSample (SpiderTimeline x :: Type) (ReadPhase x) Source # 
Instance details

Defined in Reflex.Spider.Internal

HasSpiderTimeline x => MonadSample (SpiderTimeline x :: Type) (SpiderHost x) Source # 
Instance details

Defined in Reflex.Spider.Internal

HasSpiderTimeline x => MonadSample (SpiderTimeline x :: Type) (SpiderHostFrame x) Source # 
Instance details

Defined in Reflex.Spider.Internal

HasSpiderTimeline x => MonadSample (SpiderTimeline x :: Type) (SpiderPushM x) Source # 
Instance details

Defined in Reflex.Spider.Internal

MonadSample (SpiderTimeline x :: Type) (SpiderPullM x) Source # 
Instance details

Defined in Reflex.Spider.Internal

HasSpiderTimeline x => MonadSample (SpiderTimeline x :: Type) (EventM x) Source # 
Instance details

Defined in Reflex.Spider.Internal

Methods

sample :: Behavior (SpiderTimeline x) a -> EventM x a Source #

HasSpiderTimeline x => Monad (Dynamic (SpiderTimeline x)) Source # 
Instance details

Defined in Reflex.Spider.Internal

HasSpiderTimeline x => Functor (Dynamic (SpiderTimeline x)) Source # 
Instance details

Defined in Reflex.Spider.Internal

Methods

fmap :: (a -> b) -> Dynamic (SpiderTimeline x) a -> Dynamic (SpiderTimeline x) b #

(<$) :: a -> Dynamic (SpiderTimeline x) b -> Dynamic (SpiderTimeline x) a #

HasSpiderTimeline x => Applicative (Dynamic (SpiderTimeline x)) Source # 
Instance details

Defined in Reflex.Spider.Internal

type EventTrigger (SpiderTimeline x) Source # 
Instance details

Defined in Reflex.Spider.Internal

type EventHandle (SpiderTimeline x) Source # 
Instance details

Defined in Reflex.Spider.Internal

type HostFrame (SpiderTimeline x) Source # 
Instance details

Defined in Reflex.Spider.Internal

newtype Behavior (SpiderTimeline x :: Type) a Source # 
Instance details

Defined in Reflex.Spider.Internal

newtype Event (SpiderTimeline x :: Type) a Source # 
Instance details

Defined in Reflex.Spider.Internal

newtype Dynamic (SpiderTimeline x :: Type) a Source # 
Instance details

Defined in Reflex.Spider.Internal

newtype Incremental (SpiderTimeline x :: Type) p Source # 
Instance details

Defined in Reflex.Spider.Internal

type PushM (SpiderTimeline x :: Type) Source # 
Instance details

Defined in Reflex.Spider.Internal

type PullM (SpiderTimeline x :: Type) Source # 
Instance details

Defined in Reflex.Spider.Internal

newtype Height Source #

Constructors

Height 

Fields

Instances
Bounded Height Source # 
Instance details

Defined in Reflex.Spider.Internal

Eq Height Source # 
Instance details

Defined in Reflex.Spider.Internal

Methods

(==) :: Height -> Height -> Bool #

(/=) :: Height -> Height -> Bool #

Ord Height Source # 
Instance details

Defined in Reflex.Spider.Internal

Read Height Source # 
Instance details

Defined in Reflex.Spider.Internal

Show Height Source # 
Instance details

Defined in Reflex.Spider.Internal

newtype EventSelector x k Source #

Constructors

EventSelector 

Fields

type MergeDestroyFunc k s = DMap k s -> IO () Source #

type MergeInitFunc k x s = DMap k (Event x) -> (forall a. EventM x (k a) -> Subscriber x a) -> EventM x (DMap k Identity, [Height], DMap k s) Source #

type MergeUpdateFunc k x p s = (forall a. EventM x (k a) -> Subscriber x a) -> IORef HeightBag -> DMap k s -> p -> EventM x ([EventSubscription x], DMap k s) Source #

newtype EventSelectorInt x a Source #

Constructors

EventSelectorInt 

Fields

type WeakList a = [Weak a] Source #

data SomeAssignment x Source #

Constructors

SomeAssignment !(IORef a) !(IORef [Weak (Invalidator x)]) a 
Instances
HasSpiderTimeline x => Defer (SomeAssignment x) (EventM x) Source # 
Instance details

Defined in Reflex.Spider.Internal

data SomeIntClear Source #

Constructors

SomeIntClear !(IORef (IntMap a)) 

data SomeClear Source #

Constructors

SomeClear !(IORef (Maybe a)) 
Instances
HasSpiderTimeline x => Defer SomeClear (EventM x) Source # 
Instance details

Defined in Reflex.Spider.Internal

newtype Dyn x p Source #

Constructors

Dyn 

Fields

data DynType x p Source #

Constructors

UnsafeDyn !(BehaviorM x (PatchTarget p), Event x p) 
BuildDyn !(EventM x (PatchTarget p), Event x p) 
HoldDyn !(Hold x p) 

data Switch x a Source #

Constructors

Switch 

data Fan x k Source #

Constructors

Fan 

Fields

newtype EventM x a Source #

Constructors

EventM 

Fields

Instances
HasSpiderTimeline x => HasCurrentHeight x (EventM x) Source # 
Instance details

Defined in Reflex.Spider.Internal

HasSpiderTimeline x => Defer SomeRootClear (EventM x) Source # 
Instance details

Defined in Reflex.Spider.Internal

HasSpiderTimeline x => Defer SomeIntClear (EventM x) Source # 
Instance details

Defined in Reflex.Spider.Internal

HasSpiderTimeline x => Defer SomeClear (EventM x) Source # 
Instance details

Defined in Reflex.Spider.Internal

Monad (EventM x) Source # 
Instance details

Defined in Reflex.Spider.Internal

Methods

(>>=) :: EventM x a -> (a -> EventM x b) -> EventM x b #

(>>) :: EventM x a -> EventM x b -> EventM x b #

return :: a -> EventM x a #

fail :: String -> EventM x a #

Functor (EventM x) Source # 
Instance details

Defined in Reflex.Spider.Internal

Methods

fmap :: (a -> b) -> EventM x a -> EventM x b #

(<$) :: a -> EventM x b -> EventM x a #

MonadFix (EventM x) Source # 
Instance details

Defined in Reflex.Spider.Internal

Methods

mfix :: (a -> EventM x a) -> EventM x a #

Applicative (EventM x) Source # 
Instance details

Defined in Reflex.Spider.Internal

Methods

pure :: a -> EventM x a #

(<*>) :: EventM x (a -> b) -> EventM x a -> EventM x b #

liftA2 :: (a -> b -> c) -> EventM x a -> EventM x b -> EventM x c #

(*>) :: EventM x a -> EventM x b -> EventM x b #

(<*) :: EventM x a -> EventM x b -> EventM x a #

MonadIO (EventM x) Source # 
Instance details

Defined in Reflex.Spider.Internal

Methods

liftIO :: IO a -> EventM x a #

MonadException (EventM x) Source # 
Instance details

Defined in Reflex.Spider.Internal

Methods

throw :: Exception e => e -> EventM x a #

catch :: Exception e => EventM x a -> (e -> EventM x a) -> EventM x a #

finally :: EventM x a -> EventM x b -> EventM x a #

MonadAsyncException (EventM x) Source # 
Instance details

Defined in Reflex.Spider.Internal

Methods

mask :: ((forall a. EventM x a -> EventM x a) -> EventM x b) -> EventM x b #

MonadRef (EventM x) Source # 
Instance details

Defined in Reflex.Spider.Internal

Associated Types

type Ref (EventM x) :: Type -> Type #

Methods

newRef :: a -> EventM x (Ref (EventM x) a) #

readRef :: Ref (EventM x) a -> EventM x a #

writeRef :: Ref (EventM x) a -> a -> EventM x () #

modifyRef :: Ref (EventM x) a -> (a -> a) -> EventM x () #

modifyRef' :: Ref (EventM x) a -> (a -> a) -> EventM x () #

MonadAtomicRef (EventM x) Source # 
Instance details

Defined in Reflex.Spider.Internal

Methods

atomicModifyRef :: Ref (EventM x) a -> (a -> (a, b)) -> EventM x b #

atomicModifyRef' :: Ref (EventM x) a -> (a -> (a, b)) -> EventM x b #

HasSpiderTimeline x => Defer (SomeResetCoincidence x) (EventM x) Source # 
Instance details

Defined in Reflex.Spider.Internal

HasSpiderTimeline x => Defer (SomeAssignment x) (EventM x) Source # 
Instance details

Defined in Reflex.Spider.Internal

HasSpiderTimeline x => Defer (SomeMergeInit x) (EventM x) Source # 
Instance details

Defined in Reflex.Spider.Internal

HasSpiderTimeline x => Defer (SomeMergeUpdate x) (EventM x) Source # 
Instance details

Defined in Reflex.Spider.Internal

HasSpiderTimeline x => Defer (SomeDynInit x) (EventM x) Source # 
Instance details

Defined in Reflex.Spider.Internal

HasSpiderTimeline x => Defer (SomeHoldInit x) (EventM x) Source # 
Instance details

Defined in Reflex.Spider.Internal

HasSpiderTimeline x => MonadHold (SpiderTimeline x :: Type) (EventM x) Source # 
Instance details

Defined in Reflex.Spider.Internal

HasSpiderTimeline x => MonadSample (SpiderTimeline x :: Type) (EventM x) Source # 
Instance details

Defined in Reflex.Spider.Internal

Methods

sample :: Behavior (SpiderTimeline x) a -> EventM x a Source #

type Ref (EventM x) Source # 
Instance details

Defined in Reflex.Spider.Internal

type Ref (EventM x) = Ref IO

newtype SomeMergeInit x Source #

Constructors

SomeMergeInit 

Fields

Instances
HasSpiderTimeline x => Defer (SomeMergeInit x) (EventM x) Source # 
Instance details

Defined in Reflex.Spider.Internal

data SomeDynInit x Source #

Constructors

Patch p => SomeDynInit !(Dyn x p) 
Instances
HasSpiderTimeline x => Defer (SomeDynInit x) (EventM x) Source # 
Instance details

Defined in Reflex.Spider.Internal

data SomeHoldInit x Source #

Constructors

Patch p => SomeHoldInit !(Hold x p) 
Instances
Defer (SomeHoldInit x) (BehaviorM x) Source # 
Instance details

Defined in Reflex.Spider.Internal

HasSpiderTimeline x => Defer (SomeHoldInit x) (EventM x) Source # 
Instance details

Defined in Reflex.Spider.Internal

data Root x (k :: * -> *) Source #

Constructors

Root 

Fields

data Pull x a Source #

Constructors

Pull 

Fields

newtype BehaviorM x a Source #

Constructors

BehaviorM 
Instances
Monad (BehaviorM x) Source # 
Instance details

Defined in Reflex.Spider.Internal

Methods

(>>=) :: BehaviorM x a -> (a -> BehaviorM x b) -> BehaviorM x b #

(>>) :: BehaviorM x a -> BehaviorM x b -> BehaviorM x b #

return :: a -> BehaviorM x a #

fail :: String -> BehaviorM x a #

Functor (BehaviorM x) Source # 
Instance details

Defined in Reflex.Spider.Internal

Methods

fmap :: (a -> b) -> BehaviorM x a -> BehaviorM x b #

(<$) :: a -> BehaviorM x b -> BehaviorM x a #

MonadFix (BehaviorM x) Source # 
Instance details

Defined in Reflex.Spider.Internal

Methods

mfix :: (a -> BehaviorM x a) -> BehaviorM x a #

Applicative (BehaviorM x) Source # 
Instance details

Defined in Reflex.Spider.Internal

Methods

pure :: a -> BehaviorM x a #

(<*>) :: BehaviorM x (a -> b) -> BehaviorM x a -> BehaviorM x b #

liftA2 :: (a -> b -> c) -> BehaviorM x a -> BehaviorM x b -> BehaviorM x c #

(*>) :: BehaviorM x a -> BehaviorM x b -> BehaviorM x b #

(<*) :: BehaviorM x a -> BehaviorM x b -> BehaviorM x a #

MonadIO (BehaviorM x) Source # 
Instance details

Defined in Reflex.Spider.Internal

Methods

liftIO :: IO a -> BehaviorM x a #

Defer (SomeHoldInit x) (BehaviorM x) Source # 
Instance details

Defined in Reflex.Spider.Internal

class HasSpiderTimeline x => HasCurrentHeight x m | m -> x where Source #

Instances
HasSpiderTimeline x => HasCurrentHeight x (EventM x) Source # 
Instance details

Defined in Reflex.Spider.Internal

class MonadIO m => Defer a m where Source #

Methods

getDeferralQueue :: m (IORef [a]) Source #

Instances
HasSpiderTimeline x => Defer SomeRootClear (EventM x) Source # 
Instance details

Defined in Reflex.Spider.Internal

HasSpiderTimeline x => Defer SomeIntClear (EventM x) Source # 
Instance details

Defined in Reflex.Spider.Internal

HasSpiderTimeline x => Defer SomeClear (EventM x) Source # 
Instance details

Defined in Reflex.Spider.Internal

HasSpiderTimeline x => Defer (SomeResetCoincidence x) (EventM x) Source # 
Instance details

Defined in Reflex.Spider.Internal

HasSpiderTimeline x => Defer (SomeAssignment x) (EventM x) Source # 
Instance details

Defined in Reflex.Spider.Internal

HasSpiderTimeline x => Defer (SomeMergeInit x) (EventM x) Source # 
Instance details

Defined in Reflex.Spider.Internal

HasSpiderTimeline x => Defer (SomeMergeUpdate x) (EventM x) Source # 
Instance details

Defined in Reflex.Spider.Internal

HasSpiderTimeline x => Defer (SomeDynInit x) (EventM x) Source # 
Instance details

Defined in Reflex.Spider.Internal

Defer (SomeHoldInit x) (BehaviorM x) Source # 
Instance details

Defined in Reflex.Spider.Internal

HasSpiderTimeline x => Defer (SomeHoldInit x) (EventM x) Source # 
Instance details

Defined in Reflex.Spider.Internal

data SpiderTimelineEnv x Source #

Stores all global data relevant to a particular Spider timeline; only one value should exist for each type x

Instances
Eq (SpiderTimelineEnv x) Source # 
Instance details

Defined in Reflex.Spider.Internal

GEq SpiderTimelineEnv Source # 
Instance details

Defined in Reflex.Spider.Internal

Methods

geq :: SpiderTimelineEnv a -> SpiderTimelineEnv b -> Maybe (a := b) #

data Global Source #

A statically allocated SpiderTimeline

data Hold x p Source #

Constructors

Hold 

data Dynamic x p Source #

Constructors

Dynamic 

Fields

newtype Behavior x a Source #

Constructors

Behavior 
Instances
Functor (Behavior x) Source # 
Instance details

Defined in Reflex.Spider.Internal

Methods

fmap :: (a -> b) -> Behavior x a -> Behavior x b #

(<$) :: a -> Behavior x b -> Behavior x a #

data Subscriber x a Source #

Constructors

Subscriber 

newtype Event x a Source #

Constructors

Event 

Fields

Instances
HasSpiderTimeline x => Functor (Event x) Source # 
Instance details

Defined in Reflex.Spider.Internal

Methods

fmap :: (a -> b) -> Event x a -> Event x b #

(<$) :: a -> Event x b -> Event x a #

HasSpiderTimeline x => Align (Event x) Source # 
Instance details

Defined in Reflex.Spider.Internal

Methods

nil :: Event x a #

align :: Event x a -> Event x b -> Event x (These a b) #

alignWith :: (These a b -> c) -> Event x a -> Event x b -> Event x c #

HasSpiderTimeline x => FunctorMaybe (Event x) Source # 
Instance details

Defined in Reflex.Spider.Internal

Methods

fmapMaybe :: (a -> Maybe b) -> Event x a -> Event x b Source #

pushCheap :: (a -> ComputeM x (Maybe b)) -> Event x a -> Event x b Source #

Construct an Event equivalent to that constructed by push, but with no caching; if the computation function is very cheap, this is (much) more efficient than push

terminalSubscriber :: (a -> EventM x ()) -> Subscriber x a Source #

A subscriber that never triggers other Events

subscribeAndReadHead :: Event x a -> Subscriber x a -> EventM x (EventSubscription x, Maybe a) Source #

Subscribe to an Event only for the duration of one occurrence

headE :: (MonadIO m, Defer (SomeMergeInit x) m) => Event x a -> m (Event x a) Source #

cacheEvent :: forall x a. HasSpiderTimeline x => Event x a -> Event x a Source #

Construct an Event whose value is guaranteed not to be recomputed repeatedly

TODO: Try a caching strategy where we subscribe directly to the parent when there's only one subscriber, and then build our own FastWeakBag only when a second subscriber joins

wrap :: MonadIO m => (t -> EventSubscribed x) -> (Subscriber x a -> m (WeakBagTicket, t, Maybe a)) -> Subscriber x a -> m (EventSubscription x, Maybe a) Source #

eventRoot :: GCompare k => k a -> Root x k -> Event x a Source #

eventFan :: (GCompare k, HasSpiderTimeline x) => k a -> Fan x k -> Event x a Source #

eventHold :: Hold x p -> Event x p Source #

eventDyn :: (HasSpiderTimeline x, Patch p) => Dyn x p -> Event x p Source #

propagate :: a -> WeakBag (Subscriber x a) -> EventM x () Source #

Propagate everything at the current height

propagateFast :: a -> FastWeakBag (Subscriber x a) -> EventM x () Source #

Propagate everything at the current height

toAny :: a -> Any Source #

runEventM :: EventM x a -> IO a Source #

asksEventEnv :: forall x a. HasSpiderTimeline x => (EventEnv x -> a) -> EventM x a Source #

defer :: Defer a m => a -> m () Source #

hold :: (Patch p, Defer (SomeHoldInit x) m) => PatchTarget p -> Event x p -> m (Hold x p) Source #

newMapDyn :: HasSpiderTimeline x => (a -> b) -> Dynamic x (Identity a) -> Dynamic x (Identity b) Source #

zipDynWith :: HasSpiderTimeline x => (a -> b -> c) -> Dynamic x (Identity a) -> Dynamic x (Identity b) -> Dynamic x (Identity c) Source #

buildDynamic :: (Defer (SomeDynInit x) m, Patch p) => EventM x (PatchTarget p) -> Event x p -> m (Dyn x p) Source #

unsafeNewIORef :: a -> b -> IORef b Source #

push :: HasSpiderTimeline x => (a -> ComputeM x (Maybe b)) -> Event x a -> Event x b Source #

run :: forall x b. HasSpiderTimeline x => [DSum (RootTrigger x) Identity] -> ResultM x b -> SpiderHost x b Source #

tracePropagate :: CanTrace x m => proxy x -> String -> m () Source #

traceWhen :: CanTrace x m => proxy x -> Bool -> String -> m () Source #

traceMWhen :: CanTrace x m => proxy x -> Bool -> m String -> m () Source #

propagateSubscriberHold :: forall x p. (HasSpiderTimeline x, Patch p) => Hold x p -> p -> EventM x () Source #

getDynHold :: (Defer (SomeHoldInit x) m, Patch p) => Dyn x p -> m (Hold x p) Source #

merge :: forall k x. (HasSpiderTimeline x, GCompare k) => Dynamic x (PatchDMap k (Event x)) -> Event x (DMap k Identity) Source #

mergeCheap :: forall k x. (HasSpiderTimeline x, GCompare k) => Dynamic x (PatchDMap k (Event x)) -> Event x (DMap k Identity) Source #

mergeSubscriber :: forall x k s a. (HasSpiderTimeline x, GCompare k) => Merge x k s -> EventM x (k a) -> Subscriber x a Source #

mergeCheap' :: forall k x p s. (HasSpiderTimeline x, GCompare k, PatchTarget p ~ DMap k (Event x)) => MergeInitFunc k x s -> MergeUpdateFunc k x p s -> MergeDestroyFunc k s -> Dynamic x p -> Event x (DMap k Identity) Source #

mergeInt :: forall x a. HasSpiderTimeline x => Dynamic x (PatchIntMap (Event x a)) -> Event x (IntMap a) Source #

runFrame :: forall x a. HasSpiderTimeline x => EventM x a -> SpiderHost x a Source #

Run an event action outside of a frame

newSpiderTimeline :: IO (Some SpiderTimelineEnv) Source #

Create a new SpiderTimelineEnv

withSpiderTimeline :: (forall x. HasSpiderTimeline x => SpiderTimelineEnv x -> IO r) -> IO r Source #

Pass a new timeline to the given function.

runSpiderHost :: SpiderHost Global a -> IO a Source #

Run an action affecting the global Spider timeline; this will be guarded by a mutex for that timeline

runSpiderHostForTimeline :: SpiderHost x a -> SpiderTimelineEnv x -> IO a Source #

Run an action affecting a given Spider timeline; this will be guarded by a mutex for that timeline

newFanEventWithTriggerIO :: GCompare k => (forall a. k a -> RootTrigger x a -> IO (IO ())) -> IO (EventSelector x k) Source #