Safe Haskell | None |
---|---|
Language | Haskell2010 |
Language.Javascript.JSaddle.Types
Synopsis
- data JSContextRef = JSContextRef {
- contextId :: Int64
- startTime :: UTCTime
- doSendCommand :: Command -> IO Result
- doSendAsyncCommand :: AsyncCommand -> IO ()
- addCallback :: Object -> JSCallAsFunction -> IO ()
- nextRef :: TVar JSValueRef
- doEnableLogging :: Bool -> IO ()
- finalizerThreads :: MVar (Set Text)
- animationFrameHandlers :: MVar [Double -> JSM ()]
- liveRefs :: MVar (Set Int64)
- newtype JSM a = JSM {
- unJSM :: ReaderT JSContextRef IO a
- class (Applicative m, MonadIO m) => MonadJSM (m :: Type -> Type) where
- liftJSM :: MonadJSM m => JSM a -> m a
- newtype GHCJSPure a = GHCJSPure (JSM a)
- ghcjsPure :: GHCJSPure a -> JSM a
- ghcjsPureMap :: (a -> b) -> GHCJSPure a -> GHCJSPure b
- ghcjsPureId :: a -> GHCJSPure a
- newtype JSVal = JSVal (IORef JSValueRef)
- class IsJSVal a where
- jsval :: IsJSVal a => a -> GHCJSPure JSVal
- newtype SomeJSArray (m :: MutabilityType s) = SomeJSArray JSVal
- type JSArray = SomeJSArray Immutable
- type MutableJSArray = SomeJSArray Mutable
- type STJSArray (s1 :: s) = SomeJSArray ('STMutable s1)
- newtype Object = Object JSVal
- newtype JSString = JSString Text
- newtype Nullable a = Nullable a
- type JSCallAsFunction = JSVal -> JSVal -> [JSVal] -> JSM ()
- type JSadddleHasCallStack = ()
- syncPoint :: JSM ()
- syncAfter :: JSM a -> JSM a
- sendCommand :: Command -> JSM Result
- data MutabilityType s
- = Mutable_ s
- | Immutable_ s
- | STMutable s
- type Mutable = 'Mutable_ ()
- type Immutable = 'Immutable_ ()
- data IsItMutable
- type family Mutability (a :: MutabilityType s) :: IsItMutable where ...
- newtype JSValueReceived = JSValueReceived JSValueRef
- newtype JSValueForSend = JSValueForSend JSValueRef
- newtype JSStringReceived = JSStringReceived Text
- newtype JSStringForSend = JSStringForSend Text
- newtype JSObjectForSend = JSObjectForSend JSValueForSend
- data AsyncCommand
- = FreeRef Text JSValueForSend
- | FreeRefs Text
- | SetPropertyByName JSObjectForSend JSStringForSend JSValueForSend
- | SetPropertyAtIndex JSObjectForSend Int JSValueForSend
- | StringToValue JSStringForSend JSValueForSend
- | NumberToValue Double JSValueForSend
- | JSONValueToValue Value JSValueForSend
- | GetPropertyByName JSObjectForSend JSStringForSend JSValueForSend
- | GetPropertyAtIndex JSObjectForSend Int JSValueForSend
- | CallAsFunction JSObjectForSend JSObjectForSend [JSValueForSend] JSValueForSend
- | CallAsConstructor JSObjectForSend [JSValueForSend] JSValueForSend
- | NewEmptyObject JSValueForSend
- | NewAsyncCallback JSValueForSend
- | NewSyncCallback JSValueForSend
- | FreeCallback JSValueForSend
- | NewArray [JSValueForSend] JSValueForSend
- | EvaluateScript JSStringForSend JSValueForSend
- | SyncWithAnimationFrame JSValueForSend
- | StartSyncBlock
- | EndSyncBlock
- data Command
- = DeRefVal JSValueForSend
- | ValueToBool JSValueForSend
- | ValueToNumber JSValueForSend
- | ValueToString JSValueForSend
- | ValueToJSON JSValueForSend
- | ValueToJSONValue JSValueForSend
- | IsNull JSValueForSend
- | IsUndefined JSValueForSend
- | StrictEqual JSValueForSend JSValueForSend
- | InstanceOf JSValueForSend JSObjectForSend
- | PropertyNames JSObjectForSend
- | Sync
- data Batch = Batch [Either AsyncCommand Command] Bool Int
- data Result
- = DeRefValResult JSValueRef Text
- | ValueToBoolResult Bool
- | ValueToNumberResult Double
- | ValueToStringResult JSStringReceived
- | ValueToJSONResult JSStringReceived
- | ValueToJSONValueResult Value
- | IsNullResult Bool
- | IsUndefinedResult Bool
- | StrictEqualResult Bool
- | InstanceOfResult Bool
- | PropertyNamesResult [JSStringReceived]
- | ThrowJSValue JSValueReceived
- | SyncResult
- data BatchResults
- data Results
JavaScript Context
data JSContextRef Source #
Identifies a JavaScript execution context.
When using GHCJS this is just ()
since their is only one context.
When using GHC it includes the functions JSaddle needs to communicate
with the JavaScript context.
Constructors
JSContextRef | |
Fields
|
The JSM Monad
The JSM
monad keeps track of the JavaScript execution context.
When using GHCJS it is IO
.
Given a JSM
function and a JSContextRef
you can run the
function like this...
runJSM jsmFunction javaScriptContext
Constructors
JSM | |
Fields
|
Instances
class (Applicative m, MonadIO m) => MonadJSM (m :: Type -> Type) where Source #
Minimal complete definition
Nothing
Methods
Instances
MonadJSM JSM Source # | |
MonadJSM m => MonadJSM (MaybeT m) Source # | |
MonadJSM m => MonadJSM (ExceptT e m) Source # | |
MonadJSM m => MonadJSM (IdentityT m) Source # | |
MonadJSM m => MonadJSM (ReaderT r m) Source # | |
MonadJSM m => MonadJSM (StateT s m) Source # | |
MonadJSM m => MonadJSM (StateT s m) Source # | |
(Monoid w, MonadJSM m) => MonadJSM (WriterT w m) Source # | |
(Monoid w, MonadJSM m) => MonadJSM (WriterT w m) Source # | |
MonadJSM m => MonadJSM (ContT r m) Source # | |
(Monoid w, MonadJSM m) => MonadJSM (RWST r w s m) Source # | |
(Monoid w, MonadJSM m) => MonadJSM (RWST r w s m) Source # | |
Pure GHCJS functions
Type we can give to functions that are pure when using ghcjs, but live in JSM when using jsaddle.
Some functions that can be pure in GHCJS cannot be implemented in
a pure way in JSaddle (because we need to know the JSContextRef).
Instead we implement versions of these functions in that return
`GHCJSPure a` instead of a
. To call them in a way that will
work when compiling with GHCJS use ghcjsPure
.
ghcjsPure :: GHCJSPure a -> JSM a Source #
Used when you want to call a functions that is pure in GHCJS, but lives in the JSM in jsaddle.
ghcjsPureMap :: (a -> b) -> GHCJSPure a -> GHCJSPure b Source #
ghcjsPureId :: a -> GHCJSPure a Source #
JavaScript Value Types
Constructors
JSVal (IORef JSValueRef) |
Instances
NFData JSVal Source # | |
Defined in GHCJS.Prim.Internal | |
FromJSVal JSVal Source # | |
PFromJSVal JSVal Source # | |
Defined in GHCJS.Marshal.Pure Methods pFromJSVal :: JSVal -> JSVal Source # | |
PToJSVal JSVal Source # | |
ToJSVal JSVal Source # | If we already have a JSVal we are fine |
ToJSVal JSCallAsFunction Source # | A callback to Haskell can be used as a JavaScript value. This will create
an anonymous JavaScript function object. Use |
Defined in Language.Javascript.JSaddle.Object Methods toJSVal :: JSCallAsFunction -> JSM JSVal Source # toJSValListOf :: [JSCallAsFunction] -> JSM JSVal Source # | |
MakeArgs JSVal Source # | A single JSVal can be used as the argument list |
MakeArgs JSCallAsFunction Source # | |
Defined in Language.Javascript.JSaddle.Object | |
MakeObject JSVal Source # | |
Defined in Language.Javascript.JSaddle.Value |
class IsJSVal a where Source #
Minimal complete definition
Nothing
Methods
Instances
IsJSVal JSString Source # | |
IsJSVal (SomeArrayBuffer m) Source # | |
Defined in JavaScript.TypedArray.ArrayBuffer.Internal | |
IsJSVal (SomeJSArray m) Source # | |
Defined in Language.Javascript.JSaddle.Types | |
IsJSVal (SomeTypedArray e m) Source # | |
Defined in JavaScript.TypedArray.Internal.Types |
newtype SomeJSArray (m :: MutabilityType s) Source #
Constructors
SomeJSArray JSVal |
Instances
IsJSVal (SomeJSArray m) Source # | |
Defined in Language.Javascript.JSaddle.Types |
type MutableJSArray = SomeJSArray Mutable Source #
See MutableJSArray
See Object
Instances
ToJSVal Object Source # | |
MakeObject Object Source # | If we already have a Object we are fine |
Defined in Language.Javascript.JSaddle.Classes.Internal |
A wrapper around a JavaScript string
Instances
type JSCallAsFunction Source #
Arguments
= JSVal | Function object |
-> JSVal | this |
-> [JSVal] | Function arguments |
-> JSM () | Only () (aka |
Type used for Haskell functions called from JavaScript.
Debugging
type JSadddleHasCallStack = () Source #
Like HasCallStack, but only when jsaddle cabal flag check-unchecked is set
Sync JSM
JavaScript Context Commands
data MutabilityType s Source #
Constructors
Mutable_ s | |
Immutable_ s | |
STMutable s |
type Immutable = 'Immutable_ () Source #
data IsItMutable Source #
Constructors
IsImmutable | |
IsMutable |
type family Mutability (a :: MutabilityType s) :: IsItMutable where ... Source #
Equations
Mutability Immutable = 'IsImmutable | |
Mutability Mutable = 'IsMutable | |
Mutability ('STMutable s2 :: MutabilityType s1) = 'IsMutable |
newtype JSValueReceived Source #
Wrapper used when receiving a JSVal
from the JavaScript context
Constructors
JSValueReceived JSValueRef |
Instances
FromJSON JSValueReceived Source # | |
Defined in Language.Javascript.JSaddle.Types Methods parseJSON :: Value -> Parser JSValueReceived Source # parseJSONList :: Value -> Parser [JSValueReceived] Source # | |
ToJSON JSValueReceived Source # | |
Defined in Language.Javascript.JSaddle.Types Methods toJSON :: JSValueReceived -> Value Source # toEncoding :: JSValueReceived -> Encoding Source # toJSONList :: [JSValueReceived] -> Value Source # toEncodingList :: [JSValueReceived] -> Encoding Source # omitField :: JSValueReceived -> Bool Source # | |
Show JSValueReceived Source # | |
Defined in Language.Javascript.JSaddle.Types Methods showsPrec :: Int -> JSValueReceived -> ShowS # show :: JSValueReceived -> String # showList :: [JSValueReceived] -> ShowS # |
newtype JSValueForSend Source #
Wrapper used when sending a JSVal
to the JavaScript context
Constructors
JSValueForSend JSValueRef |
Instances
newtype JSStringReceived Source #
Wrapper used when receiving a JSString
from the JavaScript context
Constructors
JSStringReceived Text |
Instances
FromJSON JSStringReceived Source # | |
Defined in Language.Javascript.JSaddle.Types Methods parseJSON :: Value -> Parser JSStringReceived Source # parseJSONList :: Value -> Parser [JSStringReceived] Source # | |
ToJSON JSStringReceived Source # | |
Defined in Language.Javascript.JSaddle.Types Methods toJSON :: JSStringReceived -> Value Source # toEncoding :: JSStringReceived -> Encoding Source # toJSONList :: [JSStringReceived] -> Value Source # toEncodingList :: [JSStringReceived] -> Encoding Source # omitField :: JSStringReceived -> Bool Source # | |
Show JSStringReceived Source # | |
Defined in Language.Javascript.JSaddle.Types Methods showsPrec :: Int -> JSStringReceived -> ShowS # show :: JSStringReceived -> String # showList :: [JSStringReceived] -> ShowS # |
newtype JSStringForSend Source #
Wrapper used when sending a JString
to the JavaScript context
Constructors
JSStringForSend Text |
Instances
FromJSON JSStringForSend Source # | |||||
Defined in Language.Javascript.JSaddle.Types Methods parseJSON :: Value -> Parser JSStringForSend Source # parseJSONList :: Value -> Parser [JSStringForSend] Source # | |||||
ToJSON JSStringForSend Source # | |||||
Defined in Language.Javascript.JSaddle.Types Methods toJSON :: JSStringForSend -> Value Source # toEncoding :: JSStringForSend -> Encoding Source # toJSONList :: [JSStringForSend] -> Value Source # toEncodingList :: [JSStringForSend] -> Encoding Source # omitField :: JSStringForSend -> Bool Source # | |||||
NFData JSStringForSend Source # | |||||
Defined in Language.Javascript.JSaddle.Types Methods rnf :: JSStringForSend -> () # | |||||
Generic JSStringForSend Source # | |||||
Defined in Language.Javascript.JSaddle.Types Associated Types
Methods from :: JSStringForSend -> Rep JSStringForSend x # to :: Rep JSStringForSend x -> JSStringForSend # | |||||
Show JSStringForSend Source # | |||||
Defined in Language.Javascript.JSaddle.Types Methods showsPrec :: Int -> JSStringForSend -> ShowS # show :: JSStringForSend -> String # showList :: [JSStringForSend] -> ShowS # | |||||
type Rep JSStringForSend Source # | |||||
Defined in Language.Javascript.JSaddle.Types type Rep JSStringForSend = D1 ('MetaData "JSStringForSend" "Language.Javascript.JSaddle.Types" "jsaddle-0.9.9.2-4Mwamj0HYdtlFoBWYVI0q" 'True) (C1 ('MetaCons "JSStringForSend" 'PrefixI 'False) (S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 Text))) |
newtype JSObjectForSend Source #
Wrapper used when sending a Object
to the JavaScript context
Constructors
JSObjectForSend JSValueForSend |
Instances
FromJSON JSObjectForSend Source # | |||||
Defined in Language.Javascript.JSaddle.Types Methods parseJSON :: Value -> Parser JSObjectForSend Source # parseJSONList :: Value -> Parser [JSObjectForSend] Source # | |||||
ToJSON JSObjectForSend Source # | |||||
Defined in Language.Javascript.JSaddle.Types Methods toJSON :: JSObjectForSend -> Value Source # toEncoding :: JSObjectForSend -> Encoding Source # toJSONList :: [JSObjectForSend] -> Value Source # toEncodingList :: [JSObjectForSend] -> Encoding Source # omitField :: JSObjectForSend -> Bool Source # | |||||
NFData JSObjectForSend Source # | |||||
Defined in Language.Javascript.JSaddle.Types Methods rnf :: JSObjectForSend -> () # | |||||
Generic JSObjectForSend Source # | |||||
Defined in Language.Javascript.JSaddle.Types Associated Types
Methods from :: JSObjectForSend -> Rep JSObjectForSend x # to :: Rep JSObjectForSend x -> JSObjectForSend # | |||||
Show JSObjectForSend Source # | |||||
Defined in Language.Javascript.JSaddle.Types Methods showsPrec :: Int -> JSObjectForSend -> ShowS # show :: JSObjectForSend -> String # showList :: [JSObjectForSend] -> ShowS # | |||||
type Rep JSObjectForSend Source # | |||||
Defined in Language.Javascript.JSaddle.Types type Rep JSObjectForSend = D1 ('MetaData "JSObjectForSend" "Language.Javascript.JSaddle.Types" "jsaddle-0.9.9.2-4Mwamj0HYdtlFoBWYVI0q" 'True) (C1 ('MetaCons "JSObjectForSend" 'PrefixI 'False) (S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 JSValueForSend))) |
data AsyncCommand Source #
Command sent to a JavaScript context for execution asynchronously
Constructors
FreeRef Text JSValueForSend | |
FreeRefs Text | |
SetPropertyByName JSObjectForSend JSStringForSend JSValueForSend | |
SetPropertyAtIndex JSObjectForSend Int JSValueForSend | |
StringToValue JSStringForSend JSValueForSend | |
NumberToValue Double JSValueForSend | |
JSONValueToValue Value JSValueForSend | |
GetPropertyByName JSObjectForSend JSStringForSend JSValueForSend | |
GetPropertyAtIndex JSObjectForSend Int JSValueForSend | |
CallAsFunction JSObjectForSend JSObjectForSend [JSValueForSend] JSValueForSend | |
CallAsConstructor JSObjectForSend [JSValueForSend] JSValueForSend | |
NewEmptyObject JSValueForSend | |
NewAsyncCallback JSValueForSend | |
NewSyncCallback JSValueForSend | |
FreeCallback JSValueForSend | |
NewArray [JSValueForSend] JSValueForSend | |
EvaluateScript JSStringForSend JSValueForSend | |
SyncWithAnimationFrame JSValueForSend | |
StartSyncBlock | |
EndSyncBlock |
Instances
FromJSON AsyncCommand Source # | |||||
Defined in Language.Javascript.JSaddle.Types Methods parseJSON :: Value -> Parser AsyncCommand Source # parseJSONList :: Value -> Parser [AsyncCommand] Source # | |||||
ToJSON AsyncCommand Source # | |||||
Defined in Language.Javascript.JSaddle.Types Methods toJSON :: AsyncCommand -> Value Source # toEncoding :: AsyncCommand -> Encoding Source # toJSONList :: [AsyncCommand] -> Value Source # toEncodingList :: [AsyncCommand] -> Encoding Source # omitField :: AsyncCommand -> Bool Source # | |||||
NFData AsyncCommand Source # | |||||
Defined in Language.Javascript.JSaddle.Types Methods rnf :: AsyncCommand -> () # | |||||
Generic AsyncCommand Source # | |||||
Defined in Language.Javascript.JSaddle.Types Associated Types
| |||||
Show AsyncCommand Source # | |||||
Defined in Language.Javascript.JSaddle.Types Methods showsPrec :: Int -> AsyncCommand -> ShowS # show :: AsyncCommand -> String # showList :: [AsyncCommand] -> ShowS # | |||||
type Rep AsyncCommand Source # | |||||
Defined in Language.Javascript.JSaddle.Types type Rep AsyncCommand = D1 ('MetaData "AsyncCommand" "Language.Javascript.JSaddle.Types" "jsaddle-0.9.9.2-4Mwamj0HYdtlFoBWYVI0q" 'False) ((((C1 ('MetaCons "FreeRef" 'PrefixI 'False) (S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 Text) :*: S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 JSValueForSend)) :+: C1 ('MetaCons "FreeRefs" 'PrefixI 'False) (S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 Text))) :+: (C1 ('MetaCons "SetPropertyByName" 'PrefixI 'False) (S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 JSObjectForSend) :*: (S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 JSStringForSend) :*: S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 JSValueForSend))) :+: (C1 ('MetaCons "SetPropertyAtIndex" 'PrefixI 'False) (S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 JSObjectForSend) :*: (S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 Int) :*: S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 JSValueForSend))) :+: C1 ('MetaCons "StringToValue" 'PrefixI 'False) (S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 JSStringForSend) :*: S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 JSValueForSend))))) :+: ((C1 ('MetaCons "NumberToValue" 'PrefixI 'False) (S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 Double) :*: S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 JSValueForSend)) :+: C1 ('MetaCons "JSONValueToValue" 'PrefixI 'False) (S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 Value) :*: S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 JSValueForSend))) :+: (C1 ('MetaCons "GetPropertyByName" 'PrefixI 'False) (S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 JSObjectForSend) :*: (S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 JSStringForSend) :*: S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 JSValueForSend))) :+: (C1 ('MetaCons "GetPropertyAtIndex" 'PrefixI 'False) (S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 JSObjectForSend) :*: (S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 Int) :*: S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 JSValueForSend))) :+: C1 ('MetaCons "CallAsFunction" 'PrefixI 'False) ((S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 JSObjectForSend) :*: S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 JSObjectForSend)) :*: (S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 [JSValueForSend]) :*: S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 JSValueForSend))))))) :+: (((C1 ('MetaCons "CallAsConstructor" 'PrefixI 'False) (S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 JSObjectForSend) :*: (S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 [JSValueForSend]) :*: S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 JSValueForSend))) :+: C1 ('MetaCons "NewEmptyObject" 'PrefixI 'False) (S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 JSValueForSend))) :+: (C1 ('MetaCons "NewAsyncCallback" 'PrefixI 'False) (S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 JSValueForSend)) :+: (C1 ('MetaCons "NewSyncCallback" 'PrefixI 'False) (S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 JSValueForSend)) :+: C1 ('MetaCons "FreeCallback" 'PrefixI 'False) (S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 JSValueForSend))))) :+: ((C1 ('MetaCons "NewArray" 'PrefixI 'False) (S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 [JSValueForSend]) :*: S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 JSValueForSend)) :+: C1 ('MetaCons "EvaluateScript" 'PrefixI 'False) (S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 JSStringForSend) :*: S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 JSValueForSend))) :+: (C1 ('MetaCons "SyncWithAnimationFrame" 'PrefixI 'False) (S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 JSValueForSend)) :+: (C1 ('MetaCons "StartSyncBlock" 'PrefixI 'False) (U1 :: Type -> Type) :+: C1 ('MetaCons "EndSyncBlock" 'PrefixI 'False) (U1 :: Type -> Type)))))) |
Command sent to a JavaScript context for execution synchronously
Constructors
DeRefVal JSValueForSend | |
ValueToBool JSValueForSend | |
ValueToNumber JSValueForSend | |
ValueToString JSValueForSend | |
ValueToJSON JSValueForSend | |
ValueToJSONValue JSValueForSend | |
IsNull JSValueForSend | |
IsUndefined JSValueForSend | |
StrictEqual JSValueForSend JSValueForSend | |
InstanceOf JSValueForSend JSObjectForSend | |
PropertyNames JSObjectForSend | |
Sync |
Instances
FromJSON Command Source # | |||||
ToJSON Command Source # | |||||
NFData Command Source # | |||||
Defined in Language.Javascript.JSaddle.Types | |||||
Generic Command Source # | |||||
Defined in Language.Javascript.JSaddle.Types Associated Types
| |||||
Show Command Source # | |||||
type Rep Command Source # | |||||
Defined in Language.Javascript.JSaddle.Types type Rep Command = D1 ('MetaData "Command" "Language.Javascript.JSaddle.Types" "jsaddle-0.9.9.2-4Mwamj0HYdtlFoBWYVI0q" 'False) (((C1 ('MetaCons "DeRefVal" 'PrefixI 'False) (S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 JSValueForSend)) :+: (C1 ('MetaCons "ValueToBool" 'PrefixI 'False) (S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 JSValueForSend)) :+: C1 ('MetaCons "ValueToNumber" 'PrefixI 'False) (S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 JSValueForSend)))) :+: (C1 ('MetaCons "ValueToString" 'PrefixI 'False) (S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 JSValueForSend)) :+: (C1 ('MetaCons "ValueToJSON" 'PrefixI 'False) (S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 JSValueForSend)) :+: C1 ('MetaCons "ValueToJSONValue" 'PrefixI 'False) (S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 JSValueForSend))))) :+: ((C1 ('MetaCons "IsNull" 'PrefixI 'False) (S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 JSValueForSend)) :+: (C1 ('MetaCons "IsUndefined" 'PrefixI 'False) (S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 JSValueForSend)) :+: C1 ('MetaCons "StrictEqual" 'PrefixI 'False) (S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 JSValueForSend) :*: S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 JSValueForSend)))) :+: (C1 ('MetaCons "InstanceOf" 'PrefixI 'False) (S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 JSValueForSend) :*: S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 JSObjectForSend)) :+: (C1 ('MetaCons "PropertyNames" 'PrefixI 'False) (S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 JSObjectForSend)) :+: C1 ('MetaCons "Sync" 'PrefixI 'False) (U1 :: Type -> Type))))) |
Batch of commands that can be sent together to the JavaScript context
Instances
FromJSON Batch Source # | |||||
ToJSON Batch Source # | |||||
NFData Batch Source # | |||||
Defined in Language.Javascript.JSaddle.Types | |||||
Generic Batch Source # | |||||
Defined in Language.Javascript.JSaddle.Types Associated Types
| |||||
Show Batch Source # | |||||
type Rep Batch Source # | |||||
Defined in Language.Javascript.JSaddle.Types type Rep Batch = D1 ('MetaData "Batch" "Language.Javascript.JSaddle.Types" "jsaddle-0.9.9.2-4Mwamj0HYdtlFoBWYVI0q" 'False) (C1 ('MetaCons "Batch" 'PrefixI 'False) (S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 [Either AsyncCommand Command]) :*: (S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 Bool) :*: S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 Int)))) |
Result of a Command
returned from the JavaScript context
Constructors
DeRefValResult JSValueRef Text | |
ValueToBoolResult Bool | |
ValueToNumberResult Double | |
ValueToStringResult JSStringReceived | |
ValueToJSONResult JSStringReceived | |
ValueToJSONValueResult Value | |
IsNullResult Bool | |
IsUndefinedResult Bool | |
StrictEqualResult Bool | |
InstanceOfResult Bool | |
PropertyNamesResult [JSStringReceived] | |
ThrowJSValue JSValueReceived | |
SyncResult |
Instances
FromJSON Result Source # | |||||
ToJSON Result Source # | |||||
Generic Result Source # | |||||
Defined in Language.Javascript.JSaddle.Types Associated Types
| |||||
Show Result Source # | |||||
type Rep Result Source # | |||||
Defined in Language.Javascript.JSaddle.Types type Rep Result = D1 ('MetaData "Result" "Language.Javascript.JSaddle.Types" "jsaddle-0.9.9.2-4Mwamj0HYdtlFoBWYVI0q" 'False) (((C1 ('MetaCons "DeRefValResult" 'PrefixI 'False) (S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 JSValueRef) :*: S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 Text)) :+: (C1 ('MetaCons "ValueToBoolResult" 'PrefixI 'False) (S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 Bool)) :+: C1 ('MetaCons "ValueToNumberResult" 'PrefixI 'False) (S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 Double)))) :+: (C1 ('MetaCons "ValueToStringResult" 'PrefixI 'False) (S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 JSStringReceived)) :+: (C1 ('MetaCons "ValueToJSONResult" 'PrefixI 'False) (S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 JSStringReceived)) :+: C1 ('MetaCons "ValueToJSONValueResult" 'PrefixI 'False) (S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 Value))))) :+: ((C1 ('MetaCons "IsNullResult" 'PrefixI 'False) (S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 Bool)) :+: (C1 ('MetaCons "IsUndefinedResult" 'PrefixI 'False) (S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 Bool)) :+: C1 ('MetaCons "StrictEqualResult" 'PrefixI 'False) (S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 Bool)))) :+: ((C1 ('MetaCons "InstanceOfResult" 'PrefixI 'False) (S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 Bool)) :+: C1 ('MetaCons "PropertyNamesResult" 'PrefixI 'False) (S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 [JSStringReceived]))) :+: (C1 ('MetaCons "ThrowJSValue" 'PrefixI 'False) (S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 JSValueReceived)) :+: C1 ('MetaCons "SyncResult" 'PrefixI 'False) (U1 :: Type -> Type))))) |
data BatchResults Source #
Constructors
Success [JSValueReceived] [Result] | |
Failure [JSValueReceived] [Result] JSValueReceived String |
Instances
FromJSON BatchResults Source # | |||||
Defined in Language.Javascript.JSaddle.Types Methods parseJSON :: Value -> Parser BatchResults Source # parseJSONList :: Value -> Parser [BatchResults] Source # | |||||
ToJSON BatchResults Source # | |||||
Defined in Language.Javascript.JSaddle.Types Methods toJSON :: BatchResults -> Value Source # toEncoding :: BatchResults -> Encoding Source # toJSONList :: [BatchResults] -> Value Source # toEncodingList :: [BatchResults] -> Encoding Source # omitField :: BatchResults -> Bool Source # | |||||
Generic BatchResults Source # | |||||
Defined in Language.Javascript.JSaddle.Types Associated Types
| |||||
Show BatchResults Source # | |||||
Defined in Language.Javascript.JSaddle.Types Methods showsPrec :: Int -> BatchResults -> ShowS # show :: BatchResults -> String # showList :: [BatchResults] -> ShowS # | |||||
type Rep BatchResults Source # | |||||
Defined in Language.Javascript.JSaddle.Types type Rep BatchResults = D1 ('MetaData "BatchResults" "Language.Javascript.JSaddle.Types" "jsaddle-0.9.9.2-4Mwamj0HYdtlFoBWYVI0q" 'False) (C1 ('MetaCons "Success" 'PrefixI 'False) (S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 [JSValueReceived]) :*: S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 [Result])) :+: C1 ('MetaCons "Failure" 'PrefixI 'False) ((S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 [JSValueReceived]) :*: S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 [Result])) :*: (S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 JSValueReceived) :*: S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 String)))) |
Constructors
BatchResults Int BatchResults | |
Duplicate Int Int | |
Callback Int BatchResults JSValueReceived JSValueReceived JSValueReceived [JSValueReceived] | |
ProtocolError Text |
Instances
FromJSON Results Source # | |||||
ToJSON Results Source # | |||||
Generic Results Source # | |||||
Defined in Language.Javascript.JSaddle.Types Associated Types
| |||||
Show Results Source # | |||||
type Rep Results Source # | |||||
Defined in Language.Javascript.JSaddle.Types type Rep Results = D1 ('MetaData "Results" "Language.Javascript.JSaddle.Types" "jsaddle-0.9.9.2-4Mwamj0HYdtlFoBWYVI0q" 'False) ((C1 ('MetaCons "BatchResults" 'PrefixI 'False) (S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 Int) :*: S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 BatchResults)) :+: C1 ('MetaCons "Duplicate" 'PrefixI 'False) (S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 Int) :*: S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 Int))) :+: (C1 ('MetaCons "Callback" 'PrefixI 'False) ((S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 Int) :*: (S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 BatchResults) :*: S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 JSValueReceived))) :*: (S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 JSValueReceived) :*: (S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 JSValueReceived) :*: S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 [JSValueReceived])))) :+: C1 ('MetaCons "ProtocolError" 'PrefixI 'False) (S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 Text)))) |