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 Identity) -> 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 = SomeBehaviorSubscribed (BehaviorSubscribed a)
- data PullSubscribed a = PullSubscribed {}
- data Pull a = Pull {
- pullValue :: !(IORef (Maybe (PullSubscribed a)))
- pullCompute :: !(BehaviorM a)
- data Invalidator
- = InvalidatorPull (Pull a)
- | InvalidatorSwitch (SwitchSubscribed a)
- data RootSubscribed a = RootSubscribed {
- rootSubscribedSubscribers :: !(IORef [WeakSubscriber a])
- rootSubscribedOccurrence :: !(IO (Maybe a))
- data Root k = Root {
- rootOccurrence :: !(IORef (DMap k Identity))
- rootSubscribed :: !(IORef (DMap k RootSubscribed))
- rootInit :: !(forall a. k a -> RootTrigger a -> IO (IO ()))
- data SomeHoldInit = 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 Identity)))
- mergeSubscribedAccum :: !(IORef (DMap k Identity))
- mergeSubscribedHeight :: !(IORef Int)
- mergeSubscribedSubscribers :: !(IORef [WeakSubscriber (DMap k Identity)])
- mergeSubscribedSelf :: !Any
- mergeSubscribedParents :: !(DMap k EventSubscribed)
- data Merge k = Merge {
- mergeParents :: !(DMap k Event)
- 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) Identity))
- fanSubscribedParent :: !(EventSubscribed (DMap k Identity))
- fanSubscribedSelf :: (Subscriber (DMap k Identity))
- data Fan k = Fan {
- fanParent :: !(Event (DMap k Identity))
- 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
- = 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
- = SubscriberPush !(a -> EventM (Maybe b)) (PushSubscribed a b)
- | GCompare k => SubscriberMerge !(k a) (MergeSubscribed k)
- | (GCompare k, a ~ DMap k Identity) => SubscriberFan (FanSubscribed k)
- | SubscriberHold !(Hold a)
- | SubscriberSwitch (SwitchSubscribed a)
- | (a ~ Event b) => SubscriberCoincidenceOuter (CoincidenceSubscribed b)
- | SubscriberCoincidenceInner (CoincidenceSubscribed a)
- showSubscriberType :: Subscriber a -> String
- data Event a
- = GCompare k => EventRoot !(k a) !(Root k)
- | EventNever
- | EventPush !(Push b a)
- | (GCompare k, a ~ DMap k Identity) => EventMerge !(Merge 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
- | EventSubscribedPush !(PushSubscribed b a)
- | (GCompare k, a ~ DMap k Identity) => EventSubscribedMerge !(MergeSubscribed 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 Identity))
- 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 Identity] -> ResultM b -> IO b
- data SomeMaybeIORef = SomeMaybeIORef (IORef (Maybe a))
- data SomeDMapIORef = SomeDMapIORef (IORef (DMap k Identity))
- data SomeAssignment = SomeAssignment (Hold a) a
- data DelayedMerge = 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 = 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 k Event -> Event (DMap k Identity)
- newtype EventSelector k = EventSelector {}
- fan :: GCompare k => Event (DMap k Identity) -> 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 = SomeSwitchSubscribed (SwitchSubscribed a)
- debugInvalidate :: Bool
- invalidate :: IORef [SomeSwitchSubscribed] -> WeakList Invalidator -> IO (WeakList Invalidator)
- data Spider
- data RootTrigger a = GCompare k => RootTrigger (IORef [WeakSubscriber a], IORef (DMap k Identity), 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 | |
|
askToAssignRef :: EventM (IORef [SomeAssignment]) Source #
askHoldInitRef :: EventM (IORef [SomeHoldInit]) Source #
putCurrentHeight :: Int -> EventM () Source #
scheduleMerge :: Int -> MergeSubscribed a -> EventM () Source #
emitCoincidenceInfo :: SomeCoincidenceInfo -> EventM () Source #
BehaviorM | |
|
data BehaviorSubscribed a Source #
data PullSubscribed a Source #
Pull | |
|
data Invalidator Source #
data RootSubscribed a Source #
RootSubscribed | |
|
Root | |
|
data SomeHoldInit Source #
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] |
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 #
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 #
SubscriberPush !(a -> EventM (Maybe b)) (PushSubscribed a b) | |
GCompare k => SubscriberMerge !(k a) (MergeSubscribed k) | |
(GCompare k, a ~ DMap k Identity) => SubscriberFan (FanSubscribed k) | |
SubscriberHold !(Hold a) | |
SubscriberSwitch (SwitchSubscribed a) | |
(a ~ Event b) => SubscriberCoincidenceOuter (CoincidenceSubscribed b) | |
SubscriberCoincidenceInner (CoincidenceSubscribed a) |
showSubscriberType :: Subscriber a -> String Source #
GCompare k => EventRoot !(k a) !(Root k) | |
EventNever | |
EventPush !(Push b a) | |
(GCompare k, a ~ DMap k Identity) => EventMerge !(Merge 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 | |
EventSubscribedPush !(PushSubscribed b a) | |
(GCompare k, a ~ DMap k Identity) => EventSubscribedMerge !(MergeSubscribed 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 Identity)) 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 #
propagateAndUpdateSubscribersRef :: IORef [WeakSubscriber a] -> a -> EventM () Source #
data SomeMaybeIORef Source #
SomeMaybeIORef (IORef (Maybe a)) |
data SomeDMapIORef Source #
SomeDMapIORef (IORef (DMap k Identity)) |
data SomeAssignment Source #
SomeAssignment (Hold a) a |
data DelayedMerge Source #
debugFinalize :: Bool 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 #
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 #
askInvalidator :: BehaviorM (Maybe (Weak Invalidator)) 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 #
noinlineFalse :: Bool 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 #
invalidHeight :: Int Source #
invalidateSubscriberHeight :: WeakSubscriber a -> IO () Source #
invalidateCoincidenceHeight :: CoincidenceSubscribed a -> IO () Source #
recalculateSubscriberHeight :: WeakSubscriber a -> IO () Source #
recalculateCoincidenceHeight :: CoincidenceSubscribed a -> IO () Source #
calculateMergeHeight :: MergeSubscribed k -> IO Int Source #
calculateSwitchHeight :: SwitchSubscribed a -> IO Int Source #
invalidate :: IORef [SomeSwitchSubscribed] -> WeakList Invalidator -> IO (WeakList Invalidator) Source #
data RootTrigger a Source #
GCompare k => RootTrigger (IORef [WeakSubscriber a], IORef (DMap k Identity), 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 #