Safe Haskell | None |
---|---|
Language | Haskell98 |
- debugPropagate :: Bool
- debugInvalidateHeight :: Bool
- showNodeId :: a -> String
- data Hold a = Hold {
- holdValue :: !(IORef a)
- holdInvalidators :: !(IORef [Weak Invalidator])
- holdSubscriber :: !(IORef Any)
- holdParent :: !(IORef Any)
- data EventEnv = EventEnv {
- eventEnvAssignments :: !(IORef [SomeAssignment])
- eventEnvHoldInits :: !(IORef [SomeHoldInit])
- eventEnvClears :: !(IORef [SomeMaybeIORef])
- eventEnvRootClears :: !(IORef [SomeDMapIORef])
- eventEnvCurrentHeight :: !(IORef Int)
- eventEnvCoincidenceInfos :: !(IORef [SomeCoincidenceInfo])
- eventEnvDelayedMerges :: !(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 {
- unBehaviorM :: ReaderT (Maybe (Weak Invalidator, IORef [SomeBehaviorSubscribed])) IO a
- data BehaviorSubscribed a
- data SomeBehaviorSubscribed = forall a . SomeBehaviorSubscribed (BehaviorSubscribed a)
- data PullSubscribed a = PullSubscribed {}
- data Pull a = Pull {
- pullValue :: !(IORef (Maybe (PullSubscribed a)))
- pullCompute :: !(BehaviorM a)
- data Invalidator
- = forall a . InvalidatorPull (Pull a)
- | forall a . InvalidatorSwitch (SwitchSubscribed a)
- data RootSubscribed a = RootSubscribed {
- rootSubscribedSubscribers :: !(IORef [WeakSubscriber a])
- rootSubscribedOccurrence :: !(IO (Maybe a))
- data Root k = Root {
- rootOccurrence :: !(IORef (DMap k))
- rootSubscribed :: !(IORef (DMap (WrapArg RootSubscribed k)))
- rootInit :: !(forall a. k a -> RootTrigger a -> IO (IO ()))
- data SomeHoldInit = forall a . SomeHoldInit (Event a) (Hold a)
- newtype EventM a = EventM {}
- data PushSubscribed a b = PushSubscribed {
- pushSubscribedOccurrence :: !(IORef (Maybe b))
- pushSubscribedHeight :: !(IORef Int)
- pushSubscribedSubscribers :: !(IORef [WeakSubscriber b])
- pushSubscribedSelf :: !(Subscriber a)
- pushSubscribedParent :: !(EventSubscribed a)
- data Push a b = Push {
- pushCompute :: !(a -> EventM (Maybe b))
- pushParent :: !(Event a)
- pushSubscribed :: !(IORef (Maybe (PushSubscribed a b)))
- data MergeSubscribed k = MergeSubscribed {
- mergeSubscribedOccurrence :: !(IORef (Maybe (DMap k)))
- mergeSubscribedAccum :: !(IORef (DMap k))
- mergeSubscribedHeight :: !(IORef Int)
- mergeSubscribedSubscribers :: !(IORef [WeakSubscriber (DMap k)])
- mergeSubscribedSelf :: !Any
- mergeSubscribedParents :: !(DMap (WrapArg EventSubscribed k))
- data Merge k = Merge {
- mergeParents :: !(DMap (WrapArg Event k))
- mergeSubscribed :: !(IORef (Maybe (MergeSubscribed k)))
- data FanSubscriberKey k a where
- FanSubscriberKey :: k a -> FanSubscriberKey k [WeakSubscriber a]
- data FanSubscribed k = FanSubscribed {
- fanSubscribedSubscribers :: !(IORef (DMap (FanSubscriberKey k)))
- fanSubscribedParent :: !(EventSubscribed (DMap k))
- fanSubscribedSelf :: !(Subscriber (DMap k))
- data Fan k = Fan {
- fanParent :: !(Event (DMap k))
- fanSubscribed :: !(IORef (Maybe (FanSubscribed k)))
- data SwitchSubscribed a = SwitchSubscribed {
- switchSubscribedOccurrence :: !(IORef (Maybe a))
- switchSubscribedHeight :: !(IORef Int)
- switchSubscribedSubscribers :: !(IORef [WeakSubscriber a])
- switchSubscribedSelf :: !(Subscriber a)
- switchSubscribedSelfWeak :: !(IORef (Weak (Subscriber a)))
- switchSubscribedOwnInvalidator :: !Invalidator
- switchSubscribedOwnWeakInvalidator :: !(IORef (Weak Invalidator))
- switchSubscribedBehaviorParents :: !(IORef [SomeBehaviorSubscribed])
- switchSubscribedParent :: !(Behavior (Event a))
- switchSubscribedCurrentParent :: !(IORef (EventSubscribed a))
- data Switch a = Switch {
- switchParent :: !(Behavior (Event a))
- switchSubscribed :: !(IORef (Maybe (SwitchSubscribed a)))
- data CoincidenceSubscribed a = CoincidenceSubscribed {
- coincidenceSubscribedOccurrence :: !(IORef (Maybe a))
- coincidenceSubscribedSubscribers :: !(IORef [WeakSubscriber a])
- coincidenceSubscribedHeight :: !(IORef Int)
- coincidenceSubscribedOuter :: !(Subscriber (Event a))
- coincidenceSubscribedOuterParent :: !(EventSubscribed (Event a))
- coincidenceSubscribedInnerParent :: !(IORef (Maybe (EventSubscribed a)))
- data Coincidence a = Coincidence {
- coincidenceParent :: !(Event (Event a))
- coincidenceSubscribed :: !(IORef (Maybe (CoincidenceSubscribed a)))
- data Box a = Box {
- unBox :: a
- data WeakSubscriber a
- = forall k . GCompare k => WeakSubscriberMerge !(k a) !(Weak (Box (MergeSubscribed k)))
- | WeakSubscriberSimple !(Weak (Subscriber a))
- showWeakSubscriberType :: WeakSubscriber a -> String
- deRefWeakSubscriber :: WeakSubscriber a -> IO (Maybe (Subscriber a))
- data Subscriber a
- = forall b . SubscriberPush !(a -> EventM (Maybe b)) (PushSubscribed a b)
- | forall k . GCompare k => SubscriberMerge !(k a) (MergeSubscribed k)
- | forall k . (GCompare k, a ~ DMap k) => SubscriberFan (FanSubscribed k)
- | SubscriberHold !(Hold a)
- | SubscriberSwitch (SwitchSubscribed a)
- | forall b . (a ~ Event b) => SubscriberCoincidenceOuter (CoincidenceSubscribed b)
- | SubscriberCoincidenceInner (CoincidenceSubscribed a)
- showSubscriberType :: Subscriber a -> String
- data Event a
- = forall k . GCompare k => EventRoot !(k a) !(Root k)
- | EventNever
- | forall b . EventPush !(Push b a)
- | forall k . (GCompare k, a ~ DMap k) => EventMerge !(Merge k)
- | forall k . GCompare k => EventFan !(k a) !(Fan k)
- | EventSwitch !(Switch a)
- | EventCoincidence !(Coincidence a)
- showEventType :: Event a -> String
- data EventSubscribed a
- = EventSubscribedRoot !(RootSubscribed a)
- | EventSubscribedNever
- | forall b . EventSubscribedPush !(PushSubscribed b a)
- | forall k . (GCompare k, a ~ DMap k) => EventSubscribedMerge !(MergeSubscribed k)
- | forall k . GCompare k => EventSubscribedFan !(k a) !(FanSubscribed k)
- | EventSubscribedSwitch !(SwitchSubscribed a)
- | EventSubscribedCoincidence !(CoincidenceSubscribed 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)
- | BehaviorConst !a
- | BehaviorPull !(Pull 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 = forall a . SomeMaybeIORef (IORef (Maybe a))
- data SomeDMapIORef = forall k . SomeDMapIORef (IORef (DMap k))
- data SomeAssignment = forall a . SomeAssignment (Hold a) a
- data DelayedMerge = forall k . DelayedMerge (MergeSubscribed k)
- 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 :: a -> [WeakSubscriber a] -> EventM [WeakSubscriber a]
- data SomeCoincidenceInfo = forall a . SomeCoincidenceInfo (Weak (Subscriber a)) (Subscriber a) (Maybe (CoincidenceSubscribed a))
- 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 :: forall k. GCompare k => Merge k -> EventM (MergeSubscribed k)
- getFanSubscribed :: GCompare k => Fan k -> EventM (FanSubscribed k)
- getSwitchSubscribed :: Switch a -> EventM (SwitchSubscribed a)
- getCoincidenceSubscribed :: forall a. Coincidence a -> EventM (CoincidenceSubscribed a)
- merge :: GCompare k => DMap (WrapArg Event k) -> Event (DMap k)
- newtype EventSelector k = EventSelector {}
- fan :: GCompare k => Event (DMap k) -> EventSelector k
- 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 = forall a . SomeSwitchSubscribed (SwitchSubscribed a)
- debugInvalidate :: Bool
- invalidate :: IORef [SomeSwitchSubscribed] -> WeakList Invalidator -> IO (WeakList Invalidator)
- data Spider
- data RootTrigger a = forall k . GCompare k => RootTrigger (IORef [WeakSubscriber a], IORef (DMap k), k a)
- newtype SpiderEventHandle a = SpiderEventHandle {
- unEventHandle :: Event a
- newtype SpiderHost a = SpiderHost {
- runSpiderHost :: IO a
- newtype SpiderHostFrame a = SpiderHostFrame {
- runSpiderHostFrame :: EventM a
- newEventWithTriggerIO :: forall a. (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 {
- runReadPhase :: ResultM a
Documentation
showNodeId :: a -> String Source
Hold | |
|
EventEnv | |
|
askHoldInitRef :: EventM (IORef [SomeHoldInit]) Source
putCurrentHeight :: Int -> EventM () Source
scheduleClear :: IORef (Maybe a) -> EventM () Source
scheduleRootClear :: IORef (DMap k) -> EventM () Source
scheduleMerge :: Int -> MergeSubscribed a -> EventM () Source
subscribeHold :: Event a -> Hold a -> EventM () Source
BehaviorM | |
|
data BehaviorSubscribed a Source
data SomeBehaviorSubscribed Source
forall a . SomeBehaviorSubscribed (BehaviorSubscribed a) |
data PullSubscribed a Source
Pull | |
|
data Invalidator Source
forall a . InvalidatorPull (Pull a) | |
forall a . InvalidatorSwitch (SwitchSubscribed a) |
data RootSubscribed a Source
RootSubscribed | |
|
Root | |
|
data SomeHoldInit Source
forall a . SomeHoldInit (Event a) (Hold a) |
data PushSubscribed a b Source
PushSubscribed | |
|
Push | |
|
data MergeSubscribed k Source
MergeSubscribed | |
|
Merge | |
|
data FanSubscriberKey k a where Source
FanSubscriberKey :: k a -> FanSubscriberKey k [WeakSubscriber a] |
GCompare * k => GCompare * (FanSubscriberKey k) Source | |
GEq * k => GEq * (FanSubscriberKey k) Source |
data FanSubscribed k Source
FanSubscribed | |
|
Fan | |
|
data SwitchSubscribed a Source
SwitchSubscribed | |
|
Switch | |
|
data CoincidenceSubscribed a Source
CoincidenceSubscribed | |
|
data Coincidence a Source
Coincidence | |
|
data WeakSubscriber a Source
forall k . GCompare k => WeakSubscriberMerge !(k a) !(Weak (Box (MergeSubscribed k))) | |
WeakSubscriberSimple !(Weak (Subscriber a)) |
deRefWeakSubscriber :: WeakSubscriber a -> IO (Maybe (Subscriber a)) Source
data Subscriber a Source
forall b . SubscriberPush !(a -> EventM (Maybe b)) (PushSubscribed a b) | |
forall k . GCompare k => SubscriberMerge !(k a) (MergeSubscribed k) | |
forall k . (GCompare k, a ~ DMap k) => SubscriberFan (FanSubscribed k) | |
SubscriberHold !(Hold a) | |
SubscriberSwitch (SwitchSubscribed a) | |
forall b . (a ~ Event b) => SubscriberCoincidenceOuter (CoincidenceSubscribed b) | |
SubscriberCoincidenceInner (CoincidenceSubscribed a) |
showSubscriberType :: Subscriber a -> String Source
forall k . GCompare k => EventRoot !(k a) !(Root k) | |
EventNever | |
forall b . EventPush !(Push b a) | |
forall k . (GCompare k, a ~ DMap k) => EventMerge !(Merge k) | |
forall k . GCompare k => EventFan !(k a) !(Fan k) | |
EventSwitch !(Switch a) | |
EventCoincidence !(Coincidence a) |
showEventType :: Event a -> String Source
data EventSubscribed a Source
EventSubscribedRoot !(RootSubscribed a) | |
EventSubscribedNever | |
forall b . EventSubscribedPush !(PushSubscribed b a) | |
forall k . (GCompare k, a ~ DMap k) => EventSubscribedMerge !(MergeSubscribed k) | |
forall k . GCompare k => EventSubscribedFan !(k a) !(FanSubscribed k) | |
EventSubscribedSwitch !(SwitchSubscribed a) | |
EventSubscribedCoincidence !(CoincidenceSubscribed a) |
newRootSubscribed :: IO (Maybe a) -> IORef [WeakSubscriber a] -> IO (RootSubscribed a) Source
newSubscriberPush :: (a -> EventM (Maybe b)) -> PushSubscribed a b -> IO (Subscriber a) Source
newSubscriberHold :: Hold a -> IO (Subscriber a) Source
newSubscriberFan :: GCompare k => FanSubscribed k -> IO (Subscriber (DMap k)) Source
newSubscriberSwitch :: SwitchSubscribed a -> IO (Subscriber a) Source
newSubscriberCoincidenceOuter :: CoincidenceSubscribed b -> IO (Subscriber (Event b)) Source
newInvalidatorPull :: Pull a -> IO Invalidator Source
BehaviorHold !(Hold a) | |
BehaviorConst !a | |
BehaviorPull !(Pull a) |
unsafeNewIORef :: a -> b -> IORef b Source
coincidence :: Event (Event a) -> Event a Source
propagateAndUpdateSubscribersRef :: IORef [WeakSubscriber a] -> a -> EventM () Source
data SomeMaybeIORef Source
forall a . SomeMaybeIORef (IORef (Maybe a)) |
data SomeDMapIORef Source
forall k . SomeDMapIORef (IORef (DMap k)) |
data SomeAssignment Source
forall a . SomeAssignment (Hold a) a |
data DelayedMerge Source
forall k . DelayedMerge (MergeSubscribed k) |
mkWeakPtrWithDebug :: a -> String -> IO (Weak a) Source
traverseAndCleanWeakList_ :: Monad m => (wa -> m (Maybe a)) -> [wa] -> (a -> m ()) -> m [wa] Source
propagate :: a -> [WeakSubscriber a] -> EventM [WeakSubscriber a] Source
Propagate everything at the current height
data SomeCoincidenceInfo Source
forall a . SomeCoincidenceInfo (Weak (Subscriber a)) (Subscriber a) (Maybe (CoincidenceSubscribed a)) |
subscribeCoincidenceInner :: Event a -> Int -> CoincidenceSubscribed a -> EventM (Maybe a, Int, EventSubscribed a) Source
readBehavior :: Behavior a -> IO a Source
runBehaviorM :: BehaviorM a -> Maybe (Weak Invalidator, IORef [SomeBehaviorSubscribed]) -> IO a Source
readBehaviorTracked :: Behavior a -> BehaviorM a Source
getEventSubscribed :: Event a -> EventM (EventSubscribed a) Source
subscribeEventSubscribed :: EventSubscribed a -> WeakSubscriber a -> IO () Source
getEventSubscribedOcc :: EventSubscribed a -> IO (Maybe a) Source
subscribe :: Event a -> WeakSubscriber a -> EventM (EventSubscribed a) Source
getRootSubscribed :: GCompare k => k a -> Root k -> EventM (RootSubscribed a) Source
getPushSubscribed :: Push a b -> EventM (PushSubscribed a b) Source
getMergeSubscribed :: forall k. GCompare k => Merge k -> EventM (MergeSubscribed k) Source
getFanSubscribed :: GCompare k => Fan k -> EventM (FanSubscribed k) Source
getSwitchSubscribed :: Switch a -> EventM (SwitchSubscribed a) Source
getCoincidenceSubscribed :: forall a. Coincidence a -> EventM (CoincidenceSubscribed a) Source
newtype EventSelector k Source
invalidateSubscriberHeight :: WeakSubscriber a -> IO () Source
invalidateCoincidenceHeight :: CoincidenceSubscribed a -> IO () Source
recalculateSubscriberHeight :: WeakSubscriber a -> IO () Source
calculateMergeHeight :: MergeSubscribed k -> IO Int Source
calculateSwitchHeight :: SwitchSubscribed a -> IO Int Source
data SomeSwitchSubscribed Source
forall a . SomeSwitchSubscribed (SwitchSubscribed a) |
invalidate :: IORef [SomeSwitchSubscribed] -> WeakList Invalidator -> IO (WeakList Invalidator) Source
data RootTrigger a Source
forall k . GCompare k => RootTrigger (IORef [WeakSubscriber a], IORef (DMap k), k a) |
newtype SpiderEventHandle a Source
newtype SpiderHost a Source
SpiderHost | |
|
newtype SpiderHostFrame a Source
newEventWithTriggerIO :: forall a. (RootTrigger a -> IO (IO ())) -> IO (Event a) Source
newFanEventWithTriggerIO :: GCompare k => (forall a. k a -> RootTrigger a -> IO (IO ())) -> IO (EventSelector k) Source