Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions jsaddle/jsaddle.cabal
Original file line number Diff line number Diff line change
Expand Up @@ -117,6 +117,7 @@ library
base64-bytestring >=1.0.0.1 && <1.3,
bytestring >=0.10.6.0 && <0.13,
exceptions >=0.8 && <0.11,
kan-extensions >= 5 && < 6,
lens >=3.8.5 && <5.4,
primitive >=0.6.1.0 && <0.10,
text >=1.2.1.3 && <1.3 || >= 2.0 && < 2.2,
Expand Down
6 changes: 6 additions & 0 deletions jsaddle/src/Language/Javascript/JSaddle/Types.hs
Original file line number Diff line number Diff line change
Expand Up @@ -97,6 +97,7 @@ import GHCJS.Prim.Internal (JSVal(..), JSValueRef)
import Data.JSString.Internal.Type (JSString(..))
import Control.DeepSeq (NFData(..))
import Control.Monad.Catch (MonadThrow, MonadCatch(..), MonadMask(..))
import Control.Monad.Codensity (Codensity(..))
import Control.Monad.Trans.Cont (ContT(..))
import Control.Monad.Trans.Except (ExceptT(..))
import Control.Monad.Trans.Identity (IdentityT(..))
Expand All @@ -117,10 +118,12 @@ import Data.Int (Int64)
import Data.Set (Set)
import Data.Text (Text)
import Data.Time.Clock (UTCTime(..))
import Data.Type.Equality (type (~~))
import Data.Typeable (Typeable)
import Data.Coerce (coerce, Coercible)
import Data.Aeson
(defaultOptions, genericToEncoding, ToJSON(..), FromJSON(..), Value)
import GHC.Exts (TYPE)
import GHC.Generics (Generic)
import Control.Monad.IO.Unlift (MonadUnliftIO)
import qualified Control.Monad.Fail as Fail
Expand Down Expand Up @@ -316,6 +319,9 @@ instance (Monoid w, MonadJSM m) => MonadJSM (Strict.WriterT w m) where
liftJSM' = lift . liftJSM'
{-# INLINE liftJSM' #-}

instance (m ~~ m', MonadJSM m') => MonadJSM (Codensity (m :: k -> TYPE rep)) where
liftJSM' = lift . liftJSM'

instance MonadRef JSM where
type Ref JSM = Ref IO
newRef = liftIO . newRef
Expand Down