reflex-0.8.1.1: Higher-order Functional Reactive Programming
Safe HaskellNone
LanguageHaskell2010

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

Instances details
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

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 #

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

newtype SpiderHostFrame (x :: Type) a Source #

Constructors

SpiderHostFrame 

Fields

Instances

Instances details
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) #

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 #

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

HasSpiderTimeline x => 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

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 :: Type) a Source #

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

Constructors

SpiderHost 

Fields

Instances

Instances details
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 #

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 #

MonadFail (SpiderHost x) Source # 
Instance details

Defined in Reflex.Spider.Internal

Methods

fail :: String -> 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 => 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

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

Defined in Reflex.Spider.Internal

Associated Types

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

HasSpiderTimeline x => 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

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

Defined in Reflex.Spider.Internal

HasSpiderTimeline x => NotReady (SpiderTimeline x) (PerformEventT (SpiderTimeline x) (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

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

newtype SpiderPushM (x :: Type) a Source #

Constructors

SpiderPushM (ComputeM x a) 

Instances

Instances details
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 #

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 :: Type) a Source #

Constructors

SpiderPullM (BehaviorM x a) 

Instances

Instances details
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 #

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

Instances details
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 #

mergeG :: forall k (k :: k -> Type) q v. GCompare k => (forall (a :: k). q a -> Event (SpiderTimeline x) (v a)) -> DMap k q -> Event (SpiderTimeline x) (DMap k v) Source #

fanG :: forall k (k :: k -> Type) (v :: k -> Type). GCompare k => Event (SpiderTimeline x) (DMap k v) -> EventSelectorG (SpiderTimeline x) k v 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 #

mergeIncrementalG :: forall k (k :: k -> Type) q v. GCompare k => (forall (a :: k). q a -> Event (SpiderTimeline x) (v a)) -> Incremental (SpiderTimeline x) (PatchDMap k q) -> Event (SpiderTimeline x) (DMap k v) Source #

mergeIncrementalWithMoveG :: forall k (k :: k -> Type) q v. GCompare k => (forall (a :: k). q a -> Event (SpiderTimeline x) (v a)) -> Incremental (SpiderTimeline x) (PatchDMapWithMove k q) -> Event (SpiderTimeline x) (DMap k v) 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 #

incrementalCoercion :: Coercion (PatchTarget a) (PatchTarget b) -> Coercion a b -> Coercion (Incremental (SpiderTimeline x) a) (Incremental (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 => 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 => 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 => MonadHold (SpiderTimeline x :: Type) (ReadPhase 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) (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

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

Defined in Reflex.Spider.Internal

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

Defined in Reflex.Spider.Internal

Associated Types

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

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

Defined in Reflex.Spider.Internal

HasSpiderTimeline x => 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 => MonadSubscribeEvent (SpiderTimeline x) (SpiderHostFrame x) Source # 
Instance details

Defined in Reflex.Spider.Internal

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

Defined in Reflex.Spider.Internal

NotReady (SpiderTimeline x) (SpiderHostFrame 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 => NotReady (SpiderTimeline x) (PerformEventT (SpiderTimeline x) (SpiderHost 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

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 Height Source #

Constructors

Height 

Fields

Instances

Instances details
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 EventSelectorG x k v Source #

Constructors

EventSelectorG 

Fields

newtype EventSelector x k Source #

Constructors

EventSelector 

Fields

data Merge x k v s Source #

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

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

type MergeGetSubscription x s = forall a. s a -> EventSubscription x Source #

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

newtype EventSelectorInt x a Source #

Constructors

EventSelectorInt 

Fields

data SomeResetCoincidence x Source #

Instances

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

Defined in Reflex.Spider.Internal

type WeakList a = [Weak a] Source #

data SomeAssignment x Source #

Constructors

forall a. SomeAssignment !(IORef a) !(IORef [Weak (Invalidator x)]) a 

Instances

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

Defined in Reflex.Spider.Internal

newtype RootClear k Source #

Constructors

RootClear (IORef (DMap k Identity)) 

Instances

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

Defined in Reflex.Spider.Internal

newtype IntClear a Source #

Constructors

IntClear (IORef (IntMap a)) 

Instances

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

Defined in Reflex.Spider.Internal

newtype Clear a Source #

Constructors

Clear (IORef (Maybe a)) 

Instances

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

Defined in Reflex.Spider.Internal

newtype Dyn (x :: Type) 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 v Source #

Constructors

Fan 

Fields

newtype EventM x a Source #

Constructors

EventM 

Fields

Instances

Instances details
HasSpiderTimeline x => HasCurrentHeight 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 => 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 #

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 #

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 (Some RootClear) (EventM x) Source # 
Instance details

Defined in Reflex.Spider.Internal

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

Defined in Reflex.Spider.Internal

HasSpiderTimeline x => Defer (Some Clear) (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 (SomeHoldInit x) (EventM x) Source # 
Instance details

Defined in Reflex.Spider.Internal

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

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

Defined in Reflex.Spider.Internal

data SomeDynInit x Source #

Constructors

forall p.Patch p => SomeDynInit !(Dyn x p) 

Instances

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

Defined in Reflex.Spider.Internal

data SomeHoldInit x Source #

Constructors

forall p.Patch p => SomeHoldInit !(Hold x p) 

Instances

Instances details
MonadReader (BehaviorEnv x) (BehaviorM x) Source # 
Instance details

Defined in Reflex.Spider.Internal

Methods

ask :: BehaviorM x (BehaviorEnv x) #

local :: (BehaviorEnv x -> BehaviorEnv x) -> BehaviorM x a -> BehaviorM x a #

reader :: (BehaviorEnv x -> a) -> BehaviorM x a #

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

Defined in Reflex.Spider.Internal

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

Defined in Reflex.Spider.Internal

data Root x k Source #

Constructors

Root 

Fields

data Invalidator x Source #

Constructors

forall a. InvalidatorPull (Pull x a) 
forall a. InvalidatorSwitch (SwitchSubscribed x a) 

Instances

Instances details
MonadReader (BehaviorEnv x) (BehaviorM x) Source # 
Instance details

Defined in Reflex.Spider.Internal

Methods

ask :: BehaviorM x (BehaviorEnv x) #

local :: (BehaviorEnv x -> BehaviorEnv x) -> BehaviorM x a -> BehaviorM x a #

reader :: (BehaviorEnv x -> a) -> BehaviorM x a #

data Pull x a Source #

Constructors

Pull 

Fields

newtype SomeBehaviorSubscribed x Source #

Instances

Instances details
MonadReader (BehaviorEnv x) (BehaviorM x) Source # 
Instance details

Defined in Reflex.Spider.Internal

Methods

ask :: BehaviorM x (BehaviorEnv x) #

local :: (BehaviorEnv x -> BehaviorEnv x) -> BehaviorM x a -> BehaviorM x a #

reader :: (BehaviorEnv x -> a) -> BehaviorM x a #

newtype BehaviorM x a Source #

Constructors

BehaviorM 

Instances

Instances details
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 #

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 #

MonadReader (BehaviorEnv x) (BehaviorM x) Source # 
Instance details

Defined in Reflex.Spider.Internal

Methods

ask :: BehaviorM x (BehaviorEnv x) #

local :: (BehaviorEnv x -> BehaviorEnv x) -> BehaviorM x a -> BehaviorM x a #

reader :: (BehaviorEnv x -> a) -> BehaviorM x a #

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

Defined in Reflex.Spider.Internal

class HasSpiderTimeline x where Source #

Methods

spiderTimeline :: SpiderTimelineEnv x Source #

Retrieve the current SpiderTimelineEnv

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

Instances

Instances details
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

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

Defined in Reflex.Spider.Internal

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

Defined in Reflex.Spider.Internal

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

Defined in Reflex.Spider.Internal

HasSpiderTimeline x => Defer (Some Clear) (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 (SomeHoldInit x) (EventM x) Source # 
Instance details

Defined in Reflex.Spider.Internal

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

Defined in Reflex.Spider.Internal

newtype SpiderTimelineEnv x Source #

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

Constructors

STE 

Instances

Instances details
GEq SpiderTimelineEnv Source # 
Instance details

Defined in Reflex.Spider.Internal

Methods

geq :: forall (a :: k) (b :: k). SpiderTimelineEnv a -> SpiderTimelineEnv b -> Maybe (a :~: b) #

Eq (SpiderTimelineEnv x) Source # 
Instance details

Defined in Reflex.Spider.Internal

data Global Source #

A statically allocated SpiderTimeline

Instances

Instances details
HasSpiderTimeline Global Source # 
Instance details

Defined in Reflex.Spider.Internal

data Hold x p Source #

Constructors

Hold 

data Dynamic x target p Source #

Constructors

Dynamic 

Fields

Instances

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

Defined in Reflex.Spider.Internal

Methods

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

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

type DynamicS x p = Dynamic x (PatchTarget p) p Source #

newtype Behavior x a Source #

Constructors

Behavior 

Instances

Instances details
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

Instances details
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 => Semialign (Event x) Source # 
Instance details

Defined in Reflex.Spider.Internal

Methods

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 => Align (Event x) Source # 
Instance details

Defined in Reflex.Spider.Internal

Methods

nil :: Event x a #

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

Defined in Reflex.Spider.Internal

Methods

zip :: Event x a -> Event x b -> Event x (a, b) #

zipWith :: (a -> b -> c) -> Event x a -> Event x b -> Event x c #

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

Defined in Reflex.Spider.Internal

Methods

mapMaybe :: (a -> Maybe b) -> Event x a -> Event x b #

catMaybes :: Event x (Maybe a) -> Event x a #

filter :: (a -> Bool) -> Event x a -> Event x a #

pushCheap :: HasSpiderTimeline x => (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 :: HasSpiderTimeline x => 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, HasSpiderTimeline x) => 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, HasSpiderTimeline x) => k a -> Root x k -> Event x a Source #

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

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

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

newSubscriberFan :: forall x k v. (HasSpiderTimeline x, GCompare k) => FanSubscribed x k v -> IO (Subscriber x (DMap k v)) Source #

propagate :: forall x a. HasSpiderTimeline x => a -> WeakBag (Subscriber x a) -> EventM x () Source #

Propagate everything at the current height

propagateFast :: forall x a. HasSpiderTimeline x => 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 #

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

buildDynamic :: (Defer (SomeDynInit x) m, Patch p) => EventM x (PatchTarget p) -> Event x p -> m (Dyn x p) 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 #

withIncreasedDepth :: proxy x -> m a -> m a Source #

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

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

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

groupByHead :: Eq a => [NonEmpty a] -> [(a, NonEmpty [a])] Source #

listsToForest :: Eq a => [[a]] -> Forest a 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 #

getRootSubscribed :: forall k x a. (GCompare k, HasSpiderTimeline x) => k a -> Root x k -> Subscriber x a -> IO (WeakBagTicket, RootSubscribed x a, Maybe a) Source #

getFanSubscribed :: (HasSpiderTimeline x, GCompare k) => k a -> Fan x k v -> Subscriber x (v a) -> EventM x (WeakBagTicket, FanSubscribed x k v, Maybe (v a)) Source #

mergeG :: forall k q x v. (HasSpiderTimeline x, GCompare k) => (forall a. q a -> Event x (v a)) -> DynamicS x (PatchDMap k q) -> Event x (DMap k v) Source #

mergeWithMove :: forall k v q x. (HasSpiderTimeline x, GCompare k) => (forall a. q a -> Event x (v a)) -> DynamicS x (PatchDMapWithMove k q) -> Event x (DMap k v) Source #

mergeCheap :: forall k x q v. (HasSpiderTimeline x, GCompare k) => (forall a. q a -> Event x (v a)) -> DynamicS x (PatchDMap k q) -> Event x (DMap k v) Source #

mergeCheapWithMove :: forall k x v q. (HasSpiderTimeline x, GCompare k) => (forall a. q a -> Event x (v a)) -> DynamicS x (PatchDMapWithMove k q) -> Event x (DMap k v) Source #

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

mergeGCheap' :: forall k v x p s q. (HasSpiderTimeline x, GCompare k, PatchTarget p ~ DMap k q) => MergeGetSubscription x s -> MergeInitFunc k v q x s -> MergeUpdateFunc k v x p s -> MergeDestroyFunc k s -> DynamicS x p -> Event x (DMap k v) Source #

mergeInt :: forall x a. HasSpiderTimeline x => DynamicS 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

newEventWithTriggerIO :: forall x a. HasSpiderTimeline x => (RootTrigger x a -> IO (IO ())) -> IO (Event x a) Source #

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