module JavaScript.Array.Internal where
import Prelude hiding (length, reverse, drop, take)
import Data.Typeable
import GHCJS.Internal.Types
import qualified GHCJS.Prim as Prim
import GHCJS.Types
newtype SomeJSArray (m :: MutabilityType s) = SomeJSArray JSVal
deriving (Typeable)
instance IsJSVal (SomeJSArray m)
type JSArray = SomeJSArray Immutable
type MutableJSArray = SomeJSArray Mutable
type STJSArray s = SomeJSArray ('STMutable s)
create :: IO MutableJSArray
create = pure (SomeJSArray nullRef)
length :: JSArray -> Int
length _ = 0
lengthIO :: SomeJSArray m -> IO Int
lengthIO _ = pure 0
null :: JSArray -> Bool
null _ = True
append :: SomeJSArray m -> SomeJSArray m -> IO (SomeJSArray m1)
append _ _ = pure (SomeJSArray nullRef)
fromList :: [JSVal] -> JSArray
fromList _ = SomeJSArray nullRef
fromListIO :: [JSVal] -> IO (SomeJSArray m)
fromListIO _ = pure (SomeJSArray nullRef)
toList :: JSArray -> [JSVal]
toList _ = []
toListIO :: SomeJSArray m -> IO [JSVal]
toListIO _ = pure []
index :: Int -> JSArray -> JSVal
index _ _ = nullRef
read :: Int -> SomeJSArray m -> IO JSVal
read _ _ = pure nullRef
write :: Int -> JSVal -> MutableJSArray -> IO ()
write _ _ _ = pure ()
push :: JSVal -> MutableJSArray -> IO ()
push _ _ = pure ()
pop :: MutableJSArray -> IO JSVal
pop _ = pure nullRef
unshift :: JSVal -> MutableJSArray -> IO ()
unshift _ _ = pure ()
shift :: MutableJSArray -> IO JSVal
shift _ = pure nullRef
reverse :: MutableJSArray -> IO ()
reverse _ = pure ()
take :: Int -> JSArray -> JSArray
take _ _ = SomeJSArray nullRef
takeIO :: Int -> SomeJSArray m -> IO (SomeJSArray m1)
takeIO _ _ = pure (SomeJSArray nullRef)
drop :: Int -> JSArray -> JSArray
drop _ _ = SomeJSArray nullRef
dropIO :: Int -> SomeJSArray m -> IO (SomeJSArray m1)
dropIO _ _ = pure (SomeJSArray nullRef)
sliceIO :: Int -> Int -> JSArray -> IO (SomeJSArray m1)
sliceIO _ _ _ = pure (SomeJSArray nullRef)
slice :: Int -> Int -> JSArray -> JSArray
slice _ _ _= SomeJSArray nullRef
freeze :: MutableJSArray -> IO JSArray
freeze _ = pure (SomeJSArray nullRef)
unsafeFreeze :: MutableJSArray -> IO JSArray
unsafeFreeze (SomeJSArray x) = pure (SomeJSArray x)
thaw :: JSArray -> IO MutableJSArray
thaw _ = pure (SomeJSArray nullRef)
unsafeThaw :: JSArray -> IO MutableJSArray
unsafeThaw (SomeJSArray x) = pure (SomeJSArray x)