Safe Haskell | None |
---|---|
Language | Haskell98 |
Synopsis
- newtype EventTriggerRef t a = EventTriggerRef {
- unEventTriggerRef :: IORef (Maybe (EventTrigger t a))
- data ImmediateDomBuilderEnv t = ImmediateDomBuilderEnv {}
- newtype ImmediateDomBuilderT t m a = ImmediateDomBuilderT {
- unImmediateDomBuilderT :: ReaderT (ImmediateDomBuilderEnv t) (RequesterT t JSM Identity (TriggerEventT t m)) a
- runImmediateDomBuilderT :: (MonadFix m, PerformEvent t m, MonadReflexCreateTrigger t m, MonadJSM m, MonadJSM (Performable m), MonadRef m, Ref m ~ IORef) => ImmediateDomBuilderT t m a -> ImmediateDomBuilderEnv t -> Chan [DSum (EventTriggerRef t) TriggerInvocation] -> m a
- askParent :: Monad m => ImmediateDomBuilderT t m Node
- askEvents :: Monad m => ImmediateDomBuilderT t m (Chan [DSum (EventTriggerRef t) TriggerInvocation])
- append :: MonadJSM m => Node -> ImmediateDomBuilderT t m ()
- textNodeInternal :: (MonadJSM m, ToDOMString contents) => contents -> ImmediateDomBuilderT t m Text
- deleteBetweenExclusive :: (MonadJSM m, IsNode start, IsNode end) => start -> end -> m ()
- extractBetweenExclusive :: (MonadJSM m, IsNode start, IsNode end) => DocumentFragment -> start -> end -> m ()
- deleteUpTo :: (MonadJSM m, IsNode start, IsNode end) => start -> end -> m ()
- extractUpTo :: (MonadJSM m, IsNode start, IsNode end) => DocumentFragment -> start -> end -> m ()
- type SupportsImmediateDomBuilder t m = (Reflex t, MonadJSM m, MonadHold t m, MonadFix m, MonadReflexCreateTrigger t m, MonadRef m, Ref m ~ Ref JSM, Adjustable t m, PrimMonad m)
- collectUpTo :: (MonadJSM m, IsNode start, IsNode end) => start -> end -> m DocumentFragment
- collectUpToGivenParent :: (MonadJSM m, IsNode parent, IsNode start, IsNode end) => parent -> start -> end -> m DocumentFragment
- newtype EventFilterTriggerRef t er (en :: EventTag) = EventFilterTriggerRef (IORef (Maybe (EventTrigger t (er en))))
- wrap :: forall m er t. (Reflex t, MonadFix m, MonadJSM m, MonadReflexCreateTrigger t m) => RawElement GhcjsDomSpace -> RawElementConfig er t GhcjsDomSpace -> ImmediateDomBuilderT t m (Element er GhcjsDomSpace t)
- makeElement :: forall er t m a. (MonadJSM m, MonadFix m, MonadReflexCreateTrigger t m, Adjustable t m) => Text -> ElementConfig er t GhcjsDomSpace -> ImmediateDomBuilderT t m a -> ImmediateDomBuilderT t m ((Element er GhcjsDomSpace t, a), Element)
- newtype GhcjsDomHandler a b = GhcjsDomHandler {
- unGhcjsDomHandler :: a -> JSM b
- newtype GhcjsDomHandler1 a b = GhcjsDomHandler1 {
- unGhcjsDomHandler1 :: forall (x :: EventTag). a x -> JSM (b x)
- newtype GhcjsDomEvent en = GhcjsDomEvent {
- unGhcjsDomEvent :: EventType en
- data GhcjsDomSpace
- newtype GhcjsEventFilter er en = GhcjsEventFilter (GhcjsDomEvent en -> JSM (EventFlags, JSM (Maybe (er en))))
- data Pair1 (f :: k -> *) (g :: k -> *) (a :: k) = Pair1 (f a) (g a)
- data Maybe1 f a
- data GhcjsEventSpec er = GhcjsEventSpec {}
- class Monad m => HasDocument m where
- ghcjsEventSpec_filters :: forall er. Lens' (GhcjsEventSpec er) (DMap EventName (GhcjsEventFilter er))
- ghcjsEventSpec_handler :: forall er. Lens' (GhcjsEventSpec er) (GhcjsEventHandler er)
- newtype GhcjsEventHandler er = GhcjsEventHandler {
- unGhcjsEventHandler :: forall en. (EventName en, GhcjsDomEvent en) -> JSM (Maybe (er en))
- drawChildUpdate :: (MonadIO m, MonadJSM m) => ImmediateDomBuilderEnv t -> (IORef (ChildReadyState k) -> JSM ()) -> ImmediateDomBuilderT t m (v' a) -> RequesterT t JSM Identity (TriggerEventT t m) (Compose ((,,,) DocumentFragment Text (IORef (ChildReadyState k))) v' a)
- data ChildReadyState k
- data ChildReadyStateInt
- mkHasFocus :: (MonadHold t m, Reflex t) => Element er d t -> m (Dynamic t Bool)
- insertBefore :: (MonadJSM m, IsNode new, IsNode existing) => new -> existing -> m ()
- type family EventType en where ...
- defaultDomEventHandler :: IsElement e => e -> EventName en -> EventM e (EventType en) (Maybe (EventResult en))
- defaultDomWindowEventHandler :: Window -> EventName en -> EventM Window (EventType en) (Maybe (EventResult en))
- withIsEvent :: EventName en -> (IsEvent (EventType en) => r) -> r
- showEventName :: EventName en -> String
- elementOnEventName :: IsElement e => EventName en -> e -> EventM e (EventType en) () -> JSM (JSM ())
- windowOnEventName :: EventName en -> Window -> EventM Window (EventType en) () -> JSM (JSM ())
- wrapDomEvent :: (TriggerEvent t m, MonadJSM m) => e -> (e -> EventM e event () -> JSM (JSM ())) -> EventM e event a -> m (Event t a)
- subscribeDomEvent :: (EventM e event () -> JSM (JSM ())) -> EventM e event (Maybe a) -> Chan [DSum (EventTriggerRef t) TriggerInvocation] -> EventTrigger t a -> JSM (JSM ())
- wrapDomEventMaybe :: (TriggerEvent t m, MonadJSM m) => e -> (e -> EventM e event () -> JSM (JSM ())) -> EventM e event (Maybe a) -> m (Event t a)
- wrapDomEventsMaybe :: (MonadJSM m, MonadReflexCreateTrigger t m) => e -> (forall en. IsEvent (EventType en) => EventName en -> EventM e (EventType en) (Maybe (f en))) -> (forall en. EventName en -> e -> EventM e (EventType en) () -> JSM (JSM ())) -> ImmediateDomBuilderT t m (EventSelector t (WrapArg f EventName))
- getKeyEvent :: EventM e KeyboardEvent Word
- getMouseEventCoords :: EventM e MouseEvent (Int, Int)
- getTouchEvent :: EventM e TouchEvent TouchEventResult
- data WindowConfig t = WindowConfig
- data Window t = Window {}
- wrapWindow :: (MonadJSM m, MonadReflexCreateTrigger t m) => Window -> WindowConfig t -> ImmediateDomBuilderT t m (Window t)
- traverseDMapWithKeyWithAdjust' :: forall t m (k :: * -> *) v v'. (Adjustable t m, MonadHold t m, MonadFix m, MonadIO m, MonadJSM m, PrimMonad m, GCompare k) => (forall a. k a -> v a -> ImmediateDomBuilderT t m (v' a)) -> DMap k v -> Event t (PatchDMap k v) -> ImmediateDomBuilderT t m (DMap k v', Event t (PatchDMap k v'))
- hoistTraverseWithKeyWithAdjust :: forall (k :: * -> *) v v' t m p. (Adjustable t m, MonadHold t m, GCompare k, MonadIO m, MonadJSM m, PrimMonad m, MonadFix m, Patch (p k v), PatchTarget (p k (Constant Int)) ~ DMap k (Constant Int), Monoid (p k (Compose ((,,,) DocumentFragment Text (IORef (ChildReadyState k))) v')), Patch (p k (Constant Int))) => (forall vv vv'. (forall a. k a -> vv a -> RequesterT t JSM Identity (TriggerEventT t m) (vv' a)) -> DMap k vv -> Event t (p k vv) -> RequesterT t JSM Identity (TriggerEventT t m) (DMap k vv', Event t (p k vv'))) -> (forall vv vv'. (forall a. vv a -> vv' a) -> p k vv -> p k vv') -> (p k (Compose ((,,,) DocumentFragment Text (IORef (ChildReadyState k))) v') -> DMap k (Constant (IORef (ChildReadyState k))) -> IO (DMap k (Constant (IORef (ChildReadyState k))))) -> (IORef (Map (Some k) Text) -> IORef Text -> p k (Compose ((,,,) DocumentFragment Text (IORef (ChildReadyState k))) v') -> JSM ()) -> (forall a. k a -> v a -> ImmediateDomBuilderT t m (v' a)) -> DMap k v -> Event t (p k v) -> ImmediateDomBuilderT t m (DMap k v', Event t (p k v'))
- traverseIntMapWithKeyWithAdjust' :: forall t m v v'. (Adjustable t m, MonadHold t m, MonadFix m, MonadIO m, MonadJSM m, PrimMonad m) => (Key -> v -> ImmediateDomBuilderT t m v') -> IntMap v -> Event t (PatchIntMap v) -> ImmediateDomBuilderT t m (IntMap v', Event t (PatchIntMap v'))
- hoistTraverseIntMapWithKeyWithAdjust :: forall v v' t m p. (Adjustable t m, MonadIO m, MonadJSM m, MonadFix m, PrimMonad m, Monoid (p (DocumentFragment, Text, IORef ChildReadyStateInt, v')), Functor p) => ((Key -> v -> RequesterT t JSM Identity (TriggerEventT t m) (DocumentFragment, Text, IORef ChildReadyStateInt, v')) -> IntMap v -> Event t (p v) -> RequesterT t JSM Identity (TriggerEventT t m) (IntMap (DocumentFragment, Text, IORef ChildReadyStateInt, v'), Event t (p (DocumentFragment, Text, IORef ChildReadyStateInt, v')))) -> (p (DocumentFragment, Text, IORef ChildReadyStateInt, v') -> IntMap (IORef ChildReadyStateInt) -> IO (IntMap (IORef ChildReadyStateInt))) -> (IORef (IntMap Text) -> IORef Text -> p (DocumentFragment, Text, IORef ChildReadyStateInt, v') -> JSM ()) -> (Key -> v -> ImmediateDomBuilderT t m v') -> IntMap v -> Event t (p v) -> ImmediateDomBuilderT t m (IntMap v', Event t (p v'))
Documentation
newtype EventTriggerRef t a #
A reference to an EventTrigger
suitable for firing with TriggerEventT
.
EventTriggerRef | |
|
data ImmediateDomBuilderEnv t Source #
newtype ImmediateDomBuilderT t m a Source #
ImmediateDomBuilderT | |
|
Instances
runImmediateDomBuilderT :: (MonadFix m, PerformEvent t m, MonadReflexCreateTrigger t m, MonadJSM m, MonadJSM (Performable m), MonadRef m, Ref m ~ IORef) => ImmediateDomBuilderT t m a -> ImmediateDomBuilderEnv t -> Chan [DSum (EventTriggerRef t) TriggerInvocation] -> m a Source #
askEvents :: Monad m => ImmediateDomBuilderT t m (Chan [DSum (EventTriggerRef t) TriggerInvocation]) Source #
textNodeInternal :: (MonadJSM m, ToDOMString contents) => contents -> ImmediateDomBuilderT t m Text Source #
deleteBetweenExclusive :: (MonadJSM m, IsNode start, IsNode end) => start -> end -> m () Source #
s and e must both be children of the same node and s must precede e; all nodes between s and e will be removed, but s and e will not be removed
extractBetweenExclusive :: (MonadJSM m, IsNode start, IsNode end) => DocumentFragment -> start -> end -> m () Source #
s and e must both be children of the same node and s must precede e; all nodes between s and e will be moved into the given DocumentFragment, but s and e will not be moved
deleteUpTo :: (MonadJSM m, IsNode start, IsNode end) => start -> end -> m () Source #
s and e must both be children of the same node and s must precede e; s and all nodes between s and e will be removed, but e will not be removed
extractUpTo :: (MonadJSM m, IsNode start, IsNode end) => DocumentFragment -> start -> end -> m () Source #
type SupportsImmediateDomBuilder t m = (Reflex t, MonadJSM m, MonadHold t m, MonadFix m, MonadReflexCreateTrigger t m, MonadRef m, Ref m ~ Ref JSM, Adjustable t m, PrimMonad m) Source #
collectUpTo :: (MonadJSM m, IsNode start, IsNode end) => start -> end -> m DocumentFragment Source #
collectUpToGivenParent :: (MonadJSM m, IsNode parent, IsNode start, IsNode end) => parent -> start -> end -> m DocumentFragment Source #
newtype EventFilterTriggerRef t er (en :: EventTag) Source #
EventFilterTriggerRef (IORef (Maybe (EventTrigger t (er en)))) |
wrap :: forall m er t. (Reflex t, MonadFix m, MonadJSM m, MonadReflexCreateTrigger t m) => RawElement GhcjsDomSpace -> RawElementConfig er t GhcjsDomSpace -> ImmediateDomBuilderT t m (Element er GhcjsDomSpace t) Source #
makeElement :: forall er t m a. (MonadJSM m, MonadFix m, MonadReflexCreateTrigger t m, Adjustable t m) => Text -> ElementConfig er t GhcjsDomSpace -> ImmediateDomBuilderT t m a -> ImmediateDomBuilderT t m ((Element er GhcjsDomSpace t, a), Element) Source #
newtype GhcjsDomHandler a b Source #
GhcjsDomHandler | |
|
newtype GhcjsDomHandler1 a b Source #
GhcjsDomHandler1 | |
|
newtype GhcjsDomEvent en Source #
data GhcjsDomSpace Source #
Instances
newtype GhcjsEventFilter er en Source #
GhcjsEventFilter (GhcjsDomEvent en -> JSM (EventFlags, JSM (Maybe (er en)))) |
data GhcjsEventSpec er Source #
Instances
er ~ EventResult => Default (GhcjsEventSpec er) Source # | |
Defined in Reflex.Dom.Builder.Immediate def :: GhcjsEventSpec er # |
class Monad m => HasDocument m where Source #
askDocument :: m (RawDocument (DomBuilderSpace m)) Source #
askDocument :: (m ~ f m', RawDocument (DomBuilderSpace m) ~ RawDocument (DomBuilderSpace m'), MonadTrans f, Monad m', HasDocument m') => m (RawDocument (DomBuilderSpace m)) Source #
Instances
ghcjsEventSpec_filters :: forall er. Lens' (GhcjsEventSpec er) (DMap EventName (GhcjsEventFilter er)) Source #
ghcjsEventSpec_handler :: forall er. Lens' (GhcjsEventSpec er) (GhcjsEventHandler er) Source #
newtype GhcjsEventHandler er Source #
GhcjsEventHandler | |
|
drawChildUpdate :: (MonadIO m, MonadJSM m) => ImmediateDomBuilderEnv t -> (IORef (ChildReadyState k) -> JSM ()) -> ImmediateDomBuilderT t m (v' a) -> RequesterT t JSM Identity (TriggerEventT t m) (Compose ((,,,) DocumentFragment Text (IORef (ChildReadyState k))) v' a) Source #
data ChildReadyState k Source #
Instances
data ChildReadyStateInt Source #
Instances
Eq ChildReadyStateInt Source # | |
Defined in Reflex.Dom.Builder.Immediate (==) :: ChildReadyStateInt -> ChildReadyStateInt -> Bool # (/=) :: ChildReadyStateInt -> ChildReadyStateInt -> Bool # | |
Ord ChildReadyStateInt Source # | |
Defined in Reflex.Dom.Builder.Immediate compare :: ChildReadyStateInt -> ChildReadyStateInt -> Ordering # (<) :: ChildReadyStateInt -> ChildReadyStateInt -> Bool # (<=) :: ChildReadyStateInt -> ChildReadyStateInt -> Bool # (>) :: ChildReadyStateInt -> ChildReadyStateInt -> Bool # (>=) :: ChildReadyStateInt -> ChildReadyStateInt -> Bool # max :: ChildReadyStateInt -> ChildReadyStateInt -> ChildReadyStateInt # min :: ChildReadyStateInt -> ChildReadyStateInt -> ChildReadyStateInt # | |
Read ChildReadyStateInt Source # | |
Defined in Reflex.Dom.Builder.Immediate | |
Show ChildReadyStateInt Source # | |
Defined in Reflex.Dom.Builder.Immediate showsPrec :: Int -> ChildReadyStateInt -> ShowS # show :: ChildReadyStateInt -> String # showList :: [ChildReadyStateInt] -> ShowS # |
type family EventType en where ... Source #
defaultDomEventHandler :: IsElement e => e -> EventName en -> EventM e (EventType en) (Maybe (EventResult en)) Source #
defaultDomWindowEventHandler :: Window -> EventName en -> EventM Window (EventType en) (Maybe (EventResult en)) Source #
showEventName :: EventName en -> String Source #
elementOnEventName :: IsElement e => EventName en -> e -> EventM e (EventType en) () -> JSM (JSM ()) Source #
windowOnEventName :: EventName en -> Window -> EventM Window (EventType en) () -> JSM (JSM ()) Source #
wrapDomEvent :: (TriggerEvent t m, MonadJSM m) => e -> (e -> EventM e event () -> JSM (JSM ())) -> EventM e event a -> m (Event t a) Source #
subscribeDomEvent :: (EventM e event () -> JSM (JSM ())) -> EventM e event (Maybe a) -> Chan [DSum (EventTriggerRef t) TriggerInvocation] -> EventTrigger t a -> JSM (JSM ()) Source #
wrapDomEventMaybe :: (TriggerEvent t m, MonadJSM m) => e -> (e -> EventM e event () -> JSM (JSM ())) -> EventM e event (Maybe a) -> m (Event t a) Source #
wrapDomEventsMaybe :: (MonadJSM m, MonadReflexCreateTrigger t m) => e -> (forall en. IsEvent (EventType en) => EventName en -> EventM e (EventType en) (Maybe (f en))) -> (forall en. EventName en -> e -> EventM e (EventType en) () -> JSM (JSM ())) -> ImmediateDomBuilderT t m (EventSelector t (WrapArg f EventName)) Source #
getMouseEventCoords :: EventM e MouseEvent (Int, Int) Source #
data WindowConfig t Source #
Instances
Default (WindowConfig t) Source # | |
Defined in Reflex.Dom.Builder.Immediate def :: WindowConfig t # |
wrapWindow :: (MonadJSM m, MonadReflexCreateTrigger t m) => Window -> WindowConfig t -> ImmediateDomBuilderT t m (Window t) Source #
Internal
traverseDMapWithKeyWithAdjust' :: forall t m (k :: * -> *) v v'. (Adjustable t m, MonadHold t m, MonadFix m, MonadIO m, MonadJSM m, PrimMonad m, GCompare k) => (forall a. k a -> v a -> ImmediateDomBuilderT t m (v' a)) -> DMap k v -> Event t (PatchDMap k v) -> ImmediateDomBuilderT t m (DMap k v', Event t (PatchDMap k v')) Source #
hoistTraverseWithKeyWithAdjust Source #
:: forall (k :: * -> *). (Adjustable t m, MonadHold t m, GCompare k, MonadIO m, MonadJSM m, PrimMonad m, MonadFix m, Patch (p k v), PatchTarget (p k (Constant Int)) ~ DMap k (Constant Int), Monoid (p k (Compose ((,,,) DocumentFragment Text (IORef (ChildReadyState k))) v')), Patch (p k (Constant Int))) | |
=> (forall vv vv'. (forall a. k a -> vv a -> RequesterT t JSM Identity (TriggerEventT t m) (vv' a)) -> DMap k vv -> Event t (p k vv) -> RequesterT t JSM Identity (TriggerEventT t m) (DMap k vv', Event t (p k vv'))) | The base monad's traversal |
-> (forall vv vv'. (forall a. vv a -> vv' a) -> p k vv -> p k vv') | A way of mapping over the patch type |
-> (p k (Compose ((,,,) DocumentFragment Text (IORef (ChildReadyState k))) v') -> DMap k (Constant (IORef (ChildReadyState k))) -> IO (DMap k (Constant (IORef (ChildReadyState k))))) | Given a patch for the children DOM elements, produce a patch for the childrens' unreadiness state |
-> (IORef (Map (Some k) Text) -> IORef Text -> p k (Compose ((,,,) DocumentFragment Text (IORef (ChildReadyState k))) v') -> JSM ()) | Apply a patch to the DOM |
-> (forall a. k a -> v a -> ImmediateDomBuilderT t m (v' a)) | |
-> DMap k v | |
-> Event t (p k v) | |
-> ImmediateDomBuilderT t m (DMap k v', Event t (p k v')) |
traverseIntMapWithKeyWithAdjust' :: forall t m v v'. (Adjustable t m, MonadHold t m, MonadFix m, MonadIO m, MonadJSM m, PrimMonad m) => (Key -> v -> ImmediateDomBuilderT t m v') -> IntMap v -> Event t (PatchIntMap v) -> ImmediateDomBuilderT t m (IntMap v', Event t (PatchIntMap v')) Source #
hoistTraverseIntMapWithKeyWithAdjust Source #
:: (Adjustable t m, MonadIO m, MonadJSM m, MonadFix m, PrimMonad m, Monoid (p (DocumentFragment, Text, IORef ChildReadyStateInt, v')), Functor p) | |
=> ((Key -> v -> RequesterT t JSM Identity (TriggerEventT t m) (DocumentFragment, Text, IORef ChildReadyStateInt, v')) -> IntMap v -> Event t (p v) -> RequesterT t JSM Identity (TriggerEventT t m) (IntMap (DocumentFragment, Text, IORef ChildReadyStateInt, v'), Event t (p (DocumentFragment, Text, IORef ChildReadyStateInt, v')))) | The base monad's traversal |
-> (p (DocumentFragment, Text, IORef ChildReadyStateInt, v') -> IntMap (IORef ChildReadyStateInt) -> IO (IntMap (IORef ChildReadyStateInt))) | Given a patch for the children DOM elements, produce a patch for the childrens' unreadiness state |
-> (IORef (IntMap Text) -> IORef Text -> p (DocumentFragment, Text, IORef ChildReadyStateInt, v') -> JSM ()) | Apply a patch to the DOM |
-> (Key -> v -> ImmediateDomBuilderT t m v') | |
-> IntMap v | |
-> Event t (p v) | |
-> ImmediateDomBuilderT t m (IntMap v', Event t (p v')) |