{-# OPTIONS_HADDOCK hide #-} {-# LANGUAGE CPP #-} {-# LANGUAGE FlexibleContexts #-} {-# LANGUAGE UndecidableInstances #-} {-# OPTIONS_GHC -fno-warn-orphans #-} module Foreign.JavaScript.Orphans where #ifndef ghcjs_HOST_OS import Control.Monad.Trans.Class (lift) import GHCJS.DOM.Types (MonadJSM (..)) import Reflex.DynamicWriter.Base (DynamicWriterT) import Reflex.EventWriter.Base (EventWriterT) import Reflex.Host.Class (HostFrame, ReflexHost) import Reflex.PerformEvent.Base (PerformEventT (..)) import Reflex.PostBuild.Base (PostBuildT) import Reflex.Requester.Base (RequesterT) import Reflex.TriggerEvent.Base import Reflex.Query.Base (QueryT) instance MonadJSM m => MonadJSM (PostBuildT t m) where liftJSM' :: JSM a -> PostBuildT t m a liftJSM' = m a -> PostBuildT t m a forall (t :: (* -> *) -> * -> *) (m :: * -> *) a. (MonadTrans t, Monad m) => m a -> t m a lift (m a -> PostBuildT t m a) -> (JSM a -> m a) -> JSM a -> PostBuildT t m a forall b c a. (b -> c) -> (a -> b) -> a -> c . JSM a -> m a forall (m :: * -> *) a. MonadJSM m => JSM a -> m a liftJSM' instance (MonadJSM (HostFrame t), ReflexHost t) => MonadJSM (PerformEventT t m) where liftJSM' :: JSM a -> PerformEventT t m a liftJSM' = RequesterT t (HostFrame t) Identity (HostFrame t) a -> PerformEventT t m a forall k t (m :: k) a. RequesterT t (HostFrame t) Identity (HostFrame t) a -> PerformEventT t m a PerformEventT (RequesterT t (HostFrame t) Identity (HostFrame t) a -> PerformEventT t m a) -> (JSM a -> RequesterT t (HostFrame t) Identity (HostFrame t) a) -> JSM a -> PerformEventT t m a forall b c a. (b -> c) -> (a -> b) -> a -> c . HostFrame t a -> RequesterT t (HostFrame t) Identity (HostFrame t) a forall (t :: (* -> *) -> * -> *) (m :: * -> *) a. (MonadTrans t, Monad m) => m a -> t m a lift (HostFrame t a -> RequesterT t (HostFrame t) Identity (HostFrame t) a) -> (JSM a -> HostFrame t a) -> JSM a -> RequesterT t (HostFrame t) Identity (HostFrame t) a forall b c a. (b -> c) -> (a -> b) -> a -> c . JSM a -> HostFrame t a forall (m :: * -> *) a. MonadJSM m => JSM a -> m a liftJSM' instance MonadJSM m => MonadJSM (DynamicWriterT t w m) where liftJSM' :: JSM a -> DynamicWriterT t w m a liftJSM' = m a -> DynamicWriterT t w m a forall (t :: (* -> *) -> * -> *) (m :: * -> *) a. (MonadTrans t, Monad m) => m a -> t m a lift (m a -> DynamicWriterT t w m a) -> (JSM a -> m a) -> JSM a -> DynamicWriterT t w m a forall b c a. (b -> c) -> (a -> b) -> a -> c . JSM a -> m a forall (m :: * -> *) a. MonadJSM m => JSM a -> m a liftJSM' instance MonadJSM m => MonadJSM (EventWriterT t w m) where liftJSM' :: JSM a -> EventWriterT t w m a liftJSM' = m a -> EventWriterT t w m a forall (t :: (* -> *) -> * -> *) (m :: * -> *) a. (MonadTrans t, Monad m) => m a -> t m a lift (m a -> EventWriterT t w m a) -> (JSM a -> m a) -> JSM a -> EventWriterT t w m a forall b c a. (b -> c) -> (a -> b) -> a -> c . JSM a -> m a forall (m :: * -> *) a. MonadJSM m => JSM a -> m a liftJSM' instance MonadJSM m => MonadJSM (RequesterT t request response m) where liftJSM' :: JSM a -> RequesterT t request response m a liftJSM' = m a -> RequesterT t request response m a forall (t :: (* -> *) -> * -> *) (m :: * -> *) a. (MonadTrans t, Monad m) => m a -> t m a lift (m a -> RequesterT t request response m a) -> (JSM a -> m a) -> JSM a -> RequesterT t request response m a forall b c a. (b -> c) -> (a -> b) -> a -> c . JSM a -> m a forall (m :: * -> *) a. MonadJSM m => JSM a -> m a liftJSM' instance MonadJSM m => MonadJSM (TriggerEventT t m) where liftJSM' :: JSM a -> TriggerEventT t m a liftJSM' = m a -> TriggerEventT t m a forall (t :: (* -> *) -> * -> *) (m :: * -> *) a. (MonadTrans t, Monad m) => m a -> t m a lift (m a -> TriggerEventT t m a) -> (JSM a -> m a) -> JSM a -> TriggerEventT t m a forall b c a. (b -> c) -> (a -> b) -> a -> c . JSM a -> m a forall (m :: * -> *) a. MonadJSM m => JSM a -> m a liftJSM' instance MonadJSM m => MonadJSM (QueryT t q m) where liftJSM' :: JSM a -> QueryT t q m a liftJSM' = m a -> QueryT t q m a forall (t :: (* -> *) -> * -> *) (m :: * -> *) a. (MonadTrans t, Monad m) => m a -> t m a lift (m a -> QueryT t q m a) -> (JSM a -> m a) -> JSM a -> QueryT t q m a forall b c a. (b -> c) -> (a -> b) -> a -> c . JSM a -> m a forall (m :: * -> *) a. MonadJSM m => JSM a -> m a liftJSM' #endif