@@ -1,10 +1,13 @@
1{-# LANGUAGE TypeFamilies, FlexibleContexts, FlexibleInstances, MultiParamTypeClasses, RankNTypes, GADTs, ScopedTypeVariables, FunctionalDependencies, RecursiveDo, UndecidableInstances, GeneralizedNewtypeDeriving, StandaloneDeriving, EmptyDataDecls, NoMonomorphismRestriction, TemplateHaskell, PolyKinds, TypeOperators, DeriveFunctor, LambdaCase, CPP, ForeignFunctionInterface, DeriveDataTypeable, ConstraintKinds, DefaultSignatures #-}
1{-# LANGUAGE TypeFamilies, FlexibleContexts, FlexibleInstances, MultiParamTypeClasses, RankNTypes, GADTs, ScopedTypeVariables, FunctionalDependencies, RecursiveDo, UndecidableInstances, GeneralizedNewtypeDeriving, StandaloneDeriving, EmptyDataDecls, NoMonomorphismRestriction, TemplateHaskell, PolyKinds, TypeOperators, DeriveFunctor, LambdaCase, CPP, ForeignFunctionInterface, DeriveDataTypeable, ConstraintKinds, DefaultSignatures #-}
2−module Reflex.Dom.Class where
2+module Reflex.Dom.Class ( module Reflex.Dom.Class
3+ , module Foreign.JavaScript.TH
4import Prelude hiding (mapM, mapM_, sequence, concat)
6import Prelude hiding (mapM, mapM_, sequence, concat)
6import Reflex
8import Reflex
7import Reflex.Host.Class
9import Reflex.Host.Class
10+import Foreign.JavaScript.TH
9import Control.Monad.Identity hiding (mapM, mapM_, forM, forM_, sequence)
12import Control.Monad.Identity hiding (mapM, mapM_, forM, forM_, sequence)
10import Data.Map (Map)
13import Data.Map (Map)
@@ -64,28 +67,6 @@ instance HasDocument m => HasDocument (StateT r m) where
64instance HasDocument m => HasDocument (Strict.StateT r m) where
67instance HasDocument m => HasDocument (Strict.StateT r m) where
65 askDocument = lift askDocument
68 askDocument = lift askDocument
67−-- | A singleton type for a given WebView; we use this to statically guarantee that different WebViews (and thus different javscript contexts) don't get mixed up
68−newtype WebViewSingleton x = WebViewSingleton { unWebViewSingleton :: WebView }
70−withWebViewSingleton :: WebView -> (forall x. WebViewSingleton x -> r) -> r
71−withWebViewSingleton wv f = f $ WebViewSingleton wv
73−class Monad m => HasWebView m where
74− type WebViewPhantom m :: *
75− askWebView :: m (WebViewSingleton (WebViewPhantom m))
77−instance HasWebView m => HasWebView (ReaderT r m) where
78− type WebViewPhantom (ReaderT r m) = WebViewPhantom m
79− askWebView = lift askWebView
81−instance HasWebView m => HasWebView (StateT r m) where
82− type WebViewPhantom (StateT r m) = WebViewPhantom m
83− askWebView = lift askWebView
85−instance HasWebView m => HasWebView (Strict.StateT r m) where
86− type WebViewPhantom (Strict.StateT r m) = WebViewPhantom m
87− askWebView = lift askWebView
89newtype Restore m = Restore { restore :: forall a. m a -> IO a }
70newtype Restore m = Restore { restore :: forall a. m a -> IO a }
91class Monad m => MonadIORestore m where
72class Monad m => MonadIORestore m where