-- Hoogle documentation, generated by Haddock
-- See Hoogle, http://www.haskell.org/hoogle/


-- | Allow GHCJS projects to compile under GHC and develop using intero.
--   
--   Allow GHCJS projects to compile under GHC and develop using intero.
--   Please refer to README.md.
@package ghcjs-base-stub
@version 0.2.0.0

module Data.JSString.Internal.Fusion.CaseMapping

module Data.JSString.Internal.Fusion.Common

module Data.JSString.Internal.Fusion.Types

module Data.JSString.Internal.Search

module GHCJS.Prim
newtype JSVal
JSVal :: () -> JSVal

-- | If a synchronous thread tries to do something that can only be done
--   asynchronously, and the thread is set up to not continue
--   asynchronously, it receives this exception.
data WouldBlockException
WouldBlockException :: WouldBlockException
data JSException
JSException :: JSVal -> String -> JSException
mkJSException :: JSVal -> IO JSException

-- | Low-level conversion utilities for packages that cannot depend on
--   ghcjs-base
--   
--   returns an empty string if the JSVal does not contain a string
fromJSString :: JSVal -> String
toJSString :: String -> JSVal
toJSArray :: [JSVal] -> IO JSVal
fromJSArray :: JSVal -> IO [JSVal]

-- | returns zero if the JSVal does not contain a number
fromJSInt :: JSVal -> Int
toJSInt :: Int -> JSVal
isNull :: JSVal -> Bool
isUndefined :: JSVal -> Bool
jsNull :: JSVal
getProp :: JSVal -> String -> IO JSVal
getProp' :: JSVal -> JSVal -> IO JSVal
instance GHC.Show.Show GHCJS.Prim.WouldBlockException
instance GHC.Exception.Exception GHCJS.Prim.WouldBlockException
instance GHC.Exception.Exception GHCJS.Prim.JSException
instance GHC.Show.Show GHCJS.Prim.JSException


-- | GHCJS has two types of threads. Regular, asynchronous threads are
--   started with `h$run`, are managed by the scheduler and run in the
--   background. `h$run` returns immediately.
--   
--   Synchronous threads are started with `h$runSync`, which returns when
--   the thread has run to completion. When a synchronous thread does an
--   operation that would block, like accessing an MVar or an asynchronous
--   FFI call, it cannot continue synchronously.
--   
--   There are two ways this can be resolved, depending on the second
--   argument of the `h$runSync` call:
--   
--   <ul>
--   <li>The action is aborted and the thread receives a
--   <a>WouldBlockException</a></li>
--   <li>The thread continues asynchronously, `h$runSync` returns</li>
--   </ul>
--   
--   Note: when a synchronous thread encounters a black hole from another
--   thread, it tries to steal the work from that thread to avoid blocking.
--   In some cases that might not be possible, for example when the data
--   accessed is produced by a lazy IO operation. This is resolved the same
--   way as blocking on an IO action would be.
module GHCJS.Concurrent

-- | Returns whether the <a>ThreadId</a> is a synchronous thread
isThreadSynchronous :: ThreadId -> IO Bool

-- | Returns whether the <a>ThreadId</a> will continue running async.
--   Always returns <a>True</a> when the thread is not synchronous.
isThreadContinueAsync :: ThreadId -> IO Bool

-- | The runtime tries to run synchronous threads to completion. Sometimes
--   it's not possible to continue running a thread, for example when the
--   thread tries to take an empty <tt>MVar</tt>. The runtime can then
--   either throw a <a>WouldBlockException</a>, aborting the blocking
--   action, or continue the thread asynchronously.
data OnBlocked

-- | continue the thread asynchronously if blocked
ContinueAsync :: OnBlocked

-- | throw <a>WouldBlockException</a> if blocked
ThrowWouldBlock :: OnBlocked

-- | If a synchronous thread tries to do something that can only be done
--   asynchronously, and the thread is set up to not continue
--   asynchronously, it receives this exception.
data WouldBlockException
WouldBlockException :: WouldBlockException

-- | Run the action without the scheduler preempting the thread. When a
--   blocking action is encountered, the thread is still suspended and will
--   continue without preemption when it's woken up again.
--   
--   When the thread encounters a black hole from another thread, the
--   scheduler will attempt to clear it by temporarily switching to that
--   thread.
withoutPreemption :: IO a -> IO a

-- | Run the action synchronously, which means that the thread will not be
--   preempted by the scheduler. If the thread encounters a blocking
--   operation, the runtime throws a WouldBlock exception.
--   
--   When the thread encounters a black hole from another thread, the
--   scheduler will attempt to clear it by temporarily switching to that
--   thread.
synchronously :: IO a -> IO a
instance GHC.Classes.Ord GHCJS.Concurrent.OnBlocked
instance GHC.Classes.Eq GHCJS.Concurrent.OnBlocked
instance GHC.Show.Show GHCJS.Concurrent.OnBlocked
instance GHC.Enum.Enum GHCJS.Concurrent.OnBlocked
instance Data.Data.Data GHCJS.Concurrent.OnBlocked

module Data.JSString.Text
textToJSString :: Text -> JSString
textFromJSString :: JSString -> Text
lazyTextToJSString :: Text -> JSString
lazyTextFromJSString :: JSString -> Text

-- | returns the empty Text if not a string
textFromJSVal :: JSVal -> Text

-- | returns the empty Text if not a string
lazyTextFromJSVal :: JSVal -> Text

module Data.JSString.Internal.Fusion
data Stream a
[Stream] :: Stream a

-- | Intermediate result in a processing pipeline.
data Step s a
Done :: Step s a
Skip :: !s -> Step s a
Yield :: !a -> !s -> Step s a

-- | <i>O(n)</i> Convert a <a>JSString</a> into a 'Stream Char'.
stream :: JSString -> Stream Char

-- | <i>O(n)</i> Convert a 'Stream Char' into a <a>JSString</a>.
unstream :: Stream Char -> JSString

-- | <i>O(n)</i> Convert a <a>JSString</a> into a 'Stream Char', but
--   iterate backwards.
reverseStream :: JSString -> Stream Char
length :: Stream Char -> Int

-- | <i>O(n)</i> Reverse the characters of a string.
reverse :: Stream Char -> JSString

-- | <i>O(n)</i> Perform the equivalent of <a>scanr</a> over a list, only
--   with the input and result reversed.
reverseScanr :: (Char -> Char -> Char) -> Char -> Stream Char -> Stream Char

-- | <i>O(n)</i> Like a combination of <a>map</a> and <tt>foldl'</tt>.
--   Applies a function to each element of a <tt>Text</tt>, passing an
--   accumulating parameter from left to right, and returns a final
--   <a>JSString</a>.
mapAccumL :: (a -> Char -> (a, Char)) -> a -> Stream Char -> (a, JSString)

-- | <i>O(n)</i> Like <tt>unfoldr</tt>, <a>unfoldrN</a> builds a stream
--   from a seed value. However, the length of the result is limited by the
--   first argument to <a>unfoldrN</a>. This function is more efficient
--   than <tt>unfoldr</tt> when the length of the result is known.
unfoldrN :: Int -> (a -> Maybe (Char, a)) -> a -> Stream Char

-- | <i>O(n)</i> stream index (subscript) operator, starting from 0.
index :: Stream Char -> Int -> Char

-- | The <a>findIndex</a> function takes a predicate and a stream and
--   returns the index of the first element in the stream satisfying the
--   predicate.
findIndex :: (Char -> Bool) -> Stream Char -> Maybe Int

-- | <i>O(n)</i> The <tt>count</tt> function returns the number of times
--   the query element appears in the given stream.
countChar :: Char -> Stream Char -> Int

module Data.JSString
data JSString

-- | <i>O(n)</i> Convert a <a>String</a> into a <a>JSString</a>. Subject to
--   fusion.
pack :: String -> JSString

-- | <i>O(n)</i> Convert a <a>JSString</a> into a <a>String</a>. Subject to
--   fusion.
unpack :: JSString -> String
unpack' :: JSString -> String

-- | <i>O(1)</i> Convert a character into a <a>JSString</a>. Subject to
--   fusion. Performs replacement on invalid scalar values.
singleton :: Char -> JSString

-- | <i>O(1)</i> The empty <a>JSString</a>.
empty :: JSString

-- | <i>O(n)</i> Adds a character to the front of a <a>JSString</a>. This
--   function is more costly than its <tt>List</tt> counterpart because it
--   requires copying a new array. Subject to fusion. Performs replacement
--   on invalid scalar values.
cons :: Char -> JSString -> JSString
infixr 5 `cons`

-- | <i>O(n)</i> Adds a character to the end of a <a>JSString</a>. This
--   copies the entire array in the process, unless fused. Subject to
--   fusion. Performs replacement on invalid scalar values.
snoc :: JSString -> Char -> JSString

-- | <i>O(n)</i> Appends one <a>JSString</a> to the other by copying both
--   of them into a new <a>JSString</a>. Subject to fusion.
append :: JSString -> JSString -> JSString

-- | <i>O(1)</i> Returns the first character and rest of a <a>JSString</a>,
--   or <tt>Nothing</tt> if empty. Subject to fusion.
uncons :: JSString -> Maybe (Char, JSString)

-- | <i>O(1)</i> Returns the first character of a <a>JSString</a>, which
--   must be non-empty. Subject to fusion.
head :: JSString -> Char

-- | <i>O(1)</i> Returns the last character of a <a>JSString</a>, which
--   must be non-empty. Subject to fusion.
last :: JSString -> Char

-- | <i>O(1)</i> Returns all characters after the head of a
--   <a>JSString</a>, which must be non-empty. Subject to fusion.
tail :: JSString -> JSString

-- | <i>O(1)</i> Returns all but the last character of a <a>JSString</a>,
--   which must be non-empty. Subject to fusion.
init :: JSString -> JSString

-- | <i>O(1)</i> Tests whether a <a>JSString</a> is empty or not. Subject
--   to fusion.
null :: JSString -> Bool

-- | <i>O(n)</i> Returns the number of characters in a <a>JSString</a>.
--   Subject to fusion.
length :: JSString -> Int

-- | <i>O(n)</i> Compare the count of characters in a <a>JSString</a> to a
--   number. Subject to fusion.
--   
--   This function gives the same answer as comparing against the result of
--   <a>length</a>, but can short circuit if the count of characters is
--   greater than the number, and hence be more efficient.
compareLength :: JSString -> Int -> Ordering

-- | <i>O(n)</i> <a>map</a> <tt>f</tt> <tt>t</tt> is the <a>JSString</a>
--   obtained by applying <tt>f</tt> to each element of <tt>t</tt>. Subject
--   to fusion. Performs replacement on invalid scalar values.
map :: (Char -> Char) -> JSString -> JSString

-- | <i>O(n)</i> The <a>intercalate</a> function takes a <a>JSString</a>
--   and a list of <a>JSString</a>s and concatenates the list after
--   interspersing the first argument between each element of the list.
intercalate :: JSString -> [JSString] -> JSString

-- | <i>O(n)</i> The <a>intersperse</a> function takes a character and
--   places it between the characters of a <a>JSString</a>. Subject to
--   fusion. Performs replacement on invalid scalar values.
intersperse :: Char -> JSString -> JSString

-- | <i>O(n)</i> The <a>transpose</a> function transposes the rows and
--   columns of its <a>JSString</a> argument. Note that this function uses
--   <a>pack</a>, <a>unpack</a>, and the list version of transpose, and is
--   thus not very efficient.
transpose :: [JSString] -> [JSString]

-- | <i>O(n)</i> Reverse the characters of a string. Subject to fusion.
reverse :: JSString -> JSString

-- | <i>O(m+n)</i> Replace every non-overlapping occurrence of
--   <tt>needle</tt> in <tt>haystack</tt> with <tt>replacement</tt>.
--   
--   This function behaves as though it was defined as follows:
--   
--   <pre>
--   replace needle replacement haystack =
--     <a>intercalate</a> replacement (<a>splitOn</a> needle haystack)
--   </pre>
--   
--   As this suggests, each occurrence is replaced exactly once. So if
--   <tt>needle</tt> occurs in <tt>replacement</tt>, that occurrence will
--   <i>not</i> itself be replaced recursively:
--   
--   <pre>
--   replace "oo" "foo" "oo" == "foo"
--   </pre>
--   
--   In cases where several instances of <tt>needle</tt> overlap, only the
--   first one will be replaced:
--   
--   <pre>
--   replace "ofo" "bar" "ofofo" == "barfo"
--   </pre>
--   
--   In (unlikely) bad cases, this function's time complexity degrades
--   towards <i>O(n*m)</i>.
replace :: JSString -> JSString -> JSString -> JSString

-- | <i>O(n)</i> Convert a string to folded case. Subject to fusion.
--   
--   This function is mainly useful for performing caseless (also known as
--   case insensitive) string comparisons.
--   
--   A string <tt>x</tt> is a caseless match for a string <tt>y</tt> if and
--   only if:
--   
--   <pre>
--   toCaseFold x == toCaseFold y
--   </pre>
--   
--   The result string may be longer than the input string, and may differ
--   from applying <a>toLower</a> to the input string. For instance, the
--   Armenian small ligature "ﬓ" (men now, U+FB13) is case folded to the
--   sequence "մ" (men, U+0574) followed by "ն" (now, U+0576), while the
--   Greek "µ" (micro sign, U+00B5) is case folded to "μ" (small letter mu,
--   U+03BC) instead of itself.
toCaseFold :: JSString -> JSString

-- | <i>O(n)</i> Convert a string to lower case, using simple case
--   conversion. Subject to fusion.
--   
--   The result string may be longer than the input string. For instance,
--   "İ" (Latin capital letter I with dot above, U+0130) maps to the
--   sequence "i" (Latin small letter i, U+0069) followed by " ̇"
--   (combining dot above, U+0307).
toLower :: JSString -> JSString

-- | <i>O(n)</i> Convert a string to upper case, using simple case
--   conversion. Subject to fusion.
--   
--   The result string may be longer than the input string. For instance,
--   the German "ß" (eszett, U+00DF) maps to the two-letter sequence "SS".
toUpper :: JSString -> JSString

-- | <i>O(n)</i> Convert a string to title case, using simple case
--   conversion. Subject to fusion.
--   
--   The first letter of the input is converted to title case, as is every
--   subsequent letter that immediately follows a non-letter. Every letter
--   that immediately follows another letter is converted to lower case.
--   
--   The result string may be longer than the input string. For example,
--   the Latin small ligature ﬂ (U+FB02) is converted to the sequence Latin
--   capital letter F (U+0046) followed by Latin small letter l (U+006C).
--   
--   <i>Note</i>: this function does not take language or culture specific
--   rules into account. For instance, in English, different style guides
--   disagree on whether the book name "The Hill of the Red Fox" is
--   correctly title cased—but this function will capitalize <i>every</i>
--   word.
toTitle :: JSString -> JSString

-- | <i>O(n)</i> Left-justify a string to the given length, using the
--   specified fill character on the right. Subject to fusion. Performs
--   replacement on invalid scalar values.
--   
--   Examples:
--   
--   <pre>
--   justifyLeft 7 'x' "foo"    == "fooxxxx"
--   justifyLeft 3 'x' "foobar" == "foobar"
--   </pre>
justifyLeft :: Int -> Char -> JSString -> JSString

-- | <i>O(n)</i> Right-justify a string to the given length, using the
--   specified fill character on the left. Performs replacement on invalid
--   scalar values.
--   
--   Examples:
--   
--   <pre>
--   justifyRight 7 'x' "bar"    == "xxxxbar"
--   justifyRight 3 'x' "foobar" == "foobar"
--   </pre>
justifyRight :: Int -> Char -> JSString -> JSString

-- | <i>O(n)</i> Center a string to the given length, using the specified
--   fill character on either side. Performs replacement on invalid scalar
--   values.
--   
--   Examples:
--   
--   <pre>
--   center 8 'x' "HS" = "xxxHSxxx"
--   </pre>
center :: Int -> Char -> JSString -> JSString

-- | <i>O(n)</i> <a>foldl</a>, applied to a binary operator, a starting
--   value (typically the left-identity of the operator), and a
--   <a>JSString</a>, reduces the <a>JSString</a> using the binary
--   operator, from left to right. Subject to fusion.
foldl :: (a -> Char -> a) -> a -> JSString -> a

-- | <i>O(n)</i> A strict version of <a>foldl</a>. Subject to fusion.
foldl' :: (a -> Char -> a) -> a -> JSString -> a

-- | <i>O(n)</i> A variant of <a>foldl</a> that has no starting value
--   argument, and thus must be applied to a non-empty <a>JSString</a>.
--   Subject to fusion.
foldl1 :: (Char -> Char -> Char) -> JSString -> Char

-- | <i>O(n)</i> A strict version of <a>foldl1</a>. Subject to fusion.
foldl1' :: (Char -> Char -> Char) -> JSString -> Char

-- | <i>O(n)</i> <a>foldr</a>, applied to a binary operator, a starting
--   value (typically the right-identity of the operator), and a
--   <a>JSString</a>, reduces the <a>JSString</a> using the binary
--   operator, from right to left. Subject to fusion.
foldr :: (Char -> a -> a) -> a -> JSString -> a

-- | <i>O(n)</i> A variant of <a>foldr</a> that has no starting value
--   argument, and thus must be applied to a non-empty <a>JSString</a>.
--   Subject to fusion.
foldr1 :: (Char -> Char -> Char) -> JSString -> Char

-- | <i>O(n)</i> Concatenate a list of <a>JSString</a>s.
concat :: [JSString] -> JSString

-- | <i>O(n)</i> Map a function over a <a>JSString</a> that results in a
--   <a>JSString</a>, and concatenate the results.
concatMap :: (Char -> JSString) -> JSString -> JSString

-- | <i>O(n)</i> <a>any</a> <tt>p</tt> <tt>t</tt> determines whether any
--   character in the <a>JSString</a> <tt>t</tt> satisifes the predicate
--   <tt>p</tt>. Subject to fusion.
any :: (Char -> Bool) -> JSString -> Bool

-- | <i>O(n)</i> <a>all</a> <tt>p</tt> <tt>t</tt> determines whether all
--   characters in the <a>JSString</a> <tt>t</tt> satisify the predicate
--   <tt>p</tt>. Subject to fusion.
all :: (Char -> Bool) -> JSString -> Bool

-- | <i>O(n)</i> <a>maximum</a> returns the maximum value from a
--   <a>JSString</a>, which must be non-empty. Subject to fusion.
maximum :: JSString -> Char

-- | <i>O(n)</i> <a>minimum</a> returns the minimum value from a
--   <a>JSString</a>, which must be non-empty. Subject to fusion.
minimum :: JSString -> Char

-- | <i>O(n)</i> <a>scanl</a> is similar to <a>foldl</a>, but returns a
--   list of successive reduced values from the left. Subject to fusion.
--   Performs replacement on invalid scalar values.
--   
--   <pre>
--   scanl f z [x1, x2, ...] == [z, z `f` x1, (z `f` x1) `f` x2, ...]
--   </pre>
--   
--   Note that
--   
--   <pre>
--   last (scanl f z xs) == foldl f z xs.
--   </pre>
scanl :: (Char -> Char -> Char) -> Char -> JSString -> JSString

-- | <i>O(n)</i> <a>scanl1</a> is a variant of <a>scanl</a> that has no
--   starting value argument. Subject to fusion. Performs replacement on
--   invalid scalar values.
--   
--   <pre>
--   scanl1 f [x1, x2, ...] == [x1, x1 `f` x2, ...]
--   </pre>
scanl1 :: (Char -> Char -> Char) -> JSString -> JSString

-- | <i>O(n)</i> <a>scanr</a> is the right-to-left dual of <a>scanl</a>.
--   Performs replacement on invalid scalar values.
--   
--   <pre>
--   scanr f v == reverse . scanl (flip f) v . reverse
--   </pre>
scanr :: (Char -> Char -> Char) -> Char -> JSString -> JSString

-- | <i>O(n)</i> <a>scanr1</a> is a variant of <a>scanr</a> that has no
--   starting value argument. Subject to fusion. Performs replacement on
--   invalid scalar values.
scanr1 :: (Char -> Char -> Char) -> JSString -> JSString

-- | <i>O(n)</i> Like a combination of <a>map</a> and <a>foldl'</a>.
--   Applies a function to each element of a <a>JSString</a>, passing an
--   accumulating parameter from left to right, and returns a final
--   <a>JSString</a>. Performs replacement on invalid scalar values.
mapAccumL :: (a -> Char -> (a, Char)) -> a -> JSString -> (a, JSString)

-- | The <a>mapAccumR</a> function behaves like a combination of <a>map</a>
--   and a strict <a>foldr</a>; it applies a function to each element of a
--   <a>JSString</a>, passing an accumulating parameter from right to left,
--   and returning a final value of this accumulator together with the new
--   <a>JSString</a>. Performs replacement on invalid scalar values.
mapAccumR :: (a -> Char -> (a, Char)) -> a -> JSString -> (a, JSString)

-- | <i>O(n*m)</i> <a>replicate</a> <tt>n</tt> <tt>t</tt> is a
--   <a>JSString</a> consisting of the input <tt>t</tt> repeated <tt>n</tt>
--   times.
replicate :: Int -> JSString -> JSString

-- | <i>O(n)</i>, where <tt>n</tt> is the length of the result. The
--   <a>unfoldr</a> function is analogous to the List <a>unfoldr</a>.
--   <a>unfoldr</a> builds a <a>JSString</a> from a seed value. The
--   function takes the element and returns <tt>Nothing</tt> if it is done
--   producing the <a>JSString</a>, otherwise <tt>Just</tt> <tt>(a,b)</tt>.
--   In this case, <tt>a</tt> is the next <a>Char</a> in the string, and
--   <tt>b</tt> is the seed value for further production. Subject to
--   fusion. Performs replacement on invalid scalar values.
unfoldr :: (a -> Maybe (Char, a)) -> a -> JSString

-- | <i>O(n)</i> Like <a>unfoldr</a>, <a>unfoldrN</a> builds a
--   <a>JSString</a> from a seed value. However, the length of the result
--   should be limited by the first argument to <a>unfoldrN</a>. This
--   function is more efficient than <a>unfoldr</a> when the maximum length
--   of the result is known and correct, otherwise its performance is
--   similar to <a>unfoldr</a>. Subject to fusion. Performs replacement on
--   invalid scalar values.
unfoldrN :: Int -> (a -> Maybe (Char, a)) -> a -> JSString

-- | <i>O(n)</i> <a>take</a> <tt>n</tt>, applied to a <a>JSString</a>,
--   returns the prefix of the <a>JSString</a> of length <tt>n</tt>, or the
--   <a>JSString</a> itself if <tt>n</tt> is greater than the length of the
--   JSString. Subject to fusion.
take :: Int -> JSString -> JSString

-- | <i>O(n)</i> <a>takeEnd</a> <tt>n</tt> <tt>t</tt> returns the suffix
--   remaining after taking <tt>n</tt> characters from the end of
--   <tt>t</tt>.
--   
--   Examples:
--   
--   <pre>
--   takeEnd 3 "foobar" == "bar"
--   </pre>
takeEnd :: Int -> JSString -> JSString

-- | <i>O(n)</i> <a>drop</a> <tt>n</tt>, applied to a <a>JSString</a>,
--   returns the suffix of the <a>JSString</a> after the first <tt>n</tt>
--   characters, or the empty <a>JSString</a> if <tt>n</tt> is greater than
--   the length of the <a>JSString</a>. Subject to fusion.
drop :: Int -> JSString -> JSString

-- | <i>O(n)</i> <a>dropEnd</a> <tt>n</tt> <tt>t</tt> returns the prefix
--   remaining after dropping <tt>n</tt> characters from the end of
--   <tt>t</tt>.
--   
--   Examples:
--   
--   <pre>
--   dropEnd 3 "foobar" == "foo"
--   </pre>
dropEnd :: Int -> JSString -> JSString

-- | <i>O(n)</i> <a>takeWhile</a>, applied to a predicate <tt>p</tt> and a
--   <a>JSString</a>, returns the longest prefix (possibly empty) of
--   elements that satisfy <tt>p</tt>. Subject to fusion.
takeWhile :: (Char -> Bool) -> JSString -> JSString

-- | <i>O(n)</i> <a>dropWhile</a> <tt>p</tt> <tt>t</tt> returns the suffix
--   remaining after <a>takeWhile</a> <tt>p</tt> <tt>t</tt>. Subject to
--   fusion.
dropWhile :: (Char -> Bool) -> JSString -> JSString

-- | <i>O(n)</i> <a>dropWhileEnd</a> <tt>p</tt> <tt>t</tt> returns the
--   prefix remaining after dropping characters that fail the predicate
--   <tt>p</tt> from the end of <tt>t</tt>. Subject to fusion. Examples:
--   
--   <pre>
--   dropWhileEnd (=='.') "foo..." == "foo"
--   </pre>
dropWhileEnd :: (Char -> Bool) -> JSString -> JSString

-- | <i>O(n)</i> <a>dropAround</a> <tt>p</tt> <tt>t</tt> returns the
--   substring remaining after dropping characters that fail the predicate
--   <tt>p</tt> from both the beginning and end of <tt>t</tt>. Subject to
--   fusion.
dropAround :: (Char -> Bool) -> JSString -> JSString

-- | <i>O(n)</i> Remove leading and trailing white space from a string.
--   Equivalent to:
--   
--   <pre>
--   dropAround isSpace
--   </pre>
strip :: JSString -> JSString

-- | <i>O(n)</i> Remove leading white space from a string. Equivalent to:
--   
--   <pre>
--   dropWhile isSpace
--   </pre>
stripStart :: JSString -> JSString

-- | <i>O(n)</i> Remove trailing white space from a string. Equivalent to:
--   
--   <pre>
--   dropWhileEnd isSpace
--   </pre>
stripEnd :: JSString -> JSString

-- | <i>O(n)</i> <a>splitAt</a> <tt>n t</tt> returns a pair whose first
--   element is a prefix of <tt>t</tt> of length <tt>n</tt>, and whose
--   second is the remainder of the string. It is equivalent to
--   <tt>(<a>take</a> n t, <a>drop</a> n t)</tt>.
splitAt :: Int -> JSString -> (JSString, JSString)

-- | <i>O(n+m)</i> Find the first instance of <tt>needle</tt> (which must
--   be non-<a>null</a>) in <tt>haystack</tt>. The first element of the
--   returned tuple is the prefix of <tt>haystack</tt> before
--   <tt>needle</tt> is matched. The second is the remainder of
--   <tt>haystack</tt>, starting with the match.
--   
--   Examples:
--   
--   <pre>
--   breakOn "::" "a::b::c" ==&gt; ("a", "::b::c")
--   breakOn "/" "foobar"   ==&gt; ("foobar", "")
--   </pre>
--   
--   Laws:
--   
--   <pre>
--   append prefix match == haystack
--     where (prefix, match) = breakOn needle haystack
--   </pre>
--   
--   If you need to break a string by a substring repeatedly (e.g. you want
--   to break on every instance of a substring), use <a>breakOnAll</a>
--   instead, as it has lower startup overhead.
--   
--   In (unlikely) bad cases, this function's time complexity degrades
--   towards <i>O(n*m)</i>.
breakOn :: JSString -> JSString -> (JSString, JSString)

-- | <i>O(n+m)</i> Similar to <a>breakOn</a>, but searches from the end of
--   the string.
--   
--   The first element of the returned tuple is the prefix of
--   <tt>haystack</tt> up to and including the last match of
--   <tt>needle</tt>. The second is the remainder of <tt>haystack</tt>,
--   following the match.
--   
--   <pre>
--   breakOnEnd "::" "a::b::c" ==&gt; ("a::b::", "c")
--   </pre>
breakOnEnd :: JSString -> JSString -> (JSString, JSString)

-- | <i>O(n)</i> <a>break</a> is like <a>span</a>, but the prefix returned
--   is over elements that fail the predicate <tt>p</tt>.
break :: (Char -> Bool) -> JSString -> (JSString, JSString)

-- | <i>O(n)</i> <a>span</a>, applied to a predicate <tt>p</tt> and text
--   <tt>t</tt>, returns a pair whose first element is the longest prefix
--   (possibly empty) of <tt>t</tt> of elements that satisfy <tt>p</tt>,
--   and whose second is the remainder of the list.
span :: (Char -> Bool) -> JSString -> (JSString, JSString)

-- | <i>O(n)</i> Group characters in a string by equality.
group :: JSString -> [JSString]
group' :: JSString -> [JSString]

-- | <i>O(n)</i> Group characters in a string according to a predicate.
groupBy :: (Char -> Char -> Bool) -> JSString -> [JSString]

-- | <i>O(n^2)</i> Return all initial segments of the given
--   <a>JSString</a>, shortest first.
inits :: JSString -> [JSString]

-- | <i>O(n^2)</i> Return all final segments of the given <a>JSString</a>,
--   longest first.
tails :: JSString -> [JSString]

-- | <i>O(m+n)</i> Break a <a>JSString</a> into pieces separated by the
--   first <a>JSString</a> argument (which cannot be empty), consuming the
--   delimiter. An empty delimiter is invalid, and will cause an error to
--   be raised.
--   
--   Examples:
--   
--   <pre>
--   splitOn "\r\n" "a\r\nb\r\nd\r\ne" == ["a","b","d","e"]
--   splitOn "aaa"  "aaaXaaaXaaaXaaa"  == ["","X","X","X",""]
--   splitOn "x"    "x"                == ["",""]
--   </pre>
--   
--   and
--   
--   <pre>
--   intercalate s . splitOn s         == id
--   splitOn (singleton c)             == split (==c)
--   </pre>
--   
--   (Note: the string <tt>s</tt> to split on above cannot be empty.)
--   
--   In (unlikely) bad cases, this function's time complexity degrades
--   towards <i>O(n*m)</i>.
splitOn :: JSString -> JSString -> [JSString]
splitOn' :: JSString -> JSString -> [JSString]

-- | <i>O(n)</i> Splits a <a>JSString</a> into components delimited by
--   separators, where the predicate returns True for a separator element.
--   The resulting components do not contain the separators. Two adjacent
--   separators result in an empty component in the output. eg.
--   
--   <pre>
--   split (=='a') "aabbaca" == ["","","bb","c",""]
--   split (=='a') ""        == [""]
--   </pre>
split :: (Char -> Bool) -> JSString -> [JSString]

-- | <i>O(n)</i> Splits a <a>JSString</a> into components of length
--   <tt>k</tt>. The last element may be shorter than the other chunks,
--   depending on the length of the input. Examples:
--   
--   <pre>
--   chunksOf 3 "foobarbaz"   == ["foo","bar","baz"]
--   chunksOf 4 "haskell.org" == ["hask","ell.","org"]
--   </pre>
chunksOf :: Int -> JSString -> [JSString]

-- | <i>O(n)</i> Splits a <a>JSString</a> into components of length
--   <tt>k</tt>. The last element may be shorter than the other chunks,
--   depending on the length of the input. Examples:
--   
--   <pre>
--   chunksOf 3 "foobarbaz"   == ["foo","bar","baz"]
--   chunksOf 4 "haskell.org" == ["hask","ell.","org"]
--   </pre>
chunksOf' :: Int -> JSString -> [JSString]

-- | <i>O(n)</i> Breaks a <a>JSString</a> up into a list of
--   <a>JSString</a>s at newline <a>Char</a>s. The resulting strings do not
--   contain newlines.
lines :: JSString -> [JSString]
lines' :: JSString -> [JSString]

-- | <i>O(n)</i> Breaks a <a>JSString</a> up into a list of words,
--   delimited by <a>Char</a>s representing white space.
words :: JSString -> [JSString]
words' :: JSString -> [JSString]

-- | <i>O(n)</i> Joins lines, after appending a terminating newline to
--   each.
unlines :: [JSString] -> JSString

-- | <i>O(n)</i> Joins words using single space characters.
unwords :: [JSString] -> JSString

-- | <i>O(n)</i> The <a>isPrefixOf</a> function takes two <a>JSString</a>s
--   and returns <tt>True</tt> iff the first is a prefix of the second.
--   Subject to fusion.
isPrefixOf :: JSString -> JSString -> Bool

-- | <i>O(n)</i> The <a>isSuffixOf</a> function takes two <a>JSString</a>s
--   and returns <tt>True</tt> iff the first is a suffix of the second.
isSuffixOf :: JSString -> JSString -> Bool

-- | The <a>isInfixOf</a> function takes two <a>JSString</a>s and returns
--   <tt>True</tt> iff the first is contained, wholly and intact, anywhere
--   within the second.
--   
--   Complexity depends on how the JavaScript engine implements
--   String.prototype.find.
isInfixOf :: JSString -> JSString -> Bool

-- | <i>O(n)</i> Return the suffix of the second string if its prefix
--   matches the entire first string.
--   
--   Examples:
--   
--   <pre>
--   stripPrefix "foo" "foobar" == Just "bar"
--   stripPrefix ""    "baz"    == Just "baz"
--   stripPrefix "foo" "quux"   == Nothing
--   </pre>
--   
--   This is particularly useful with the <tt>ViewPatterns</tt> extension
--   to GHC, as follows:
--   
--   <pre>
--   {-# LANGUAGE ViewPatterns #-}
--   import Data.Text as T
--   
--   fnordLength :: JSString -&gt; Int
--   fnordLength (stripPrefix "fnord" -&gt; Just suf) = T.length suf
--   fnordLength _                                 = -1
--   </pre>
stripPrefix :: JSString -> JSString -> Maybe JSString

-- | <i>O(n)</i> Return the prefix of the second string if its suffix
--   matches the entire first string.
--   
--   Examples:
--   
--   <pre>
--   stripSuffix "bar" "foobar" == Just "foo"
--   stripSuffix ""    "baz"    == Just "baz"
--   stripSuffix "foo" "quux"   == Nothing
--   </pre>
--   
--   This is particularly useful with the <tt>ViewPatterns</tt> extension
--   to GHC, as follows:
--   
--   <pre>
--   {-# LANGUAGE ViewPatterns #-}
--   import Data.Text as T
--   
--   quuxLength :: Text -&gt; Int
--   quuxLength (stripSuffix "quux" -&gt; Just pre) = T.length pre
--   quuxLength _                                = -1
--   </pre>
stripSuffix :: JSString -> JSString -> Maybe JSString

-- | <i>O(n)</i> Find the longest non-empty common prefix of two strings
--   and return it, along with the suffixes of each string at which they no
--   longer match.
--   
--   If the strings do not have a common prefix or either one is empty,
--   this function returns <tt>Nothing</tt>.
--   
--   Examples:
--   
--   <pre>
--   commonPrefixes "foobar" "fooquux" == Just ("foo","bar","quux")
--   commonPrefixes "veeble" "fetzer"  == Nothing
--   commonPrefixes "" "baz"           == Nothing
--   </pre>
commonPrefixes :: JSString -> JSString -> Maybe (JSString, JSString, JSString)

-- | <i>O(n)</i> <a>filter</a>, applied to a predicate and a
--   <a>JSString</a>, returns a <a>JSString</a> containing those characters
--   that satisfy the predicate.
filter :: (Char -> Bool) -> JSString -> JSString

-- | <i>O(n+m)</i> Find all non-overlapping instances of <tt>needle</tt> in
--   <tt>haystack</tt>. Each element of the returned list consists of a
--   pair:
--   
--   <ul>
--   <li>The entire string prior to the <i>k</i>th match (i.e. the
--   prefix)</li>
--   <li>The <i>k</i>th match, followed by the remainder of the string</li>
--   </ul>
--   
--   Examples:
--   
--   <pre>
--   breakOnAll "::" ""
--   ==&gt; []
--   breakOnAll "/" "a/b/c/"
--   ==&gt; [("a", "/b/c/"), ("a/b", "/c/"), ("a/b/c", "/")]
--   </pre>
--   
--   In (unlikely) bad cases, this function's time complexity degrades
--   towards <i>O(n*m)</i>.
--   
--   The <tt>needle</tt> parameter may not be empty.
breakOnAll :: JSString -> JSString -> [(JSString, JSString)]
breakOnAll' :: JSString -> JSString -> [(JSString, JSString)]

-- | <i>O(n)</i> The <a>find</a> function takes a predicate and a
--   <a>JSString</a>, and returns the first element matching the predicate,
--   or <tt>Nothing</tt> if there is no such element.
find :: (Char -> Bool) -> JSString -> Maybe Char

-- | <i>O(n)</i> The <a>partition</a> function takes a predicate and a
--   <a>JSString</a>, and returns the pair of <a>JSString</a>s with
--   elements which do and do not satisfy the predicate, respectively; i.e.
--   
--   <pre>
--   partition p t == (filter p t, filter (not . p) t)
--   </pre>
partition :: (Char -> Bool) -> JSString -> (JSString, JSString)

-- | <i>O(n)</i> <a>JSString</a> index (subscript) operator, starting from
--   0.
index :: JSString -> Int -> Char

-- | <i>O(n)</i> The <a>findIndex</a> function takes a predicate and a
--   <a>JSString</a> and returns the index of the first element in the
--   <a>JSString</a> satisfying the predicate. Subject to fusion.
findIndex :: (Char -> Bool) -> JSString -> Maybe Int

-- | <i>O(n+m)</i> The <a>count</a> function returns the number of times
--   the query string appears in the given <a>JSString</a>. An empty query
--   string is invalid, and will cause an error to be raised.
--   
--   In (unlikely) bad cases, this function's time complexity degrades
--   towards <i>O(n*m)</i>.
count :: JSString -> JSString -> Int

-- | <i>O(n)</i> <a>zip</a> takes two <a>JSString</a>s and returns a list
--   of corresponding pairs of bytes. If one input <a>JSString</a> is
--   short, excess elements of the longer <a>JSString</a> are discarded.
--   This is equivalent to a pair of <a>unpack</a> operations.
zip :: JSString -> JSString -> [(Char, Char)]

-- | <i>O(n)</i> <a>zipWith</a> generalises <a>zip</a> by zipping with the
--   function given as the first argument, instead of a tupling function.
--   Performs replacement on invalid scalar values.
zipWith :: (Char -> Char -> Char) -> JSString -> JSString -> JSString

module GHCJS.Types
data JSVal

-- | If a synchronous thread tries to do something that can only be done
--   asynchronously, and the thread is set up to not continue
--   asynchronously, it receives this exception.
data WouldBlockException
WouldBlockException :: WouldBlockException
data JSException
JSException :: JSVal -> String -> JSException
class IsJSVal a
jsval :: IsJSVal a => a -> JSVal
isNull :: JSVal -> Bool
isUndefined :: JSVal -> Bool
nullRef :: JSVal
data JSString
mkRef :: ByteArray# -> JSVal
type Ref# = ByteArray#
toPtr :: JSVal -> Ptr a
fromPtr :: Ptr a -> JSVal

-- | This is a deprecated copmatibility wrapper for the old JSRef type.
--   
--   See <a>https://github.com/ghcjs/ghcjs/issues/421</a>

-- | <i>Deprecated: Use JSVal instead, or a more specific newtype wrapper
--   of JSVal </i>
type JSRef a = JSVal


-- | Basic interop between Haskell and JavaScript.
--   
--   The principal type here is <a>JSVal</a>, which is a lifted type that
--   contains a JavaScript reference. The <a>JSVal</a> type is
--   parameterized with one phantom type, and GHCJS.Types defines several
--   type synonyms for specific variants.
--   
--   The code in this module makes no assumptions about 'JSVal a' types.
--   Operations that can result in a JS exception that can kill a Haskell
--   thread are marked unsafe (for example if the <a>JSVal</a> contains a
--   null or undefined value). There are safe variants where the JS
--   exception is propagated as a Haskell exception, so that it can be
--   handled on the Haskell side.
--   
--   For more specific types, like <tt>JSArray</tt> or <tt>JSBool</tt>, the
--   code assumes that the contents of the <a>JSVal</a> actually is a
--   JavaScript array or bool value. If it contains an unexpected value,
--   the code can result in exceptions that kill the Haskell thread, even
--   for functions not marked unsafe.
--   
--   The code makes use of `foreign import javascript', enabled with the
--   <tt>JavaScriptFFI</tt> extension, available since GHC 7.8. There are
--   three different safety levels:
--   
--   <ul>
--   <li>unsafe: The imported code is run directly. returning an
--   incorrectly typed value leads to undefined behaviour. JavaScript
--   exceptions in the foreign code kill the Haskell thread.</li>
--   <li>safe: Returned values are replaced with a default value if they
--   have the wrong type. JavaScript exceptions are caught and propagated
--   as Haskell exceptions (<a>JSException</a>), so they can be handled
--   with the standard <a>Control.Exception</a> machinery.</li>
--   <li>interruptible: The import is asynchronous. The calling Haskell
--   thread sleeps until the foreign code calls the `$c` JavaScript
--   function with the result. The thread is in interruptible state while
--   blocked, so it can receive asynchronous exceptions.</li>
--   </ul>
--   
--   Unlike the FFI for native code, it's safe to call back into Haskell
--   (`h$run`, `h$runSync`) from foreign code in any of the safety levels.
--   Since JavaScript is single threaded, no Haskell threads can run while
--   the foreign code is running.
module GHCJS.Foreign.Internal
data JSType
Undefined :: JSType
Object :: JSType
Boolean :: JSType
Number :: JSType
String :: JSType
Symbol :: JSType
Function :: JSType

-- | implementation dependent
Other :: JSType
jsTypeOf :: JSVal -> JSType
data JSONType
JSONNull :: JSONType
JSONInteger :: JSONType
JSONFloat :: JSONType
JSONBool :: JSONType
JSONString :: JSONType
JSONArray :: JSONType
JSONObject :: JSONType
jsonTypeOf :: JSVal -> JSONType
isTruthy :: JSVal -> Bool
fromJSBool :: JSVal -> Bool
toJSBool :: Bool -> JSVal
jsTrue :: JSVal
jsFalse :: JSVal
jsNull :: JSVal
jsUndefined :: JSVal
isNull :: JSVal -> Bool
isUndefined :: JSVal -> Bool
isNumber :: JSVal -> Bool
isObject :: JSVal -> Bool
isBoolean :: JSVal -> Bool
isString :: JSVal -> Bool
isSymbol :: JSVal -> Bool
isFunction :: JSVal -> Bool
instance GHC.Enum.Enum GHCJS.Foreign.Internal.JSONType
instance GHC.Classes.Ord GHCJS.Foreign.Internal.JSONType
instance GHC.Classes.Eq GHCJS.Foreign.Internal.JSONType
instance GHC.Show.Show GHCJS.Foreign.Internal.JSONType
instance GHC.Enum.Enum GHCJS.Foreign.Internal.JSType
instance GHC.Classes.Ord GHCJS.Foreign.Internal.JSType
instance GHC.Classes.Eq GHCJS.Foreign.Internal.JSType
instance GHC.Show.Show GHCJS.Foreign.Internal.JSType


-- | Dynamically export Haskell values to JavaScript
module GHCJS.Foreign.Export
data Export a

-- | Export any Haskell value to a JavaScript reference without evaluating
--   it. The JavaScript reference can be passed to foreign code and used to
--   retrieve the value later.
--   
--   The data referenced by the value will be kept in memory until you call
--   <a>releaseExport</a>, even if no foreign code references the export
--   anymore.
export :: Typeable a => a -> IO (Export a)

-- | Export the value and run the action. The value is only exported for
--   the duration of the action. Dereferencing it after the
--   <a>withExport</a> call has returned will always return <a>Nothing</a>.
withExport :: Typeable a => a -> (Export a -> IO b) -> IO b

-- | Retrieve the Haskell value from an export. Returns <a>Nothing</a> if
--   the type does not match or the export has already been released.
derefExport :: forall a. Typeable a => Export a -> IO (Maybe a)

-- | Release all memory associated with the export. Subsequent calls to
--   <a>derefExport</a> will return <a>Nothing</a>
releaseExport :: Export a -> IO ()
instance GHCJS.Internal.Types.IsJSVal (GHCJS.Foreign.Export.Export a)

module GHCJS.Foreign.Callback.Internal
newtype Callback a
Callback :: JSVal -> Callback a
instance GHCJS.Internal.Types.IsJSVal (GHCJS.Foreign.Callback.Internal.Callback a)

module GHCJS.Foreign.Callback
data Callback a

-- | The runtime tries to run synchronous threads to completion. Sometimes
--   it's not possible to continue running a thread, for example when the
--   thread tries to take an empty <tt>MVar</tt>. The runtime can then
--   either throw a <a>WouldBlockException</a>, aborting the blocking
--   action, or continue the thread asynchronously.
data OnBlocked

-- | continue the thread asynchronously if blocked
ContinueAsync :: OnBlocked

-- | throw <a>WouldBlockException</a> if blocked
ThrowWouldBlock :: OnBlocked

-- | When you create a callback, the Haskell runtime stores a reference to
--   the exported IO action or function. This means that all data
--   referenced by the exported value stays in memory, even if nothing
--   outside the Haskell runtime holds a reference to to callback.
--   
--   Use <a>releaseCallback</a> to free the reference. Subsequent calls
--   from JavaScript to the callback will result in an exception.
releaseCallback :: Callback a -> IO ()

-- | Make a callback (JavaScript function) that runs the supplied IO action
--   in an asynchronous thread when called.
--   
--   Call <a>releaseCallback</a> when done with the callback, freeing data
--   referenced by the IO action.
asyncCallback :: IO () -> IO (Callback (IO ()))
asyncCallback1 :: (JSVal -> IO ()) -> IO (Callback (JSVal -> IO ()))
asyncCallback2 :: (JSVal -> JSVal -> IO ()) -> IO (Callback (JSVal -> JSVal -> IO ()))
asyncCallback3 :: (JSVal -> JSVal -> JSVal -> IO ()) -> IO (Callback (JSVal -> JSVal -> JSVal -> IO ()))

-- | Make a callback (JavaScript function) that runs the supplied IO action
--   in a synchronous thread when called.
--   
--   Call <a>releaseCallback</a> when done with the callback, freeing
--   memory referenced by the IO action.
syncCallback :: OnBlocked -> IO () -> IO (Callback (IO ()))

-- | Make a callback (JavaScript function) that runs the supplied IO
--   function in a synchronous thread when called. The callback takes one
--   argument that it passes as a JSVal value to the Haskell function.
--   
--   Call <a>releaseCallback</a> when done with the callback, freeing data
--   referenced by the function.
syncCallback1 :: OnBlocked -> (JSVal -> IO ()) -> IO (Callback (JSVal -> IO ()))

-- | Make a callback (JavaScript function) that runs the supplied IO
--   function in a synchronous thread when called. The callback takes two
--   arguments that it passes as JSVal values to the Haskell function.
--   
--   Call <a>releaseCallback</a> when done with the callback, freeing data
--   referenced by the function.
syncCallback2 :: OnBlocked -> (JSVal -> JSVal -> IO ()) -> IO (Callback (JSVal -> JSVal -> IO ()))

-- | Make a callback (JavaScript function) that runs the supplied IO
--   function in a synchronous thread when called. The callback takes three
--   arguments that it passes as JSVal values to the Haskell function.
--   
--   Call <a>releaseCallback</a> when done with the callback, freeing data
--   referenced by the function.
syncCallback3 :: OnBlocked -> (JSVal -> JSVal -> JSVal -> IO ()) -> IO (Callback (JSVal -> JSVal -> JSVal -> IO ()))

-- | Make a callback (JavaScript function) that runs the supplied IO action
--   in a synchronous thread when called.
--   
--   Call <a>releaseCallback</a> when done with the callback, freeing
--   memory referenced by the IO action.
syncCallback' :: IO JSVal -> IO (Callback (IO JSVal))
syncCallback1' :: (JSVal -> IO JSVal) -> IO (Callback (JSVal -> IO JSVal))
syncCallback2' :: (JSVal -> JSVal -> IO JSVal) -> IO (Callback (JSVal -> JSVal -> IO JSVal))
syncCallback3' :: (JSVal -> JSVal -> JSVal -> IO JSVal) -> IO (Callback (JSVal -> JSVal -> JSVal -> IO JSVal))


-- | Basic interop between Haskell and JavaScript.
--   
--   The principal type here is <a>JSVal</a>, which is a lifted type that
--   contains a JavaScript reference. The <a>JSVal</a> type is
--   parameterized with one phantom type, and GHCJS.Types defines several
--   type synonyms for specific variants.
--   
--   The code in this module makes no assumptions about 'JSVal a' types.
--   Operations that can result in a JS exception that can kill a Haskell
--   thread are marked unsafe (for example if the <a>JSVal</a> contains a
--   null or undefined value). There are safe variants where the JS
--   exception is propagated as a Haskell exception, so that it can be
--   handled on the Haskell side.
--   
--   For more specific types, like <tt>JSArray</tt> or <tt>JSBool</tt>, the
--   code assumes that the contents of the <a>JSVal</a> actually is a
--   JavaScript array or bool value. If it contains an unexpected value,
--   the code can result in exceptions that kill the Haskell thread, even
--   for functions not marked unsafe.
--   
--   The code makes use of `foreign import javascript', enabled with the
--   <tt>JavaScriptFFI</tt> extension, available since GHC 7.8. There are
--   three different safety levels:
--   
--   <ul>
--   <li>unsafe: The imported code is run directly. returning an
--   incorrectly typed value leads to undefined behaviour. JavaScript
--   exceptions in the foreign code kill the Haskell thread.</li>
--   <li>safe: Returned values are replaced with a default value if they
--   have the wrong type. JavaScript exceptions are caught and propagated
--   as Haskell exceptions (<a>JSException</a>), so they can be handled
--   with the standard <a>Control.Exception</a> machinery.</li>
--   <li>interruptible: The import is asynchronous. The calling Haskell
--   thread sleeps until the foreign code calls the `$c` JavaScript
--   function with the result. The thread is in interruptible state while
--   blocked, so it can receive asynchronous exceptions.</li>
--   </ul>
--   
--   Unlike the FFI for native code, it's safe to call back into Haskell
--   (`h$run`, `h$runSync`) from foreign code in any of the safety levels.
--   Since JavaScript is single threaded, no Haskell threads can run while
--   the foreign code is running.
module GHCJS.Foreign
jsTrue :: JSVal
jsFalse :: JSVal
jsNull :: JSVal
toJSBool :: Bool -> JSVal
fromJSBool :: JSVal -> Bool
jsUndefined :: JSVal
isTruthy :: JSVal -> Bool
isNull :: JSVal -> Bool
isUndefined :: JSVal -> Bool
isObject :: JSVal -> Bool
isFunction :: JSVal -> Bool
isString :: JSVal -> Bool
isBoolean :: JSVal -> Bool
isSymbol :: JSVal -> Bool
isNumber :: JSVal -> Bool
jsTypeOf :: JSVal -> JSType
data JSType
Undefined :: JSType
Object :: JSType
Boolean :: JSType
Number :: JSType
String :: JSType
Symbol :: JSType
Function :: JSType

-- | implementation dependent
Other :: JSType
jsonTypeOf :: JSVal -> JSONType
data JSONType
JSONNull :: JSONType
JSONInteger :: JSONType
JSONFloat :: JSONType
JSONBool :: JSONType
JSONString :: JSONType
JSONArray :: JSONType
JSONObject :: JSONType

module JavaScript.Array.Internal
newtype SomeJSArray (m :: MutabilityType s)
SomeJSArray :: JSVal -> SomeJSArray
type JSArray = SomeJSArray Immutable
type MutableJSArray = SomeJSArray Mutable
type STJSArray s = SomeJSArray ( 'STMutable s)
create :: IO MutableJSArray
length :: JSArray -> Int
lengthIO :: SomeJSArray m -> IO Int
null :: JSArray -> Bool
append :: SomeJSArray m -> SomeJSArray m -> IO (SomeJSArray m1)
fromList :: [JSVal] -> JSArray
fromListIO :: [JSVal] -> IO (SomeJSArray m)
toList :: JSArray -> [JSVal]
toListIO :: SomeJSArray m -> IO [JSVal]
index :: Int -> JSArray -> JSVal
read :: Int -> SomeJSArray m -> IO JSVal
write :: Int -> JSVal -> MutableJSArray -> IO ()
push :: JSVal -> MutableJSArray -> IO ()
pop :: MutableJSArray -> IO JSVal
unshift :: JSVal -> MutableJSArray -> IO ()
shift :: MutableJSArray -> IO JSVal
reverse :: MutableJSArray -> IO ()
take :: Int -> JSArray -> JSArray
takeIO :: Int -> SomeJSArray m -> IO (SomeJSArray m1)
drop :: Int -> JSArray -> JSArray
dropIO :: Int -> SomeJSArray m -> IO (SomeJSArray m1)
sliceIO :: Int -> Int -> JSArray -> IO (SomeJSArray m1)
slice :: Int -> Int -> JSArray -> JSArray
freeze :: MutableJSArray -> IO JSArray
unsafeFreeze :: MutableJSArray -> IO JSArray
thaw :: JSArray -> IO MutableJSArray
unsafeThaw :: JSArray -> IO MutableJSArray
instance forall s (m :: GHCJS.Internal.Types.MutabilityType s). GHCJS.Internal.Types.IsJSVal (JavaScript.Array.Internal.SomeJSArray m)

module JavaScript.Array
type JSArray = SomeJSArray Immutable
type MutableJSArray = SomeJSArray Mutable
create :: IO MutableJSArray
length :: JSArray -> Int
lengthIO :: SomeJSArray m -> IO Int
null :: JSArray -> Bool
fromList :: [JSVal] -> JSArray
fromListIO :: [JSVal] -> IO (SomeJSArray m)
toList :: JSArray -> [JSVal]
toListIO :: SomeJSArray m -> IO [JSVal]
index :: Int -> JSArray -> JSVal
(!) :: JSArray -> Int -> JSVal
read :: Int -> SomeJSArray m -> IO JSVal
write :: Int -> JSVal -> MutableJSArray -> IO ()
append :: SomeJSArray m -> SomeJSArray m -> IO (SomeJSArray m1)
push :: JSVal -> MutableJSArray -> IO ()
pop :: MutableJSArray -> IO JSVal
unshift :: JSVal -> MutableJSArray -> IO ()
shift :: MutableJSArray -> IO JSVal
reverse :: MutableJSArray -> IO ()
take :: Int -> JSArray -> JSArray
takeIO :: Int -> SomeJSArray m -> IO (SomeJSArray m1)
drop :: Int -> JSArray -> JSArray
dropIO :: Int -> SomeJSArray m -> IO (SomeJSArray m1)
slice :: Int -> Int -> JSArray -> JSArray
sliceIO :: Int -> Int -> JSArray -> IO (SomeJSArray m1)
freeze :: MutableJSArray -> IO JSArray
unsafeFreeze :: MutableJSArray -> IO JSArray
thaw :: JSArray -> IO MutableJSArray
unsafeThaw :: JSArray -> IO MutableJSArray

module JavaScript.Cast
class Cast a
unsafeWrap :: Cast a => JSVal -> a
instanceRef :: Cast a => a -> JSVal
cast :: forall a. Cast a => JSVal -> Maybe a

-- | Don't ever run this in GHC - guaranteed segfault
unsafeCast :: Cast a => JSVal -> a

module JavaScript.Object.Internal
newtype Object
Object :: JSVal -> Object

-- | create an empty object
create :: IO Object
allProps :: Object -> IO JSArray
listProps :: Object -> IO [JSString]

-- | get a property from an object. If accessing the property results in an
--   exception, the exception is converted to a JSException. Since
--   exception handling code prevents some optimizations in some JS
--   engines, you may want to use unsafeGetProp instead
getProp :: JSString -> Object -> IO JSVal
unsafeGetProp :: JSString -> Object -> IO JSVal
setProp :: JSString -> JSVal -> Object -> IO ()
unsafeSetProp :: JSString -> JSVal -> Object -> IO ()
isInstanceOf :: Object -> JSVal -> Bool
instance GHCJS.Internal.Types.IsJSVal JavaScript.Object.Internal.Object

module JavaScript.Object
data Object

-- | create an empty object
create :: IO Object

-- | get a property from an object. If accessing the property results in an
--   exception, the exception is converted to a JSException. Since
--   exception handling code prevents some optimizations in some JS
--   engines, you may want to use unsafeGetProp instead
getProp :: JSString -> Object -> IO JSVal
unsafeGetProp :: JSString -> Object -> IO JSVal
setProp :: JSString -> JSVal -> Object -> IO ()
unsafeSetProp :: JSString -> JSVal -> Object -> IO ()
allProps :: Object -> IO JSArray
listProps :: Object -> IO [JSString]
isInstanceOf :: Object -> JSVal -> Bool

module GHCJS.Marshal.Internal
class FromJSVal a
fromJSVal :: FromJSVal a => JSVal -> IO (Maybe a)
fromJSValUnchecked :: FromJSVal a => JSVal -> IO a
fromJSValListOf :: FromJSVal a => JSVal -> IO (Maybe [a])
fromJSValUncheckedListOf :: FromJSVal a => JSVal -> IO [a]
fromJSVal :: (FromJSVal a, Generic a, GFromJSVal (Rep a ())) => JSVal -> IO (Maybe a)
class ToJSVal a
toJSVal :: ToJSVal a => a -> IO JSVal
toJSValListOf :: ToJSVal a => [a] -> IO JSVal
toJSVal :: (ToJSVal a, Generic a, GToJSVal (Rep a ())) => a -> IO JSVal
class PToJSVal a
pToJSVal :: PToJSVal a => a -> JSVal
class PFromJSVal a
pFromJSVal :: PFromJSVal a => JSVal -> a
data Purity

-- | conversion is pure even if the original value is shared
PureShared :: Purity

-- | conversion is pure if the we only convert once
PureExclusive :: Purity
toJSVal_generic :: forall a. (Generic a, GToJSVal (Rep a ())) => (String -> String) -> a -> IO JSVal
fromJSVal_generic :: forall a. (Generic a, GFromJSVal (Rep a ())) => (String -> String) -> JSVal -> IO (Maybe a)
toJSVal_pure :: PToJSVal a => a -> IO JSVal
fromJSVal_pure :: PFromJSVal a => JSVal -> IO (Maybe a)
fromJSValUnchecked_pure :: PFromJSVal a => JSVal -> IO a
instance Data.Data.Data GHCJS.Marshal.Internal.Purity
instance GHC.Classes.Ord GHCJS.Marshal.Internal.Purity
instance GHC.Classes.Eq GHCJS.Marshal.Internal.Purity
instance (GHCJS.Marshal.Internal.GFromJSArr (a p), GHCJS.Marshal.Internal.GFromJSArr (b p), GHCJS.Marshal.Internal.GFromJSProp (a p), GHCJS.Marshal.Internal.GFromJSProp (b p)) => GHCJS.Marshal.Internal.GFromJSVal ((GHC.Generics.:*:) a b p)
instance (GHCJS.Marshal.Internal.GFromJSArr (a p), GHCJS.Marshal.Internal.GFromJSArr (b p)) => GHCJS.Marshal.Internal.GFromJSArr ((GHC.Generics.:*:) a b p)
instance GHCJS.Marshal.Internal.GFromJSVal (a p) => GHCJS.Marshal.Internal.GFromJSArr (GHC.Generics.M1 GHC.Generics.S c a p)
instance (GHCJS.Marshal.Internal.GFromJSProp (a p), GHCJS.Marshal.Internal.GFromJSProp (b p)) => GHCJS.Marshal.Internal.GFromJSProp ((GHC.Generics.:*:) a b p)
instance (GHC.Generics.Selector c, GHCJS.Marshal.Internal.GFromJSVal (a p)) => GHCJS.Marshal.Internal.GFromJSProp (GHC.Generics.M1 GHC.Generics.S c a p)
instance GHCJS.Marshal.Internal.FromJSVal b => GHCJS.Marshal.Internal.GFromJSVal (GHC.Generics.K1 a b c)
instance GHCJS.Marshal.Internal.GFromJSVal p => GHCJS.Marshal.Internal.GFromJSVal (GHC.Generics.Par1 p)
instance GHCJS.Marshal.Internal.GFromJSVal (f p) => GHCJS.Marshal.Internal.GFromJSVal (GHC.Generics.Rec1 f p)
instance (GHCJS.Marshal.Internal.GFromJSVal (a p), GHCJS.Marshal.Internal.GFromJSVal (b p)) => GHCJS.Marshal.Internal.GFromJSVal ((GHC.Generics.:+:) a b p)
instance (GHC.Generics.Datatype c, GHCJS.Marshal.Internal.GFromJSVal (a p)) => GHCJS.Marshal.Internal.GFromJSVal (GHC.Generics.M1 GHC.Generics.D c a p)
instance (GHC.Generics.Constructor c, GHCJS.Marshal.Internal.GFromJSVal (a p)) => GHCJS.Marshal.Internal.GFromJSVal (GHC.Generics.M1 GHC.Generics.C c a p)
instance GHCJS.Marshal.Internal.GFromJSVal (a p) => GHCJS.Marshal.Internal.GFromJSVal (GHC.Generics.M1 GHC.Generics.S c a p)
instance GHCJS.Marshal.Internal.GFromJSVal (GHC.Generics.V1 p)
instance GHCJS.Marshal.Internal.GFromJSVal (GHC.Generics.U1 p)
instance (GHCJS.Marshal.Internal.GToJSArr (a p), GHCJS.Marshal.Internal.GToJSArr (b p), GHCJS.Marshal.Internal.GToJSProp (a p), GHCJS.Marshal.Internal.GToJSProp (b p)) => GHCJS.Marshal.Internal.GToJSVal ((GHC.Generics.:*:) a b p)
instance (GHCJS.Marshal.Internal.GToJSArr (a p), GHCJS.Marshal.Internal.GToJSArr (b p)) => GHCJS.Marshal.Internal.GToJSArr ((GHC.Generics.:*:) a b p)
instance GHCJS.Marshal.Internal.GToJSVal (a p) => GHCJS.Marshal.Internal.GToJSArr (GHC.Generics.M1 GHC.Generics.S c a p)
instance (GHCJS.Marshal.Internal.GToJSProp (a p), GHCJS.Marshal.Internal.GToJSProp (b p)) => GHCJS.Marshal.Internal.GToJSProp ((GHC.Generics.:*:) a b p)
instance (GHC.Generics.Selector c, GHCJS.Marshal.Internal.GToJSVal (a p)) => GHCJS.Marshal.Internal.GToJSProp (GHC.Generics.M1 GHC.Generics.S c a p)
instance GHCJS.Marshal.Internal.ToJSVal b => GHCJS.Marshal.Internal.GToJSVal (GHC.Generics.K1 a b c)
instance GHCJS.Marshal.Internal.GToJSVal p => GHCJS.Marshal.Internal.GToJSVal (GHC.Generics.Par1 p)
instance GHCJS.Marshal.Internal.GToJSVal (f p) => GHCJS.Marshal.Internal.GToJSVal (GHC.Generics.Rec1 f p)
instance (GHCJS.Marshal.Internal.GToJSVal (a p), GHCJS.Marshal.Internal.GToJSVal (b p)) => GHCJS.Marshal.Internal.GToJSVal ((GHC.Generics.:+:) a b p)
instance (GHC.Generics.Datatype c, GHCJS.Marshal.Internal.GToJSVal (a p)) => GHCJS.Marshal.Internal.GToJSVal (GHC.Generics.M1 GHC.Generics.D c a p)
instance (GHC.Generics.Constructor c, GHCJS.Marshal.Internal.GToJSVal (a p)) => GHCJS.Marshal.Internal.GToJSVal (GHC.Generics.M1 GHC.Generics.C c a p)
instance GHCJS.Marshal.Internal.GToJSVal (a p) => GHCJS.Marshal.Internal.GToJSVal (GHC.Generics.M1 GHC.Generics.S c a p)
instance GHCJS.Marshal.Internal.GToJSVal (GHC.Generics.V1 p)
instance GHCJS.Marshal.Internal.GToJSVal (GHC.Generics.U1 p)

module GHCJS.Marshal.Pure
class PFromJSVal a
pFromJSVal :: PFromJSVal a => JSVal -> a
class PToJSVal a
pToJSVal :: PToJSVal a => a -> JSVal
instance GHCJS.Marshal.Internal.PFromJSVal GHCJS.Prim.JSVal
instance GHCJS.Marshal.Internal.PFromJSVal ()
instance GHCJS.Marshal.Internal.PFromJSVal Data.JSString.Internal.Type.JSString
instance GHCJS.Marshal.Internal.PFromJSVal [GHC.Types.Char]
instance GHCJS.Marshal.Internal.PFromJSVal Data.Text.Internal.Text
instance GHCJS.Marshal.Internal.PFromJSVal GHC.Types.Char
instance GHCJS.Marshal.Internal.PFromJSVal GHC.Types.Bool
instance GHCJS.Marshal.Internal.PFromJSVal GHC.Types.Int
instance GHCJS.Marshal.Internal.PFromJSVal GHC.Int.Int8
instance GHCJS.Marshal.Internal.PFromJSVal GHC.Int.Int16
instance GHCJS.Marshal.Internal.PFromJSVal GHC.Int.Int32
instance GHCJS.Marshal.Internal.PFromJSVal GHC.Types.Word
instance GHCJS.Marshal.Internal.PFromJSVal GHC.Word.Word8
instance GHCJS.Marshal.Internal.PFromJSVal GHC.Word.Word16
instance GHCJS.Marshal.Internal.PFromJSVal GHC.Word.Word32
instance GHCJS.Marshal.Internal.PFromJSVal GHC.Types.Float
instance GHCJS.Marshal.Internal.PFromJSVal GHC.Types.Double
instance GHCJS.Marshal.Internal.PFromJSVal a => GHCJS.Marshal.Internal.PFromJSVal (GHC.Base.Maybe a)
instance GHCJS.Marshal.Internal.PToJSVal GHCJS.Prim.JSVal
instance GHCJS.Marshal.Internal.PToJSVal Data.JSString.Internal.Type.JSString
instance GHCJS.Marshal.Internal.PToJSVal [GHC.Types.Char]
instance GHCJS.Marshal.Internal.PToJSVal Data.Text.Internal.Text
instance GHCJS.Marshal.Internal.PToJSVal GHC.Types.Char
instance GHCJS.Marshal.Internal.PToJSVal GHC.Types.Bool
instance GHCJS.Marshal.Internal.PToJSVal GHC.Types.Int
instance GHCJS.Marshal.Internal.PToJSVal GHC.Int.Int8
instance GHCJS.Marshal.Internal.PToJSVal GHC.Int.Int16
instance GHCJS.Marshal.Internal.PToJSVal GHC.Int.Int32
instance GHCJS.Marshal.Internal.PToJSVal GHC.Types.Word
instance GHCJS.Marshal.Internal.PToJSVal GHC.Word.Word8
instance GHCJS.Marshal.Internal.PToJSVal GHC.Word.Word16
instance GHCJS.Marshal.Internal.PToJSVal GHC.Word.Word32
instance GHCJS.Marshal.Internal.PToJSVal GHC.Types.Float
instance GHCJS.Marshal.Internal.PToJSVal GHC.Types.Double
instance GHCJS.Marshal.Internal.PToJSVal a => GHCJS.Marshal.Internal.PToJSVal (GHC.Base.Maybe a)

module GHCJS.Nullable
newtype Nullable a
Nullable :: JSVal -> Nullable a
nullableToMaybe :: PFromJSVal a => Nullable a -> Maybe a
maybeToNullable :: PToJSVal a => Maybe a -> Nullable a

module GHCJS.Marshal
class FromJSVal a
fromJSVal :: FromJSVal a => JSVal -> IO (Maybe a)
fromJSValUnchecked :: FromJSVal a => JSVal -> IO a
fromJSValListOf :: FromJSVal a => JSVal -> IO (Maybe [a])
fromJSValUncheckedListOf :: FromJSVal a => JSVal -> IO [a]
fromJSVal :: (FromJSVal a, Generic a, GFromJSVal (Rep a ())) => JSVal -> IO (Maybe a)
class ToJSVal a
toJSVal :: ToJSVal a => a -> IO JSVal
toJSValListOf :: ToJSVal a => [a] -> IO JSVal
toJSVal :: (ToJSVal a, Generic a, GToJSVal (Rep a ())) => a -> IO JSVal
toJSVal_aeson :: ToJSON a => a -> IO JSVal
toJSVal_pure :: PToJSVal a => a -> IO JSVal
instance GHCJS.Marshal.Internal.FromJSVal GHCJS.Prim.JSVal
instance GHCJS.Marshal.Internal.FromJSVal ()
instance GHCJS.Marshal.Internal.FromJSVal a => GHCJS.Marshal.Internal.FromJSVal [a]
instance GHCJS.Marshal.Internal.FromJSVal a => GHCJS.Marshal.Internal.FromJSVal (GHC.Base.Maybe a)
instance GHCJS.Marshal.Internal.FromJSVal Data.JSString.Internal.Type.JSString
instance GHCJS.Marshal.Internal.FromJSVal Data.Text.Internal.Text
instance GHCJS.Marshal.Internal.FromJSVal GHC.Types.Char
instance GHCJS.Marshal.Internal.FromJSVal GHC.Types.Bool
instance GHCJS.Marshal.Internal.FromJSVal GHC.Types.Int
instance GHCJS.Marshal.Internal.FromJSVal GHC.Int.Int8
instance GHCJS.Marshal.Internal.FromJSVal GHC.Int.Int16
instance GHCJS.Marshal.Internal.FromJSVal GHC.Int.Int32
instance GHCJS.Marshal.Internal.FromJSVal GHC.Types.Word
instance GHCJS.Marshal.Internal.FromJSVal GHC.Word.Word8
instance GHCJS.Marshal.Internal.FromJSVal GHC.Word.Word16
instance GHCJS.Marshal.Internal.FromJSVal GHC.Word.Word32
instance GHCJS.Marshal.Internal.FromJSVal GHC.Types.Float
instance GHCJS.Marshal.Internal.FromJSVal GHC.Types.Double
instance GHCJS.Marshal.Internal.FromJSVal Data.Aeson.Types.Internal.Value
instance (GHCJS.Marshal.Internal.FromJSVal a, GHCJS.Marshal.Internal.FromJSVal b) => GHCJS.Marshal.Internal.FromJSVal (a, b)
instance (GHCJS.Marshal.Internal.FromJSVal a, GHCJS.Marshal.Internal.FromJSVal b, GHCJS.Marshal.Internal.FromJSVal c) => GHCJS.Marshal.Internal.FromJSVal (a, b, c)
instance (GHCJS.Marshal.Internal.FromJSVal a, GHCJS.Marshal.Internal.FromJSVal b, GHCJS.Marshal.Internal.FromJSVal c, GHCJS.Marshal.Internal.FromJSVal d) => GHCJS.Marshal.Internal.FromJSVal (a, b, c, d)
instance (GHCJS.Marshal.Internal.FromJSVal a, GHCJS.Marshal.Internal.FromJSVal b, GHCJS.Marshal.Internal.FromJSVal c, GHCJS.Marshal.Internal.FromJSVal d, GHCJS.Marshal.Internal.FromJSVal e) => GHCJS.Marshal.Internal.FromJSVal (a, b, c, d, e)
instance (GHCJS.Marshal.Internal.FromJSVal a, GHCJS.Marshal.Internal.FromJSVal b, GHCJS.Marshal.Internal.FromJSVal c, GHCJS.Marshal.Internal.FromJSVal d, GHCJS.Marshal.Internal.FromJSVal e, GHCJS.Marshal.Internal.FromJSVal f) => GHCJS.Marshal.Internal.FromJSVal (a, b, c, d, e, f)
instance (GHCJS.Marshal.Internal.FromJSVal a, GHCJS.Marshal.Internal.FromJSVal b, GHCJS.Marshal.Internal.FromJSVal c, GHCJS.Marshal.Internal.FromJSVal d, GHCJS.Marshal.Internal.FromJSVal e, GHCJS.Marshal.Internal.FromJSVal f, GHCJS.Marshal.Internal.FromJSVal g) => GHCJS.Marshal.Internal.FromJSVal (a, b, c, d, e, f, g)
instance (GHCJS.Marshal.Internal.FromJSVal a, GHCJS.Marshal.Internal.FromJSVal b, GHCJS.Marshal.Internal.FromJSVal c, GHCJS.Marshal.Internal.FromJSVal d, GHCJS.Marshal.Internal.FromJSVal e, GHCJS.Marshal.Internal.FromJSVal f, GHCJS.Marshal.Internal.FromJSVal g, GHCJS.Marshal.Internal.FromJSVal h) => GHCJS.Marshal.Internal.FromJSVal (a, b, c, d, e, f, g, h)
instance GHCJS.Marshal.Internal.ToJSVal GHCJS.Prim.JSVal
instance GHCJS.Marshal.Internal.ToJSVal Data.Aeson.Types.Internal.Value
instance GHCJS.Marshal.Internal.ToJSVal Data.JSString.Internal.Type.JSString
instance GHCJS.Marshal.Internal.ToJSVal Data.Text.Internal.Text
instance GHCJS.Marshal.Internal.ToJSVal GHC.Types.Char
instance GHCJS.Marshal.Internal.ToJSVal GHC.Types.Bool
instance GHCJS.Marshal.Internal.ToJSVal GHC.Types.Int
instance GHCJS.Marshal.Internal.ToJSVal GHC.Int.Int8
instance GHCJS.Marshal.Internal.ToJSVal GHC.Int.Int16
instance GHCJS.Marshal.Internal.ToJSVal GHC.Int.Int32
instance GHCJS.Marshal.Internal.ToJSVal GHC.Types.Word
instance GHCJS.Marshal.Internal.ToJSVal GHC.Word.Word8
instance GHCJS.Marshal.Internal.ToJSVal GHC.Word.Word16
instance GHCJS.Marshal.Internal.ToJSVal GHC.Word.Word32
instance GHCJS.Marshal.Internal.ToJSVal GHC.Types.Float
instance GHCJS.Marshal.Internal.ToJSVal GHC.Types.Double
instance GHCJS.Marshal.Internal.ToJSVal a => GHCJS.Marshal.Internal.ToJSVal [a]
instance GHCJS.Marshal.Internal.ToJSVal a => GHCJS.Marshal.Internal.ToJSVal (GHC.Base.Maybe a)
instance (GHCJS.Marshal.Internal.ToJSVal a, GHCJS.Marshal.Internal.ToJSVal b) => GHCJS.Marshal.Internal.ToJSVal (a, b)
instance (GHCJS.Marshal.Internal.ToJSVal a, GHCJS.Marshal.Internal.ToJSVal b, GHCJS.Marshal.Internal.ToJSVal c) => GHCJS.Marshal.Internal.ToJSVal (a, b, c)
instance (GHCJS.Marshal.Internal.ToJSVal a, GHCJS.Marshal.Internal.ToJSVal b, GHCJS.Marshal.Internal.ToJSVal c, GHCJS.Marshal.Internal.ToJSVal d) => GHCJS.Marshal.Internal.ToJSVal (a, b, c, d)
instance (GHCJS.Marshal.Internal.ToJSVal a, GHCJS.Marshal.Internal.ToJSVal b, GHCJS.Marshal.Internal.ToJSVal c, GHCJS.Marshal.Internal.ToJSVal d, GHCJS.Marshal.Internal.ToJSVal e) => GHCJS.Marshal.Internal.ToJSVal (a, b, c, d, e)
instance (GHCJS.Marshal.Internal.ToJSVal a, GHCJS.Marshal.Internal.ToJSVal b, GHCJS.Marshal.Internal.ToJSVal c, GHCJS.Marshal.Internal.ToJSVal d, GHCJS.Marshal.Internal.ToJSVal e, GHCJS.Marshal.Internal.ToJSVal f) => GHCJS.Marshal.Internal.ToJSVal (a, b, c, d, e, f)
instance (GHCJS.Marshal.Internal.ToJSVal a, GHCJS.Marshal.Internal.ToJSVal b, GHCJS.Marshal.Internal.ToJSVal c, GHCJS.Marshal.Internal.ToJSVal d, GHCJS.Marshal.Internal.ToJSVal e, GHCJS.Marshal.Internal.ToJSVal f, GHCJS.Marshal.Internal.ToJSVal g) => GHCJS.Marshal.Internal.ToJSVal (a, b, c, d, e, f, g)

module JavaScript.Web.Location
data Location
getWindowLocation :: IO Location
getHref :: Location -> IO JSString
setHref :: JSString -> Location -> IO ()
getProtocol :: Location -> IO JSString
setProtocol :: JSString -> Location -> IO ()
getHost :: Location -> IO JSString
setHost :: JSString -> Location -> IO ()
getHostname :: Location -> IO JSString
setHostname :: JSString -> Location -> IO ()
getPort :: Location -> IO JSString
setPort :: JSString -> Location -> IO ()
getPathname :: Location -> IO JSString
setPathname :: JSString -> Location -> IO ()
getSearch :: Location -> IO JSString
setSearch :: JSString -> Location -> IO ()
getHash :: Location -> IO JSString
setHash :: JSString -> Location -> IO ()
getUsername :: Location -> IO JSString
setUsername :: JSString -> Location -> IO ()
getPassword :: Location -> IO JSString
setPassword :: JSString -> Location -> IO ()
getOrigin :: Location -> IO JSString
assign :: JSString -> Location -> IO ()
reload :: Bool -> Location -> IO ()
replace :: JSString -> Location -> IO ()

module JavaScript.Web.Storage
localStorage :: Storage
sessionStorage :: Storage
data Storage
getLength :: Storage -> IO Int
getIndex :: Int -> Storage -> IO (Maybe JSString)
getItem :: JSString -> Storage -> IO (Maybe JSString)
setItem :: JSString -> JSString -> Storage -> IO ()
removeItem :: JSString -> Storage -> IO ()
clear :: Storage -> IO ()
