{-# LANGUAGE TypeFamilies #-}
{-# LANGUAGE TypeSynonymInstances #-}
{-# LANGUAGE FlexibleInstances #-}
{-# LANGUAGE DataKinds #-}
{-# LANGUAGE PolyKinds #-}
{-# LANGUAGE TypeOperators #-}
module JavaScript.TypedArray.Internal where
import Prelude hiding ((!!))
import GHC.Int
import GHC.Word
import GHCJS.Internal.Types
import Control.Monad (void)
import Control.Lens.Operators ((^.))
import GHCJS.Marshal (fromJSValUnchecked)
import JavaScript.Array.Internal (SomeJSArray(..))
import JavaScript.TypedArray.ArrayBuffer
import JavaScript.TypedArray.ArrayBuffer.Internal (SomeArrayBuffer(..))
import JavaScript.TypedArray.Internal.Types
import Language.Javascript.JSaddle.Types (JSM, GHCJSPure(..))
import Language.Javascript.JSaddle.Object (js, jsg, js1, js2, new, (!!), (<##))
elemSize :: SomeTypedArray e m -> GHCJSPure Int
elemSize :: forall {s} (e :: TypedArrayElem) (m :: MutabilityType s).
SomeTypedArray e m -> GHCJSPure Int
elemSize (SomeTypedArray JSVal
a) = JSM Int -> GHCJSPure Int
forall a. JSM a -> GHCJSPure a
GHCJSPure (JSM Int -> GHCJSPure Int) -> JSM Int -> GHCJSPure Int
forall a b. (a -> b) -> a -> b
$ JSVal
a JSVal -> Getting (JSM JSVal) JSVal (JSM JSVal) -> JSM JSVal
forall s a. s -> Getting a s a -> a
^. String -> IndexPreservingGetter JSVal (JSM JSVal)
forall s name.
(MakeObject s, ToJSString name) =>
name -> IndexPreservingGetter s (JSM JSVal)
js String
"BYTES_PER_ELEMENT" JSM JSVal -> (JSVal -> JSM Int) -> JSM Int
forall a b. JSM a -> (a -> JSM b) -> JSM b
forall (m :: * -> *) a b. Monad m => m a -> (a -> m b) -> m b
>>= JSVal -> JSM Int
forall a. FromJSVal a => JSVal -> JSM a
fromJSValUnchecked
{-# INLINE [1] elemSize #-}
{-# RULES "elemSizeUint8Clamped" forall (x :: SomeUint8ClampedArray m). elemSize x = GHCJSPure $ return 1 #-}
{-# RULES "elemSizeUint8" forall (x :: SomeUint8Array m). elemSize x = GHCJSPure $ return 1 #-}
{-# RULES "elemSizeUint16" forall (x :: SomeUint16Array m). elemSize x = GHCJSPure $ return 2 #-}
{-# RULES "elemSizeUint32" forall (x :: SomeUint32Array m). elemSize x = GHCJSPure $ return 4 #-}
{-# RULES "elemSizeInt8" forall (x :: SomeInt8Array m). elemSize x = GHCJSPure $ return 1 #-}
{-# RULES "elemSizeInt16" forall (x :: SomeInt16Array m). elemSize x = GHCJSPure $ return 2 #-}
{-# RULES "elemSizeInt32" forall (x :: SomeInt32Array m). elemSize x = GHCJSPure $ return 4 #-}
{-# RULES "elemSizeFloat32" forall (x :: SomeFloat32Array m). elemSize x = GHCJSPure $ return 4 #-}
{-# RULES "elemSizeFloat64" forall (x :: SomeFloat64Array m). elemSize x = GHCJSPure $ return 8 #-}
instance TypedArray IOInt8Array where
index :: Int -> IOInt8Array -> JSM (Elem IOInt8Array)
index = Int -> IOInt8Array -> JSM Int8
Int -> IOInt8Array -> JSM (Elem IOInt8Array)
forall {s} (e :: TypedArrayElem) (m :: MutabilityType s).
Int -> SomeTypedArray e m -> JSM Int8
indexI8
unsafeIndex :: Int -> IOInt8Array -> JSM (Elem IOInt8Array)
unsafeIndex = Int -> IOInt8Array -> JSM Int8
Int -> IOInt8Array -> JSM (Elem IOInt8Array)
forall {s} (e :: TypedArrayElem) (m :: MutabilityType s).
Int -> SomeTypedArray e m -> JSM Int8
unsafeIndexI8
setIndex :: Int -> Elem IOInt8Array -> IOInt8Array -> JSM ()
setIndex Int
i Elem IOInt8Array
x = Int -> Int -> IOInt8Array -> JSM ()
forall {s} (m :: MutabilityType s) (e :: TypedArrayElem).
(Mutability m ~ 'IsMutable) =>
Int -> Int -> SomeTypedArray e m -> JSM ()
setIndexI Int
i (Int8 -> Int
forall a b. (Integral a, Num b) => a -> b
fromIntegral Int8
Elem IOInt8Array
x)
unsafeSetIndex :: Int -> Elem IOInt8Array -> IOInt8Array -> JSM ()
unsafeSetIndex Int
i Elem IOInt8Array
x = Int -> Int -> IOInt8Array -> JSM ()
forall {s} (m :: MutabilityType s) (e :: TypedArrayElem).
(Mutability m ~ 'IsMutable) =>
Int -> Int -> SomeTypedArray e m -> JSM ()
unsafeSetIndexI Int
i (Int8 -> Int
forall a b. (Integral a, Num b) => a -> b
fromIntegral Int8
Elem IOInt8Array
x)
indexOf :: Int -> Elem IOInt8Array -> IOInt8Array -> JSM Int
indexOf Int
s Elem IOInt8Array
x = Int -> Int -> IOInt8Array -> JSM Int
forall {s} (m :: MutabilityType s) (e :: TypedArrayElem).
(Mutability m ~ 'IsMutable) =>
Int -> Int -> SomeTypedArray e m -> JSM Int
indexOfI Int
s (Int8 -> Int
forall a b. (Integral a, Num b) => a -> b
fromIntegral Int8
Elem IOInt8Array
x)
lastIndexOf :: Int -> Elem IOInt8Array -> IOInt8Array -> JSM Int
lastIndexOf Int
s Elem IOInt8Array
x = Int -> Int -> IOInt8Array -> JSM Int
forall {s} (e :: TypedArrayElem) (m :: MutabilityType s).
Int -> Int -> SomeTypedArray e m -> JSM Int
lastIndexOfI Int
s (Int8 -> Int
forall a b. (Integral a, Num b) => a -> b
fromIntegral Int8
Elem IOInt8Array
x)
create :: Int -> JSM IOInt8Array
create Int
l = JSVal -> IOInt8Array
forall s (e :: TypedArrayElem) (m :: MutabilityType s).
JSVal -> SomeTypedArray e m
SomeTypedArray (JSVal -> IOInt8Array) -> JSM JSVal -> JSM IOInt8Array
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
<$> JSM JSVal -> [Int] -> JSM JSVal
forall constructor args.
(MakeObject constructor, MakeArgs args) =>
constructor -> args -> JSM JSVal
new (String -> JSM JSVal
forall a. ToJSString a => a -> JSM JSVal
jsg String
"Int8Array") [Int
l]
fromArray :: forall {s} (m :: MutabilityType s).
SomeJSArray m -> JSM IOInt8Array
fromArray = SomeJSArray m -> JSM IOInt8Array
forall {s} {s} (m0 :: MutabilityType s) (m1 :: MutabilityType s).
SomeJSArray m0 -> JSM (SomeInt8Array m1)
int8ArrayFrom
fromArrayBuffer :: MutableArrayBuffer -> Int -> Maybe Int -> JSM IOInt8Array
fromArrayBuffer = MutableArrayBuffer -> Int -> Maybe Int -> JSM IOInt8Array
forall a. HasCallStack => a
undefined
instance TypedArray IOInt16Array where
index :: Int -> IOInt16Array -> JSM (Elem IOInt16Array)
index = Int -> IOInt16Array -> JSM Int16
Int -> IOInt16Array -> JSM (Elem IOInt16Array)
forall {s} (e :: TypedArrayElem) (m :: MutabilityType s).
Int -> SomeTypedArray e m -> JSM Int16
indexI16
unsafeIndex :: Int -> IOInt16Array -> JSM (Elem IOInt16Array)
unsafeIndex = Int -> IOInt16Array -> JSM Int16
Int -> IOInt16Array -> JSM (Elem IOInt16Array)
forall {s} (e :: TypedArrayElem) (m :: MutabilityType s).
Int -> SomeTypedArray e m -> JSM Int16
unsafeIndexI16
setIndex :: Int -> Elem IOInt16Array -> IOInt16Array -> JSM ()
setIndex Int
i Elem IOInt16Array
x = Int -> Int -> IOInt16Array -> JSM ()
forall {s} (m :: MutabilityType s) (e :: TypedArrayElem).
(Mutability m ~ 'IsMutable) =>
Int -> Int -> SomeTypedArray e m -> JSM ()
setIndexI Int
i (Int16 -> Int
forall a b. (Integral a, Num b) => a -> b
fromIntegral Int16
Elem IOInt16Array
x)
unsafeSetIndex :: Int -> Elem IOInt16Array -> IOInt16Array -> JSM ()
unsafeSetIndex Int
i Elem IOInt16Array
x = Int -> Int -> IOInt16Array -> JSM ()
forall {s} (m :: MutabilityType s) (e :: TypedArrayElem).
(Mutability m ~ 'IsMutable) =>
Int -> Int -> SomeTypedArray e m -> JSM ()
unsafeSetIndexI Int
i (Int16 -> Int
forall a b. (Integral a, Num b) => a -> b
fromIntegral Int16
Elem IOInt16Array
x)
indexOf :: Int -> Elem IOInt16Array -> IOInt16Array -> JSM Int
indexOf Int
s Elem IOInt16Array
x = Int -> Int -> IOInt16Array -> JSM Int
forall {s} (m :: MutabilityType s) (e :: TypedArrayElem).
(Mutability m ~ 'IsMutable) =>
Int -> Int -> SomeTypedArray e m -> JSM Int
indexOfI Int
s (Int16 -> Int
forall a b. (Integral a, Num b) => a -> b
fromIntegral Int16
Elem IOInt16Array
x)
lastIndexOf :: Int -> Elem IOInt16Array -> IOInt16Array -> JSM Int
lastIndexOf Int
s Elem IOInt16Array
x = Int -> Int -> IOInt16Array -> JSM Int
forall {s} (e :: TypedArrayElem) (m :: MutabilityType s).
Int -> Int -> SomeTypedArray e m -> JSM Int
lastIndexOfI Int
s (Int16 -> Int
forall a b. (Integral a, Num b) => a -> b
fromIntegral Int16
Elem IOInt16Array
x)
create :: Int -> JSM IOInt16Array
create Int
l = JSVal -> IOInt16Array
forall s (e :: TypedArrayElem) (m :: MutabilityType s).
JSVal -> SomeTypedArray e m
SomeTypedArray (JSVal -> IOInt16Array) -> JSM JSVal -> JSM IOInt16Array
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
<$> JSM JSVal -> [Int] -> JSM JSVal
forall constructor args.
(MakeObject constructor, MakeArgs args) =>
constructor -> args -> JSM JSVal
new (String -> JSM JSVal
forall a. ToJSString a => a -> JSM JSVal
jsg String
"Int16Array") [Int
l]
fromArray :: forall {s} (m :: MutabilityType s).
SomeJSArray m -> JSM IOInt16Array
fromArray = SomeJSArray m -> JSM IOInt16Array
forall {s} {s} (m0 :: MutabilityType s) (m1 :: MutabilityType s).
SomeJSArray m0 -> JSM (SomeInt16Array m1)
int16ArrayFrom
fromArrayBuffer :: MutableArrayBuffer -> Int -> Maybe Int -> JSM IOInt16Array
fromArrayBuffer = MutableArrayBuffer -> Int -> Maybe Int -> JSM IOInt16Array
forall a. HasCallStack => a
undefined
instance TypedArray IOInt32Array where
index :: Int -> IOInt32Array -> JSM (Elem IOInt32Array)
index = Int -> IOInt32Array -> JSM Int
Int -> IOInt32Array -> JSM (Elem IOInt32Array)
forall {s} (e :: TypedArrayElem) (m :: MutabilityType s).
Int -> SomeTypedArray e m -> JSM Int
indexI
unsafeIndex :: Int -> IOInt32Array -> JSM (Elem IOInt32Array)
unsafeIndex = Int -> IOInt32Array -> JSM Int
Int -> IOInt32Array -> JSM (Elem IOInt32Array)
forall {s} (e :: TypedArrayElem) (m :: MutabilityType s).
Int -> SomeTypedArray e m -> JSM Int
unsafeIndexI
setIndex :: Int -> Elem IOInt32Array -> IOInt32Array -> JSM ()
setIndex = Int -> Int -> IOInt32Array -> JSM ()
Int -> Elem IOInt32Array -> IOInt32Array -> JSM ()
forall {s} (m :: MutabilityType s) (e :: TypedArrayElem).
(Mutability m ~ 'IsMutable) =>
Int -> Int -> SomeTypedArray e m -> JSM ()
setIndexI
unsafeSetIndex :: Int -> Elem IOInt32Array -> IOInt32Array -> JSM ()
unsafeSetIndex = Int -> Int -> IOInt32Array -> JSM ()
Int -> Elem IOInt32Array -> IOInt32Array -> JSM ()
forall {s} (m :: MutabilityType s) (e :: TypedArrayElem).
(Mutability m ~ 'IsMutable) =>
Int -> Int -> SomeTypedArray e m -> JSM ()
unsafeSetIndexI
indexOf :: Int -> Elem IOInt32Array -> IOInt32Array -> JSM Int
indexOf = Int -> Int -> IOInt32Array -> JSM Int
Int -> Elem IOInt32Array -> IOInt32Array -> JSM Int
forall {s} (m :: MutabilityType s) (e :: TypedArrayElem).
(Mutability m ~ 'IsMutable) =>
Int -> Int -> SomeTypedArray e m -> JSM Int
indexOfI
lastIndexOf :: Int -> Elem IOInt32Array -> IOInt32Array -> JSM Int
lastIndexOf = Int -> Int -> IOInt32Array -> JSM Int
Int -> Elem IOInt32Array -> IOInt32Array -> JSM Int
forall {s} (e :: TypedArrayElem) (m :: MutabilityType s).
Int -> Int -> SomeTypedArray e m -> JSM Int
lastIndexOfI
create :: Int -> JSM IOInt32Array
create Int
l = JSVal -> IOInt32Array
forall s (e :: TypedArrayElem) (m :: MutabilityType s).
JSVal -> SomeTypedArray e m
SomeTypedArray (JSVal -> IOInt32Array) -> JSM JSVal -> JSM IOInt32Array
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
<$> JSM JSVal -> [Int] -> JSM JSVal
forall constructor args.
(MakeObject constructor, MakeArgs args) =>
constructor -> args -> JSM JSVal
new (String -> JSM JSVal
forall a. ToJSString a => a -> JSM JSVal
jsg String
"Int32Array") [Int
l]
fromArray :: forall {s} (m :: MutabilityType s).
SomeJSArray m -> JSM IOInt32Array
fromArray = SomeJSArray m -> JSM IOInt32Array
forall {s} {s} (m0 :: MutabilityType s) (m1 :: MutabilityType s).
SomeJSArray m0 -> JSM (SomeInt32Array m1)
int32ArrayFrom
fromArrayBuffer :: MutableArrayBuffer -> Int -> Maybe Int -> JSM IOInt32Array
fromArrayBuffer = MutableArrayBuffer -> Int -> Maybe Int -> JSM IOInt32Array
forall a. HasCallStack => a
undefined
instance TypedArray IOUint8ClampedArray where
index :: Int -> IOUint8ClampedArray -> JSM (Elem IOUint8ClampedArray)
index = Int -> IOUint8ClampedArray -> JSM Word8
Int -> IOUint8ClampedArray -> JSM (Elem IOUint8ClampedArray)
forall {s} (e :: TypedArrayElem) (m :: MutabilityType s).
Int -> SomeTypedArray e m -> JSM Word8
indexW8
unsafeIndex :: Int -> IOUint8ClampedArray -> JSM (Elem IOUint8ClampedArray)
unsafeIndex = Int -> IOUint8ClampedArray -> JSM Word8
Int -> IOUint8ClampedArray -> JSM (Elem IOUint8ClampedArray)
forall {s} (e :: TypedArrayElem) (m :: MutabilityType s).
Int -> SomeTypedArray e m -> JSM Word8
unsafeIndexW8
setIndex :: Int -> Elem IOUint8ClampedArray -> IOUint8ClampedArray -> JSM ()
setIndex Int
i Elem IOUint8ClampedArray
x = Int -> Word -> IOUint8ClampedArray -> JSM ()
forall {s} (m :: MutabilityType s) (e :: TypedArrayElem).
(Mutability m ~ 'IsMutable) =>
Int -> Word -> SomeTypedArray e m -> JSM ()
setIndexW Int
i (Word8 -> Word
forall a b. (Integral a, Num b) => a -> b
fromIntegral Word8
Elem IOUint8ClampedArray
x)
unsafeSetIndex :: Int -> Elem IOUint8ClampedArray -> IOUint8ClampedArray -> JSM ()
unsafeSetIndex Int
i Elem IOUint8ClampedArray
x = Int -> Word -> IOUint8ClampedArray -> JSM ()
forall {s} (m :: MutabilityType s) (e :: TypedArrayElem).
(Mutability m ~ 'IsMutable) =>
Int -> Word -> SomeTypedArray e m -> JSM ()
unsafeSetIndexW Int
i (Word8 -> Word
forall a b. (Integral a, Num b) => a -> b
fromIntegral Word8
Elem IOUint8ClampedArray
x)
indexOf :: Int -> Elem IOUint8ClampedArray -> IOUint8ClampedArray -> JSM Int
indexOf Int
s Elem IOUint8ClampedArray
x = Int -> Word -> IOUint8ClampedArray -> JSM Int
forall {s} (e :: TypedArrayElem) (m :: MutabilityType s).
Int -> Word -> SomeTypedArray e m -> JSM Int
indexOfW Int
s (Word8 -> Word
forall a b. (Integral a, Num b) => a -> b
fromIntegral Word8
Elem IOUint8ClampedArray
x)
lastIndexOf :: Int -> Elem IOUint8ClampedArray -> IOUint8ClampedArray -> JSM Int
lastIndexOf Int
s Elem IOUint8ClampedArray
x = Int -> Word -> IOUint8ClampedArray -> JSM Int
forall {s} (e :: TypedArrayElem) (m :: MutabilityType s).
Int -> Word -> SomeTypedArray e m -> JSM Int
lastIndexOfW Int
s (Word8 -> Word
forall a b. (Integral a, Num b) => a -> b
fromIntegral Word8
Elem IOUint8ClampedArray
x)
create :: Int -> JSM IOUint8ClampedArray
create Int
l = JSVal -> IOUint8ClampedArray
forall s (e :: TypedArrayElem) (m :: MutabilityType s).
JSVal -> SomeTypedArray e m
SomeTypedArray (JSVal -> IOUint8ClampedArray)
-> JSM JSVal -> JSM IOUint8ClampedArray
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
<$> JSM JSVal -> [Int] -> JSM JSVal
forall constructor args.
(MakeObject constructor, MakeArgs args) =>
constructor -> args -> JSM JSVal
new (String -> JSM JSVal
forall a. ToJSString a => a -> JSM JSVal
jsg String
"Uint8ClampedArray") [Int
l]
fromArray :: forall {s} (m :: MutabilityType s).
SomeJSArray m -> JSM IOUint8ClampedArray
fromArray = SomeJSArray m -> JSM IOUint8ClampedArray
forall {s} {s} (m0 :: MutabilityType s) (m1 :: MutabilityType s).
SomeJSArray m0 -> JSM (SomeUint8ClampedArray m1)
uint8ClampedArrayFrom
fromArrayBuffer :: MutableArrayBuffer -> Int -> Maybe Int -> JSM IOUint8ClampedArray
fromArrayBuffer = MutableArrayBuffer -> Int -> Maybe Int -> JSM IOUint8ClampedArray
forall a. HasCallStack => a
undefined
instance TypedArray IOUint8Array where
index :: Int -> IOUint8Array -> JSM (Elem IOUint8Array)
index = Int -> IOUint8Array -> JSM Word8
Int -> IOUint8Array -> JSM (Elem IOUint8Array)
forall {s} (e :: TypedArrayElem) (m :: MutabilityType s).
Int -> SomeTypedArray e m -> JSM Word8
indexW8
unsafeIndex :: Int -> IOUint8Array -> JSM (Elem IOUint8Array)
unsafeIndex = Int -> IOUint8Array -> JSM Word8
Int -> IOUint8Array -> JSM (Elem IOUint8Array)
forall {s} (e :: TypedArrayElem) (m :: MutabilityType s).
Int -> SomeTypedArray e m -> JSM Word8
unsafeIndexW8
setIndex :: Int -> Elem IOUint8Array -> IOUint8Array -> JSM ()
setIndex Int
i Elem IOUint8Array
x = Int -> Word -> IOUint8Array -> JSM ()
forall {s} (m :: MutabilityType s) (e :: TypedArrayElem).
(Mutability m ~ 'IsMutable) =>
Int -> Word -> SomeTypedArray e m -> JSM ()
setIndexW Int
i (Word8 -> Word
forall a b. (Integral a, Num b) => a -> b
fromIntegral Word8
Elem IOUint8Array
x)
unsafeSetIndex :: Int -> Elem IOUint8Array -> IOUint8Array -> JSM ()
unsafeSetIndex Int
i Elem IOUint8Array
x = Int -> Word -> IOUint8Array -> JSM ()
forall {s} (m :: MutabilityType s) (e :: TypedArrayElem).
(Mutability m ~ 'IsMutable) =>
Int -> Word -> SomeTypedArray e m -> JSM ()
unsafeSetIndexW Int
i (Word8 -> Word
forall a b. (Integral a, Num b) => a -> b
fromIntegral Word8
Elem IOUint8Array
x)
indexOf :: Int -> Elem IOUint8Array -> IOUint8Array -> JSM Int
indexOf Int
s Elem IOUint8Array
x = Int -> Word -> IOUint8Array -> JSM Int
forall {s} (e :: TypedArrayElem) (m :: MutabilityType s).
Int -> Word -> SomeTypedArray e m -> JSM Int
indexOfW Int
s (Word8 -> Word
forall a b. (Integral a, Num b) => a -> b
fromIntegral Word8
Elem IOUint8Array
x)
lastIndexOf :: Int -> Elem IOUint8Array -> IOUint8Array -> JSM Int
lastIndexOf Int
s Elem IOUint8Array
x = Int -> Word -> IOUint8Array -> JSM Int
forall {s} (e :: TypedArrayElem) (m :: MutabilityType s).
Int -> Word -> SomeTypedArray e m -> JSM Int
lastIndexOfW Int
s (Word8 -> Word
forall a b. (Integral a, Num b) => a -> b
fromIntegral Word8
Elem IOUint8Array
x)
create :: Int -> JSM IOUint8Array
create Int
l = JSVal -> IOUint8Array
forall s (e :: TypedArrayElem) (m :: MutabilityType s).
JSVal -> SomeTypedArray e m
SomeTypedArray (JSVal -> IOUint8Array) -> JSM JSVal -> JSM IOUint8Array
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
<$> JSM JSVal -> [Int] -> JSM JSVal
forall constructor args.
(MakeObject constructor, MakeArgs args) =>
constructor -> args -> JSM JSVal
new (String -> JSM JSVal
forall a. ToJSString a => a -> JSM JSVal
jsg String
"Uint8Array") [Int
l]
fromArray :: forall {s} (m :: MutabilityType s).
SomeJSArray m -> JSM IOUint8Array
fromArray = SomeJSArray m -> JSM IOUint8Array
forall {s} {s} (m0 :: MutabilityType s) (m1 :: MutabilityType s).
SomeJSArray m0 -> JSM (SomeUint8Array m1)
uint8ArrayFrom
fromArrayBuffer :: MutableArrayBuffer -> Int -> Maybe Int -> JSM IOUint8Array
fromArrayBuffer = MutableArrayBuffer -> Int -> Maybe Int -> JSM IOUint8Array
forall a. HasCallStack => a
undefined
instance TypedArray IOUint16Array where
index :: Int -> IOUint16Array -> JSM (Elem IOUint16Array)
index = Int -> IOUint16Array -> JSM Word16
Int -> IOUint16Array -> JSM (Elem IOUint16Array)
forall {s} (e :: TypedArrayElem) (m :: MutabilityType s).
Int -> SomeTypedArray e m -> JSM Word16
indexW16
unsafeIndex :: Int -> IOUint16Array -> JSM (Elem IOUint16Array)
unsafeIndex = Int -> IOUint16Array -> JSM Word16
Int -> IOUint16Array -> JSM (Elem IOUint16Array)
forall {s} (e :: TypedArrayElem) (m :: MutabilityType s).
Int -> SomeTypedArray e m -> JSM Word16
unsafeIndexW16
setIndex :: Int -> Elem IOUint16Array -> IOUint16Array -> JSM ()
setIndex Int
i Elem IOUint16Array
x = Int -> Word -> IOUint16Array -> JSM ()
forall {s} (m :: MutabilityType s) (e :: TypedArrayElem).
(Mutability m ~ 'IsMutable) =>
Int -> Word -> SomeTypedArray e m -> JSM ()
setIndexW Int
i (Word16 -> Word
forall a b. (Integral a, Num b) => a -> b
fromIntegral Word16
Elem IOUint16Array
x)
unsafeSetIndex :: Int -> Elem IOUint16Array -> IOUint16Array -> JSM ()
unsafeSetIndex Int
i Elem IOUint16Array
x = Int -> Word -> IOUint16Array -> JSM ()
forall {s} (m :: MutabilityType s) (e :: TypedArrayElem).
(Mutability m ~ 'IsMutable) =>
Int -> Word -> SomeTypedArray e m -> JSM ()
unsafeSetIndexW Int
i (Word16 -> Word
forall a b. (Integral a, Num b) => a -> b
fromIntegral Word16
Elem IOUint16Array
x)
indexOf :: Int -> Elem IOUint16Array -> IOUint16Array -> JSM Int
indexOf Int
s Elem IOUint16Array
x = Int -> Word -> IOUint16Array -> JSM Int
forall {s} (e :: TypedArrayElem) (m :: MutabilityType s).
Int -> Word -> SomeTypedArray e m -> JSM Int
indexOfW Int
s (Word16 -> Word
forall a b. (Integral a, Num b) => a -> b
fromIntegral Word16
Elem IOUint16Array
x)
lastIndexOf :: Int -> Elem IOUint16Array -> IOUint16Array -> JSM Int
lastIndexOf Int
s Elem IOUint16Array
x = Int -> Word -> IOUint16Array -> JSM Int
forall {s} (e :: TypedArrayElem) (m :: MutabilityType s).
Int -> Word -> SomeTypedArray e m -> JSM Int
lastIndexOfW Int
s (Word16 -> Word
forall a b. (Integral a, Num b) => a -> b
fromIntegral Word16
Elem IOUint16Array
x)
create :: Int -> JSM IOUint16Array
create Int
l = JSVal -> IOUint16Array
forall s (e :: TypedArrayElem) (m :: MutabilityType s).
JSVal -> SomeTypedArray e m
SomeTypedArray (JSVal -> IOUint16Array) -> JSM JSVal -> JSM IOUint16Array
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
<$> JSM JSVal -> [Int] -> JSM JSVal
forall constructor args.
(MakeObject constructor, MakeArgs args) =>
constructor -> args -> JSM JSVal
new (String -> JSM JSVal
forall a. ToJSString a => a -> JSM JSVal
jsg String
"Uint16Array") [Int
l]
fromArray :: forall {s} (m :: MutabilityType s).
SomeJSArray m -> JSM IOUint16Array
fromArray = SomeJSArray m -> JSM IOUint16Array
forall {s} {s} (m0 :: MutabilityType s) (m1 :: MutabilityType s).
SomeJSArray m0 -> JSM (SomeUint16Array m1)
uint16ArrayFrom
fromArrayBuffer :: MutableArrayBuffer -> Int -> Maybe Int -> JSM IOUint16Array
fromArrayBuffer = MutableArrayBuffer -> Int -> Maybe Int -> JSM IOUint16Array
forall a. HasCallStack => a
undefined
instance TypedArray IOUint32Array where
index :: Int -> IOUint32Array -> JSM (Elem IOUint32Array)
index = Int -> IOUint32Array -> JSM Word
Int -> IOUint32Array -> JSM (Elem IOUint32Array)
forall {s} (e :: TypedArrayElem) (m :: MutabilityType s).
Int -> SomeTypedArray e m -> JSM Word
indexW
unsafeIndex :: Int -> IOUint32Array -> JSM (Elem IOUint32Array)
unsafeIndex = Int -> IOUint32Array -> JSM Word
Int -> IOUint32Array -> JSM (Elem IOUint32Array)
forall {s} (e :: TypedArrayElem) (m :: MutabilityType s).
Int -> SomeTypedArray e m -> JSM Word
unsafeIndexW
setIndex :: Int -> Elem IOUint32Array -> IOUint32Array -> JSM ()
setIndex = Int -> Word -> IOUint32Array -> JSM ()
Int -> Elem IOUint32Array -> IOUint32Array -> JSM ()
forall {s} (m :: MutabilityType s) (e :: TypedArrayElem).
(Mutability m ~ 'IsMutable) =>
Int -> Word -> SomeTypedArray e m -> JSM ()
setIndexW
unsafeSetIndex :: Int -> Elem IOUint32Array -> IOUint32Array -> JSM ()
unsafeSetIndex = Int -> Word -> IOUint32Array -> JSM ()
Int -> Elem IOUint32Array -> IOUint32Array -> JSM ()
forall {s} (m :: MutabilityType s) (e :: TypedArrayElem).
(Mutability m ~ 'IsMutable) =>
Int -> Word -> SomeTypedArray e m -> JSM ()
unsafeSetIndexW
indexOf :: Int -> Elem IOUint32Array -> IOUint32Array -> JSM Int
indexOf = Int -> Word -> IOUint32Array -> JSM Int
Int -> Elem IOUint32Array -> IOUint32Array -> JSM Int
forall {s} (e :: TypedArrayElem) (m :: MutabilityType s).
Int -> Word -> SomeTypedArray e m -> JSM Int
indexOfW
lastIndexOf :: Int -> Elem IOUint32Array -> IOUint32Array -> JSM Int
lastIndexOf = Int -> Word -> IOUint32Array -> JSM Int
Int -> Elem IOUint32Array -> IOUint32Array -> JSM Int
forall {s} (e :: TypedArrayElem) (m :: MutabilityType s).
Int -> Word -> SomeTypedArray e m -> JSM Int
lastIndexOfW
create :: Int -> JSM IOUint32Array
create Int
l = JSVal -> IOUint32Array
forall s (e :: TypedArrayElem) (m :: MutabilityType s).
JSVal -> SomeTypedArray e m
SomeTypedArray (JSVal -> IOUint32Array) -> JSM JSVal -> JSM IOUint32Array
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
<$> JSM JSVal -> [Int] -> JSM JSVal
forall constructor args.
(MakeObject constructor, MakeArgs args) =>
constructor -> args -> JSM JSVal
new (String -> JSM JSVal
forall a. ToJSString a => a -> JSM JSVal
jsg String
"Uint32Array") [Int
l]
fromArray :: forall {s} (m :: MutabilityType s).
SomeJSArray m -> JSM IOUint32Array
fromArray = SomeJSArray m -> JSM IOUint32Array
forall {s} {s} (m0 :: MutabilityType s) (m1 :: MutabilityType s).
SomeJSArray m0 -> JSM (SomeUint32Array m1)
uint32ArrayFrom
fromArrayBuffer :: MutableArrayBuffer -> Int -> Maybe Int -> JSM IOUint32Array
fromArrayBuffer = MutableArrayBuffer -> Int -> Maybe Int -> JSM IOUint32Array
forall a. HasCallStack => a
undefined
instance TypedArray IOFloat32Array where
index :: Int -> IOFloat32Array -> JSM (Elem IOFloat32Array)
index = Int -> IOFloat32Array -> JSM Double
Int -> IOFloat32Array -> JSM (Elem IOFloat32Array)
forall {s} (e :: TypedArrayElem) (m :: MutabilityType s).
Int -> SomeTypedArray e m -> JSM Double
indexD
unsafeIndex :: Int -> IOFloat32Array -> JSM (Elem IOFloat32Array)
unsafeIndex = Int -> IOFloat32Array -> JSM Double
Int -> IOFloat32Array -> JSM (Elem IOFloat32Array)
forall {s} (e :: TypedArrayElem) (m :: MutabilityType s).
Int -> SomeTypedArray e m -> JSM Double
unsafeIndexD
setIndex :: Int -> Elem IOFloat32Array -> IOFloat32Array -> JSM ()
setIndex = Int -> Double -> IOFloat32Array -> JSM ()
Int -> Elem IOFloat32Array -> IOFloat32Array -> JSM ()
forall {s} (m :: MutabilityType s) (e :: TypedArrayElem).
(Mutability m ~ 'IsMutable) =>
Int -> Double -> SomeTypedArray e m -> JSM ()
setIndexD
unsafeSetIndex :: Int -> Elem IOFloat32Array -> IOFloat32Array -> JSM ()
unsafeSetIndex = Int -> Double -> IOFloat32Array -> JSM ()
Int -> Elem IOFloat32Array -> IOFloat32Array -> JSM ()
forall {s} (m :: MutabilityType s) (e :: TypedArrayElem).
(Mutability m ~ 'IsMutable) =>
Int -> Double -> SomeTypedArray e m -> JSM ()
unsafeSetIndexD
indexOf :: Int -> Elem IOFloat32Array -> IOFloat32Array -> JSM Int
indexOf = Int -> Double -> IOFloat32Array -> JSM Int
Int -> Elem IOFloat32Array -> IOFloat32Array -> JSM Int
forall {s} (e :: TypedArrayElem) (m :: MutabilityType s).
Int -> Double -> SomeTypedArray e m -> JSM Int
indexOfD
lastIndexOf :: Int -> Elem IOFloat32Array -> IOFloat32Array -> JSM Int
lastIndexOf = Int -> Double -> IOFloat32Array -> JSM Int
Int -> Elem IOFloat32Array -> IOFloat32Array -> JSM Int
forall {s} (e :: TypedArrayElem) (m :: MutabilityType s).
Int -> Double -> SomeTypedArray e m -> JSM Int
lastIndexOfD
create :: Int -> JSM IOFloat32Array
create Int
l = JSVal -> IOFloat32Array
forall s (e :: TypedArrayElem) (m :: MutabilityType s).
JSVal -> SomeTypedArray e m
SomeTypedArray (JSVal -> IOFloat32Array) -> JSM JSVal -> JSM IOFloat32Array
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
<$> JSM JSVal -> [Int] -> JSM JSVal
forall constructor args.
(MakeObject constructor, MakeArgs args) =>
constructor -> args -> JSM JSVal
new (String -> JSM JSVal
forall a. ToJSString a => a -> JSM JSVal
jsg String
"Float32Array") [Int
l]
fromArray :: forall {s} (m :: MutabilityType s).
SomeJSArray m -> JSM IOFloat32Array
fromArray = SomeJSArray m -> JSM IOFloat32Array
forall {s} {s} (m0 :: MutabilityType s) (m1 :: MutabilityType s).
SomeJSArray m0 -> JSM (SomeFloat32Array m1)
float32ArrayFrom
fromArrayBuffer :: MutableArrayBuffer -> Int -> Maybe Int -> JSM IOFloat32Array
fromArrayBuffer = MutableArrayBuffer -> Int -> Maybe Int -> JSM IOFloat32Array
forall a. HasCallStack => a
undefined
instance TypedArray IOFloat64Array where
index :: Int -> IOFloat64Array -> JSM (Elem IOFloat64Array)
index = Int -> IOFloat64Array -> JSM Double
Int -> IOFloat64Array -> JSM (Elem IOFloat64Array)
forall {s} (e :: TypedArrayElem) (m :: MutabilityType s).
Int -> SomeTypedArray e m -> JSM Double
indexD
unsafeIndex :: Int -> IOFloat64Array -> JSM (Elem IOFloat64Array)
unsafeIndex = Int -> IOFloat64Array -> JSM Double
Int -> IOFloat64Array -> JSM (Elem IOFloat64Array)
forall {s} (e :: TypedArrayElem) (m :: MutabilityType s).
Int -> SomeTypedArray e m -> JSM Double
unsafeIndexD
setIndex :: Int -> Elem IOFloat64Array -> IOFloat64Array -> JSM ()
setIndex = Int -> Double -> IOFloat64Array -> JSM ()
Int -> Elem IOFloat64Array -> IOFloat64Array -> JSM ()
forall {s} (m :: MutabilityType s) (e :: TypedArrayElem).
(Mutability m ~ 'IsMutable) =>
Int -> Double -> SomeTypedArray e m -> JSM ()
setIndexD
unsafeSetIndex :: Int -> Elem IOFloat64Array -> IOFloat64Array -> JSM ()
unsafeSetIndex = Int -> Double -> IOFloat64Array -> JSM ()
Int -> Elem IOFloat64Array -> IOFloat64Array -> JSM ()
forall {s} (m :: MutabilityType s) (e :: TypedArrayElem).
(Mutability m ~ 'IsMutable) =>
Int -> Double -> SomeTypedArray e m -> JSM ()
unsafeSetIndexD
indexOf :: Int -> Elem IOFloat64Array -> IOFloat64Array -> JSM Int
indexOf = Int -> Double -> IOFloat64Array -> JSM Int
Int -> Elem IOFloat64Array -> IOFloat64Array -> JSM Int
forall {s} (e :: TypedArrayElem) (m :: MutabilityType s).
Int -> Double -> SomeTypedArray e m -> JSM Int
indexOfD
lastIndexOf :: Int -> Elem IOFloat64Array -> IOFloat64Array -> JSM Int
lastIndexOf = Int -> Double -> IOFloat64Array -> JSM Int
Int -> Elem IOFloat64Array -> IOFloat64Array -> JSM Int
forall {s} (e :: TypedArrayElem) (m :: MutabilityType s).
Int -> Double -> SomeTypedArray e m -> JSM Int
lastIndexOfD
create :: Int -> JSM IOFloat64Array
create Int
l = JSVal -> IOFloat64Array
forall s (e :: TypedArrayElem) (m :: MutabilityType s).
JSVal -> SomeTypedArray e m
SomeTypedArray (JSVal -> IOFloat64Array) -> JSM JSVal -> JSM IOFloat64Array
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
<$> JSM JSVal -> [Int] -> JSM JSVal
forall constructor args.
(MakeObject constructor, MakeArgs args) =>
constructor -> args -> JSM JSVal
new (String -> JSM JSVal
forall a. ToJSString a => a -> JSM JSVal
jsg String
"Float64Array") [Int
l]
fromArray :: forall {s} (m :: MutabilityType s).
SomeJSArray m -> JSM IOFloat64Array
fromArray = SomeJSArray m -> JSM IOFloat64Array
forall {s} {s} (m0 :: MutabilityType s) (m1 :: MutabilityType s).
SomeJSArray m0 -> JSM (SomeFloat64Array m1)
float64ArrayFrom
fromArrayBuffer :: MutableArrayBuffer -> Int -> Maybe Int -> JSM IOFloat64Array
fromArrayBuffer = MutableArrayBuffer -> Int -> Maybe Int -> JSM IOFloat64Array
forall a. HasCallStack => a
undefined
class TypedArray a where
unsafeIndex :: Int -> a -> JSM (Elem a)
index :: Int -> a -> JSM (Elem a)
unsafeSetIndex :: Int -> Elem a -> a -> JSM ()
setIndex :: Int -> Elem a -> a -> JSM ()
create :: Int -> JSM a
fromArray :: SomeJSArray m -> JSM a
fromArrayBuffer :: MutableArrayBuffer -> Int -> Maybe Int -> JSM a
indexOf :: Int -> Elem a -> a -> JSM Int
lastIndexOf :: Int -> Elem a -> a -> JSM Int
indexI :: Int -> SomeTypedArray e m -> JSM Int
indexI :: forall {s} (e :: TypedArrayElem) (m :: MutabilityType s).
Int -> SomeTypedArray e m -> JSM Int
indexI Int
i (SomeTypedArray JSVal
a) = JSVal
a JSVal -> Int -> JSM JSVal
forall this. MakeObject this => this -> Int -> JSM JSVal
!! Int
i JSM JSVal -> (JSVal -> JSM Int) -> JSM Int
forall a b. JSM a -> (a -> JSM b) -> JSM b
forall (m :: * -> *) a b. Monad m => m a -> (a -> m b) -> m b
>>= JSVal -> JSM Int
forall a. FromJSVal a => JSVal -> JSM a
fromJSValUnchecked
{-# INLINE indexI #-}
indexI16 :: Int -> SomeTypedArray e m -> JSM Int16
indexI16 :: forall {s} (e :: TypedArrayElem) (m :: MutabilityType s).
Int -> SomeTypedArray e m -> JSM Int16
indexI16 Int
i (SomeTypedArray JSVal
a) = JSVal
a JSVal -> Int -> JSM JSVal
forall this. MakeObject this => this -> Int -> JSM JSVal
!! Int
i JSM JSVal -> (JSVal -> JSM Int16) -> JSM Int16
forall a b. JSM a -> (a -> JSM b) -> JSM b
forall (m :: * -> *) a b. Monad m => m a -> (a -> m b) -> m b
>>= JSVal -> JSM Int16
forall a. FromJSVal a => JSVal -> JSM a
fromJSValUnchecked
{-# INLINE indexI16 #-}
indexI8 :: Int -> SomeTypedArray e m -> JSM Int8
indexI8 :: forall {s} (e :: TypedArrayElem) (m :: MutabilityType s).
Int -> SomeTypedArray e m -> JSM Int8
indexI8 Int
i (SomeTypedArray JSVal
a) = JSVal
a JSVal -> Int -> JSM JSVal
forall this. MakeObject this => this -> Int -> JSM JSVal
!! Int
i JSM JSVal -> (JSVal -> JSM Int8) -> JSM Int8
forall a b. JSM a -> (a -> JSM b) -> JSM b
forall (m :: * -> *) a b. Monad m => m a -> (a -> m b) -> m b
>>= JSVal -> JSM Int8
forall a. FromJSVal a => JSVal -> JSM a
fromJSValUnchecked
{-# INLINE indexI8 #-}
indexW :: Int -> SomeTypedArray e m -> JSM Word
indexW :: forall {s} (e :: TypedArrayElem) (m :: MutabilityType s).
Int -> SomeTypedArray e m -> JSM Word
indexW Int
i (SomeTypedArray JSVal
a) = JSVal
a JSVal -> Int -> JSM JSVal
forall this. MakeObject this => this -> Int -> JSM JSVal
!! Int
i JSM JSVal -> (JSVal -> JSM Word) -> JSM Word
forall a b. JSM a -> (a -> JSM b) -> JSM b
forall (m :: * -> *) a b. Monad m => m a -> (a -> m b) -> m b
>>= JSVal -> JSM Word
forall a. FromJSVal a => JSVal -> JSM a
fromJSValUnchecked
{-# INLINE indexW #-}
indexW16 :: Int -> SomeTypedArray e m -> JSM Word16
indexW16 :: forall {s} (e :: TypedArrayElem) (m :: MutabilityType s).
Int -> SomeTypedArray e m -> JSM Word16
indexW16 Int
i (SomeTypedArray JSVal
a) = JSVal
a JSVal -> Int -> JSM JSVal
forall this. MakeObject this => this -> Int -> JSM JSVal
!! Int
i JSM JSVal -> (JSVal -> JSM Word16) -> JSM Word16
forall a b. JSM a -> (a -> JSM b) -> JSM b
forall (m :: * -> *) a b. Monad m => m a -> (a -> m b) -> m b
>>= JSVal -> JSM Word16
forall a. FromJSVal a => JSVal -> JSM a
fromJSValUnchecked
{-# INLINE indexW16 #-}
indexW8 :: Int -> SomeTypedArray e m -> JSM Word8
indexW8 :: forall {s} (e :: TypedArrayElem) (m :: MutabilityType s).
Int -> SomeTypedArray e m -> JSM Word8
indexW8 Int
i (SomeTypedArray JSVal
a) = JSVal
a JSVal -> Int -> JSM JSVal
forall this. MakeObject this => this -> Int -> JSM JSVal
!! Int
i JSM JSVal -> (JSVal -> JSM Word8) -> JSM Word8
forall a b. JSM a -> (a -> JSM b) -> JSM b
forall (m :: * -> *) a b. Monad m => m a -> (a -> m b) -> m b
>>= JSVal -> JSM Word8
forall a. FromJSVal a => JSVal -> JSM a
fromJSValUnchecked
{-# INLINE indexW8 #-}
indexD :: Int -> SomeTypedArray e m -> JSM Double
indexD :: forall {s} (e :: TypedArrayElem) (m :: MutabilityType s).
Int -> SomeTypedArray e m -> JSM Double
indexD Int
i (SomeTypedArray JSVal
a) = JSVal
a JSVal -> Int -> JSM JSVal
forall this. MakeObject this => this -> Int -> JSM JSVal
!! Int
i JSM JSVal -> (JSVal -> JSM Double) -> JSM Double
forall a b. JSM a -> (a -> JSM b) -> JSM b
forall (m :: * -> *) a b. Monad m => m a -> (a -> m b) -> m b
>>= JSVal -> JSM Double
forall a. FromJSVal a => JSVal -> JSM a
fromJSValUnchecked
{-# INLINE indexD #-}
unsafeIndexI :: Int -> SomeTypedArray e m -> JSM Int
unsafeIndexI :: forall {s} (e :: TypedArrayElem) (m :: MutabilityType s).
Int -> SomeTypedArray e m -> JSM Int
unsafeIndexI Int
i (SomeTypedArray JSVal
a) = JSVal
a JSVal -> Int -> JSM JSVal
forall this. MakeObject this => this -> Int -> JSM JSVal
!! Int
i JSM JSVal -> (JSVal -> JSM Int) -> JSM Int
forall a b. JSM a -> (a -> JSM b) -> JSM b
forall (m :: * -> *) a b. Monad m => m a -> (a -> m b) -> m b
>>= JSVal -> JSM Int
forall a. FromJSVal a => JSVal -> JSM a
fromJSValUnchecked
{-# INLINE unsafeIndexI #-}
unsafeIndexI16 :: Int -> SomeTypedArray e m -> JSM Int16
unsafeIndexI16 :: forall {s} (e :: TypedArrayElem) (m :: MutabilityType s).
Int -> SomeTypedArray e m -> JSM Int16
unsafeIndexI16 Int
i (SomeTypedArray JSVal
a) = JSVal
a JSVal -> Int -> JSM JSVal
forall this. MakeObject this => this -> Int -> JSM JSVal
!! Int
i JSM JSVal -> (JSVal -> JSM Int16) -> JSM Int16
forall a b. JSM a -> (a -> JSM b) -> JSM b
forall (m :: * -> *) a b. Monad m => m a -> (a -> m b) -> m b
>>= JSVal -> JSM Int16
forall a. FromJSVal a => JSVal -> JSM a
fromJSValUnchecked
{-# INLINE unsafeIndexI16 #-}
unsafeIndexI8 :: Int -> SomeTypedArray e m -> JSM Int8
unsafeIndexI8 :: forall {s} (e :: TypedArrayElem) (m :: MutabilityType s).
Int -> SomeTypedArray e m -> JSM Int8
unsafeIndexI8 Int
i (SomeTypedArray JSVal
a) = JSVal
a JSVal -> Int -> JSM JSVal
forall this. MakeObject this => this -> Int -> JSM JSVal
!! Int
i JSM JSVal -> (JSVal -> JSM Int8) -> JSM Int8
forall a b. JSM a -> (a -> JSM b) -> JSM b
forall (m :: * -> *) a b. Monad m => m a -> (a -> m b) -> m b
>>= JSVal -> JSM Int8
forall a. FromJSVal a => JSVal -> JSM a
fromJSValUnchecked
{-# INLINE unsafeIndexI8 #-}
unsafeIndexW :: Int -> SomeTypedArray e m -> JSM Word
unsafeIndexW :: forall {s} (e :: TypedArrayElem) (m :: MutabilityType s).
Int -> SomeTypedArray e m -> JSM Word
unsafeIndexW Int
i (SomeTypedArray JSVal
a) = JSVal
a JSVal -> Int -> JSM JSVal
forall this. MakeObject this => this -> Int -> JSM JSVal
!! Int
i JSM JSVal -> (JSVal -> JSM Word) -> JSM Word
forall a b. JSM a -> (a -> JSM b) -> JSM b
forall (m :: * -> *) a b. Monad m => m a -> (a -> m b) -> m b
>>= JSVal -> JSM Word
forall a. FromJSVal a => JSVal -> JSM a
fromJSValUnchecked
{-# INLINE unsafeIndexW #-}
unsafeIndexW16 :: Int -> SomeTypedArray e m -> JSM Word16
unsafeIndexW16 :: forall {s} (e :: TypedArrayElem) (m :: MutabilityType s).
Int -> SomeTypedArray e m -> JSM Word16
unsafeIndexW16 Int
i (SomeTypedArray JSVal
a) = JSVal
a JSVal -> Int -> JSM JSVal
forall this. MakeObject this => this -> Int -> JSM JSVal
!! Int
i JSM JSVal -> (JSVal -> JSM Word16) -> JSM Word16
forall a b. JSM a -> (a -> JSM b) -> JSM b
forall (m :: * -> *) a b. Monad m => m a -> (a -> m b) -> m b
>>= JSVal -> JSM Word16
forall a. FromJSVal a => JSVal -> JSM a
fromJSValUnchecked
{-# INLINE unsafeIndexW16 #-}
unsafeIndexW8 :: Int -> SomeTypedArray e m -> JSM Word8
unsafeIndexW8 :: forall {s} (e :: TypedArrayElem) (m :: MutabilityType s).
Int -> SomeTypedArray e m -> JSM Word8
unsafeIndexW8 Int
i (SomeTypedArray JSVal
a) = JSVal
a JSVal -> Int -> JSM JSVal
forall this. MakeObject this => this -> Int -> JSM JSVal
!! Int
i JSM JSVal -> (JSVal -> JSM Word8) -> JSM Word8
forall a b. JSM a -> (a -> JSM b) -> JSM b
forall (m :: * -> *) a b. Monad m => m a -> (a -> m b) -> m b
>>= JSVal -> JSM Word8
forall a. FromJSVal a => JSVal -> JSM a
fromJSValUnchecked
{-# INLINE unsafeIndexW8 #-}
unsafeIndexD :: Int -> SomeTypedArray e m -> JSM Double
unsafeIndexD :: forall {s} (e :: TypedArrayElem) (m :: MutabilityType s).
Int -> SomeTypedArray e m -> JSM Double
unsafeIndexD Int
i (SomeTypedArray JSVal
a) = JSVal
a JSVal -> Int -> JSM JSVal
forall this. MakeObject this => this -> Int -> JSM JSVal
!! Int
i JSM JSVal -> (JSVal -> JSM Double) -> JSM Double
forall a b. JSM a -> (a -> JSM b) -> JSM b
forall (m :: * -> *) a b. Monad m => m a -> (a -> m b) -> m b
>>= JSVal -> JSM Double
forall a. FromJSVal a => JSVal -> JSM a
fromJSValUnchecked
{-# INLINE unsafeIndexD #-}
int8ArrayFrom :: SomeJSArray m0 -> JSM (SomeInt8Array m1)
int8ArrayFrom :: forall {s} {s} (m0 :: MutabilityType s) (m1 :: MutabilityType s).
SomeJSArray m0 -> JSM (SomeInt8Array m1)
int8ArrayFrom (SomeJSArray JSVal
a) = JSVal -> SomeTypedArray 'Int8Elem m1
forall s (e :: TypedArrayElem) (m :: MutabilityType s).
JSVal -> SomeTypedArray e m
SomeTypedArray (JSVal -> SomeTypedArray 'Int8Elem m1)
-> JSM JSVal -> JSM (SomeTypedArray 'Int8Elem m1)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
<$> String -> JSM JSVal
forall a. ToJSString a => a -> JSM JSVal
jsg String
"Int8Array" JSM JSVal
-> Getting (JSM JSVal) (JSM JSVal) (JSM JSVal) -> JSM JSVal
forall s a. s -> Getting a s a -> a
^. String -> JSVal -> JSF
forall name a0. (ToJSString name, ToJSVal a0) => name -> a0 -> JSF
js1 String
"from" JSVal
a
{-# INLINE int8ArrayFrom #-}
int16ArrayFrom :: SomeJSArray m0 -> JSM (SomeInt16Array m1)
int16ArrayFrom :: forall {s} {s} (m0 :: MutabilityType s) (m1 :: MutabilityType s).
SomeJSArray m0 -> JSM (SomeInt16Array m1)
int16ArrayFrom (SomeJSArray JSVal
a) = JSVal -> SomeTypedArray 'Int16Elem m1
forall s (e :: TypedArrayElem) (m :: MutabilityType s).
JSVal -> SomeTypedArray e m
SomeTypedArray (JSVal -> SomeTypedArray 'Int16Elem m1)
-> JSM JSVal -> JSM (SomeTypedArray 'Int16Elem m1)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
<$> String -> JSM JSVal
forall a. ToJSString a => a -> JSM JSVal
jsg String
"Int16Array" JSM JSVal
-> Getting (JSM JSVal) (JSM JSVal) (JSM JSVal) -> JSM JSVal
forall s a. s -> Getting a s a -> a
^. String -> JSVal -> JSF
forall name a0. (ToJSString name, ToJSVal a0) => name -> a0 -> JSF
js1 String
"from" JSVal
a
{-# INLINE int16ArrayFrom #-}
int32ArrayFrom :: SomeJSArray m0 -> JSM (SomeInt32Array m1)
int32ArrayFrom :: forall {s} {s} (m0 :: MutabilityType s) (m1 :: MutabilityType s).
SomeJSArray m0 -> JSM (SomeInt32Array m1)
int32ArrayFrom (SomeJSArray JSVal
a) = JSVal -> SomeTypedArray 'Int32Elem m1
forall s (e :: TypedArrayElem) (m :: MutabilityType s).
JSVal -> SomeTypedArray e m
SomeTypedArray (JSVal -> SomeTypedArray 'Int32Elem m1)
-> JSM JSVal -> JSM (SomeTypedArray 'Int32Elem m1)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
<$> String -> JSM JSVal
forall a. ToJSString a => a -> JSM JSVal
jsg String
"Int32Array" JSM JSVal
-> Getting (JSM JSVal) (JSM JSVal) (JSM JSVal) -> JSM JSVal
forall s a. s -> Getting a s a -> a
^. String -> JSVal -> JSF
forall name a0. (ToJSString name, ToJSVal a0) => name -> a0 -> JSF
js1 String
"from" JSVal
a
{-# INLINE int32ArrayFrom #-}
uint8ArrayFrom :: SomeJSArray m0 -> JSM (SomeUint8Array m1)
uint8ArrayFrom :: forall {s} {s} (m0 :: MutabilityType s) (m1 :: MutabilityType s).
SomeJSArray m0 -> JSM (SomeUint8Array m1)
uint8ArrayFrom (SomeJSArray JSVal
a) = JSVal -> SomeTypedArray 'Uint8Elem m1
forall s (e :: TypedArrayElem) (m :: MutabilityType s).
JSVal -> SomeTypedArray e m
SomeTypedArray (JSVal -> SomeTypedArray 'Uint8Elem m1)
-> JSM JSVal -> JSM (SomeTypedArray 'Uint8Elem m1)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
<$> String -> JSM JSVal
forall a. ToJSString a => a -> JSM JSVal
jsg String
"Uint8Array" JSM JSVal
-> Getting (JSM JSVal) (JSM JSVal) (JSM JSVal) -> JSM JSVal
forall s a. s -> Getting a s a -> a
^. String -> JSVal -> JSF
forall name a0. (ToJSString name, ToJSVal a0) => name -> a0 -> JSF
js1 String
"from" JSVal
a
{-# INLINE uint8ArrayFrom #-}
uint8ClampedArrayFrom :: SomeJSArray m0 -> JSM (SomeUint8ClampedArray m1)
uint8ClampedArrayFrom :: forall {s} {s} (m0 :: MutabilityType s) (m1 :: MutabilityType s).
SomeJSArray m0 -> JSM (SomeUint8ClampedArray m1)
uint8ClampedArrayFrom (SomeJSArray JSVal
a) = JSVal -> SomeTypedArray 'Uint8ClampedElem m1
forall s (e :: TypedArrayElem) (m :: MutabilityType s).
JSVal -> SomeTypedArray e m
SomeTypedArray (JSVal -> SomeTypedArray 'Uint8ClampedElem m1)
-> JSM JSVal -> JSM (SomeTypedArray 'Uint8ClampedElem m1)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
<$> String -> JSM JSVal
forall a. ToJSString a => a -> JSM JSVal
jsg String
"Uint8ClampedArray" JSM JSVal
-> Getting (JSM JSVal) (JSM JSVal) (JSM JSVal) -> JSM JSVal
forall s a. s -> Getting a s a -> a
^. String -> JSVal -> JSF
forall name a0. (ToJSString name, ToJSVal a0) => name -> a0 -> JSF
js1 String
"from" JSVal
a
{-# INLINE uint8ClampedArrayFrom #-}
uint16ArrayFrom :: SomeJSArray m0 -> JSM (SomeUint16Array m1)
uint16ArrayFrom :: forall {s} {s} (m0 :: MutabilityType s) (m1 :: MutabilityType s).
SomeJSArray m0 -> JSM (SomeUint16Array m1)
uint16ArrayFrom (SomeJSArray JSVal
a) = JSVal -> SomeTypedArray 'Uint16Elem m1
forall s (e :: TypedArrayElem) (m :: MutabilityType s).
JSVal -> SomeTypedArray e m
SomeTypedArray (JSVal -> SomeTypedArray 'Uint16Elem m1)
-> JSM JSVal -> JSM (SomeTypedArray 'Uint16Elem m1)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
<$> String -> JSM JSVal
forall a. ToJSString a => a -> JSM JSVal
jsg String
"Uint16Array" JSM JSVal
-> Getting (JSM JSVal) (JSM JSVal) (JSM JSVal) -> JSM JSVal
forall s a. s -> Getting a s a -> a
^. String -> JSVal -> JSF
forall name a0. (ToJSString name, ToJSVal a0) => name -> a0 -> JSF
js1 String
"from" JSVal
a
{-# INLINE uint16ArrayFrom #-}
uint32ArrayFrom :: SomeJSArray m0 -> JSM (SomeUint32Array m1)
uint32ArrayFrom :: forall {s} {s} (m0 :: MutabilityType s) (m1 :: MutabilityType s).
SomeJSArray m0 -> JSM (SomeUint32Array m1)
uint32ArrayFrom (SomeJSArray JSVal
a) = JSVal -> SomeTypedArray 'Uint32Elem m1
forall s (e :: TypedArrayElem) (m :: MutabilityType s).
JSVal -> SomeTypedArray e m
SomeTypedArray (JSVal -> SomeTypedArray 'Uint32Elem m1)
-> JSM JSVal -> JSM (SomeTypedArray 'Uint32Elem m1)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
<$> String -> JSM JSVal
forall a. ToJSString a => a -> JSM JSVal
jsg String
"Uint32Array" JSM JSVal
-> Getting (JSM JSVal) (JSM JSVal) (JSM JSVal) -> JSM JSVal
forall s a. s -> Getting a s a -> a
^. String -> JSVal -> JSF
forall name a0. (ToJSString name, ToJSVal a0) => name -> a0 -> JSF
js1 String
"from" JSVal
a
{-# INLINE uint32ArrayFrom #-}
float32ArrayFrom :: SomeJSArray m0 -> JSM (SomeFloat32Array m1)
float32ArrayFrom :: forall {s} {s} (m0 :: MutabilityType s) (m1 :: MutabilityType s).
SomeJSArray m0 -> JSM (SomeFloat32Array m1)
float32ArrayFrom (SomeJSArray JSVal
a) = JSVal -> SomeTypedArray 'Float32Elem m1
forall s (e :: TypedArrayElem) (m :: MutabilityType s).
JSVal -> SomeTypedArray e m
SomeTypedArray (JSVal -> SomeTypedArray 'Float32Elem m1)
-> JSM JSVal -> JSM (SomeTypedArray 'Float32Elem m1)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
<$> String -> JSM JSVal
forall a. ToJSString a => a -> JSM JSVal
jsg String
"Float32Array" JSM JSVal
-> Getting (JSM JSVal) (JSM JSVal) (JSM JSVal) -> JSM JSVal
forall s a. s -> Getting a s a -> a
^. String -> JSVal -> JSF
forall name a0. (ToJSString name, ToJSVal a0) => name -> a0 -> JSF
js1 String
"from" JSVal
a
{-# INLINE float32ArrayFrom #-}
float64ArrayFrom :: SomeJSArray m0 -> JSM (SomeFloat64Array m1)
float64ArrayFrom :: forall {s} {s} (m0 :: MutabilityType s) (m1 :: MutabilityType s).
SomeJSArray m0 -> JSM (SomeFloat64Array m1)
float64ArrayFrom (SomeJSArray JSVal
a) = JSVal -> SomeTypedArray 'Float64Elem m1
forall s (e :: TypedArrayElem) (m :: MutabilityType s).
JSVal -> SomeTypedArray e m
SomeTypedArray (JSVal -> SomeTypedArray 'Float64Elem m1)
-> JSM JSVal -> JSM (SomeTypedArray 'Float64Elem m1)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
<$> String -> JSM JSVal
forall a. ToJSString a => a -> JSM JSVal
jsg String
"Float64Array" JSM JSVal
-> Getting (JSM JSVal) (JSM JSVal) (JSM JSVal) -> JSM JSVal
forall s a. s -> Getting a s a -> a
^. String -> JSVal -> JSF
forall name a0. (ToJSString name, ToJSVal a0) => name -> a0 -> JSF
js1 String
"from" JSVal
a
{-# INLINE float64ArrayFrom #-}
setIndexI :: Mutability m ~ IsMutable
=> Int -> Int -> SomeTypedArray e m -> JSM ()
setIndexI :: forall {s} (m :: MutabilityType s) (e :: TypedArrayElem).
(Mutability m ~ 'IsMutable) =>
Int -> Int -> SomeTypedArray e m -> JSM ()
setIndexI Int
i Int
x (SomeTypedArray JSVal
a) = (JSVal
a JSVal -> Int -> Int -> JSM ()
forall this val.
(MakeObject this, ToJSVal val) =>
this -> Int -> val -> JSM ()
<## Int
i) Int
x
{-# INLINE setIndexI #-}
unsafeSetIndexI :: Mutability m ~ IsMutable
=> Int -> Int -> SomeTypedArray e m -> JSM ()
unsafeSetIndexI :: forall {s} (m :: MutabilityType s) (e :: TypedArrayElem).
(Mutability m ~ 'IsMutable) =>
Int -> Int -> SomeTypedArray e m -> JSM ()
unsafeSetIndexI Int
i Int
x (SomeTypedArray JSVal
a) = (JSVal
a JSVal -> Int -> Int -> JSM ()
forall this val.
(MakeObject this, ToJSVal val) =>
this -> Int -> val -> JSM ()
<## Int
i) Int
x
{-# INLINE unsafeSetIndexI #-}
setIndexW :: Mutability m ~ IsMutable
=> Int -> Word -> SomeTypedArray e m -> JSM ()
setIndexW :: forall {s} (m :: MutabilityType s) (e :: TypedArrayElem).
(Mutability m ~ 'IsMutable) =>
Int -> Word -> SomeTypedArray e m -> JSM ()
setIndexW Int
i Word
x (SomeTypedArray JSVal
a) = (JSVal
a JSVal -> Int -> Word -> JSM ()
forall this val.
(MakeObject this, ToJSVal val) =>
this -> Int -> val -> JSM ()
<## Int
i) Word
x
{-# INLINE setIndexW #-}
unsafeSetIndexW :: Mutability m ~ IsMutable
=> Int -> Word -> SomeTypedArray e m -> JSM ()
unsafeSetIndexW :: forall {s} (m :: MutabilityType s) (e :: TypedArrayElem).
(Mutability m ~ 'IsMutable) =>
Int -> Word -> SomeTypedArray e m -> JSM ()
unsafeSetIndexW Int
i Word
x (SomeTypedArray JSVal
a) = (JSVal
a JSVal -> Int -> Word -> JSM ()
forall this val.
(MakeObject this, ToJSVal val) =>
this -> Int -> val -> JSM ()
<## Int
i) Word
x
{-# INLINE unsafeSetIndexW #-}
setIndexD :: Mutability m ~ IsMutable
=> Int -> Double -> SomeTypedArray e m -> JSM ()
setIndexD :: forall {s} (m :: MutabilityType s) (e :: TypedArrayElem).
(Mutability m ~ 'IsMutable) =>
Int -> Double -> SomeTypedArray e m -> JSM ()
setIndexD Int
i Double
x (SomeTypedArray JSVal
a) = (JSVal
a JSVal -> Int -> Double -> JSM ()
forall this val.
(MakeObject this, ToJSVal val) =>
this -> Int -> val -> JSM ()
<## Int
i) Double
x
{-# INLINE setIndexD #-}
unsafeSetIndexD :: Mutability m ~ IsMutable
=> Int -> Double -> SomeTypedArray e m -> JSM ()
unsafeSetIndexD :: forall {s} (m :: MutabilityType s) (e :: TypedArrayElem).
(Mutability m ~ 'IsMutable) =>
Int -> Double -> SomeTypedArray e m -> JSM ()
unsafeSetIndexD Int
i Double
x (SomeTypedArray JSVal
a) = (JSVal
a JSVal -> Int -> Double -> JSM ()
forall this val.
(MakeObject this, ToJSVal val) =>
this -> Int -> val -> JSM ()
<## Int
i) Double
x
{-# INLINE unsafeSetIndexD #-}
indexOfI :: Mutability m ~ IsMutable
=> Int -> Int -> SomeTypedArray e m -> JSM Int
indexOfI :: forall {s} (m :: MutabilityType s) (e :: TypedArrayElem).
(Mutability m ~ 'IsMutable) =>
Int -> Int -> SomeTypedArray e m -> JSM Int
indexOfI Int
s Int
x (SomeTypedArray JSVal
a) = JSVal
a JSVal -> Getting (JSM JSVal) JSVal (JSM JSVal) -> JSM JSVal
forall s a. s -> Getting a s a -> a
^. String -> Int -> Int -> JSF
forall name a0 a1.
(ToJSString name, ToJSVal a0, ToJSVal a1) =>
name -> a0 -> a1 -> JSF
js2 String
"indexOf" Int
x Int
s JSM JSVal -> (JSVal -> JSM Int) -> JSM Int
forall a b. JSM a -> (a -> JSM b) -> JSM b
forall (m :: * -> *) a b. Monad m => m a -> (a -> m b) -> m b
>>= JSVal -> JSM Int
forall a. FromJSVal a => JSVal -> JSM a
fromJSValUnchecked
{-# INLINE indexOfI #-}
indexOfW :: Int -> Word -> SomeTypedArray e m -> JSM Int
indexOfW :: forall {s} (e :: TypedArrayElem) (m :: MutabilityType s).
Int -> Word -> SomeTypedArray e m -> JSM Int
indexOfW Int
s Word
x (SomeTypedArray JSVal
a) = JSVal
a JSVal -> Getting (JSM JSVal) JSVal (JSM JSVal) -> JSM JSVal
forall s a. s -> Getting a s a -> a
^. String -> Word -> Int -> JSF
forall name a0 a1.
(ToJSString name, ToJSVal a0, ToJSVal a1) =>
name -> a0 -> a1 -> JSF
js2 String
"indexOf" Word
x Int
s JSM JSVal -> (JSVal -> JSM Int) -> JSM Int
forall a b. JSM a -> (a -> JSM b) -> JSM b
forall (m :: * -> *) a b. Monad m => m a -> (a -> m b) -> m b
>>= JSVal -> JSM Int
forall a. FromJSVal a => JSVal -> JSM a
fromJSValUnchecked
{-# INLINE indexOfW #-}
indexOfD :: Int -> Double -> SomeTypedArray e m -> JSM Int
indexOfD :: forall {s} (e :: TypedArrayElem) (m :: MutabilityType s).
Int -> Double -> SomeTypedArray e m -> JSM Int
indexOfD Int
s Double
x (SomeTypedArray JSVal
a) = JSVal
a JSVal -> Getting (JSM JSVal) JSVal (JSM JSVal) -> JSM JSVal
forall s a. s -> Getting a s a -> a
^. String -> Double -> Int -> JSF
forall name a0 a1.
(ToJSString name, ToJSVal a0, ToJSVal a1) =>
name -> a0 -> a1 -> JSF
js2 String
"indexOf" Double
x Int
s JSM JSVal -> (JSVal -> JSM Int) -> JSM Int
forall a b. JSM a -> (a -> JSM b) -> JSM b
forall (m :: * -> *) a b. Monad m => m a -> (a -> m b) -> m b
>>= JSVal -> JSM Int
forall a. FromJSVal a => JSVal -> JSM a
fromJSValUnchecked
{-# INLINE indexOfD #-}
lastIndexOfI :: Int -> Int -> SomeTypedArray e m -> JSM Int
lastIndexOfI :: forall {s} (e :: TypedArrayElem) (m :: MutabilityType s).
Int -> Int -> SomeTypedArray e m -> JSM Int
lastIndexOfI Int
s Int
x (SomeTypedArray JSVal
a) = JSVal
a JSVal -> Getting (JSM JSVal) JSVal (JSM JSVal) -> JSM JSVal
forall s a. s -> Getting a s a -> a
^. String -> Int -> Int -> JSF
forall name a0 a1.
(ToJSString name, ToJSVal a0, ToJSVal a1) =>
name -> a0 -> a1 -> JSF
js2 String
"lastIndexOf" Int
x Int
s JSM JSVal -> (JSVal -> JSM Int) -> JSM Int
forall a b. JSM a -> (a -> JSM b) -> JSM b
forall (m :: * -> *) a b. Monad m => m a -> (a -> m b) -> m b
>>= JSVal -> JSM Int
forall a. FromJSVal a => JSVal -> JSM a
fromJSValUnchecked
{-# INLINE lastIndexOfI #-}
lastIndexOfW :: Int -> Word -> SomeTypedArray e m -> JSM Int
lastIndexOfW :: forall {s} (e :: TypedArrayElem) (m :: MutabilityType s).
Int -> Word -> SomeTypedArray e m -> JSM Int
lastIndexOfW Int
s Word
x (SomeTypedArray JSVal
a) = JSVal
a JSVal -> Getting (JSM JSVal) JSVal (JSM JSVal) -> JSM JSVal
forall s a. s -> Getting a s a -> a
^. String -> Word -> Int -> JSF
forall name a0 a1.
(ToJSString name, ToJSVal a0, ToJSVal a1) =>
name -> a0 -> a1 -> JSF
js2 String
"lastIndexOf" Word
x Int
s JSM JSVal -> (JSVal -> JSM Int) -> JSM Int
forall a b. JSM a -> (a -> JSM b) -> JSM b
forall (m :: * -> *) a b. Monad m => m a -> (a -> m b) -> m b
>>= JSVal -> JSM Int
forall a. FromJSVal a => JSVal -> JSM a
fromJSValUnchecked
{-# INLINE lastIndexOfW #-}
lastIndexOfD :: Int -> Double -> SomeTypedArray e m -> JSM Int
lastIndexOfD :: forall {s} (e :: TypedArrayElem) (m :: MutabilityType s).
Int -> Double -> SomeTypedArray e m -> JSM Int
lastIndexOfD Int
s Double
x (SomeTypedArray JSVal
a) = JSVal
a JSVal -> Getting (JSM JSVal) JSVal (JSM JSVal) -> JSM JSVal
forall s a. s -> Getting a s a -> a
^. String -> Double -> Int -> JSF
forall name a0 a1.
(ToJSString name, ToJSVal a0, ToJSVal a1) =>
name -> a0 -> a1 -> JSF
js2 String
"lastIndexOf" Double
x Int
s JSM JSVal -> (JSVal -> JSM Int) -> JSM Int
forall a b. JSM a -> (a -> JSM b) -> JSM b
forall (m :: * -> *) a b. Monad m => m a -> (a -> m b) -> m b
>>= JSVal -> JSM Int
forall a. FromJSVal a => JSVal -> JSM a
fromJSValUnchecked
{-# INLINE lastIndexOfD #-}
length :: SomeTypedArray e m -> GHCJSPure Int
length :: forall {s} (e :: TypedArrayElem) (m :: MutabilityType s).
SomeTypedArray e m -> GHCJSPure Int
length (SomeTypedArray JSVal
a) = JSM Int -> GHCJSPure Int
forall a. JSM a -> GHCJSPure a
GHCJSPure (JSM Int -> GHCJSPure Int) -> JSM Int -> GHCJSPure Int
forall a b. (a -> b) -> a -> b
$ JSVal
a JSVal -> Getting (JSM JSVal) JSVal (JSM JSVal) -> JSM JSVal
forall s a. s -> Getting a s a -> a
^. String -> IndexPreservingGetter JSVal (JSM JSVal)
forall s name.
(MakeObject s, ToJSString name) =>
name -> IndexPreservingGetter s (JSM JSVal)
js String
"length" JSM JSVal -> (JSVal -> JSM Int) -> JSM Int
forall a b. JSM a -> (a -> JSM b) -> JSM b
forall (m :: * -> *) a b. Monad m => m a -> (a -> m b) -> m b
>>= JSVal -> JSM Int
forall a. FromJSVal a => JSVal -> JSM a
fromJSValUnchecked
{-# INLINE length #-}
byteLength :: SomeTypedArray e m -> GHCJSPure Int
byteLength :: forall {s} (e :: TypedArrayElem) (m :: MutabilityType s).
SomeTypedArray e m -> GHCJSPure Int
byteLength (SomeTypedArray JSVal
a) = JSM Int -> GHCJSPure Int
forall a. JSM a -> GHCJSPure a
GHCJSPure (JSM Int -> GHCJSPure Int) -> JSM Int -> GHCJSPure Int
forall a b. (a -> b) -> a -> b
$ JSVal
a JSVal -> Getting (JSM JSVal) JSVal (JSM JSVal) -> JSM JSVal
forall s a. s -> Getting a s a -> a
^. String -> IndexPreservingGetter JSVal (JSM JSVal)
forall s name.
(MakeObject s, ToJSString name) =>
name -> IndexPreservingGetter s (JSM JSVal)
js String
"byteLength" JSM JSVal -> (JSVal -> JSM Int) -> JSM Int
forall a b. JSM a -> (a -> JSM b) -> JSM b
forall (m :: * -> *) a b. Monad m => m a -> (a -> m b) -> m b
>>= JSVal -> JSM Int
forall a. FromJSVal a => JSVal -> JSM a
fromJSValUnchecked
{-# INLINE byteLength #-}
byteOffset :: SomeTypedArray e m -> GHCJSPure Int
byteOffset :: forall {s} (e :: TypedArrayElem) (m :: MutabilityType s).
SomeTypedArray e m -> GHCJSPure Int
byteOffset (SomeTypedArray JSVal
a) = JSM Int -> GHCJSPure Int
forall a. JSM a -> GHCJSPure a
GHCJSPure (JSM Int -> GHCJSPure Int) -> JSM Int -> GHCJSPure Int
forall a b. (a -> b) -> a -> b
$ JSVal
a JSVal -> Getting (JSM JSVal) JSVal (JSM JSVal) -> JSM JSVal
forall s a. s -> Getting a s a -> a
^. String -> IndexPreservingGetter JSVal (JSM JSVal)
forall s name.
(MakeObject s, ToJSString name) =>
name -> IndexPreservingGetter s (JSM JSVal)
js String
"byteOffset" JSM JSVal -> (JSVal -> JSM Int) -> JSM Int
forall a b. JSM a -> (a -> JSM b) -> JSM b
forall (m :: * -> *) a b. Monad m => m a -> (a -> m b) -> m b
>>= JSVal -> JSM Int
forall a. FromJSVal a => JSVal -> JSM a
fromJSValUnchecked
{-# INLINE byteOffset #-}
buffer :: SomeTypedArray e m -> GHCJSPure (SomeArrayBuffer m)
buffer :: forall {s} (e :: TypedArrayElem) (m :: MutabilityType s).
SomeTypedArray e m -> GHCJSPure (SomeArrayBuffer m)
buffer (SomeTypedArray JSVal
a) = JSM (SomeArrayBuffer m) -> GHCJSPure (SomeArrayBuffer m)
forall a. JSM a -> GHCJSPure a
GHCJSPure (JSM (SomeArrayBuffer m) -> GHCJSPure (SomeArrayBuffer m))
-> JSM (SomeArrayBuffer m) -> GHCJSPure (SomeArrayBuffer m)
forall a b. (a -> b) -> a -> b
$ JSVal -> SomeArrayBuffer m
forall s (a :: MutabilityType s). JSVal -> SomeArrayBuffer a
SomeArrayBuffer (JSVal -> SomeArrayBuffer m)
-> JSM JSVal -> JSM (SomeArrayBuffer m)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
<$> JSVal
a JSVal -> Getting (JSM JSVal) JSVal (JSM JSVal) -> JSM JSVal
forall s a. s -> Getting a s a -> a
^. String -> IndexPreservingGetter JSVal (JSM JSVal)
forall s name.
(MakeObject s, ToJSString name) =>
name -> IndexPreservingGetter s (JSM JSVal)
js String
"buffer"
{-# INLINE buffer #-}
subarray :: Int -> Int -> SomeTypedArray e m -> GHCJSPure (SomeTypedArray e m)
subarray :: forall {s} (e :: TypedArrayElem) (m :: MutabilityType s).
Int -> Int -> SomeTypedArray e m -> GHCJSPure (SomeTypedArray e m)
subarray Int
begin Int
end (SomeTypedArray JSVal
a) = JSM (SomeTypedArray e m) -> GHCJSPure (SomeTypedArray e m)
forall a. JSM a -> GHCJSPure a
GHCJSPure(JSM (SomeTypedArray e m) -> GHCJSPure (SomeTypedArray e m))
-> JSM (SomeTypedArray e m) -> GHCJSPure (SomeTypedArray e m)
forall a b. (a -> b) -> a -> b
$ JSVal -> SomeTypedArray e m
forall s (e :: TypedArrayElem) (m :: MutabilityType s).
JSVal -> SomeTypedArray e m
SomeTypedArray (JSVal -> SomeTypedArray e m)
-> JSM JSVal -> JSM (SomeTypedArray e m)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
<$> JSVal
a JSVal -> Getting (JSM JSVal) JSVal (JSM JSVal) -> JSM JSVal
forall s a. s -> Getting a s a -> a
^. String -> Int -> Int -> JSF
forall name a0 a1.
(ToJSString name, ToJSVal a0, ToJSVal a1) =>
name -> a0 -> a1 -> JSF
js2 String
"subarray" Int
begin Int
end
{-# INLINE subarray #-}
set :: Int -> SomeTypedArray e m -> SomeTypedArray e1 Mutable -> GHCJSPure ()
set :: forall {s} (e :: TypedArrayElem) (m :: MutabilityType s)
(e1 :: TypedArrayElem).
Int
-> SomeTypedArray e m -> SomeTypedArray e1 Mutable -> GHCJSPure ()
set Int
offset (SomeTypedArray JSVal
src) (SomeTypedArray JSVal
dest) = JSM () -> GHCJSPure ()
forall a. JSM a -> GHCJSPure a
GHCJSPure (JSM () -> GHCJSPure ()) -> JSM () -> GHCJSPure ()
forall a b. (a -> b) -> a -> b
$ JSM JSVal -> JSM ()
forall (f :: * -> *) a. Functor f => f a -> f ()
void (JSM JSVal -> JSM ()) -> JSM JSVal -> JSM ()
forall a b. (a -> b) -> a -> b
$ JSVal
dest JSVal -> Getting (JSM JSVal) JSVal (JSM JSVal) -> JSM JSVal
forall s a. s -> Getting a s a -> a
^. String -> Int -> JSVal -> JSF
forall name a0 a1.
(ToJSString name, ToJSVal a0, ToJSVal a1) =>
name -> a0 -> a1 -> JSF
js2 String
"set" Int
offset JSVal
src
{-# INLINE set #-}
unsafeSet :: Int -> SomeTypedArray e m -> SomeTypedArray e1 Mutable -> GHCJSPure ()
unsafeSet :: forall {s} (e :: TypedArrayElem) (m :: MutabilityType s)
(e1 :: TypedArrayElem).
Int
-> SomeTypedArray e m -> SomeTypedArray e1 Mutable -> GHCJSPure ()
unsafeSet Int
offset (SomeTypedArray JSVal
src) (SomeTypedArray JSVal
dest) = JSM () -> GHCJSPure ()
forall a. JSM a -> GHCJSPure a
GHCJSPure (JSM () -> GHCJSPure ()) -> JSM () -> GHCJSPure ()
forall a b. (a -> b) -> a -> b
$ JSM JSVal -> JSM ()
forall (f :: * -> *) a. Functor f => f a -> f ()
void (JSM JSVal -> JSM ()) -> JSM JSVal -> JSM ()
forall a b. (a -> b) -> a -> b
$ JSVal
dest JSVal -> Getting (JSM JSVal) JSVal (JSM JSVal) -> JSM JSVal
forall s a. s -> Getting a s a -> a
^. String -> Int -> JSVal -> JSF
forall name a0 a1.
(ToJSString name, ToJSVal a0, ToJSVal a1) =>
name -> a0 -> a1 -> JSF
js2 String
"set" Int
offset JSVal
src
{-# INLINE unsafeSet #-}