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

-- | Terminal emulator configurable in Haskell
--   
--   Termonad is a terminal emulator configurable in Haskell. It is
--   extremely customizable and provides hooks to modify the default
--   behavior. It can be thought of as the "XMonad" of terminal emulators.
--   Termonad was featured on an episode of DistroTube. This
--   video gives a short overview of Termonad.
--   
--   Please see README.md for more information.
@package termonad
@version 4.5.0.0

module Termonad.Pcre
pcre2Multiline :: CUInt
inline_c_ffi_6989586621679086563 :: IO CUInt

module Termonad.Prelude
newtype () => UnliftIO (m :: Type -> Type)
UnliftIO :: (forall a. () => m a -> IO a) -> UnliftIO (m :: Type -> Type)
[unliftIO] :: UnliftIO (m :: Type -> Type) -> forall a. () => m a -> IO a

-- | Exceptions that occur in the IO monad. An
--   IOException records a more specific error type, a descriptive
--   string and maybe the handle that was used when the error was flagged.
data () => IOException
data () => AsyncCancelled
AsyncCancelled :: AsyncCancelled

-- | An MVar (pronounced "em-var") is a synchronising variable, used
--   for communication between concurrent threads. It can be thought of as
--   a box, which may be empty or full.
data () => MVar a
data () => Async a

-- | The class Typeable allows a concrete representation of a type
--   to be calculated.
class () => Typeable (a :: k)

-- | Representable types of kind *. This class is derivable in GHC
--   with the DeriveGeneric flag on.
--   
--   A Generic instance must satisfy the following laws:
--   
--   
--   from . to ≡ id
--   to . from ≡ id
--   
class () => Generic a

-- | A type f is a Functor if it provides a function fmap
--   which, given any types a and b lets you apply any
--   function from (a -> b) to turn an f a into an
--   f b, preserving the structure of f. Furthermore
--   f needs to adhere to the following:
--   
--   
--   
- Identity fmap id == id
--   
- Composition fmap (f . g) == fmap f .
--   fmap g
--   
--   
--   Note, that the second law follows from the free theorem of the type
--   fmap and the first law, so you need only check that the former
--   condition holds. See
--   https://www.schoolofhaskell.com/user/edwardk/snippets/fmap or
--   https://github.com/quchen/articles/blob/master/second_functor_law.md
--   for an explanation.
class () => Functor (f :: Type -> Type)

-- | fmap is used to apply a function of type (a -> b)
--   to a value of type f a, where f is a functor, to produce a
--   value of type f b. Note that for any type constructor with
--   more than one parameter (e.g., Either), only the last type
--   parameter can be modified with fmap (e.g., b in
--   `Either a b`).
--   
--   Some type constructors with two parameters or more have a
--   Bifunctor instance that allows both the last and the
--   penultimate parameters to be mapped over.
--   
--   
Examples
--   
--   Convert from a Maybe Int to a Maybe String
--   using show:
--   
--   
--   >>> fmap show Nothing
--   Nothing
--   
--   >>> fmap show (Just 3)
--   Just "3"
--   
--   
--   Convert from an Either Int Int to an Either Int
--   String using show:
--   
--   
--   >>> fmap show (Left 17)
--   Left 17
--   
--   >>> fmap show (Right 17)
--   Right "17"
--   
--   
--   Double each element of a list:
--   
--   
--   >>> fmap (*2) [1,2,3]
--   [2,4,6]
--   
--   
--   Apply even to the second element of a pair:
--   
--   
--   >>> fmap even (2,2)
--   (2,True)
--   
--   
--   It may seem surprising that the function is only applied to the last
--   element of the tuple compared to the list example above which applies
--   it to every element in the list. To understand, remember that tuples
--   are type constructors with multiple type parameters: a tuple of 3
--   elements (a,b,c) can also be written (,,) a b c and
--   its Functor instance is defined for Functor ((,,) a
--   b) (i.e., only the third parameter is free to be mapped over with
--   fmap).
--   
--   It explains why fmap can be used with tuples containing
--   values of different types as in the following example:
--   
--   
--   >>> fmap even ("hello", 1.0, 4)
--   ("hello",1.0,True)
--   
fmap :: Functor f => (a -> b) -> f a -> f b

-- | Replace all locations in the input with the same value. The default
--   definition is fmap . const, but this may be
--   overridden with a more efficient version.
--   
--   
Examples
--   
--   Perform a computation with Maybe and replace the result with a
--   constant value if it is Just:
--   
--   
--   >>> 'a' <$ Just 2
--   Just 'a'
--   
--   >>> 'a' <$ Nothing
--   Nothing
--   
(<$) :: Functor f => a -> f b -> f a
infixl 4 <$

-- | Functors representing data structures that can be transformed to
--   structures of the same shape by performing an
--   Applicative (or, therefore, Monad) action on each
--   element from left to right.
--   
--   A more detailed description of what same shape means, the
--   various methods, how traversals are constructed, and example advanced
--   use-cases can be found in the Overview section of
--   Data.Traversable#overview.
--   
--   For the class laws see the Laws section of
--   Data.Traversable#laws.
class (Functor t, Foldable t) => Traversable (t :: Type -> Type)

-- | Map each element of a structure to an action, evaluate these actions
--   from left to right, and collect the results. For a version that
--   ignores the results see traverse_.
--   
--   
Examples
--   
--   Basic usage:
--   
--   In the first two examples we show each evaluated action mapping to the
--   output structure.
--   
--   
--   >>> traverse Just [1,2,3,4]
--   Just [1,2,3,4]
--   
--   
--   
--   >>> traverse id [Right 1, Right 2, Right 3, Right 4]
--   Right [1,2,3,4]
--   
--   
--   In the next examples, we show that Nothing and Left
--   values short circuit the created structure.
--   
--   
--   >>> traverse (const Nothing) [1,2,3,4]
--   Nothing
--   
--   
--   
--   >>> traverse (\x -> if odd x then Just x else Nothing)  [1,2,3,4]
--   Nothing
--   
--   
--   
--   >>> traverse id [Right 1, Right 2, Right 3, Right 4, Left 0]
--   Left 0
--   
traverse :: (Traversable t, Applicative f) => (a -> f b) -> t a -> f (t b)

-- | Evaluate each action in the structure from left to right, and collect
--   the results. For a version that ignores the results see
--   sequenceA_.
--   
--   
Examples
--   
--   Basic usage:
--   
--   For the first two examples we show sequenceA fully evaluating a a
--   structure and collecting the results.
--   
--   
--   >>> sequenceA [Just 1, Just 2, Just 3]
--   Just [1,2,3]
--   
--   
--   
--   >>> sequenceA [Right 1, Right 2, Right 3]
--   Right [1,2,3]
--   
--   
--   The next two example show Nothing and Just will short
--   circuit the resulting structure if present in the input. For more
--   context, check the Traversable instances for Either and
--   Maybe.
--   
--   
--   >>> sequenceA [Just 1, Just 2, Just 3, Nothing]
--   Nothing
--   
--   
--   
--   >>> sequenceA [Right 1, Right 2, Right 3, Left 4]
--   Left 4
--   
sequenceA :: (Traversable t, Applicative f) => t (f a) -> f (t a)

-- | Map each element of a structure to a monadic action, evaluate these
--   actions from left to right, and collect the results. For a version
--   that ignores the results see mapM_.
--   
--   
Examples
--   
--   mapM is literally a traverse with a type signature
--   restricted to Monad. Its implementation may be more efficient
--   due to additional power of Monad.
mapM :: (Traversable t, Monad m) => (a -> m b) -> t a -> m (t b)

-- | Evaluate each monadic action in the structure from left to right, and
--   collect the results. For a version that ignores the results see
--   sequence_.
--   
--   
Examples
--   
--   Basic usage:
--   
--   The first two examples are instances where the input and and output of
--   sequence are isomorphic.
--   
--   
--   >>> sequence $ Right [1,2,3,4]
--   [Right 1,Right 2,Right 3,Right 4]
--   
--   
--   
--   >>> sequence $ [Right 1,Right 2,Right 3,Right 4]
--   Right [1,2,3,4]
--   
--   
--   The following examples demonstrate short circuit behavior for
--   sequence.
--   
--   
--   >>> sequence $ Left [1,2,3,4]
--   Left [1,2,3,4]
--   
--   
--   
--   >>> sequence $ [Left 0, Right 1,Right 2,Right 3,Right 4]
--   Left 0
--   
sequence :: (Traversable t, Monad m) => t (m a) -> m (t a)

-- | The Foldable class represents data structures that can be reduced to a
--   summary value one element at a time. Strict left-associative folds are
--   a good fit for space-efficient reduction, while lazy right-associative
--   folds are a good fit for corecursive iteration, or for folds that
--   short-circuit after processing an initial subsequence of the
--   structure's elements.
--   
--   Instances can be derived automatically by enabling the
--   DeriveFoldable extension. For example, a derived instance for
--   a binary tree might be:
--   
--   
--   {-# LANGUAGE DeriveFoldable #-}
--   data Tree a = Empty
--               | Leaf a
--               | Node (Tree a) a (Tree a)
--       deriving Foldable
--   
--   
--   A more detailed description can be found in the Overview
--   section of Data.Foldable#overview.
--   
--   For the class laws see the Laws section of
--   Data.Foldable#laws.
class () => Foldable (t :: Type -> Type)

-- | The Bounded class is used to name the upper and lower limits of
--   a type. Ord is not a superclass of Bounded since types
--   that are not totally ordered may also have upper and lower bounds.
--   
--   The Bounded class may be derived for any enumeration type;
--   minBound is the first constructor listed in the data
--   declaration and maxBound is the last. Bounded may also
--   be derived for single-constructor datatypes whose constituent types
--   are in Bounded.
class () => Bounded a
minBound :: Bounded a => a
maxBound :: Bounded a => a

-- | Class Enum defines operations on sequentially ordered types.
--   
--   The enumFrom... methods are used in Haskell's translation of
--   arithmetic sequences.
--   
--   Instances of Enum may be derived for any enumeration type
--   (types whose constructors have no fields). The nullary constructors
--   are assumed to be numbered left-to-right by fromEnum from
--   0 through n-1. See Chapter 10 of the Haskell
--   Report for more details.
--   
--   For any type that is an instance of class Bounded as well as
--   Enum, the following should hold:
--   
--   
--   
- The calls succ maxBound and pred
--   minBound should result in a runtime error.
--   
- fromEnum and toEnum should give a runtime error if
--   the result value is not representable in the result type. For example,
--   toEnum 7 :: Bool is an error.
--   
- enumFrom and enumFromThen should be defined with an
--   implicit bound, thus:
--   
--   
--   
--   enumFrom     x   = enumFromTo     x maxBound
--   enumFromThen x y = enumFromThenTo x y bound
--     where
--       bound | fromEnum y >= fromEnum x = maxBound
--             | otherwise                = minBound
--   
class () => Enum a

-- | the successor of a value. For numeric types, succ adds 1.
succ :: Enum a => a -> a

-- | the predecessor of a value. For numeric types, pred subtracts
--   1.
pred :: Enum a => a -> a

-- | Convert from an Int.
toEnum :: Enum a => Int -> a

-- | Convert to an Int. It is implementation-dependent what
--   fromEnum returns when applied to a value that is too large to
--   fit in an Int.
fromEnum :: Enum a => a -> Int

-- | Used in Haskell's translation of [n..] with [n..] =
--   enumFrom n, a possible implementation being enumFrom n = n :
--   enumFrom (succ n). For example:
--   
--   
--   
- 
enumFrom 4 :: [Integer] = [4,5,6,7,...]

--   
- 
enumFrom 6 :: [Int] = [6,7,8,9,...,maxBound ::
--   Int]

--   
enumFrom :: Enum a => a -> [a]

-- | Used in Haskell's translation of [n,n'..] with [n,n'..] =
--   enumFromThen n n', a possible implementation being
--   enumFromThen n n' = n : n' : worker (f x) (f x n'),
--   worker s v = v : worker s (s v), x = fromEnum n' -
--   fromEnum n and f n y | n > 0 = f (n - 1) (succ y) | n <
--   0 = f (n + 1) (pred y) | otherwise = y For example:
--   
--   
--   
- 
enumFromThen 4 6 :: [Integer] = [4,6,8,10...]

--   
- 
enumFromThen 6 2 :: [Int] = [6,2,-2,-6,...,minBound ::
--   Int]

--   
enumFromThen :: Enum a => a -> a -> [a]

-- | Used in Haskell's translation of [n..m] with [n..m] =
--   enumFromTo n m, a possible implementation being enumFromTo n
--   m | n <= m = n : enumFromTo (succ n) m | otherwise = []. For
--   example:
--   
--   
--   
- 
enumFromTo 6 10 :: [Int] = [6,7,8,9,10]

--   
- 
enumFromTo 42 1 :: [Integer] = []

--   
enumFromTo :: Enum a => a -> a -> [a]

-- | Used in Haskell's translation of [n,n'..m] with [n,n'..m]
--   = enumFromThenTo n n' m, a possible implementation being
--   enumFromThenTo n n' m = worker (f x) (c x) n m, x =
--   fromEnum n' - fromEnum n, c x = bool (>=) ((x
--   0) f n y | n > 0 = f (n - 1) (succ y) | n < 0 = f (n +
--   1) (pred y) | otherwise = y and worker s c v m | c v m = v :
--   worker s c (s v) m | otherwise = [] For example:
--   
--   
--   
- 
enumFromThenTo 4 2 -6 :: [Integer] =
--   [4,2,0,-2,-4,-6]

--   
- 
enumFromThenTo 6 8 2 :: [Int] = []

--   
enumFromThenTo :: Enum a => a -> a -> a -> [a]

-- | The Eq class defines equality (==) and inequality
--   (/=). All the basic datatypes exported by the Prelude
--   are instances of Eq, and Eq may be derived for any
--   datatype whose constituents are also instances of Eq.
--   
--   The Haskell Report defines no laws for Eq. However, instances
--   are encouraged to follow these properties:
--   
--   
--   
- Reflexivity x == x = True
--   
- Symmetry x == y = y == x
--   
- Transitivity if x == y && y == z =
--   True, then x == z = True
--   
- Extensionality if x == y = True and
--   f is a function whose return type is an instance of
--   Eq, then f x == f y = True
--   
- Negation x /= y = not (x ==
--   y)
--   
--   
--   Minimal complete definition: either == or /=.
class () => Eq a
(==) :: Eq a => a -> a -> Bool
(/=) :: Eq a => a -> a -> Bool
infix 4 ==
infix 4 /=

-- | Trigonometric and hyperbolic functions and related functions.
--   
--   The Haskell Report defines no laws for Floating. However,
--   (+), (*) and exp are
--   customarily expected to define an exponential field and have the
--   following properties:
--   
--   
--   
- exp (a + b) = exp a * exp b
--   
- exp (fromInteger 0) = fromInteger 1
--   
class Fractional a => Floating a
pi :: Floating a => a
exp :: Floating a => a -> a
log :: Floating a => a -> a
sqrt :: Floating a => a -> a
(**) :: Floating a => a -> a -> a
logBase :: Floating a => a -> a -> a
sin :: Floating a => a -> a
cos :: Floating a => a -> a
tan :: Floating a => a -> a
asin :: Floating a => a -> a
acos :: Floating a => a -> a
atan :: Floating a => a -> a
sinh :: Floating a => a -> a
cosh :: Floating a => a -> a
tanh :: Floating a => a -> a
asinh :: Floating a => a -> a
acosh :: Floating a => a -> a
atanh :: Floating a => a -> a
infixr 8 **

-- | Fractional numbers, supporting real division.
--   
--   The Haskell Report defines no laws for Fractional. However,
--   (+) and (*) are customarily expected
--   to define a division ring and have the following properties:
--   
--   
--   
- recip gives the multiplicative inverse x
--   * recip x = recip x * x = fromInteger 1
--   
- Totality of toRational toRational is
--   total
--   
- Coherence with toRational if the type also
--   implements Real, then fromRational is a left inverse for
--   toRational, i.e. fromRational (toRational i) = i
--   
--   
--   Note that it isn't customarily expected that a type instance of
--   Fractional implement a field. However, all instances in
--   base do.
class Num a => Fractional a

-- | Fractional division.
(/) :: Fractional a => a -> a -> a

-- | Reciprocal fraction.
recip :: Fractional a => a -> a

-- | Conversion from a Rational (that is Ratio
--   Integer). A floating literal stands for an application of
--   fromRational to a value of type Rational, so such
--   literals have type (Fractional a) => a.
fromRational :: Fractional a => Rational -> a
infixl 7 /

-- | Integral numbers, supporting integer division.
--   
--   The Haskell Report defines no laws for Integral. However,
--   Integral instances are customarily expected to define a
--   Euclidean domain and have the following properties for the
--   div/mod and quot/rem pairs, given suitable
--   Euclidean functions f and g:
--   
--   
--   
- x = y * quot x y + rem x y with rem x y
--   = fromInteger 0 or g (rem x y) < g
--   y
--   
- x = y * div x y + mod x y with mod x y
--   = fromInteger 0 or f (mod x y) < f
--   y
--   
--   
--   An example of a suitable Euclidean function, for Integer's
--   instance, is abs.
--   
--   In addition, toInteger should be total, and fromInteger
--   should be a left inverse for it, i.e. fromInteger (toInteger i) =
--   i.
class (Real a, Enum a) => Integral a

-- | integer division truncated toward zero
--   
--   WARNING: This function is partial (because it throws when 0 is passed
--   as the divisor) for all the integer types in base.
quot :: Integral a => a -> a -> a

-- | integer remainder, satisfying
--   
--   
--   (x `quot` y)*y + (x `rem` y) == x
--   
--   
--   WARNING: This function is partial (because it throws when 0 is passed
--   as the divisor) for all the integer types in base.
rem :: Integral a => a -> a -> a

-- | integer division truncated toward negative infinity
--   
--   WARNING: This function is partial (because it throws when 0 is passed
--   as the divisor) for all the integer types in base.
div :: Integral a => a -> a -> a

-- | integer modulus, satisfying
--   
--   
--   (x `div` y)*y + (x `mod` y) == x
--   
--   
--   WARNING: This function is partial (because it throws when 0 is passed
--   as the divisor) for all the integer types in base.
mod :: Integral a => a -> a -> a

-- | simultaneous quot and rem
--   
--   WARNING: This function is partial (because it throws when 0 is passed
--   as the divisor) for all the integer types in base.
quotRem :: Integral a => a -> a -> (a, a)

-- | simultaneous div and mod
--   
--   WARNING: This function is partial (because it throws when 0 is passed
--   as the divisor) for all the integer types in base.
divMod :: Integral a => a -> a -> (a, a)

-- | conversion to Integer
toInteger :: Integral a => a -> Integer
infixl 7 `quot`
infixl 7 `rem`
infixl 7 `div`
infixl 7 `mod`

-- | The Monad class defines the basic operations over a
--   monad, a concept from a branch of mathematics known as
--   category theory. From the perspective of a Haskell programmer,
--   however, it is best to think of a monad as an abstract datatype
--   of actions. Haskell's do expressions provide a convenient
--   syntax for writing monadic expressions.
--   
--   Instances of Monad should satisfy the following:
--   
--   
--   
- Left identity return a >>= k = k
--   a
--   
- Right identity m >>= return =
--   m
--   
- Associativity m >>= (\x -> k x
--   >>= h) = (m >>= k) >>=
--   h
--   
--   
--   Furthermore, the Monad and Applicative operations should
--   relate as follows:
--   
--   
--   
- 
pure = return

--   
- 
m1 <*> m2 = m1 >>= (\x1 -> m2
--   >>= (\x2 -> return (x1 x2)))

--   
--   
--   The above laws imply:
--   
--   
--   
- 
fmap f xs = xs >>= return .
--   f

--   
- 
(>>) = (*>)

--   
--   
--   and that pure and (<*>) satisfy the applicative
--   functor laws.
--   
--   The instances of Monad for lists, Maybe and IO
--   defined in the Prelude satisfy these laws.
class Applicative m => Monad (m :: Type -> Type)

-- | Sequentially compose two actions, passing any value produced by the
--   first as an argument to the second.
--   
--   'as >>= bs' can be understood as the do
--   expression
--   
--   
--   do a <- as
--      bs a
--   
(>>=) :: Monad m => m a -> (a -> m b) -> m b

-- | Sequentially compose two actions, discarding any value produced by the
--   first, like sequencing operators (such as the semicolon) in imperative
--   languages.
--   
--   'as >> bs' can be understood as the do
--   expression
--   
--   
--   do as
--      bs
--   
(>>) :: Monad m => m a -> m b -> m b

-- | Inject a value into the monadic type.
return :: Monad m => a -> m a
infixl 1 >>=
infixl 1 >>

-- | Basic numeric class.
--   
--   The Haskell Report defines no laws for Num. However,
--   (+) and (*) are customarily expected
--   to define a ring and have the following properties:
--   
--   
--   
- Associativity of (+) (x + y) +
--   z = x + (y + z)
--   
- Commutativity of (+) x + y
--   = y + x
--   
- fromInteger 0 is the additive
--   identity x + fromInteger 0 = x
--   
- negate gives the additive inverse x +
--   negate x = fromInteger 0
--   
- Associativity of (*) (x * y) *
--   z = x * (y * z)
--   
- fromInteger 1 is the multiplicative
--   identity x * fromInteger 1 = x and
--   fromInteger 1 * x = x
--   
- Distributivity of (*) with respect to
--   (+) a * (b + c) = (a * b) + (a *
--   c) and (b + c) * a = (b * a) + (c * a)
--   
- Coherence with toInteger if the type also
--   implements Integral, then fromInteger is a left inverse
--   for toInteger, i.e. fromInteger (toInteger i) ==
--   i
--   
--   
--   Note that it isn't customarily expected that a type instance of
--   both Num and Ord implement an ordered ring. Indeed, in
--   base only Integer and Rational do.
class () => Num a
(+) :: Num a => a -> a -> a
(-) :: Num a => a -> a -> a
(*) :: Num a => a -> a -> a

-- | Unary negation.
negate :: Num a => a -> a

-- | Absolute value.
abs :: Num a => a -> a

-- | Sign of a number. The functions abs and signum should
--   satisfy the law:
--   
--   
--   abs x * signum x == x
--   
--   
--   For real numbers, the signum is either -1 (negative),
--   0 (zero) or 1 (positive).
signum :: Num a => a -> a

-- | Conversion from an Integer. An integer literal represents the
--   application of the function fromInteger to the appropriate
--   value of type Integer, so such literals have type
--   (Num a) => a.
fromInteger :: Num a => Integer -> a
infixl 6 -
infixl 6 +
infixl 7 *

-- | The Ord class is used for totally ordered datatypes.
--   
--   Instances of Ord can be derived for any user-defined datatype
--   whose constituent types are in Ord. The declared order of the
--   constructors in the data declaration determines the ordering in
--   derived Ord instances. The Ordering datatype allows a
--   single comparison to determine the precise ordering of two objects.
--   
--   Ord, as defined by the Haskell report, implements a total order
--   and has the following properties:
--   
--   
--   
- Comparability x <= y || y <= x =
--   True
--   
- Transitivity if x <= y && y <=
--   z = True, then x <= z = True
--   
- Reflexivity x <= x = True
--   
- Antisymmetry if x <= y && y <=
--   x = True, then x == y = True
--   
--   
--   The following operator interactions are expected to hold:
--   
--   
--   
- x >= y = y <= x
--   
- x < y = x <= y && x /= y
--   
- x > y = y < x
--   
- x < y = compare x y == LT
--   
- x > y = compare x y == GT
--   
- x == y = compare x y == EQ
--   
- min x y == if x <= y then x else y = True
--   
- max x y == if x >= y then x else y = True
--   
--   
--   Note that (7.) and (8.) do not require min and
--   max to return either of their arguments. The result is merely
--   required to equal one of the arguments in terms of (==).
--   
--   Minimal complete definition: either compare or <=.
--   Using compare can be more efficient for complex types.
class Eq a => Ord a
compare :: Ord a => a -> a -> Ordering
(<) :: Ord a => a -> a -> Bool
(<=) :: Ord a => a -> a -> Bool
(>) :: Ord a => a -> a -> Bool
(>=) :: Ord a => a -> a -> Bool
max :: Ord a => a -> a -> a
min :: Ord a => a -> a -> a
infix 4 >=
infix 4 <
infix 4 <=
infix 4 >

-- | Parsing of Strings, producing values.
--   
--   Derived instances of Read make the following assumptions, which
--   derived instances of Show obey:
--   
--   
--   
- If the constructor is defined to be an infix operator, then the
--   derived Read instance will parse only infix applications of the
--   constructor (not the prefix form).
--   
- Associativity is not used to reduce the occurrence of parentheses,
--   although precedence may be.
--   
- If the constructor is defined using record syntax, the derived
--   Read will parse only the record-syntax form, and furthermore,
--   the fields must be given in the same order as the original
--   declaration.
--   
- The derived Read instance allows arbitrary Haskell
--   whitespace between tokens of the input string. Extra parentheses are
--   also allowed.
--   
--   
--   For example, given the declarations
--   
--   
--   infixr 5 :^:
--   data Tree a =  Leaf a  |  Tree a :^: Tree a
--   
--   
--   the derived instance of Read in Haskell 2010 is equivalent to
--   
--   
--   instance (Read a) => Read (Tree a) where
--   
--           readsPrec d r =  readParen (d > app_prec)
--                            (\r -> [(Leaf m,t) |
--                                    ("Leaf",s) <- lex r,
--                                    (m,t) <- readsPrec (app_prec+1) s]) r
--   
--                         ++ readParen (d > up_prec)
--                            (\r -> [(u:^:v,w) |
--                                    (u,s) <- readsPrec (up_prec+1) r,
--                                    (":^:",t) <- lex s,
--                                    (v,w) <- readsPrec (up_prec+1) t]) r
--   
--             where app_prec = 10
--                   up_prec = 5
--   
--   
--   Note that right-associativity of :^: is unused.
--   
--   The derived instance in GHC is equivalent to
--   
--   
--   instance (Read a) => Read (Tree a) where
--   
--           readPrec = parens $ (prec app_prec $ do
--                                    Ident "Leaf" <- lexP
--                                    m <- step readPrec
--                                    return (Leaf m))
--   
--                        +++ (prec up_prec $ do
--                                    u <- step readPrec
--                                    Symbol ":^:" <- lexP
--                                    v <- step readPrec
--                                    return (u :^: v))
--   
--             where app_prec = 10
--                   up_prec = 5
--   
--           readListPrec = readListPrecDefault
--   
--   
--   Why do both readsPrec and readPrec exist, and why does
--   GHC opt to implement readPrec in derived Read instances
--   instead of readsPrec? The reason is that readsPrec is
--   based on the ReadS type, and although ReadS is mentioned
--   in the Haskell 2010 Report, it is not a very efficient parser data
--   structure.
--   
--   readPrec, on the other hand, is based on a much more efficient
--   ReadPrec datatype (a.k.a "new-style parsers"), but its
--   definition relies on the use of the RankNTypes language
--   extension. Therefore, readPrec (and its cousin,
--   readListPrec) are marked as GHC-only. Nevertheless, it is
--   recommended to use readPrec instead of readsPrec
--   whenever possible for the efficiency improvements it brings.
--   
--   As mentioned above, derived Read instances in GHC will
--   implement readPrec instead of readsPrec. The default
--   implementations of readsPrec (and its cousin, readList)
--   will simply use readPrec under the hood. If you are writing a
--   Read instance by hand, it is recommended to write it like so:
--   
--   
--   instance Read T where
--     readPrec     = ...
--     readListPrec = readListPrecDefault
--   
class () => Read a

-- | Real numbers.
--   
--   The Haskell report defines no laws for Real, however
--   Real instances are customarily expected to adhere to the
--   following law:
--   
--   
--   
- Coherence with fromRational if the type also
--   implements Fractional, then fromRational is a left
--   inverse for toRational, i.e. fromRational (toRational i) =
--   i
--   
class (Num a, Ord a) => Real a

-- | the rational equivalent of its real argument with full precision
toRational :: Real a => a -> Rational

-- | Efficient, machine-independent access to the components of a
--   floating-point number.
class (RealFrac a, Floating a) => RealFloat a

-- | a constant function, returning the radix of the representation (often
--   2)
floatRadix :: RealFloat a => a -> Integer

-- | a constant function, returning the number of digits of
--   floatRadix in the significand
floatDigits :: RealFloat a => a -> Int

-- | a constant function, returning the lowest and highest values the
--   exponent may assume
floatRange :: RealFloat a => a -> (Int, Int)

-- | The function decodeFloat applied to a real floating-point
--   number returns the significand expressed as an Integer and an
--   appropriately scaled exponent (an Int). If
--   decodeFloat x yields (m,n), then x
--   is equal in value to m*b^^n, where b is the
--   floating-point radix, and furthermore, either m and
--   n are both zero or else b^(d-1) <= abs m <
--   b^d, where d is the value of floatDigits
--   x. In particular, decodeFloat 0 = (0,0). If the
--   type contains a negative zero, also decodeFloat (-0.0) =
--   (0,0). The result of decodeFloat x is
--   unspecified if either of isNaN x or
--   isInfinite x is True.
decodeFloat :: RealFloat a => a -> (Integer, Int)

-- | encodeFloat performs the inverse of decodeFloat in the
--   sense that for finite x with the exception of -0.0,
--   uncurry encodeFloat (decodeFloat x) = x.
--   encodeFloat m n is one of the two closest
--   representable floating-point numbers to m*b^^n (or
--   ±Infinity if overflow occurs); usually the closer, but if
--   m contains too many bits, the result may be rounded in the
--   wrong direction.
encodeFloat :: RealFloat a => Integer -> Int -> a

-- | exponent corresponds to the second component of
--   decodeFloat. exponent 0 = 0 and for finite
--   nonzero x, exponent x = snd (decodeFloat x)
--   + floatDigits x. If x is a finite floating-point
--   number, it is equal in value to significand x * b ^^
--   exponent x, where b is the floating-point radix.
--   The behaviour is unspecified on infinite or NaN values.
exponent :: RealFloat a => a -> Int

-- | The first component of decodeFloat, scaled to lie in the open
--   interval (-1,1), either 0.0 or of absolute
--   value >= 1/b, where b is the floating-point
--   radix. The behaviour is unspecified on infinite or NaN
--   values.
significand :: RealFloat a => a -> a

-- | multiplies a floating-point number by an integer power of the radix
scaleFloat :: RealFloat a => Int -> a -> a

-- | True if the argument is an IEEE "not-a-number" (NaN) value
isNaN :: RealFloat a => a -> Bool

-- | True if the argument is an IEEE infinity or negative infinity
isInfinite :: RealFloat a => a -> Bool

-- | True if the argument is too small to be represented in
--   normalized format
isDenormalized :: RealFloat a => a -> Bool

-- | True if the argument is an IEEE negative zero
isNegativeZero :: RealFloat a => a -> Bool

-- | True if the argument is an IEEE floating point number
isIEEE :: RealFloat a => a -> Bool

-- | a version of arctangent taking two real floating-point arguments. For
--   real floating x and y, atan2 y x
--   computes the angle (from the positive x-axis) of the vector from the
--   origin to the point (x,y). atan2 y x returns
--   a value in the range [-pi, pi]. It follows the
--   Common Lisp semantics for the origin when signed zeroes are supported.
--   atan2 y 1, with y in a type that is
--   RealFloat, should return the same value as atan
--   y. A default definition of atan2 is provided, but
--   implementors can provide a more accurate implementation.
atan2 :: RealFloat a => a -> a -> a

-- | Extracting components of fractions.
class (Real a, Fractional a) => RealFrac a

-- | The function properFraction takes a real fractional number
--   x and returns a pair (n,f) such that x =
--   n+f, and:
--   
--   
--   
- n is an integral number with the same sign as x;
--   and
--   
- f is a fraction with the same type and sign as
--   x, and with absolute value less than 1.
--   
--   
--   The default definitions of the ceiling, floor,
--   truncate and round functions are in terms of
--   properFraction.
properFraction :: (RealFrac a, Integral b) => a -> (b, a)

-- | truncate x returns the integer nearest x
--   between zero and x
truncate :: (RealFrac a, Integral b) => a -> b

-- | round x returns the nearest integer to x; the
--   even integer if x is equidistant between two integers
round :: (RealFrac a, Integral b) => a -> b

-- | ceiling x returns the least integer not less than
--   x
ceiling :: (RealFrac a, Integral b) => a -> b

-- | floor x returns the greatest integer not greater than
--   x
floor :: (RealFrac a, Integral b) => a -> b

-- | Conversion of values to readable Strings.
--   
--   Derived instances of Show have the following properties, which
--   are compatible with derived instances of Read:
--   
--   
--   
- The result of show is a syntactically correct Haskell
--   expression containing only constants, given the fixity declarations in
--   force at the point where the type is declared. It contains only the
--   constructor names defined in the data type, parentheses, and spaces.
--   When labelled constructor fields are used, braces, commas, field
--   names, and equal signs are also used.
--   
- If the constructor is defined to be an infix operator, then
--   showsPrec will produce infix applications of the
--   constructor.
--   
- the representation will be enclosed in parentheses if the
--   precedence of the top-level constructor in x is less than
--   d (associativity is ignored). Thus, if d is
--   0 then the result is never surrounded in parentheses; if
--   d is 11 it is always surrounded in parentheses,
--   unless it is an atomic expression.
--   
- If the constructor is defined using record syntax, then
--   show will produce the record-syntax form, with the fields given
--   in the same order as the original declaration.
--   
--   
--   For example, given the declarations
--   
--   
--   infixr 5 :^:
--   data Tree a =  Leaf a  |  Tree a :^: Tree a
--   
--   
--   the derived instance of Show is equivalent to
--   
--   
--   instance (Show a) => Show (Tree a) where
--   
--          showsPrec d (Leaf m) = showParen (d > app_prec) $
--               showString "Leaf " . showsPrec (app_prec+1) m
--            where app_prec = 10
--   
--          showsPrec d (u :^: v) = showParen (d > up_prec) $
--               showsPrec (up_prec+1) u .
--               showString " :^: "      .
--               showsPrec (up_prec+1) v
--            where up_prec = 5
--   
--   
--   Note that right-associativity of :^: is ignored. For example,
--   
--   
--   
- show (Leaf 1 :^: Leaf 2 :^: Leaf 3) produces the
--   string "Leaf 1 :^: (Leaf 2 :^: Leaf 3)".
--   
class () => Show a

-- | Convert a value to a readable String.
--   
--   showsPrec should satisfy the law
--   
--   
--   showsPrec d x r ++ s  ==  showsPrec d x (r ++ s)
--   
--   
--   Derived instances of Read and Show satisfy the
--   following:
--   
--   
--   
- (x,"") is an element of (readsPrec d
--   (showsPrec d x "")).
--   
--   
--   That is, readsPrec parses the string produced by
--   showsPrec, and delivers the value that showsPrec started
--   with.
showsPrec :: Show a => Int -> a -> ShowS

-- | A specialised variant of showsPrec, using precedence context
--   zero, and returning an ordinary String.
show :: Show a => a -> String

-- | The method showList is provided to allow the programmer to give
--   a specialised way of showing lists of values. For example, this is
--   used by the predefined Show instance of the Char type,
--   where values of type String should be shown in double quotes,
--   rather than between square brackets.
showList :: Show a => [a] -> ShowS

-- | IsString is used in combination with the
--   -XOverloadedStrings language extension to convert the
--   literals to different string types.
--   
--   For example, if you use the text package, you can say
--   
--   
--   {-# LANGUAGE OverloadedStrings  #-}
--   
--   myText = "hello world" :: Text
--   
--   
--   Internally, the extension will convert this to the equivalent of
--   
--   
--   myText = fromString @Text ("hello world" :: String)
--   
--   
--   Note: You can use fromString in normal code as well,
--   but the usual performance/memory efficiency problems with
--   String apply.
class () => IsString a
fromString :: IsString a => String -> a

-- | A functor with application, providing operations to
--   
--   
--   
- embed pure expressions (pure), and
--   
- sequence computations and combine their results (<*>
--   and liftA2).
--   
--   
--   A minimal complete definition must include implementations of
--   pure and of either <*> or liftA2. If it
--   defines both, then they must behave the same as their default
--   definitions:
--   
--   
--   (<*>) = liftA2 id
--   
--   
--   
--   liftA2 f x y = f <$> x <*> y
--   
--   
--   Further, any definition must satisfy the following:
--   
--   
--   
- Identity 
pure id <*> v =
--   v

--   
- Composition 
pure (.) <*> u
--   <*> v <*> w = u <*> (v
--   <*> w)

--   
- Homomorphism 
pure f <*>
--   pure x = pure (f x)

--   
- Interchange 
u <*> pure y =
--   pure ($ y) <*> u

--   
--   
--   The other methods have the following default definitions, which may be
--   overridden with equivalent specialized implementations:
--   
--   
--   
- 
u *> v = (id <$ u)
--   <*> v

--   
- 
u <* v = liftA2 const u v

--   
--   
--   As a consequence of these laws, the Functor instance for
--   f will satisfy
--   
--   
--   
- 
fmap f x = pure f <*> x

--   
--   
--   It may be useful to note that supposing
--   
--   
--   forall x y. p (q x y) = f x . g y
--   
--   
--   it follows from the above that
--   
--   
--   liftA2 p (liftA2 q u v) = liftA2 f u . liftA2 g v
--   
--   
--   If f is also a Monad, it should satisfy
--   
--   
--   
- 
pure = return

--   
- 
m1 <*> m2 = m1 >>= (\x1 -> m2
--   >>= (\x2 -> return (x1 x2)))

--   
- 
(*>) = (>>)

--   
--   
--   (which implies that pure and <*> satisfy the
--   applicative functor laws).
class Functor f => Applicative (f :: Type -> Type)

-- | Lift a value.
pure :: Applicative f => a -> f a

-- | Sequential application.
--   
--   A few functors support an implementation of <*> that is
--   more efficient than the default one.
--   
--   
Example
--   
--   Used in combination with (<$>),
--   (<*>) can be used to build a record.
--   
--   
--   >>> data MyState = MyState {arg1 :: Foo, arg2 :: Bar, arg3 :: Baz}
--   
--   
--   
--   >>> produceFoo :: Applicative f => f Foo
--   
--   
--   
--   >>> produceBar :: Applicative f => f Bar
--   
--   >>> produceBaz :: Applicative f => f Baz
--   
--   
--   
--   >>> mkState :: Applicative f => f MyState
--   
--   >>> mkState = MyState <$> produceFoo <*> produceBar <*> produceBaz
--   
(<*>) :: Applicative f => f (a -> b) -> f a -> f b

-- | Lift a binary function to actions.
--   
--   Some functors support an implementation of liftA2 that is more
--   efficient than the default one. In particular, if fmap is an
--   expensive operation, it is likely better to use liftA2 than to
--   fmap over the structure and then use <*>.
--   
--   This became a typeclass method in 4.10.0.0. Prior to that, it was a
--   function defined in terms of <*> and fmap.
--   
--   
Example
--   
--   
--   >>> liftA2 (,) (Just 3) (Just 5)
--   Just (3,5)
--   
liftA2 :: Applicative f => (a -> b -> c) -> f a -> f b -> f c

-- | Sequence actions, discarding the value of the first argument.
--   
--   
Examples
--   
--   If used in conjunction with the Applicative instance for Maybe,
--   you can chain Maybe computations, with a possible "early return" in
--   case of Nothing.
--   
--   
--   >>> Just 2 *> Just 3
--   Just 3
--   
--   
--   
--   >>> Nothing *> Just 3
--   Nothing
--   
--   
--   Of course a more interesting use case would be to have effectful
--   computations instead of just returning pure values.
--   
--   
--   >>> import Data.Char
--   
--   >>> import Text.ParserCombinators.ReadP
--   
--   >>> let p = string "my name is " *> munch1 isAlpha <* eof
--   
--   >>> readP_to_S p "my name is Simon"
--   [("Simon","")]
--   
(*>) :: Applicative f => f a -> f b -> f b

-- | Sequence actions, discarding the value of the second argument.
(<*) :: Applicative f => f a -> f b -> f a
infixl 4 <*>
infixl 4 *>
infixl 4 <*

-- | The class of semigroups (types with an associative binary operation).
--   
--   Instances should satisfy the following:
--   
--   
--   
- Associativity x <> (y <> z) =
--   (x <> y) <> z
--   
--   
--   You can alternatively define sconcat instead of
--   (<>), in which case the laws are:
--   
--   
--   
- Unit sconcat (pure x) = x
--   
- Multiplication sconcat (join xss) =
--   sconcat (fmap sconcat xss)
--   
class () => Semigroup a

-- | An associative operation.
--   
--   
Examples
--   
--   
--   >>> [1,2,3] <> [4,5,6]
--   [1,2,3,4,5,6]
--   
--   
--   
--   >>> Just [1, 2, 3] <> Just [4, 5, 6]
--   Just [1,2,3,4,5,6]
--   
--   
--   
--   >>> putStr "Hello, " <> putStrLn "World!"
--   Hello, World!
--   
(<>) :: Semigroup a => a -> a -> a

-- | Reduce a non-empty list with <>
--   
--   The default definition should be sufficient, but this can be
--   overridden for efficiency.
--   
--   
Examples
--   
--   For the following examples, we will assume that we have:
--   
--   
--   >>> import Data.List.NonEmpty (NonEmpty (..))
--   
--   
--   
--   >>> sconcat $ "Hello" :| [" ", "Haskell", "!"]
--   "Hello Haskell!"
--   
--   
--   
--   >>> sconcat $ Just [1, 2, 3] :| [Nothing, Just [4, 5, 6]]
--   Just [1,2,3,4,5,6]
--   
--   
--   
--   >>> sconcat $ Left 1 :| [Right 2, Left 3, Right 4]
--   Right 2
--   
sconcat :: Semigroup a => NonEmpty a -> a

-- | Repeat a value n times.
--   
--   The default definition will raise an exception for a multiplier that
--   is <= 0. This may be overridden with an implementation
--   that is total. For monoids it is preferred to use
--   stimesMonoid.
--   
--   By making this a member of the class, idempotent semigroups and
--   monoids can upgrade this to execute in <math> by picking
--   stimes = stimesIdempotent or stimes =
--   stimesIdempotentMonoid respectively.
--   
--   
Examples
--   
--   
--   >>> stimes 4 [1]
--   [1,1,1,1]
--   
--   
--   
--   >>> stimes 5 (putStr "hi!")
--   hi!hi!hi!hi!hi!
--   
--   
--   
--   >>> stimes 3 (Right ":)")
--   Right ":)"
--   
stimes :: (Semigroup a, Integral b) => b -> a -> a
infixr 6 <>

-- | The class of monoids (types with an associative binary operation that
--   has an identity). Instances should satisfy the following:
--   
--   
--   
- Right identity x <> mempty =
--   x
--   
- Left identity mempty <> x =
--   x
--   
- Associativity x <> (y <> z) =
--   (x <> y) <> z (Semigroup
--   law)
--   
- Concatenation mconcat = foldr
--   (<>) mempty
--   
--   
--   You can alternatively define mconcat instead of mempty,
--   in which case the laws are:
--   
--   
--   
- Unit mconcat (pure x) = x
--   
- Multiplication mconcat (join xss) =
--   mconcat (fmap mconcat xss)
--   
- Subclass mconcat (toList xs) =
--   sconcat xs
--   
--   
--   The method names refer to the monoid of lists under concatenation, but
--   there are many other instances.
--   
--   Some types can be viewed as a monoid in more than one way, e.g. both
--   addition and multiplication on numbers. In such cases we often define
--   newtypes and make those instances of Monoid, e.g.
--   Sum and Product.
--   
--   NOTE: Semigroup is a superclass of Monoid since
--   base-4.11.0.0.
class Semigroup a => Monoid a

-- | Identity of mappend
--   
--   
Examples
--   
--   
--   >>> "Hello world" <> mempty
--   "Hello world"
--   
--   
--   
--   >>> mempty <> [1, 2, 3]
--   [1,2,3]
--   
mempty :: Monoid a => a

-- | An associative operation
--   
--   NOTE: This method is redundant and has the default
--   implementation mappend = (<>) since
--   base-4.11.0.0. Should it be implemented manually, since
--   mappend is a synonym for (<>), it is expected that
--   the two functions are defined the same way. In a future GHC release
--   mappend will be removed from Monoid.
mappend :: Monoid a => a -> a -> a

-- | Fold a list using the monoid.
--   
--   For most types, the default definition for mconcat will be
--   used, but the function is included in the class definition so that an
--   optimized version can be provided for specific types.
--   
--   
--   >>> mconcat ["Hello", " ", "Haskell", "!"]
--   "Hello Haskell!"
--   
mconcat :: Monoid a => [a] -> a
data () => Bool
False :: Bool
True :: Bool

-- | String is an alias for a list of characters.
--   
--   String constants in Haskell are values of type String. That
--   means if you write a string literal like "hello world", it
--   will have the type [Char], which is the same as
--   String.
--   
--   Note: You can ask the compiler to automatically infer different
--   types with the -XOverloadedStrings language extension, for
--   example "hello world" :: Text. See IsString for more
--   information.
--   
--   Because String is just a list of characters, you can use
--   normal list functions to do basic string manipulation. See
--   Data.List for operations on lists.
--   
--   
Performance considerations
--   
--   [Char] is a relatively memory-inefficient type. It is a
--   linked list of boxed word-size characters, internally it looks
--   something like:
--   
--   
--   ╭─────┬───┬──╮  ╭─────┬───┬──╮  ╭─────┬───┬──╮  ╭────╮
--   │ (:) │   │ ─┼─>│ (:) │   │ ─┼─>│ (:) │   │ ─┼─>│ [] │
--   ╰─────┴─┼─┴──╯  ╰─────┴─┼─┴──╯  ╰─────┴─┼─┴──╯  ╰────╯
--           v               v               v
--          'a'             'b'             'c'
--   
--   
--   The String "abc" will use 5*3+1 = 16 (in general
--   5n+1) words of space in memory.
--   
--   Furthermore, operations like (++) (string concatenation) are
--   O(n) (in the left argument).
--   
--   For historical reasons, the base library uses String
--   in a lot of places for the conceptual simplicity, but library code
--   dealing with user-data should use the text package for Unicode
--   text, or the the bytestring package for binary data.
type String = [Char]

-- | The character type Char is an enumeration whose values
--   represent Unicode (or equivalently ISO/IEC 10646) code points (i.e.
--   characters, see http://www.unicode.org/ for details). This set
--   extends the ISO 8859-1 (Latin-1) character set (the first 256
--   characters), which is itself an extension of the ASCII character set
--   (the first 128 characters). A character literal in Haskell has type
--   Char.
--   
--   To convert a Char to or from the corresponding Int value
--   defined by Unicode, use toEnum and fromEnum from the
--   Enum class respectively (or equivalently ord and
--   chr).
data () => Char

-- | Double-precision floating point numbers. It is desirable that this
--   type be at least equal in range and precision to the IEEE
--   double-precision type.
data () => Double

-- | Single-precision floating point numbers. It is desirable that this
--   type be at least equal in range and precision to the IEEE
--   single-precision type.
data () => Float

-- | A fixed-precision integer type with at least the range [-2^29 ..
--   2^29-1]. The exact range for a given implementation can be
--   determined by using minBound and maxBound from the
--   Bounded class.
data () => Int

-- | 32-bit signed integer type
data () => Int32

-- | 64-bit signed integer type
data () => Int64

-- | Arbitrary precision integers. In contrast with fixed-size integral
--   types such as Int, the Integer type represents the
--   entire infinite range of integers.
--   
--   Integers are stored in a kind of sign-magnitude form, hence do not
--   expect two's complement form when using bit operations.
--   
--   If the value is small (fit into an Int), IS constructor
--   is used. Otherwise Integer and IN constructors are used
--   to store a BigNat representing respectively the positive or the
--   negative value magnitude.
--   
--   Invariant: Integer and IN are used iff value doesn't fit
--   in IS
data () => Integer

-- | The Maybe type encapsulates an optional value. A value of type
--   Maybe a either contains a value of type a
--   (represented as Just a), or it is empty (represented
--   as Nothing). Using Maybe is a good way to deal with
--   errors or exceptional cases without resorting to drastic measures such
--   as error.
--   
--   The Maybe type is also a monad. It is a simple kind of error
--   monad, where all errors are represented by Nothing. A richer
--   error monad can be built using the Either type.
data () => Maybe a
Nothing :: Maybe a
Just :: a -> Maybe a
data () => Ordering
LT :: Ordering
EQ :: Ordering
GT :: Ordering

-- | Arbitrary-precision rational numbers, represented as a ratio of two
--   Integer values. A rational number may be constructed using the
--   % operator.
type Rational = Ratio Integer

-- | A value of type IO a is a computation which, when
--   performed, does some I/O before returning a value of type a.
--   
--   There is really only one way to "perform" an I/O action: bind it to
--   Main.main in your program. When your program is run, the I/O
--   will be performed. It isn't possible to perform I/O from an arbitrary
--   function, unless that function is itself in the IO monad and
--   called at some point, directly or indirectly, from Main.main.
--   
--   IO is a monad, so IO actions can be combined using
--   either the do-notation or the >> and >>=
--   operations from the Monad class.
data () => IO a

-- | A Word is an unsigned integral type, with the same size as
--   Int.
data () => Word

-- | 8-bit unsigned integer type
data () => Word8

-- | 32-bit unsigned integer type
data () => Word32

-- | 64-bit unsigned integer type
data () => Word64

-- | The Either type represents values with two possibilities: a
--   value of type Either a b is either Left
--   a or Right b.
--   
--   The Either type is sometimes used to represent a value which is
--   either correct or an error; by convention, the Left constructor
--   is used to hold an error value and the Right constructor is
--   used to hold a correct value (mnemonic: "right" also means "correct").
--   
--   
Examples
--   
--   The type Either String Int is the type
--   of values which can be either a String or an Int. The
--   Left constructor can be used only on Strings, and the
--   Right constructor can be used only on Ints:
--   
--   
--   >>> let s = Left "foo" :: Either String Int
--   
--   >>> s
--   Left "foo"
--   
--   >>> let n = Right 3 :: Either String Int
--   
--   >>> n
--   Right 3
--   
--   >>> :type s
--   s :: Either String Int
--   
--   >>> :type n
--   n :: Either String Int
--   
--   
--   The fmap from our Functor instance will ignore
--   Left values, but will apply the supplied function to values
--   contained in a Right:
--   
--   
--   >>> let s = Left "foo" :: Either String Int
--   
--   >>> let n = Right 3 :: Either String Int
--   
--   >>> fmap (*2) s
--   Left "foo"
--   
--   >>> fmap (*2) n
--   Right 6
--   
--   
--   The Monad instance for Either allows us to chain
--   together multiple actions which may fail, and fail overall if any of
--   the individual steps failed. First we'll write a function that can
--   either parse an Int from a Char, or fail.
--   
--   
--   >>> import Data.Char ( digitToInt, isDigit )
--   
--   >>> :{
--       let parseEither :: Char -> Either String Int
--           parseEither c
--             | isDigit c = Right (digitToInt c)
--             | otherwise = Left "parse error"
--   
--   >>> :}
--   
--   
--   The following should work, since both '1' and '2'
--   can be parsed as Ints.
--   
--   
--   >>> :{
--       let parseMultiple :: Either String Int
--           parseMultiple = do
--             x <- parseEither '1'
--             y <- parseEither '2'
--             return (x + y)
--   
--   >>> :}
--   
--   
--   
--   >>> parseMultiple
--   Right 3
--   
--   
--   But the following should fail overall, since the first operation where
--   we attempt to parse 'm' as an Int will fail:
--   
--   
--   >>> :{
--       let parseMultiple :: Either String Int
--           parseMultiple = do
--             x <- parseEither 'm'
--             y <- parseEither '2'
--             return (x + y)
--   
--   >>> :}
--   
--   
--   
--   >>> parseMultiple
--   Left "parse error"
--   
data () => Either a b
Left :: a -> Either a b
Right :: b -> Either a b

-- | The SomeException type is the root of the exception type
--   hierarchy. When an exception of type e is thrown, behind the
--   scenes it is encapsulated in a SomeException.
data () => SomeException
SomeException :: e -> SomeException

-- | Monads that also support choice and failure.
class (Alternative m, Monad m) => MonadPlus (m :: Type -> Type)

-- | The identity of mplus. It should also satisfy the equations
--   
--   
--   mzero >>= f  =  mzero
--   v >> mzero   =  mzero
--   
--   
--   The default definition is
--   
--   
--   mzero = empty
--   
mzero :: MonadPlus m => m a

-- | An associative operation. The default definition is
--   
--   
--   mplus = (<|>)
--   
mplus :: MonadPlus m => m a -> m a -> m a

-- | A monoid on applicative functors.
--   
--   If defined, some and many should be the least solutions
--   of the equations:
--   
--   
--   
- 
some v = (:) <$> v <*>
--   many v

--   
- 
many v = some v <|> pure
--   []

--   
class Applicative f => Alternative (f :: Type -> Type)

-- | The identity of <|>
empty :: Alternative f => f a

-- | An associative binary operation
(<|>) :: Alternative f => f a -> f a -> f a

-- | One or more.
some :: Alternative f => f a -> f [a]

-- | Zero or more.
many :: Alternative f => f a -> f [a]
infixl 3 <|>

-- | Proxy is a type that holds no data, but has a phantom parameter
--   of arbitrary type (or even kind). Its use is to provide type
--   information, even though there is no value available of that type (or
--   it may be too costly to create one).
--   
--   Historically, Proxy :: Proxy a is a safer
--   alternative to the undefined :: a idiom.
--   
--   
--   >>> Proxy :: Proxy (Void, Int -> Int)
--   Proxy
--   
--   
--   Proxy can even hold types of higher kinds,
--   
--   
--   >>> Proxy :: Proxy Either
--   Proxy
--   
--   
--   
--   >>> Proxy :: Proxy Functor
--   Proxy
--   
--   
--   
--   >>> Proxy :: Proxy complicatedStructure
--   Proxy
--   
data () => Proxy (t :: k)
Proxy :: Proxy (t :: k)

-- | Any type that you wish to throw or catch as an exception must be an
--   instance of the Exception class. The simplest case is a new
--   exception type directly below the root:
--   
--   
--   data MyException = ThisException | ThatException
--       deriving Show
--   
--   instance Exception MyException
--   
--   
--   The default method definitions in the Exception class do what
--   we need in this case. You can now throw and catch
--   ThisException and ThatException as exceptions:
--   
--   
--   *Main> throw ThisException `catch` \e -> putStrLn ("Caught " ++ show (e :: MyException))
--   Caught ThisException
--   
--   
--   In more complicated examples, you may wish to define a whole hierarchy
--   of exceptions:
--   
--   
--   ---------------------------------------------------------------------
--   -- Make the root exception type for all the exceptions in a compiler
--   
--   data SomeCompilerException = forall e . Exception e => SomeCompilerException e
--   
--   instance Show SomeCompilerException where
--       show (SomeCompilerException e) = show e
--   
--   instance Exception SomeCompilerException
--   
--   compilerExceptionToException :: Exception e => e -> SomeException
--   compilerExceptionToException = toException . SomeCompilerException
--   
--   compilerExceptionFromException :: Exception e => SomeException -> Maybe e
--   compilerExceptionFromException x = do
--       SomeCompilerException a <- fromException x
--       cast a
--   
--   ---------------------------------------------------------------------
--   -- Make a subhierarchy for exceptions in the frontend of the compiler
--   
--   data SomeFrontendException = forall e . Exception e => SomeFrontendException e
--   
--   instance Show SomeFrontendException where
--       show (SomeFrontendException e) = show e
--   
--   instance Exception SomeFrontendException where
--       toException = compilerExceptionToException
--       fromException = compilerExceptionFromException
--   
--   frontendExceptionToException :: Exception e => e -> SomeException
--   frontendExceptionToException = toException . SomeFrontendException
--   
--   frontendExceptionFromException :: Exception e => SomeException -> Maybe e
--   frontendExceptionFromException x = do
--       SomeFrontendException a <- fromException x
--       cast a
--   
--   ---------------------------------------------------------------------
--   -- Make an exception type for a particular frontend compiler exception
--   
--   data MismatchedParentheses = MismatchedParentheses
--       deriving Show
--   
--   instance Exception MismatchedParentheses where
--       toException   = frontendExceptionToException
--       fromException = frontendExceptionFromException
--   
--   
--   We can now catch a MismatchedParentheses exception as
--   MismatchedParentheses, SomeFrontendException or
--   SomeCompilerException, but not other types, e.g.
--   IOException:
--   
--   
--   *Main> throw MismatchedParentheses `catch` \e -> putStrLn ("Caught " ++ show (e :: MismatchedParentheses))
--   Caught MismatchedParentheses
--   *Main> throw MismatchedParentheses `catch` \e -> putStrLn ("Caught " ++ show (e :: SomeFrontendException))
--   Caught MismatchedParentheses
--   *Main> throw MismatchedParentheses `catch` \e -> putStrLn ("Caught " ++ show (e :: SomeCompilerException))
--   Caught MismatchedParentheses
--   *Main> throw MismatchedParentheses `catch` \e -> putStrLn ("Caught " ++ show (e :: IOException))
--   *** Exception: MismatchedParentheses
--   
class (Typeable e, Show e) => Exception e
toException :: Exception e => e -> SomeException
fromException :: Exception e => SomeException -> Maybe e

-- | Render this exception value in a human-friendly manner.
--   
--   Default implementation: show.
displayException :: Exception e => e -> String

-- | The Haskell 2010 type for exceptions in the IO monad. Any I/O
--   operation may raise an IOException instead of returning a
--   result. For a more general type of exception, including also those
--   that arise in pure code, see Exception.
--   
--   In Haskell 2010, this is an opaque type.
type IOError = IOException

-- | File and directory names are values of type String, whose
--   precise meaning is operating system dependent. Files can be opened,
--   yielding a handle which can then be used to operate on the contents of
--   that file.
type FilePath = String

-- | Identity functor and monad. (a non-strict monad)
newtype () => Identity a
Identity :: a -> Identity a
[runIdentity] :: Identity a -> a

-- | A set of values a.
data () => Set a

-- | A Map from keys k to values a.
--   
--   The Semigroup operation for Map is union, which
--   prefers values from the left operand. If m1 maps a key
--   k to a value a1, and m2 maps the same key
--   to a different value a2, then their union m1 <>
--   m2 maps k to a1.
data () => Map k a

-- | A class of types that can be fully evaluated.
class () => NFData a

-- | rnf should reduce its argument to normal form (that is, fully
--   evaluate all sub-components), and then return ().
--   
--   
Generic NFData deriving
--   
--   Starting with GHC 7.2, you can automatically derive instances for
--   types possessing a Generic instance.
--   
--   Note: Generic1 can be auto-derived starting with GHC 7.4
--   
--   
--   {-# LANGUAGE DeriveGeneric #-}
--   
--   import GHC.Generics (Generic, Generic1)
--   import Control.DeepSeq
--   
--   data Foo a = Foo a String
--                deriving (Eq, Generic, Generic1)
--   
--   instance NFData a => NFData (Foo a)
--   instance NFData1 Foo
--   
--   data Colour = Red | Green | Blue
--                 deriving Generic
--   
--   instance NFData Colour
--   
--   
--   Starting with GHC 7.10, the example above can be written more
--   concisely by enabling the new DeriveAnyClass extension:
--   
--   
--   {-# LANGUAGE DeriveGeneric, DeriveAnyClass #-}
--   
--   import GHC.Generics (Generic)
--   import Control.DeepSeq
--   
--   data Foo a = Foo a String
--                deriving (Eq, Generic, Generic1, NFData, NFData1)
--   
--   data Colour = Red | Green | Blue
--                 deriving (Generic, NFData)
--   
--   
--   
Compatibility with previous deepseq versions
--   
--   Prior to version 1.4.0.0, the default implementation of the rnf
--   method was defined as
--   
--   
--   rnf a = seq a ()
--   
--   
--   However, starting with deepseq-1.4.0.0, the default
--   implementation is based on DefaultSignatures allowing for
--   more accurate auto-derived NFData instances. If you need the
--   previously used exact default rnf method implementation
--   semantics, use
--   
--   
--   instance NFData Colour where rnf x = seq x ()
--   
--   
--   or alternatively
--   
--   
--   instance NFData Colour where rnf = rwhnf
--   
--   
--   or
--   
--   
--   {-# LANGUAGE BangPatterns #-}
--   instance NFData Colour where rnf !_ = ()
--   
rnf :: NFData a => a -> ()

-- | RealWorld is deeply magical. It is primitive, but it is
--   not unlifted (hence ptrArg). We never manipulate
--   values of type RealWorld; it's only used in the type system, to
--   parameterise State#.
data RealWorld

-- | A space-efficient representation of a Word8 vector, supporting
--   many efficient operations.
--   
--   A ByteString contains 8-bit bytes, or by using the operations
--   from Data.ByteString.Char8 it can be interpreted as containing
--   8-bit characters.
data () => ByteString
data () => DList a

-- | See examples in Control.Monad.Reader. Note, the partially
--   applied function type (->) r is a simple reader monad. See
--   the instance declaration below.
class Monad m => MonadReader r (m :: Type -> Type) | m -> r

-- | Retrieves the monad environment.
ask :: MonadReader r m => m r

-- | The reader monad transformer, which adds a read-only environment to
--   the given monad.
--   
--   The return function ignores the environment, while
--   >>= passes the inherited environment to both
--   subcomputations.
newtype () => ReaderT r (m :: Type -> Type) a
ReaderT :: (r -> m a) -> ReaderT r (m :: Type -> Type) a
[runReaderT] :: ReaderT r (m :: Type -> Type) a -> r -> m a

-- | The parameterizable reader monad.
--   
--   Computations are functions of a shared environment.
--   
--   The return function ignores the environment, while
--   >>= passes the inherited environment to both
--   subcomputations.
type Reader r = ReaderT r Identity

-- | SemiSequence was created to share code between
--   IsSequence and NonNull.
--   
--   Semi means SemiGroup A SemiSequence can
--   accommodate a SemiGroup such as NonEmpty or
--   NonNull A Monoid should be able to fill out
--   IsSequence.
--   
--   SemiSequence operations maintain the same type because they all
--   maintain the same number of elements or increase them. However, a
--   decreasing function such as filter may change they type. For example,
--   from NonEmpty to '[]' This type-changing function exists on
--   NonNull as nfilter
--   
--   filter and other such functions are placed in IsSequence
--   
--   NOTE: Like GrowingAppend, ideally we'd have a
--   Semigroup superclass constraint here, but that would pull in
--   more dependencies to this package than desired.
class (Integral Index seq, GrowingAppend seq) => SemiSequence seq where {
    
    -- | The type of the index of a sequence.
    type family Index seq;
}

-- | intersperse takes an element and intersperses that element
--   between the elements of the sequence.
--   
--   
--   > intersperse ',' "abcde"
--   "a,b,c,d,e"
--   
intersperse :: SemiSequence seq => Element seq -> seq -> seq

-- | Reverse a sequence
--   
--   
--   > reverse "hello world"
--   "dlrow olleh"
--   
reverse :: SemiSequence seq => seq -> seq

-- | find takes a predicate and a sequence and returns the first
--   element in the sequence matching the predicate, or Nothing if
--   there isn't an element that matches the predicate.
--   
--   
--   > find (== 5) [1 .. 10]
--   Just 5
--   
--   > find (== 15) [1 .. 10]
--   Nothing
--   
find :: SemiSequence seq => (Element seq -> Bool) -> seq -> Maybe (Element seq)

-- | Sort a sequence using an supplied element ordering function.
--   
--   
--   > let compare' x y = case compare x y of LT -> GT; EQ -> EQ; GT -> LT
--   > sortBy compare' [5,3,6,1,2,4]
--   [6,5,4,3,2,1]
--   
sortBy :: SemiSequence seq => (Element seq -> Element seq -> Ordering) -> seq -> seq

-- | Prepend an element onto a sequence.
--   
--   
--   > 4 `<a>cons</a>` [1,2,3]
--   [4,1,2,3]
--   
cons :: SemiSequence seq => Element seq -> seq -> seq

-- | Append an element onto a sequence.
--   
--   
--   > [1,2,3] `<a>snoc</a>` 4
--   [1,2,3,4]
--   
snoc :: SemiSequence seq => seq -> Element seq -> seq

-- | The type of the index of a sequence.
type family Index seq

-- | A map from keys to values. A map cannot contain duplicate keys; each
--   key can map to at most one value.
data () => HashMap k v

-- | A space efficient, packed, unboxed Unicode text type.
data () => Text

-- | This is the simplest representation of UTC. It consists of the day
--   number, and a time offset from midnight. Note that if a day has a leap
--   second added to it, it will have 86401 seconds.
data () => UTCTime
UTCTime :: Day -> DiffTime -> UTCTime

-- | the day
[utctDay] :: UTCTime -> Day

-- | the time from midnight, 0 <= t < 86401s (because of
--   leap-seconds)
[utctDayTime] :: UTCTime -> DiffTime
class Eq a => Hashable a
hashWithSalt :: Hashable a => Int -> a -> Int
hash :: Hashable a => a -> Int
class Monoid builder => Builder builder lazy | builder -> lazy, lazy -> builder
builderToLazy :: Builder builder lazy => builder -> lazy
flushBuilder :: Builder builder lazy => builder

-- | Haskell defines operations to read and write characters from and to
--   files, represented by values of type Handle. Each value of
--   this type is a handle: a record used by the Haskell run-time
--   system to manage I/O with file system objects. A handle has at
--   least the following properties:
--   
--   
--   
- whether it manages input or output or both;
--   
- whether it is open, closed or
--   semi-closed;
--   
- whether the object is seekable;
--   
- whether buffering is disabled, or enabled on a line or block
--   basis;
--   
- a buffer (whose length may be zero).
--   
--   
--   Most handles will also have a current I/O position indicating where
--   the next input or output operation will occur. A handle is
--   readable if it manages only input or both input and output;
--   likewise, it is writable if it manages only output or both
--   input and output. A handle is open when first allocated. Once
--   it is closed it can no longer be used for either input or output,
--   though an implementation cannot re-use its storage while references
--   remain to it. Handles are in the Show and Eq classes.
--   The string produced by showing a handle is system dependent; it should
--   include enough information to identify the handle for debugging. A
--   handle is equal according to == only to itself; no attempt is
--   made to compare the internal state of different handles for equality.
data () => Handle

-- | A bifunctor is a type constructor that takes two type arguments and is
--   a functor in both arguments. That is, unlike with
--   Functor, a type constructor such as Either does not need
--   to be partially applied for a Bifunctor instance, and the
--   methods in this class permit mapping functions over the Left
--   value or the Right value, or both at the same time.
--   
--   Formally, the class Bifunctor represents a bifunctor from
--   Hask -> Hask.
--   
--   Intuitively it is a bifunctor where both the first and second
--   arguments are covariant.
--   
--   You can define a Bifunctor by either defining bimap or
--   by defining both first and second. A partially applied
--   Bifunctor must be a Functor and the second method
--   must agree with fmap. From this it follows that:
--   
--   
--   second id = id
--   
--   
--   If you supply bimap, you should ensure that:
--   
--   
--   bimap id id ≡ id
--   
--   
--   If you supply first and second, ensure:
--   
--   
--   first id ≡ id
--   second id ≡ id
--   
--   
--   If you supply both, you should also ensure:
--   
--   
--   bimap f g ≡ first f . second g
--   
--   
--   These ensure by parametricity:
--   
--   
--   bimap  (f . g) (h . i) ≡ bimap f h . bimap g i
--   first  (f . g) ≡ first  f . first  g
--   second (f . g) ≡ second f . second g
--   
--   
--   Since 4.18.0.0 Functor is a superclass of 'Bifunctor.
class forall a. () => Functor p a => Bifunctor (p :: Type -> Type -> Type)

-- | Map over both arguments at the same time.
--   
--   
--   bimap f g ≡ first f . second g
--   
--   
--   
Examples
--   
--   
--   >>> bimap toUpper (+1) ('j', 3)
--   ('J',4)
--   
--   
--   
--   >>> bimap toUpper (+1) (Left 'j')
--   Left 'J'
--   
--   
--   
--   >>> bimap toUpper (+1) (Right 3)
--   Right 4
--   
bimap :: Bifunctor p => (a -> b) -> (c -> d) -> p a c -> p b d

-- | Map covariantly over the first argument.
--   
--   
--   first f ≡ bimap f id
--   
--   
--   
Examples
--   
--   
--   >>> first toUpper ('j', 3)
--   ('J',3)
--   
--   
--   
--   >>> first toUpper (Left 'j')
--   Left 'J'
--   
first :: Bifunctor p => (a -> b) -> p a c -> p b c

-- | Map covariantly over the second argument.
--   
--   
--   second ≡ bimap id
--   
--   
--   
Examples
--   
--   
--   >>> second (+1) ('j', 3)
--   ('j',4)
--   
--   
--   
--   >>> second (+1) (Right 3)
--   Right 4
--   
second :: Bifunctor p => (b -> c) -> p a b -> p a c

-- | A monad supporting atomic memory transactions.
data () => STM a

-- | The member functions of this class facilitate writing values of
--   primitive types to raw memory (which may have been allocated with the
--   above mentioned routines) and reading values from blocks of raw
--   memory. The class, furthermore, includes support for computing the
--   storage requirements and alignment restrictions of storable types.
--   
--   Memory addresses are represented as values of type Ptr
--   a, for some a which is an instance of class
--   Storable. The type argument to Ptr helps provide some
--   valuable type safety in FFI code (you can't mix pointers of different
--   types without an explicit cast), while helping the Haskell type system
--   figure out which marshalling method is needed for a given pointer.
--   
--   All marshalling between Haskell and a foreign language ultimately
--   boils down to translating Haskell data structures into the binary
--   representation of a corresponding data structure of the foreign
--   language and vice versa. To code this marshalling in Haskell, it is
--   necessary to manipulate primitive data types stored in unstructured
--   memory blocks. The class Storable facilitates this manipulation
--   on all types for which it is instantiated, which are the standard
--   basic types of Haskell, the fixed size Int types
--   (Int8, Int16, Int32, Int64), the fixed
--   size Word types (Word8, Word16, Word32,
--   Word64), StablePtr, all types from
--   Foreign.C.Types, as well as Ptr.
class () => Storable a

-- | a value of type STRef s a is a mutable variable in state
--   thread s, containing a value of type a
--   
--   
--   >>> :{
--   runST (do
--       ref <- newSTRef "hello"
--       x <- readSTRef ref
--       writeSTRef ref (x ++ "world")
--       readSTRef ref )
--   :}
--   "helloworld"
--   
data () => STRef s a

-- | Monads in which IO computations may be embedded. Any monad
--   built by applying a sequence of monad transformers to the IO
--   monad will be an instance of this class.
--   
--   Instances should satisfy the following laws, which state that
--   liftIO is a transformer of monads:
--   
--   
--   
- 
liftIO . return = return

--   
- 
liftIO (m >>= f) = liftIO m >>=
--   (liftIO . f)

--   
class Monad m => MonadIO (m :: Type -> Type)

-- | Lift a computation from the IO monad. This allows us to run IO
--   computations in any monadic stack, so long as it supports these kinds
--   of operations (i.e. IO is the base monad for the stack).
--   
--   
Example
--   
--   
--   import Control.Monad.Trans.State -- from the "transformers" library
--   
--   printState :: Show s => StateT s IO ()
--   printState = do
--     state <- get
--     liftIO $ print state
--   
--   
--   Had we omitted liftIO, we would have ended up with
--   this error:
--   
--   
--   • Couldn't match type ‘IO’ with ‘StateT s IO’
--    Expected type: StateT s IO ()
--      Actual type: IO ()
--   
--   
--   The important part here is the mismatch between StateT s IO
--   () and IO ().
--   
--   Luckily, we know of a function that takes an IO a and
--   returns an (m a): liftIO, enabling us to run
--   the program and see the expected results:
--   
--   
--   > evalStateT printState "hello"
--   "hello"
--   
--   > evalStateT printState 3
--   3
--   
liftIO :: MonadIO m => IO a -> m a

-- | Chan is an abstract type representing an unbounded FIFO
--   channel.
data () => Chan a

-- | Shared memory locations that support atomic memory transactions.
data () => TVar a

-- | The Down type allows you to reverse sort order conveniently. A
--   value of type Down a contains a value of type
--   a (represented as Down a).
--   
--   If a has an Ord instance associated with it
--   then comparing two values thus wrapped will give you the opposite of
--   their normal sort order. This is particularly useful when sorting in
--   generalised list comprehensions, as in: then sortWith by
--   Down x.
--   
--   
--   >>> compare True False
--   GT
--   
--   
--   
--   >>> compare (Down True) (Down False)
--   LT
--   
--   
--   If a has a Bounded instance then the wrapped
--   instance also respects the reversed ordering by exchanging the values
--   of minBound and maxBound.
--   
--   
--   >>> minBound :: Int
--   -9223372036854775808
--   
--   
--   
--   >>> minBound :: Down Int
--   Down 9223372036854775807
--   
--   
--   All other instances of Down a behave as they do for
--   a.
newtype () => Down a
Down :: a -> Down a

[getDown] :: Down a -> a

-- | A concrete, promotable proxy type, for use at the kind level. There
--   are no instances for this because it is intended at the kind level
--   only
data () => KProxy t
KProxy :: KProxy t

-- | See openFile
data () => IOMode
ReadMode :: IOMode
WriteMode :: IOMode
AppendMode :: IOMode
ReadWriteMode :: IOMode

-- | A mutable variable in the IO monad.
--   
--   
--   >>> import Data.IORef
--   
--   >>> r <- newIORef 0
--   
--   >>> readIORef r
--   0
--   
--   >>> writeIORef r 1
--   
--   >>> readIORef r
--   1
--   
--   >>> atomicWriteIORef r 2
--   
--   >>> readIORef r
--   2
--   
--   >>> modifyIORef' r (+ 1)
--   
--   >>> readIORef r
--   3
--   
--   >>> atomicModifyIORef' r (\a -> (a + 1, ()))
--   
--   >>> readIORef r
--   4
--   
--   
--   See also STRef and MVar.
data () => IORef a

-- | A mode that determines the effect of hSeek hdl mode i.
data () => SeekMode

-- | the position of hdl is set to i.
AbsoluteSeek :: SeekMode

-- | the position of hdl is set to offset i from the
--   current position.
RelativeSeek :: SeekMode

-- | the position of hdl is set to offset i from the end
--   of the file.
SeekFromEnd :: SeekMode

-- | Three kinds of buffering are supported: line-buffering,
--   block-buffering or no-buffering. These modes have the following
--   effects. For output, items are written out, or flushed, from
--   the internal buffer according to the buffer mode:
--   
--   
--   
- line-buffering: the entire output buffer is flushed
--   whenever a newline is output, the buffer overflows, a hFlush is
--   issued, or the handle is closed.
--   
- block-buffering: the entire buffer is written out whenever
--   it overflows, a hFlush is issued, or the handle is closed.
--   
- no-buffering: output is written immediately, and never
--   stored in the buffer.
--   
--   
--   An implementation is free to flush the buffer more frequently, but not
--   less frequently, than specified above. The output buffer is emptied as
--   soon as it has been written out.
--   
--   Similarly, input occurs according to the buffer mode for the handle:
--   
--   
--   
- line-buffering: when the buffer for the handle is not
--   empty, the next item is obtained from the buffer; otherwise, when the
--   buffer is empty, characters up to and including the next newline
--   character are read into the buffer. No characters are available until
--   the newline character is available or the buffer is full.
--   
- block-buffering: when the buffer for the handle becomes
--   empty, the next block of data is read into the buffer.
--   
- no-buffering: the next input item is read and returned. The
--   hLookAhead operation implies that even a no-buffered handle may
--   require a one-character buffer.
--   
--   
--   The default buffering mode when a handle is opened is
--   implementation-dependent and may depend on the file system object
--   which is attached to that handle. For most implementations, physical
--   files will normally be block-buffered and terminals will normally be
--   line-buffered.
data () => BufferMode

-- | buffering is disabled if possible.
NoBuffering :: BufferMode

-- | line-buffering should be enabled if possible.
LineBuffering :: BufferMode

-- | block-buffering should be enabled if possible. The size of the buffer
--   is n items if the argument is Just n and is
--   otherwise implementation-dependent.
BlockBuffering :: Maybe Int -> BufferMode

-- | An abstract type that contains a value for each variant of
--   IOException.
data () => IOErrorType

-- | Superclass for asynchronous exceptions.
data () => SomeAsyncException
SomeAsyncException :: e -> SomeAsyncException

-- | Generalized version of Handler
data () => Handler (m :: Type -> Type) a
Handler :: (e -> m a) -> Handler (m :: Type -> Type) a

-- | QSemN is a quantity semaphore in which the resource is acquired
--   and released in units of one. It provides guaranteed FIFO ordering for
--   satisfying blocked waitQSemN calls.
--   
--   The pattern
--   
--   
--   bracket_ (waitQSemN n) (signalQSemN n) (...)
--   
--   
--   is safe; it never loses any of the resource.
data () => QSemN

-- | QSem is a quantity semaphore in which the resource is acquired
--   and released in units of one. It provides guaranteed FIFO ordering for
--   satisfying blocked waitQSem calls.
--   
--   The pattern
--   
--   
--   bracket_ waitQSem signalQSem (...)
--   
--   
--   is safe; it never loses a unit of the resource.
data () => QSem

-- | Provide a Semigroup for an arbitrary Monoid.
--   
--   NOTE: This is not needed anymore since Semigroup became
--   a superclass of Monoid in base-4.11 and this newtype be
--   deprecated at some point in the future.
data () => WrappedMonoid m
data () => Deque (v :: Type -> Type -> Type) s a
data () => Conc (m :: Type -> Type) a

-- | General-purpose finite sequences.
data () => Seq a

-- | A set of integers.
data () => IntSet

-- | A map of integers to values a.
data () => IntMap a

-- | A set of values. A set cannot contain duplicate values.
data () => HashSet a
data () => Vector a
class (Vector Vector a, MVector MVector a) => Unbox a
type SVector = Vector
type UVector = Vector
type LByteString = ByteString
type LText = Text

-- | The Modified Julian Day is a standard count of days, with zero being
--   the day 1858-11-17.
newtype () => Day
ModifiedJulianDay :: Integer -> Day
[toModifiedJulianDay] :: Day -> Integer
newtype () => Concurrently (m :: Type -> Type) a
Concurrently :: m a -> Concurrently (m :: Type -> Type) a
[runConcurrently] :: Concurrently (m :: Type -> Type) a -> m a

-- | TBQueue is an abstract type representing a bounded FIFO
--   channel.
data () => TBQueue a

-- | TChan is an abstract type representing an unbounded FIFO
--   channel.
data () => TChan a

-- | A TMVar is a synchronising variable, used for communication
--   between concurrent threads. It can be thought of as a box, which may
--   be empty or full.
data () => TMVar a

-- | TQueue is an abstract type representing an unbounded FIFO
--   channel.
data () => TQueue a
data () => AsyncExceptionWrapper
AsyncExceptionWrapper :: e -> AsyncExceptionWrapper
data () => SyncExceptionWrapper
SyncExceptionWrapper :: e -> SyncExceptionWrapper
data () => StringException
StringException :: String -> CallStack -> StringException
data () => ConcException
EmptyWithNoAlternative :: ConcException
data () => Memoized a
class MonadIO m => MonadUnliftIO (m :: Type -> Type)
withRunInIO :: MonadUnliftIO m => ((forall a. () => m a -> IO a) -> IO b) -> m b
class Monad m => PrimMonad (m :: Type -> Type) where {
    type family PrimState (m :: Type -> Type);
}
type family PrimState (m :: Type -> Type)
data () => MutVar s a
MutVar :: MutVar# s a -> MutVar s a
class () => Prim a
type MutableDeque c = (MutableQueue c, MutablePushFront c, MutablePopBack c)
type MutableStack c = (MutablePopFront c, MutablePushFront c)
type MutableQueue c = (MutablePopFront c, MutablePushBack c)
class MutableCollection c => MutablePushBack c
pushBack :: (MutablePushBack c, PrimMonad m, PrimState m ~ MCState c) => c -> CollElement c -> m ()
class MutableCollection c => MutablePopBack c
popBack :: (MutablePopBack c, PrimMonad m, PrimState m ~ MCState c) => c -> m (Maybe (CollElement c))
class MutableCollection c => MutablePushFront c
pushFront :: (MutablePushFront c, PrimMonad m, PrimState m ~ MCState c) => c -> CollElement c -> m ()
class MutableCollection c => MutablePopFront c
popFront :: (MutablePopFront c, PrimMonad m, PrimState m ~ MCState c) => c -> m (Maybe (CollElement c))
class MutableContainer c => MutableCollection c where {
    type family CollElement c;
}
newColl :: (MutableCollection c, PrimMonad m, PrimState m ~ MCState c) => m c
type family CollElement c
class MutableRef c => MutableAtomicRef c
atomicModifyRef :: (MutableAtomicRef c, PrimMonad m, PrimState m ~ MCState c) => c -> (RefElement c -> (RefElement c, a)) -> m a
atomicModifyRef' :: (MutableAtomicRef c, PrimMonad m, PrimState m ~ MCState c) => c -> (RefElement c -> (RefElement c, a)) -> m a
class MutableContainer c => MutableRef c where {
    type family RefElement c;
}
newRef :: (MutableRef c, PrimMonad m, PrimState m ~ MCState c) => RefElement c -> m c
readRef :: (MutableRef c, PrimMonad m, PrimState m ~ MCState c) => c -> m (RefElement c)
writeRef :: (MutableRef c, PrimMonad m, PrimState m ~ MCState c) => c -> RefElement c -> m ()
modifyRef :: (MutableRef c, PrimMonad m, PrimState m ~ MCState c) => c -> (RefElement c -> RefElement c) -> m ()
modifyRef' :: (MutableRef c, PrimMonad m, PrimState m ~ MCState c) => c -> (RefElement c -> RefElement c) -> m ()
type family RefElement c
class () => MutableContainer c where {
    type family MCState c;
}
type family MCState c
type IOBRef = BRef PrimState IO
data () => BRef s a
data () => DLList s a
type BDeque = Deque MVector
type SDeque = Deque MVector
type UDeque = Deque MVector
type IOPRef = PRef PrimState IO
data () => PRef s a
type IOSRef = SRef PrimState IO
data () => SRef s a
type IOURef = URef PrimState IO
data () => URef s a
data () => TBChan a
data () => TBMChan a
data () => TBMQueue a
data () => TMChan a
data () => TMQueue a

-- | Provides a Foldable for an arbitrary MonoFoldable.
data () => WrappedMono mono a
[WrappedMono] :: forall mono a. Element mono ~ a => mono -> WrappedMono mono a

-- | Provides a MonoFoldable, MonoFunctor or
--   MonoPointed for an arbitrary Foldable, Functor or
--   Applicative.
--   
--   Useful for, e.g., passing a Foldable type you don't own into a
--   function that expects a MonoFoldable.
--   
--   
--   // package A
--   data MyList a = MyList [a] deriving Foldable
--   
--   // package B
--   process :: MonoFoldable mono => mono -> IO ()
--   
--   // package C
--   process (WrappedPoly (MyList []))
--   
newtype () => WrappedPoly (f :: Type -> Type) a
WrappedPoly :: f a -> WrappedPoly (f :: Type -> Type) a
[unwrapPoly] :: WrappedPoly (f :: Type -> Type) a -> f a

-- | Containers which, when two values are combined, the combined length is
--   no less than the larger of the two inputs. In code:
--   
--   
--   olength (x <> y) >= max (olength x) (olength y)
--   
--   
--   This class has no methods, and is simply used to assert that this law
--   holds, in order to provide guarantees of correctness (see, for
--   instance, Data.NonNull).
--   
--   This should have a Semigroup superclass constraint, however,
--   due to Semigroup only recently moving to base, some packages
--   do not provide instances.
class MonoFoldable mono => GrowingAppend mono

-- | Typeclass for monomorphic containers where it is always okay to
--   "extract" a value from with oextract, and where you can
--   extrapolate any "extracting" function to be a function on the whole
--   part with oextend.
--   
--   oextend and oextract should work together following the
--   laws:
--   
--   
--   oextend oextract      = id
--   oextract . oextend f  = f
--   oextend f . oextend g = oextend (f . oextend g)
--   
--   
--   As an intuition, oextend f uses f to "build
--   up" a new mono with pieces from the old one received by
--   f.
class MonoFunctor mono => MonoComonad mono

-- | Extract an element from mono. Can be thought of as a dual
--   concept to opoint.
oextract :: MonoComonad mono => mono -> Element mono

-- | Extend a mono -> Element mono function to be
--   a mono -> mono; that is, builds a new mono from
--   the old one by using pieces glimpsed from the given function.
oextend :: MonoComonad mono => (mono -> Element mono) -> mono -> mono

-- | Typeclass for monomorphic containers that an element can be lifted
--   into.
--   
--   For any MonoFunctor, the following law holds:
--   
--   
--   omap f . opoint = opoint . f
--   
class () => MonoPointed mono

-- | Lift an element into a monomorphic container.
--   
--   opoint is the same as pure for an Applicative
opoint :: MonoPointed mono => Element mono -> mono

-- | Monomorphic containers that can be traversed from left to right.
--   
--   NOTE: Due to limitations with the role system, GHC is yet unable to
--   provide newtype-derivation of MonoTraversable. See
--   https://stackoverflow.com/questions/49776924/newtype-deriving-issequence.
class (MonoFunctor mono, MonoFoldable mono) => MonoTraversable mono

-- | Map each element of a monomorphic container to an action, evaluate
--   these actions from left to right, and collect the results.
otraverse :: (MonoTraversable mono, Applicative f) => (Element mono -> f (Element mono)) -> mono -> f mono

-- | Map each element of a monomorphic container to a monadic action,
--   evaluate these actions from left to right, and collect the results.
omapM :: (MonoTraversable mono, Applicative m) => (Element mono -> m (Element mono)) -> mono -> m mono

-- | Monomorphic containers that can be folded.
class () => MonoFoldable mono

-- | Map each element of a monomorphic container to a Monoid and
--   combine the results.
ofoldMap :: (MonoFoldable mono, Monoid m) => (Element mono -> m) -> mono -> m

-- | Right-associative fold of a monomorphic container.
ofoldr :: MonoFoldable mono => (Element mono -> b -> b) -> b -> mono -> b

-- | Strict left-associative fold of a monomorphic container.
ofoldl' :: MonoFoldable mono => (a -> Element mono -> a) -> a -> mono -> a

-- | Convert a monomorphic container to a list.
otoList :: MonoFoldable mono => mono -> [Element mono]

-- | Are all of the elements in a monomorphic container converted to
--   booleans True?
oall :: MonoFoldable mono => (Element mono -> Bool) -> mono -> Bool

-- | Are any of the elements in a monomorphic container converted to
--   booleans True?
oany :: MonoFoldable mono => (Element mono -> Bool) -> mono -> Bool

-- | Is the monomorphic container empty?
onull :: MonoFoldable mono => mono -> Bool

-- | Length of a monomorphic container, returns a Int.
olength :: MonoFoldable mono => mono -> Int

-- | Length of a monomorphic container, returns a Int64.
olength64 :: MonoFoldable mono => mono -> Int64

-- | Compare the length of a monomorphic container and a given number.
ocompareLength :: (MonoFoldable mono, Integral i) => mono -> i -> Ordering

-- | Map each element of a monomorphic container to an action, evaluate
--   these actions from left to right, and ignore the results.
otraverse_ :: (MonoFoldable mono, Applicative f) => (Element mono -> f b) -> mono -> f ()

-- | ofor_ is otraverse_ with its arguments flipped.
ofor_ :: (MonoFoldable mono, Applicative f) => mono -> (Element mono -> f b) -> f ()

-- | Map each element of a monomorphic container to a monadic action,
--   evaluate these actions from left to right, and ignore the results.
omapM_ :: (MonoFoldable mono, Applicative m) => (Element mono -> m ()) -> mono -> m ()

-- | oforM_ is omapM_ with its arguments flipped.
oforM_ :: (MonoFoldable mono, Applicative m) => mono -> (Element mono -> m ()) -> m ()

-- | Monadic fold over the elements of a monomorphic container, associating
--   to the left.
ofoldlM :: (MonoFoldable mono, Monad m) => (a -> Element mono -> m a) -> a -> mono -> m a

-- | Map each element of a monomorphic container to a semigroup, and
--   combine the results.
--   
--   Note: this is a partial function. On an empty MonoFoldable, it
--   will throw an exception.
--   
--   See ofoldMap1 from Data.NonNull for a total version
--   of this function.
ofoldMap1Ex :: (MonoFoldable mono, Semigroup m) => (Element mono -> m) -> mono -> m

-- | Right-associative fold of a monomorphic container with no base
--   element.
--   
--   Note: this is a partial function. On an empty MonoFoldable, it
--   will throw an exception.
--   
--   See ofoldr1 from Data.NonNull for a total version of
--   this function.
ofoldr1Ex :: MonoFoldable mono => (Element mono -> Element mono -> Element mono) -> mono -> Element mono

-- | Strict left-associative fold of a monomorphic container with no base
--   element.
--   
--   Note: this is a partial function. On an empty MonoFoldable, it
--   will throw an exception.
--   
--   See ofoldl1' from Data.NonNull for a total version of
--   this function.
ofoldl1Ex' :: MonoFoldable mono => (Element mono -> Element mono -> Element mono) -> mono -> Element mono

-- | Get the first element of a monomorphic container.
--   
--   Note: this is a partial function. On an empty MonoFoldable, it
--   will throw an exception.
--   
--   See head from Data.NonNull for a total version of
--   this function.
headEx :: MonoFoldable mono => mono -> Element mono

-- | Get the last element of a monomorphic container.
--   
--   Note: this is a partial function. On an empty MonoFoldable, it
--   will throw an exception.
--   
--   See last from Data.NonNull for a total version of
--   this function.
lastEx :: MonoFoldable mono => mono -> Element mono

-- | Equivalent to headEx.
unsafeHead :: MonoFoldable mono => mono -> Element mono

-- | Equivalent to lastEx.
unsafeLast :: MonoFoldable mono => mono -> Element mono

-- | Get the maximum element of a monomorphic container, using a supplied
--   element ordering function.
--   
--   Note: this is a partial function. On an empty MonoFoldable, it
--   will throw an exception.
--   
--   See maximumBy from Data.NonNull for a total version
--   of this function.
maximumByEx :: MonoFoldable mono => (Element mono -> Element mono -> Ordering) -> mono -> Element mono

-- | Get the minimum element of a monomorphic container, using a supplied
--   element ordering function.
--   
--   Note: this is a partial function. On an empty MonoFoldable, it
--   will throw an exception.
--   
--   See minimumBy from Data.NonNull for a total version
--   of this function.
minimumByEx :: MonoFoldable mono => (Element mono -> Element mono -> Ordering) -> mono -> Element mono

-- | Checks if the monomorphic container includes the supplied element.
oelem :: MonoFoldable mono => Element mono -> mono -> Bool

-- | Checks if the monomorphic container does not include the supplied
--   element.
onotElem :: MonoFoldable mono => Element mono -> mono -> Bool

-- | Monomorphic containers that can be mapped over.
class () => MonoFunctor mono

-- | Map over a monomorphic container
omap :: MonoFunctor mono => (Element mono -> Element mono) -> mono -> mono

-- | Type family for getting the type of the elements of a monomorphic
--   container.
type family Element mono

-- | Textual data which can be encoded to and decoded from UTF8.
class (Textual textual, IsSequence binary) => Utf8 textual binary | textual -> binary, binary -> textual

-- | Encode from textual to binary using UTF-8 encoding
encodeUtf8 :: Utf8 textual binary => textual -> binary

-- | Note that this function is required to be pure. In the case of a
--   decoding error, Unicode replacement characters must be used.
decodeUtf8 :: Utf8 textual binary => binary -> textual

-- | Lazy sequences containing strict chunks of data.
class (IsSequence lazy, IsSequence strict) => LazySequence lazy strict | lazy -> strict, strict -> lazy
toChunks :: LazySequence lazy strict => lazy -> [strict]
fromChunks :: LazySequence lazy strict => [strict] -> lazy
toStrict :: LazySequence lazy strict => lazy -> strict
fromStrict :: LazySequence lazy strict => strict -> lazy

-- | A typeclass for sequences whose elements are Chars.
class (IsSequence t, IsString t, Element t ~ Char) => Textual t

-- | Break up a textual sequence into a list of words, which were delimited
--   by white space.
--   
--   
--   > words "abc  def ghi"
--   ["abc","def","ghi"]
--   
words :: Textual t => t -> [t]

-- | Join a list of textual sequences using separating spaces.
--   
--   
--   > unwords ["abc","def","ghi"]
--   "abc def ghi"
--   
unwords :: (Textual t, Element seq ~ t, MonoFoldable seq) => seq -> t

-- | Break up a textual sequence at newline characters.
--   
--   
--   > lines "hello\nworld"
--   ["hello","world"]
--   
lines :: Textual t => t -> [t]

-- | Join a list of textual sequences using newlines.
--   
--   
--   > unlines ["abc","def","ghi"]
--   "abc\ndef\nghi"
--   
unlines :: (Textual t, Element seq ~ t, MonoFoldable seq) => seq -> t

-- | Convert a textual sequence to lower-case.
--   
--   
--   > toLower "HELLO WORLD"
--   "hello world"
--   
toLower :: Textual t => t -> t

-- | Convert a textual sequence to upper-case.
--   
--   
--   > toUpper "hello world"
--   "HELLO WORLD"
--   
toUpper :: Textual t => t -> t

-- | Convert a textual sequence to folded-case.
--   
--   Slightly different from toLower, see
--   Data.Text.toCaseFold
toCaseFold :: Textual t => t -> t

-- | Split a textual sequence into two parts, split at the first space.
--   
--   
--   > breakWord "hello world"
--   ("hello","world")
--   
breakWord :: Textual t => t -> (t, t)

-- | Split a textual sequence into two parts, split at the newline.
--   
--   
--   > breakLine "abc\ndef"
--   ("abc","def")
--   
breakLine :: Textual t => t -> (t, t)

-- | Sequence Laws:
--   
--   
--   fromList . otoList = id
--   fromList (x <> y) = fromList x <> fromList y
--   otoList (fromList x <> fromList y) = x <> y
--   
class (Monoid seq, MonoTraversable seq, SemiSequence seq, MonoPointed seq) => IsSequence seq

-- | Convert a list to a sequence.
--   
--   
--   > fromList [a, b, c] :: Text
--   "abc"
--   
fromList :: IsSequence seq => [Element seq] -> seq

-- | lengthIndex returns the length of a sequence as
--   Index seq.
lengthIndex :: IsSequence seq => seq -> Index seq

-- | break applies a predicate to a sequence, and returns a tuple
--   where the first element is the longest prefix (possibly empty) of
--   elements that do not satisfy the predicate. The second element
--   of the tuple is the remainder of the sequence.
--   
--   break p is equivalent to span (not
--   . p)
--   
--   
--   > break (> 3) (fromList [1,2,3,4,1,2,3,4] :: Vector Int)
--   (fromList [1,2,3],fromList [4,1,2,3,4])
--   
--   > break (< z) (fromList "abc" :: Text)
--   ("","abc")
--   
--   > break (> z) (fromList "abc" :: Text)
--   ("abc","")
--   
break :: IsSequence seq => (Element seq -> Bool) -> seq -> (seq, seq)

-- | span applies a predicate to a sequence, and returns a tuple
--   where the first element is the longest prefix (possibly empty) that
--   does satisfy the predicate. The second element of the tuple is
--   the remainder of the sequence.
--   
--   span p xs is equivalent to (takeWhile p xs,
--   dropWhile p xs)
--   
--   
--   > span (< 3) (fromList [1,2,3,4,1,2,3,4] :: Vector Int)
--   (fromList [1,2],fromList [3,4,1,2,3,4])
--   
--   > span (< z) (fromList "abc" :: Text)
--   ("abc","")
--   
--   > span (< 0) 1,2,3
--   
span :: IsSequence seq => (Element seq -> Bool) -> seq -> (seq, seq)

-- | dropWhile returns the suffix remaining after takeWhile.
--   
--   
--   > dropWhile (< 3) [1,2,3,4,5,1,2,3]
--   [3,4,5,1,2,3]
--   
--   > dropWhile (< z) (fromList "abc" :: Text)
--   ""
--   
dropWhile :: IsSequence seq => (Element seq -> Bool) -> seq -> seq

-- | takeWhile applies a predicate to a sequence, and returns the
--   longest prefix (possibly empty) of the sequence of elements that
--   satisfy the predicate.
--   
--   
--   > takeWhile (< 3) [1,2,3,4,5,1,2,3]
--   [1,2]
--   
--   > takeWhile (< z) (fromList "abc" :: Text)
--   "abc"
--   
takeWhile :: IsSequence seq => (Element seq -> Bool) -> seq -> seq

-- | splitAt n se returns a tuple where the first element
--   is the prefix of the sequence se with length n, and
--   the second element is the remainder of the sequence.
--   
--   
--   > splitAt 6 "Hello world!"
--   ("Hello ","world!")
--   
--   > splitAt 3 (fromList [1,2,3,4,5] :: Vector Int)
--   (fromList [1,2,3],fromList [4,5])
--   
splitAt :: IsSequence seq => Index seq -> seq -> (seq, seq)

-- | Equivalent to splitAt.
unsafeSplitAt :: IsSequence seq => Index seq -> seq -> (seq, seq)

-- | take n returns the prefix of a sequence of length
--   n, or the sequence itself if n > olength
--   seq.
--   
--   
--   > take 3 "abcdefg"
--   "abc"
--   > take 4 (fromList [1,2,3,4,5,6] :: Vector Int)
--   fromList [1,2,3,4]
--   
take :: IsSequence seq => Index seq -> seq -> seq

-- | Equivalent to take.
unsafeTake :: IsSequence seq => Index seq -> seq -> seq

-- | drop n returns the suffix of a sequence after the
--   first n elements, or an empty sequence if n >
--   olength seq.
--   
--   
--   > drop 3 "abcdefg"
--   "defg"
--   > drop 4 (fromList [1,2,3,4,5,6] :: Vector Int)
--   fromList [5,6]
--   
drop :: IsSequence seq => Index seq -> seq -> seq

-- | Equivalent to drop
unsafeDrop :: IsSequence seq => Index seq -> seq -> seq

-- | Same as drop but drops from the end of the sequence instead.
--   
--   
--   > dropEnd 3 "abcdefg"
--   "abcd"
--   > dropEnd 4 (fromList [1,2,3,4,5,6] :: Vector Int)
--   fromList [1,2]
--   
dropEnd :: IsSequence seq => Index seq -> seq -> seq

-- | partition takes a predicate and a sequence and returns the pair
--   of sequences of elements which do and do not satisfy the predicate.
--   
--   
--   partition p se = (filter p se, filter (not . p) se)
--   
partition :: IsSequence seq => (Element seq -> Bool) -> seq -> (seq, seq)

-- | uncons returns the tuple of the first element of a sequence and
--   the rest of the sequence, or Nothing if the sequence is empty.
--   
--   
--   > uncons (fromList [1,2,3,4] :: Vector Int)
--   Just (1,fromList [2,3,4])
--   
--   > uncons ([] :: [Int])
--   Nothing
--   
uncons :: IsSequence seq => seq -> Maybe (Element seq, seq)

-- | unsnoc returns the tuple of the init of a sequence and the last
--   element, or Nothing if the sequence is empty.
--   
--   
--   > unsnoc (fromList [1,2,3,4] :: Vector Int)
--   Just (fromList [1,2,3],4)
--   
--   > unsnoc ([] :: [Int])
--   Nothing
--   
unsnoc :: IsSequence seq => seq -> Maybe (seq, Element seq)

-- | filter given a predicate returns a sequence of all elements
--   that satisfy the predicate.
--   
--   
--   > filter (< 5) [1 .. 10]
--   [1,2,3,4]
--   
filter :: IsSequence seq => (Element seq -> Bool) -> seq -> seq

-- | The monadic version of filter.
filterM :: (IsSequence seq, Monad m) => (Element seq -> m Bool) -> seq -> m seq

-- | replicate n x is a sequence of length n with
--   x as the value of every element.
--   
--   
--   > replicate 10 a :: Text
--   "aaaaaaaaaa"
--   
replicate :: IsSequence seq => Index seq -> Element seq -> seq

-- | The monadic version of replicateM.
replicateM :: (IsSequence seq, Monad m) => Index seq -> m (Element seq) -> m seq

-- | group takes a sequence and returns a list of sequences such
--   that the concatenation of the result is equal to the argument. Each
--   subsequence in the result contains only equal elements, using the
--   supplied equality test.
--   
--   
--   > groupBy (==) Mississippi
--   [M,"i","ss","i","ss","i","pp","i"]
--   
groupBy :: IsSequence seq => (Element seq -> Element seq -> Bool) -> seq -> [seq]

-- | Similar to standard groupBy, but operates on the whole
--   collection, not just the consecutive items.
groupAllOn :: (IsSequence seq, Eq b) => (Element seq -> b) -> seq -> [seq]

-- | subsequences returns a list of all subsequences of the
--   argument.
--   
--   
--   > subsequences "abc"
--   ["","a","b","ab","c","ac","bc","abc"]
--   
subsequences :: IsSequence seq => seq -> [seq]

-- | permutations returns a list of all permutations of the
--   argument.
--   
--   
--   > permutations "abc"
--   ["abc","bac","cba","bca","cab","acb"]
--   
permutations :: IsSequence seq => seq -> [seq]

-- | Unsafe
--   
--   Get the tail of a sequence, throw an exception if the sequence is
--   empty.
--   
--   
--   > tailEx [1,2,3]
--   [2,3]
--   
tailEx :: IsSequence seq => seq -> seq

-- | Safe version of tailEx.
--   
--   Returns Nothing instead of throwing an exception when
--   encountering an empty monomorphic container.
tailMay :: IsSequence seq => seq -> Maybe seq

-- | Unsafe
--   
--   Get the init of a sequence, throw an exception if the sequence is
--   empty.
--   
--   
--   > initEx [1,2,3]
--   [1,2]
--   
initEx :: IsSequence seq => seq -> seq

-- | Safe version of initEx.
--   
--   Returns Nothing instead of throwing an exception when
--   encountering an empty monomorphic container.
initMay :: IsSequence seq => seq -> Maybe seq

-- | Equivalent to tailEx.
unsafeTail :: IsSequence seq => seq -> seq

-- | Equivalent to initEx.
unsafeInit :: IsSequence seq => seq -> seq

-- | Get the element of a sequence at a certain index, returns
--   Nothing if that index does not exist.
--   
--   
--   > index (fromList [1,2,3] :: Vector Int) 1
--   Just 2
--   > index (fromList [1,2,3] :: Vector Int) 4
--   Nothing
--   
index :: IsSequence seq => seq -> Index seq -> Maybe (Element seq)

-- | Unsafe
--   
--   Get the element of a sequence at a certain index, throws an exception
--   if the index does not exist.
indexEx :: IsSequence seq => seq -> Index seq -> Element seq

-- | Equivalent to indexEx.
unsafeIndex :: IsSequence seq => seq -> Index seq -> Element seq

-- | splitWhen splits a sequence 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. The number of
--   resulting components is greater by one than number of separators.
--   
--   Since 0.9.3
splitWhen :: IsSequence seq => (Element seq -> Bool) -> seq -> [seq]

-- | Returns all the final segments of seq with the longest first.
--   
--   
--   > tails [1,2]
--   [[1,2],[2],[]]
--   > tails []
--   [[]]
--   
tails :: IsSequence seq => seq -> [seq]

-- | Return all the initial segments of seq with the shortest
--   first.
--   
--   
--   > inits [1,2]
--   [[],[1],[1,2]]
--   > inits []
--   [[]]
--   
inits :: IsSequence seq => seq -> [seq]

-- | Return all the pairs of inital and final segments of seq.
--   
--   
--   > initTails [1,2]
--   [([],[1,2]),([1],[2]),([1,2],[])]
--   > initTails []
--   [([],[])]
--   
initTails :: IsSequence seq => seq -> [(seq, seq)]

-- | Type class for maps whose keys can be converted into sets.
class SetContainer set => HasKeysSet set where {
    
    -- | Type of the key set.
    type family KeySet set;
}

-- | Convert a map into a set of its keys.
keysSet :: HasKeysSet set => set -> KeySet set

-- | Type of the key set.
type family KeySet set

-- | Zip operations on MonoFunctors.
class MonoFunctor mono => MonoZip mono

-- | Combine each element of two MonoZips using a supplied function.
ozipWith :: MonoZip mono => (Element mono -> Element mono -> Element mono) -> mono -> mono -> mono

-- | Take two MonoZips and return a list of the pairs of their
--   elements.
ozip :: MonoZip mono => mono -> mono -> [(Element mono, Element mono)]

-- | Take a list of pairs of elements and return a MonoZip of the
--   first components and a MonoZip of the second components.
ounzip :: MonoZip mono => [(Element mono, Element mono)] -> (mono, mono)

-- | Polymorphic typeclass for interacting with different set types
class (SetContainer set, Element set ~ ContainerKey set) => IsSet set

-- | Insert a value into a set.
insertSet :: IsSet set => Element set -> set -> set

-- | Delete a value from a set.
deleteSet :: IsSet set => Element set -> set -> set

-- | Create a set from a single element.
singletonSet :: IsSet set => Element set -> set

-- | Convert a list to a set.
setFromList :: IsSet set => [Element set] -> set

-- | Convert a set to a list.
setToList :: IsSet set => set -> [Element set]

-- | Filter values in a set.
filterSet :: IsSet set => (Element set -> Bool) -> set -> set

-- | Polymorphic typeclass for interacting with different map types
class (MonoTraversable map, SetContainer map) => IsMap map where {
    
    -- | In some cases, <a>MapValue</a> and <a>Element</a> will be different,
    --   e.g., the <a>IsMap</a> instance of associated lists.
    type family MapValue map;
}

-- | Look up a value in a map with a specified key.
lookup :: IsMap map => ContainerKey map -> map -> Maybe (MapValue map)

-- | Insert a key-value pair into a map.
insertMap :: IsMap map => ContainerKey map -> MapValue map -> map -> map

-- | Delete a key-value pair of a map using a specified key.
deleteMap :: IsMap map => ContainerKey map -> map -> map

-- | Create a map from a single key-value pair.
singletonMap :: IsMap map => ContainerKey map -> MapValue map -> map

-- | Convert a list of key-value pairs to a map
mapFromList :: IsMap map => [(ContainerKey map, MapValue map)] -> map

-- | Convert a map to a list of key-value pairs.
mapToList :: IsMap map => map -> [(ContainerKey map, MapValue map)]

-- | Like lookup, but uses a default value when the key does not
--   exist in the map.
findWithDefault :: IsMap map => MapValue map -> ContainerKey map -> map -> MapValue map

-- | Insert a key-value pair into a map.
--   
--   Inserts the value directly if the key does not exist in the map.
--   Otherwise, apply a supplied function that accepts the new value and
--   the previous value and insert that result into the map.
insertWith :: IsMap map => (MapValue map -> MapValue map -> MapValue map) -> ContainerKey map -> MapValue map -> map -> map

-- | Insert a key-value pair into a map.
--   
--   Inserts the value directly if the key does not exist in the map.
--   Otherwise, apply a supplied function that accepts the key, the new
--   value, and the previous value and insert that result into the map.
insertWithKey :: IsMap map => (ContainerKey map -> MapValue map -> MapValue map -> MapValue map) -> ContainerKey map -> MapValue map -> map -> map

-- | Insert a key-value pair into a map, return the previous key's value if
--   it existed.
--   
--   Inserts the value directly if the key does not exist in the map.
--   Otherwise, apply a supplied function that accepts the key, the new
--   value, and the previous value and insert that result into the map.
insertLookupWithKey :: IsMap map => (ContainerKey map -> MapValue map -> MapValue map -> MapValue map) -> ContainerKey map -> MapValue map -> map -> (Maybe (MapValue map), map)

-- | Apply a function to the value of a given key.
--   
--   Returns the input map when the key-value pair does not exist.
adjustMap :: IsMap map => (MapValue map -> MapValue map) -> ContainerKey map -> map -> map

-- | Equivalent to adjustMap, but the function accepts the key, as
--   well as the previous value.
adjustWithKey :: IsMap map => (ContainerKey map -> MapValue map -> MapValue map) -> ContainerKey map -> map -> map

-- | Apply a function to the value of a given key.
--   
--   If the function returns Nothing, this deletes the key-value
--   pair.
--   
--   Returns the input map when the key-value pair does not exist.
updateMap :: IsMap map => (MapValue map -> Maybe (MapValue map)) -> ContainerKey map -> map -> map

-- | Equivalent to updateMap, but the function accepts the key, as
--   well as the previous value.
updateWithKey :: IsMap map => (ContainerKey map -> MapValue map -> Maybe (MapValue map)) -> ContainerKey map -> map -> map

-- | Apply a function to the value of a given key.
--   
--   If the map does not contain the key this returns Nothing and
--   the input map.
--   
--   If the map does contain the key but the function returns
--   Nothing, this returns the previous value and the map with the
--   key-value pair removed.
--   
--   If the map contains the key and the function returns a value, this
--   returns the new value and the map with the key-value pair with the new
--   value.
updateLookupWithKey :: IsMap map => (ContainerKey map -> MapValue map -> Maybe (MapValue map)) -> ContainerKey map -> map -> (Maybe (MapValue map), map)

-- | Update/Delete the value of a given key.
--   
--   Applies a function to previous value of a given key, if it results in
--   Nothing delete the key-value pair from the map, otherwise
--   replace the previous value with the new value.
alterMap :: IsMap map => (Maybe (MapValue map) -> Maybe (MapValue map)) -> ContainerKey map -> map -> map

-- | Combine two maps.
--   
--   When a key exists in both maps, apply a function to both of the values
--   and use the result of that as the value of the key in the resulting
--   map.
unionWith :: IsMap map => (MapValue map -> MapValue map -> MapValue map) -> map -> map -> map
unionWithKey :: IsMap map => (ContainerKey map -> MapValue map -> MapValue map -> MapValue map) -> map -> map -> map

-- | Combine a list of maps.
--   
--   When a key exists in two different maps, apply a function to both of
--   the values and use the result of that as the value of the key in the
--   resulting map.
unionsWith :: IsMap map => (MapValue map -> MapValue map -> MapValue map) -> [map] -> map

-- | Apply a function over every key-value pair of a map.
mapWithKey :: IsMap map => (ContainerKey map -> MapValue map -> MapValue map) -> map -> map

-- | Apply a function over every key of a pair and run unionsWith
--   over the results.
omapKeysWith :: IsMap map => (MapValue map -> MapValue map -> MapValue map) -> (ContainerKey map -> ContainerKey map) -> map -> map

-- | Filter values in a map.
filterMap :: IsMap map => (MapValue map -> Bool) -> map -> map

-- | Equivalent to filterMap, but the function accepts the key, as
--   well as the value.
filterWithKey :: IsMap map => (ContainerKey map -> MapValue map -> Bool) -> map -> map

-- | In some cases, MapValue and Element will be different,
--   e.g., the IsMap instance of associated lists.
type family MapValue map

-- | A Map type polymorphic in both its key and value.
class () => BiPolyMap (map :: Type -> Type -> Type) where {
    type family BPMKeyConstraint (map :: Type -> Type -> Type) key;
}
mapKeysWith :: (BiPolyMap map, BPMKeyConstraint map k1, BPMKeyConstraint map k2) => (v -> v -> v) -> (k1 -> k2) -> map k1 v -> map k2 v
type family BPMKeyConstraint (map :: Type -> Type -> Type) key

-- | A guaranteed-polymorphic Map, which allows for more
--   polymorphic versions of functions.
class () => PolyMap (map :: Type -> Type)

-- | Get the difference between two maps, using the left map's values.
differenceMap :: PolyMap map => map value1 -> map value2 -> map value1

-- | Get the intersection of two maps, using the left map's values.
intersectionMap :: PolyMap map => map value1 -> map value2 -> map value1

-- | Get the intersection of two maps with a supplied function that takes
--   in the left map's value and the right map's value.
intersectionWithMap :: PolyMap map => (value1 -> value2 -> value3) -> map value1 -> map value2 -> map value3

-- | A container whose values are stored in Key-Value pairs.
class (Monoid set, Semigroup set, MonoFoldable set, Eq ContainerKey set, GrowingAppend set) => SetContainer set where {
    
    -- | The type of the key
    type family ContainerKey set;
}

-- | Check if there is a value with the supplied key in the container.
member :: SetContainer set => ContainerKey set -> set -> Bool

-- | Check if there isn't a value with the supplied key in the container.
notMember :: SetContainer set => ContainerKey set -> set -> Bool

-- | Get the union of two containers.
union :: SetContainer set => set -> set -> set

-- | Combine a collection of SetContainers, with left-most values
--   overriding when there are matching keys.
unions :: (SetContainer set, MonoFoldable mono, Element mono ~ set) => mono -> set

-- | Get the difference of two containers.
difference :: SetContainer set => set -> set -> set

-- | Get the intersection of two containers.
intersection :: SetContainer set => set -> set -> set

-- | Get a list of all of the keys in the container.
keys :: SetContainer set => set -> [ContainerKey set]

-- | The type of the key
type family ContainerKey set
class () => ToBuilder value builder
toBuilder :: ToBuilder value builder => value -> builder
type ByteStringBuilder = Builder
type BlazeBuilder = Builder
type TextBuilder = Builder

-- | A monomorphic container that is not null.
data () => NonNull mono

-- | The parameterizable maybe monad, obtained by composing an arbitrary
--   monad with the Maybe monad.
--   
--   Computations are actions that may produce a value or exit.
--   
--   The return function yields a computation that produces that
--   value, while >>= sequences two subcomputations, exiting
--   if either computation does.
newtype () => MaybeT (m :: Type -> Type) a
MaybeT :: m (Maybe a) -> MaybeT (m :: Type -> Type) a
[runMaybeT] :: MaybeT (m :: Type -> Type) a -> m (Maybe a)
async :: MonadUnliftIO m => m a -> m (Async a)

-- | deepseq: fully evaluates the first argument, before returning
--   the second.
--   
--   The name deepseq is used to illustrate the relationship to
--   seq: where seq is shallow in the sense that it only
--   evaluates the top level of its argument, deepseq traverses the
--   entire data structure evaluating it completely.
--   
--   deepseq can be useful for forcing pending exceptions,
--   eradicating space leaks, or forcing lazy I/O to happen. It is also
--   useful in conjunction with parallel Strategies (see the
--   parallel package).
--   
--   There is no guarantee about the ordering of evaluation. The
--   implementation may evaluate the components of the structure in any
--   order or in parallel. To impose an actual order on evaluation, use
--   pseq from Control.Parallel in the parallel
--   package.
deepseq :: NFData a => a -> b -> b
infixr 0 `deepseq`
say :: MonadIO m => Text -> m ()

-- | void value discards or ignores the result of
--   evaluation, such as the return value of an IO action.
--   
--   
Examples
--   
--   Replace the contents of a Maybe Int with unit:
--   
--   
--   >>> void Nothing
--   Nothing
--   
--   >>> void (Just 3)
--   Just ()
--   
--   
--   Replace the contents of an Either Int
--   Int with unit, resulting in an Either
--   Int ():
--   
--   
--   >>> void (Left 8675309)
--   Left 8675309
--   
--   >>> void (Right 8675309)
--   Right ()
--   
--   
--   Replace every element of a list with unit:
--   
--   
--   >>> void [1,2,3]
--   [(),(),()]
--   
--   
--   Replace the second element of a pair with unit:
--   
--   
--   >>> void (1,2)
--   (1,())
--   
--   
--   Discard the result of an IO action:
--   
--   
--   >>> mapM print [1,2]
--   1
--   2
--   [(),()]
--   
--   >>> void $ mapM print [1,2]
--   1
--   2
--   
void :: Functor f => f a -> f ()
getArgs :: MonadIO m => m [Text]

-- | 
--   comparing p x y = compare (p x) (p y)
--   
--   
--   Useful combinator for use in conjunction with the xxxBy
--   family of functions from Data.List, for example:
--   
--   
--   ... sortBy (comparing fst) ...
--   
comparing :: Ord a => (b -> a) -> b -> b -> Ordering

-- | isInfixOf takes two sequences and returns true if the
--   first sequence is contained, wholly and intact, anywhere within the
--   second.
isInfixOf :: (IsSequence seq, Eq (Element seq)) => seq -> seq -> Bool

-- | Synonym for ointercalate
intercalate :: (MonoFoldable mono, Monoid (Element mono)) => Element mono -> mono -> Element mono

-- | same behavior as nub, but requires Ord and is O(n
--   log n)
--   
--   https://github.com/nh2/haskell-ordnub
ordNub :: Ord a => [a] -> [a]

-- | same behavior as nubBy, but requires Ord and is O(n
--   log n)
--   
--   https://github.com/nh2/haskell-ordnub
ordNubBy :: Ord b => (a -> b) -> (a -> a -> Bool) -> [a] -> [a]
equating :: Eq a => (b -> a) -> b -> b -> Bool
concurrently :: MonadUnliftIO m => m a -> m b -> m (a, b)

-- | Synonym for onull
null :: MonoFoldable mono => mono -> Bool
withTempFile :: MonadUnliftIO m => FilePath -> String -> (FilePath -> Handle -> m a) -> m a
withTempDirectory :: MonadUnliftIO m => FilePath -> String -> (FilePath -> m a) -> m a

-- | Safe version of initEx, only working on non-nullable
--   sequences.
init :: IsSequence seq => NonNull seq -> seq
cancel :: MonadIO m => Async a -> m ()
withAsync :: MonadUnliftIO m => m a -> (Async a -> m b) -> m b
uninterruptibleCancel :: MonadIO m => Async a -> m ()
wait :: MonadIO m => Async a -> m a
waitCatch :: MonadIO m => Async a -> m (Either SomeException a)

-- | Synonym for otoList
toList :: MonoFoldable mono => mono -> [Element mono]

-- | Synonym for ofoldMap
foldMap :: (MonoFoldable mono, Monoid m) => (Element mono -> m) -> mono -> m

-- | Synonym for ofoldr
foldr :: MonoFoldable mono => (Element mono -> b -> b) -> b -> mono -> b

-- | Synonym for ofoldl'
foldl' :: MonoFoldable mono => (a -> Element mono -> a) -> a -> mono -> a

-- | Synonym for olength
length :: MonoFoldable mono => mono -> Int

-- | Synonym for oelem
elem :: (MonoFoldable mono, Eq (Element mono)) => Element mono -> mono -> Bool

-- | Get the maximum element of a monomorphic container.
--   
--   Safe version of maximumEx, only works on monomorphic containers
--   wrapped in a NonNull.
--   
--   
Examples
--   
--   
--   > let xs = ncons 1 [2, 3 :: Int]
--   > maximum xs
--   3
--   
maximum :: (MonoFoldable mono, Ord (Element mono)) => NonNull mono -> Element mono

-- | Get the minimum element of a monomorphic container.
--   
--   Safe version of minimumEx, only works on monomorphic containers
--   wrapped in a NonNull.
--   
--   
Examples
--   
--   
--   > let xs = ncons 1 [2, 3 :: Int]
--   > minimum xs
--   1
--   
minimum :: (MonoFoldable mono, Ord (Element mono)) => NonNull mono -> Element mono

-- | Synonym for osum
sum :: (MonoFoldable mono, Num (Element mono)) => mono -> Element mono

-- | Synonym for oproduct
product :: (MonoFoldable mono, Num (Element mono)) => mono -> Element mono
(++) :: Monoid m => m -> m -> m
infixr 5 ++

-- | The value of seq a b is bottom if a is
--   bottom, and otherwise equal to b. In other words, it
--   evaluates the first argument a to weak head normal form
--   (WHNF). seq is usually introduced to improve performance by
--   avoiding unneeded laziness.
--   
--   A note on evaluation order: the expression seq a b
--   does not guarantee that a will be evaluated before
--   b. The only guarantee given by seq is that the both
--   a and b will be evaluated before seq returns
--   a value. In particular, this means that b may be evaluated
--   before a. If you need to guarantee a specific order of
--   evaluation, you must use the function pseq from the
--   "parallel" package.
seq :: forall {r :: RuntimeRep} a (b :: TYPE r). a -> b -> b
infixr 0 `seq`
zip :: Zip f => f a -> f b -> f (a, b)
zipWith :: Zip f => (a -> b -> c) -> f a -> f b -> f c
unzip :: Zip f => f (a, b) -> (f a, f b)
print :: (Show a, MonadIO m) => a -> m ()

-- | otherwise is defined as the value True. It helps to make
--   guards more readable. eg.
--   
--   
--   f x | x < 0     = ...
--       | otherwise = ...
--   
otherwise :: Bool
map :: Functor f => (a -> b) -> f a -> f b

-- | Application operator. This operator is redundant, since ordinary
--   application (f x) means the same as (f $ x).
--   However, $ has low, right-associative binding precedence, so it
--   sometimes allows parentheses to be omitted; for example:
--   
--   
--   f $ g $ h x  =  f (g (h x))
--   
--   
--   It is also useful in higher-order situations, such as map
--   ($ 0) xs, or zipWith ($) fs xs.
--   
--   Note that ($) is representation-polymorphic in its
--   result type, so that foo $ True where foo :: Bool
--   -> Int# is well-typed.
($) :: forall (r :: RuntimeRep) a (b :: TYPE r). (a -> b) -> a -> b
infixr 0 $

-- | General coercion from Integral types.
--   
--   WARNING: This function performs silent truncation if the result type
--   is not at least as big as the argument's type.
fromIntegral :: (Integral a, Num b) => a -> b

-- | General coercion to Fractional types.
--   
--   WARNING: This function goes through the Rational type, which
--   does not have values for NaN for example. This means it does
--   not round-trip.
--   
--   For Double it also behaves differently with or without -O0:
--   
--   
--   Prelude> realToFrac nan -- With -O0
--   -Infinity
--   Prelude> realToFrac nan
--   NaN
--   
realToFrac :: (Real a, Fractional b) => a -> b

-- | Conditional failure of Alternative computations. Defined by
--   
--   
--   guard True  = pure ()
--   guard False = empty
--   
--   
--   
Examples
--   
--   Common uses of guard include conditionally signaling an error
--   in an error monad and conditionally rejecting the current choice in an
--   Alternative-based parser.
--   
--   As an example of signaling an error in the error monad Maybe,
--   consider a safe division function safeDiv x y that returns
--   Nothing when the denominator y is zero and
--   Just (x `div` y) otherwise. For example:
--   
--   
--   >>> safeDiv 4 0
--   Nothing
--   
--   
--   
--   >>> safeDiv 4 2
--   Just 2
--   
--   
--   A definition of safeDiv using guards, but not guard:
--   
--   
--   safeDiv :: Int -> Int -> Maybe Int
--   safeDiv x y | y /= 0    = Just (x `div` y)
--               | otherwise = Nothing
--   
--   
--   A definition of safeDiv using guard and Monad
--   do-notation:
--   
--   
--   safeDiv :: Int -> Int -> Maybe Int
--   safeDiv x y = do
--     guard (y /= 0)
--     return (x `div` y)
--   
guard :: Alternative f => Bool -> f ()

-- | The join function is the conventional monad join operator. It
--   is used to remove one level of monadic structure, projecting its bound
--   argument into the outer level.
--   
--   'join bss' can be understood as the do
--   expression
--   
--   
--   do bs <- bss
--      bs
--   
--   
--   
Examples
--   
--   A common use of join is to run an IO computation
--   returned from an STM transaction, since STM transactions
--   can't perform IO directly. Recall that
--   
--   
--   atomically :: STM a -> IO a
--   
--   
--   is used to run STM transactions atomically. So, by specializing
--   the types of atomically and join to
--   
--   
--   atomically :: STM (IO b) -> IO (IO b)
--   join       :: IO (IO b)  -> IO b
--   
--   
--   we can compose them as
--   
--   
--   join . atomically :: STM (IO b) -> IO b
--   
--   
--   to run an STM transaction and the IO action it returns.
join :: Monad m => m (m a) -> m a

-- | Boolean "and", lazy in the second argument
(&&) :: Bool -> Bool -> Bool
infixr 3 &&

-- | Boolean "or", lazy in the second argument
(||) :: Bool -> Bool -> Bool
infixr 2 ||

-- | Boolean "not"
not :: Bool -> Bool

-- | error stops execution and displays an error message.
error :: forall (r :: RuntimeRep) (a :: TYPE r). HasCallStack => [Char] -> a

-- | We define our own undefined which is marked as deprecated. This
--   makes it useful to use during development, but lets you more easily
--   get notifications if you accidentally ship partial code in production.
--   
--   The classy prelude recommendation for when you need to really have a
--   partial function in production is to use error with a very
--   descriptive message so that, in case an exception is thrown, you get
--   more information than Prelude.undefined.
--   
--   Since 0.5.5
undefined :: HasCallStack => a

-- | Same as >>=, but with the arguments interchanged.
(=<<) :: Monad m => (a -> m b) -> m a -> m b
infixr 1 =<<

-- | Conditional execution of Applicative expressions. For example,
--   
--   
--   when debug (putStrLn "Debugging")
--   
--   
--   will output the string Debugging if the Boolean value
--   debug is True, and otherwise do nothing.
when :: Applicative f => Bool -> f () -> f ()

-- | Promote a function to a monad.
liftM :: Monad m => (a1 -> r) -> m a1 -> m r

-- | Promote a function to a monad, scanning the monadic arguments from
--   left to right. For example,
--   
--   
--   liftM2 (+) [0,1] [0,2] = [0,2,1,3]
--   liftM2 (+) (Just 1) Nothing = Nothing
--   
liftM2 :: Monad m => (a1 -> a2 -> r) -> m a1 -> m a2 -> m r

-- | In many situations, the liftM operations can be replaced by
--   uses of ap, which promotes function application.
--   
--   
--   return f `ap` x1 `ap` ... `ap` xn
--   
--   
--   is equivalent to
--   
--   
--   liftMn f x1 x2 ... xn
--   
ap :: Monad m => m (a -> b) -> m a -> m b

-- | the identity morphism
id :: forall (a :: k). Category cat => cat a a

-- | morphism composition
(.) :: forall (b :: k) (c :: k) (a :: k). Category cat => cat b c -> cat a b -> cat a c
infixr 9 .

-- | const x y always evaluates to x, ignoring its second
--   argument.
--   
--   
--   >>> const 42 "hello"
--   42
--   
--   
--   
--   >>> map (const 42) [0..3]
--   [42,42,42,42]
--   
const :: a -> b -> a

-- | flip f takes its (first) two arguments in the reverse
--   order of f.
--   
--   
--   >>> flip (++) "hello" "world"
--   "worldhello"
--   
flip :: (a -> b -> c) -> b -> a -> c

-- | Strict (call-by-value) application operator. It takes a function and
--   an argument, evaluates the argument to weak head normal form (WHNF),
--   then calls the function with that value.
($!) :: forall (r :: RuntimeRep) a (b :: TYPE r). (a -> b) -> a -> b
infixr 0 $!

-- | until p f yields the result of applying f
--   until p holds.
until :: (a -> Bool) -> (a -> a) -> a -> a

-- | asTypeOf is a type-restricted version of const. It is
--   usually used as an infix operator, and its typing forces its first
--   argument (which is usually overloaded) to have the same type as the
--   second.
asTypeOf :: a -> a -> a

-- | the same as flip (-).
--   
--   Because - is treated specially in the Haskell grammar,
--   (- e) is not a section, but an application of
--   prefix negation. However, (subtract
--   exp) is equivalent to the disallowed section.
subtract :: Num a => a -> a -> a

-- | The maybe function takes a default value, a function, and a
--   Maybe value. If the Maybe value is Nothing, the
--   function returns the default value. Otherwise, it applies the function
--   to the value inside the Just and returns the result.
--   
--   
Examples
--   
--   Basic usage:
--   
--   
--   >>> maybe False odd (Just 3)
--   True
--   
--   
--   
--   >>> maybe False odd Nothing
--   False
--   
--   
--   Read an integer from a string using readMaybe. If we succeed,
--   return twice the integer; that is, apply (*2) to it. If
--   instead we fail to parse an integer, return 0 by default:
--   
--   
--   >>> import Text.Read ( readMaybe )
--   
--   >>> maybe 0 (*2) (readMaybe "5")
--   10
--   
--   >>> maybe 0 (*2) (readMaybe "")
--   0
--   
--   
--   Apply show to a Maybe Int. If we have Just n,
--   we want to show the underlying Int n. But if we have
--   Nothing, we return the empty string instead of (for example)
--   "Nothing":
--   
--   
--   >>> maybe "" show (Just 5)
--   "5"
--   
--   >>> maybe "" show Nothing
--   ""
--   
maybe :: b -> (a -> b) -> Maybe a -> b

-- | The isJust function returns True iff its argument is of
--   the form Just _.
--   
--   
Examples
--   
--   Basic usage:
--   
--   
--   >>> isJust (Just 3)
--   True
--   
--   
--   
--   >>> isJust (Just ())
--   True
--   
--   
--   
--   >>> isJust Nothing
--   False
--   
--   
--   Only the outer constructor is taken into consideration:
--   
--   
--   >>> isJust (Just Nothing)
--   True
--   
isJust :: Maybe a -> Bool

-- | The isNothing function returns True iff its argument is
--   Nothing.
--   
--   
Examples
--   
--   Basic usage:
--   
--   
--   >>> isNothing (Just 3)
--   False
--   
--   
--   
--   >>> isNothing (Just ())
--   False
--   
--   
--   
--   >>> isNothing Nothing
--   True
--   
--   
--   Only the outer constructor is taken into consideration:
--   
--   
--   >>> isNothing (Just Nothing)
--   False
--   
isNothing :: Maybe a -> Bool

-- | The fromMaybe function takes a default value and a Maybe
--   value. If the Maybe is Nothing, it returns the default
--   value; otherwise, it returns the value contained in the Maybe.
--   
--   
Examples
--   
--   Basic usage:
--   
--   
--   >>> fromMaybe "" (Just "Hello, World!")
--   "Hello, World!"
--   
--   
--   
--   >>> fromMaybe "" Nothing
--   ""
--   
--   
--   Read an integer from a string using readMaybe. If we fail to
--   parse an integer, we want to return 0 by default:
--   
--   
--   >>> import Text.Read ( readMaybe )
--   
--   >>> fromMaybe 0 (readMaybe "5")
--   5
--   
--   >>> fromMaybe 0 (readMaybe "")
--   0
--   
fromMaybe :: a -> Maybe a -> a

-- | The maybeToList function returns an empty list when given
--   Nothing or a singleton list when given Just.
--   
--   
Examples
--   
--   Basic usage:
--   
--   
--   >>> maybeToList (Just 7)
--   [7]
--   
--   
--   
--   >>> maybeToList Nothing
--   []
--   
--   
--   One can use maybeToList to avoid pattern matching when combined
--   with a function that (safely) works on lists:
--   
--   
--   >>> import Text.Read ( readMaybe )
--   
--   >>> sum $ maybeToList (readMaybe "3")
--   3
--   
--   >>> sum $ maybeToList (readMaybe "")
--   0
--   
maybeToList :: Maybe a -> [a]

-- | The listToMaybe function returns Nothing on an empty
--   list or Just a where a is the first element
--   of the list.
--   
--   
Examples
--   
--   Basic usage:
--   
--   
--   >>> listToMaybe []
--   Nothing
--   
--   
--   
--   >>> listToMaybe [9]
--   Just 9
--   
--   
--   
--   >>> listToMaybe [1,2,3]
--   Just 1
--   
--   
--   Composing maybeToList with listToMaybe should be the
--   identity on singleton/empty lists:
--   
--   
--   >>> maybeToList $ listToMaybe [5]
--   [5]
--   
--   >>> maybeToList $ listToMaybe []
--   []
--   
--   
--   But not on lists with more than one element:
--   
--   
--   >>> maybeToList $ listToMaybe [1,2,3]
--   [1]
--   
listToMaybe :: [a] -> Maybe a

-- | Takes all of the Just values from a sequence of Maybe
--   ts and concatenates them into an unboxed sequence of ts.
--   
--   Since 0.6.2
catMaybes :: (IsSequence (f (Maybe t)), Functor f, Element (f (Maybe t)) ~ Maybe t) => f (Maybe t) -> f t

-- | The mapMaybe function is a version of map which can
--   throw out elements. In particular, the functional argument returns
--   something of type Maybe b. If this is Nothing,
--   no element is added on to the result list. If it is Just
--   b, then b is included in the result list.
--   
--   
Examples
--   
--   Using mapMaybe f x is a shortcut for
--   catMaybes $ map f x in most cases:
--   
--   
--   >>> import Text.Read ( readMaybe )
--   
--   >>> let readMaybeInt = readMaybe :: String -> Maybe Int
--   
--   >>> mapMaybe readMaybeInt ["1", "Foo", "3"]
--   [1,3]
--   
--   >>> catMaybes $ map readMaybeInt ["1", "Foo", "3"]
--   [1,3]
--   
--   
--   If we map the Just constructor, the entire list should be
--   returned:
--   
--   
--   >>> mapMaybe Just [1,2,3]
--   [1,2,3]
--   
mapMaybe :: (a -> Maybe b) -> [a] -> [b]

-- | repeat x is an infinite list, with x the
--   value of every element.
--   
--   
--   >>> repeat 17
--   [17,17,17,17,17,17,17,17,17...
--   
repeat :: a -> [a]
zip3 :: Zip3 f => f a -> f b -> f c -> f (a, b, c)
zipWith3 :: Zip3 f => (a -> b -> c -> d) -> f a -> f b -> f c -> f d
unzip3 :: Zip3 f => f (a, b, c) -> (f a, f b, f c)
even :: Integral a => a -> Bool
odd :: Integral a => a -> Bool

-- | raise a number to a non-negative integral power
(^) :: (Num a, Integral b) => a -> b -> a
infixr 8 ^

-- | raise a number to an integral power
(^^) :: (Fractional a, Integral b) => a -> b -> a
infixr 8 ^^

-- | Extract the first component of a pair.
fst :: (a, b) -> a

-- | Extract the second component of a pair.
snd :: (a, b) -> b

-- | curry converts an uncurried function to a curried function.
--   
--   
Examples
--   
--   
--   >>> curry fst 1 2
--   1
--   
curry :: ((a, b) -> c) -> a -> b -> c

-- | uncurry converts a curried function to a function on pairs.
--   
--   
Examples
--   
--   
--   >>> uncurry (+) (1,2)
--   3
--   
--   
--   
--   >>> uncurry ($) (show, 1)
--   "1"
--   
--   
--   
--   >>> map (uncurry max) [(1,2), (3,4), (6,8)]
--   [2,4,8]
--   
uncurry :: (a -> b -> c) -> (a, b) -> c

-- | An infix synonym for fmap.
--   
--   The name of this operator is an allusion to $. Note the
--   similarities between their types:
--   
--   
--    ($)  ::              (a -> b) ->   a ->   b
--   (<$>) :: Functor f => (a -> b) -> f a -> f b
--   
--   
--   Whereas $ is function application, <$> is function
--   application lifted over a Functor.
--   
--   
Examples
--   
--   Convert from a Maybe Int to a Maybe
--   String using show:
--   
--   
--   >>> show <$> Nothing
--   Nothing
--   
--   >>> show <$> Just 3
--   Just "3"
--   
--   
--   Convert from an Either Int Int to an
--   Either Int String using show:
--   
--   
--   >>> show <$> Left 17
--   Left 17
--   
--   >>> show <$> Right 17
--   Right "17"
--   
--   
--   Double each element of a list:
--   
--   
--   >>> (*2) <$> [1,2,3]
--   [2,4,6]
--   
--   
--   Apply even to the second element of a pair:
--   
--   
--   >>> even <$> (2,2)
--   (2,True)
--   
(<$>) :: Functor f => (a -> b) -> f a -> f b
infixl 4 <$>

-- | on b u x y runs the binary function b
--   on the results of applying unary function u to two
--   arguments x and y. From the opposite perspective, it
--   transforms two inputs and combines the outputs.
--   
--   
--   ((+) `<a>on</a>` f) x y = f x + f y
--   
--   
--   Typical usage: sortBy (compare `on`
--   fst).
--   
--   Algebraic properties:
--   
--   
--   
- 
(*) `on` id = (*) -- (if (*) ∉ {⊥, const
--   ⊥})

--   
- 
((*) `on` f) `on` g = (*) `on` (f . g)

--   
- 
flip on f . flip on g = flip on (g .
--   f)

--   
on :: (b -> b -> c) -> (a -> b) -> a -> a -> c
infixl 0 `on`

-- | Case analysis for the Either type. If the value is
--   Left a, apply the first function to a; if it
--   is Right b, apply the second function to b.
--   
--   
Examples
--   
--   We create two values of type Either String
--   Int, one using the Left constructor and another
--   using the Right constructor. Then we apply "either" the
--   length function (if we have a String) or the "times-two"
--   function (if we have an Int):
--   
--   
--   >>> let s = Left "foo" :: Either String Int
--   
--   >>> let n = Right 3 :: Either String Int
--   
--   >>> either length (*2) s
--   3
--   
--   >>> either length (*2) n
--   6
--   
either :: (a -> c) -> (b -> c) -> Either a b -> c

-- | Partitions a list of Either into two lists. All the Left
--   elements are extracted, in order, to the first component of the
--   output. Similarly the Right elements are extracted to the
--   second component of the output.
--   
--   
Examples
--   
--   Basic usage:
--   
--   
--   >>> let list = [ Left "foo", Right 3, Left "bar", Right 7, Left "baz" ]
--   
--   >>> partitionEithers list
--   (["foo","bar","baz"],[3,7])
--   
--   
--   The pair returned by partitionEithers x should be the
--   same pair as (lefts x, rights x):
--   
--   
--   >>> let list = [ Left "foo", Right 3, Left "bar", Right 7, Left "baz" ]
--   
--   >>> partitionEithers list == (lefts list, rights list)
--   True
--   
partitionEithers :: [Either a b] -> ([a], [b])

-- | Synonym for otraverse_
traverse_ :: (MonoFoldable mono, Applicative f) => (Element mono -> f b) -> mono -> f ()

-- | Synonym for ofor_
for_ :: (MonoFoldable mono, Applicative f) => mono -> (Element mono -> f b) -> f ()

-- | Synonym for osequence_
sequence_ :: (Applicative m, MonoFoldable mono, Element mono ~ m ()) => mono -> m ()

-- | Synonym for oconcat
concat :: (MonoFoldable mono, Monoid (Element mono)) => mono -> Element mono

-- | Synonym for oconcatMap
concatMap :: (MonoFoldable mono, Monoid m) => (Element mono -> m) -> mono -> m

-- | Synonym for oand
and :: (MonoFoldable mono, Element mono ~ Bool) => mono -> Bool

-- | Synonym for oor
or :: (MonoFoldable mono, Element mono ~ Bool) => mono -> Bool

-- | Synonym for oany
any :: MonoFoldable mono => (Element mono -> Bool) -> mono -> Bool

-- | Synonym for oall
all :: MonoFoldable mono => (Element mono -> Bool) -> mono -> Bool

-- | Synonym for onotElem
notElem :: (MonoFoldable mono, Eq (Element mono)) => Element mono -> mono -> Bool

-- | isPrefixOf takes two sequences and returns True if the
--   first sequence is a prefix of the second.
isPrefixOf :: (IsSequence seq, Eq (Element seq)) => seq -> seq -> Bool

-- | isSuffixOf takes two sequences and returns True if the
--   first sequence is a suffix of the second.
isSuffixOf :: (IsSequence seq, Eq (Element seq)) => seq -> seq -> Bool

-- | Sort a ordered sequence.
--   
--   
--   > sort [4,3,1,2]
--   [1,2,3,4]
--   
sort :: (SemiSequence seq, Ord (Element seq)) => seq -> seq

-- | Construct an IOException value with a string describing the
--   error. The fail method of the IO instance of the
--   Monad class raises a userError, thus:
--   
--   
--   instance Monad IO where
--     ...
--     fail s = ioError (userError s)
--   
userError :: String -> IOError
catch :: (MonadUnliftIO m, Exception e) => m a -> (e -> m a) -> m a
throwIO :: (MonadIO m, Exception e) => e -> m a
evaluate :: MonadIO m => a -> m a

-- | Raise an IOException in the IO monad.
ioError :: IOError -> IO a

-- | Write a character to stdout
--   
--   Uses system locale settings
putChar :: MonadIO m => Char -> m ()

-- | Write a Text to stdout
--   
--   Uses system locale settings
putStr :: MonadIO m => Text -> m ()

-- | Write a Text followed by a newline to stdout
--   
--   Uses system locale settings
putStrLn :: MonadIO m => Text -> m ()

-- | Read a character from stdin
--   
--   Uses system locale settings
getChar :: MonadIO m => m Char

-- | Read a line from stdin
--   
--   Uses system locale settings
getLine :: MonadIO m => m Text

-- | Read all input from stdin into a lazy Text (LText)
--   
--   Uses system locale settings
getContents :: MonadIO m => m LText

-- | Takes a function of type 'LText -> LText' and passes all input on
--   stdin to it, then prints result to stdout
--   
--   Uses lazy IO Uses system locale settings
interact :: MonadIO m => (LText -> LText) -> m ()

-- | Strictly read a file into a ByteString.
readFile :: MonadIO m => FilePath -> m ByteString

-- | Write a ByteString to a file.
writeFile :: MonadIO m => FilePath -> ByteString -> m ()

-- | for is traverse with its arguments flipped. For a
--   version that ignores the results see for_.
for :: (Traversable t, Applicative f) => t a -> (a -> f b) -> f (t b)

-- | Synonym for ofoldM
foldM :: (MonoFoldable mono, Monad m) => (a -> Element mono -> m a) -> a -> mono -> m a

-- | The reverse of when.
unless :: Applicative f => Bool -> f () -> f ()

-- | Return the first element of a monomorphic container.
--   
--   Safe version of headEx, only works on monomorphic containers
--   wrapped in a NonNull.
head :: MonoFoldable mono => NonNull mono -> Element mono

-- | Safe version of tailEx, only working on non-nullable
--   sequences.
tail :: IsSequence seq => NonNull seq -> seq

-- | Return the last element of a monomorphic container.
--   
--   Safe version of lastEx, only works on monomorphic containers
--   wrapped in a NonNull.
last :: MonoFoldable mono => NonNull mono -> Element mono

-- | a variant of deepseq that is useful in some circumstances:
--   
--   
--   force x = x `deepseq` x
--   
--   
--   force x fully evaluates x, and then returns it. Note
--   that force x only performs evaluation when the value of
--   force x itself is demanded, so essentially it turns shallow
--   evaluation into deep evaluation.
--   
--   force can be conveniently used in combination with
--   ViewPatterns:
--   
--   
--   {-# LANGUAGE BangPatterns, ViewPatterns #-}
--   import Control.DeepSeq
--   
--   someFun :: ComplexData -> SomeResult
--   someFun (force -> !arg) = {- 'arg' will be fully evaluated -}
--   
--   
--   Another useful application is to combine force with
--   evaluate in order to force deep evaluation relative to other
--   IO operations:
--   
--   
--   import Control.Exception (evaluate)
--   import Control.DeepSeq
--   
--   main = do
--     result <- evaluate $ force $ pureComputation
--     {- 'result' will be fully evaluated at this point -}
--     return ()
--   
--   
--   Finally, here's an exception safe variant of the readFile'
--   example:
--   
--   
--   readFile' :: FilePath -> IO String
--   readFile' fn = bracket (openFile fn ReadMode) hClose $ \h ->
--                          evaluate . force =<< hGetContents h
--   
force :: NFData a => a -> a
tryIO :: MonadUnliftIO m => m a -> m (Either IOException a)
catchIO :: MonadUnliftIO m => m a -> (IOException -> m a) -> m a

-- | We define our own trace (and also its variants) which provides
--   a warning when used. So that tracing is available during development,
--   but the compiler reminds you to not leave them in the code for
--   production.
trace :: String -> a -> a

-- | Since 0.5.9
traceShowId :: Show a => a -> a
traceShow :: Show a => a -> b -> b

-- | Strictly read the contents of the given Handle into a
--   ByteString.
hGetContents :: MonadIO m => Handle -> m ByteString
hClose :: MonadIO m => Handle -> m ()

-- | Synonym for oforM_
forM_ :: (MonoFoldable mono, Applicative m) => mono -> (Element mono -> m ()) -> m ()
stderr :: Handle
stdout :: Handle

-- | Combine two paths with a path separator. If the second path starts
--   with a path separator or a drive letter, then it returns the second.
--   The intention is that readFile (dir </> file)
--   will access the same file as setCurrentDirectory dir; readFile
--   file.
--   
--   
--   Posix:   "/directory" </> "file.ext" == "/directory/file.ext"
--   Windows: "/directory" </> "file.ext" == "/directory\\file.ext"
--            "directory" </> "/file.ext" == "/file.ext"
--   Valid x => (takeDirectory x </> takeFileName x) `equalFilePath` x
--   
--   
--   Combined:
--   
--   
--   Posix:   "/" </> "test" == "/test"
--   Posix:   "home" </> "bob" == "home/bob"
--   Posix:   "x:" </> "foo" == "x:/foo"
--   Windows: "C:\\foo" </> "bar" == "C:\\foo\\bar"
--   Windows: "home" </> "bob" == "home\\bob"
--   
--   
--   Not combined:
--   
--   
--   Posix:   "home" </> "/bob" == "/bob"
--   Windows: "home" </> "C:\\bob" == "C:\\bob"
--   
--   
--   Not combined (tricky):
--   
--   On Windows, if a filepath starts with a single slash, it is relative
--   to the root of the current drive. In [1], this is (confusingly)
--   referred to as an absolute path. The current behavior of
--   </> is to never combine these forms.
--   
--   
--   Windows: "home" </> "/bob" == "/bob"
--   Windows: "home" </> "\\bob" == "\\bob"
--   Windows: "C:\\home" </> "\\bob" == "\\bob"
--   
--   
--   On Windows, from [1]: "If a file name begins with only a disk
--   designator but not the backslash after the colon, it is interpreted as
--   a relative path to the current directory on the drive with the
--   specified letter." The current behavior of </> is to
--   never combine these forms.
--   
--   
--   Windows: "D:\\foo" </> "C:bar" == "C:bar"
--   Windows: "C:\\foo" </> "C:bar" == "C:bar"
--   
(</>) :: FilePath -> FilePath -> FilePath
infixr 5 </>

-- | If the first argument evaluates to True, then the result is the
--   second argument. Otherwise an AssertionFailed exception is
--   raised, containing a String with the source file and line
--   number of the call to assert.
--   
--   Assertions can normally be turned on or off with a compiler flag (for
--   GHC, assertions are normally on unless optimisation is turned on with
--   -O or the -fignore-asserts option is given). When
--   assertions are turned off, the first argument to assert is
--   ignored, and the second argument is returned as the result.
assert :: Bool -> a -> a

-- | One or none.
--   
--   It is useful for modelling any computation that is allowed to fail.
--   
--   
Examples
--   
--   Using the Alternative instance of Control.Monad.Except,
--   the following functions:
--   
--   
--   >>> import Control.Monad.Except
--   
--   
--   
--   >>> canFail = throwError "it failed" :: Except String Int
--   
--   >>> final = return 42                :: Except String Int
--   
--   
--   Can be combined by allowing the first function to fail:
--   
--   
--   >>> runExcept $ canFail *> final
--   Left "it failed"
--   
--   >>> runExcept $ optional canFail *> final
--   Right 42
--   
optional :: Alternative f => f a -> f (Maybe a)

-- | Synonym for fromList
pack :: IsSequence seq => [Element seq] -> seq

-- | Synonym for otoList
unpack :: MonoFoldable mono => mono -> [Element mono]

-- | Create a sequence from a single element.
--   
--   
--   > singleton a :: String
--   "a"
--   > singleton a :: Vector Char
--   fromList "a"
--   
singleton :: MonoPointed seq => Element seq -> seq

delete :: (IsSequence seq, Eq (Element seq)) => Element seq -> seq -> seq

-- | Safely convert from a NonEmpty list to a non-null
--   monomorphic container.
fromNonEmpty :: IsSequence seq => NonEmpty (Element seq) -> NonNull seq

-- | Safely convert from a NonNull container to a
--   NonEmpty list.
toNonEmpty :: MonoFoldable mono => NonNull mono -> NonEmpty (Element mono)
try :: (MonadUnliftIO m, Exception e) => m a -> m (Either e a)

-- | & is a reverse application operator. This provides
--   notational convenience. Its precedence is one higher than that of the
--   forward application operator $, which allows & to be
--   nested in $.
--   
--   
--   >>> 5 & (+1) & show
--   "6"
--   
(&) :: a -> (a -> b) -> b
infixl 1 &
finally :: MonadUnliftIO m => m a -> m b -> m a
handle :: (MonadUnliftIO m, Exception e) => (e -> m a) -> m a -> m a

-- | Case analysis for the Bool type. bool x y p
--   evaluates to x when p is False, and evaluates
--   to y when p is True.
--   
--   This is equivalent to if p then y else x; that is, one can
--   think of it as an if-then-else construct with its arguments reordered.
--   
--   
Examples
--   
--   Basic usage:
--   
--   
--   >>> bool "foo" "bar" True
--   "bar"
--   
--   >>> bool "foo" "bar" False
--   "foo"
--   
--   
--   Confirm that bool x y p and if p then y else
--   x are equivalent:
--   
--   
--   >>> let p = True; x = "bar"; y = "foo"
--   
--   >>> bool x y p == if p then y else x
--   True
--   
--   >>> let p = False
--   
--   >>> bool x y p == if p then y else x
--   True
--   
bool :: a -> a -> Bool -> a

-- | Lift a computation from the argument monad to the constructed monad.
lift :: (MonadTrans t, Monad m) => m a -> t m a
atomically :: MonadIO m => STM a -> m a
bracket :: MonadUnliftIO m => m a -> (a -> m b) -> (a -> m c) -> m c

-- | Get the maximum element of a monomorphic container, using a supplied
--   element ordering function.
--   
--   Safe version of maximumByEx, only works on monomorphic
--   containers wrapped in a NonNull.
maximumBy :: MonoFoldable mono => (Element mono -> Element mono -> Ordering) -> NonNull mono -> Element mono

-- | Get the minimum element of a monomorphic container, using a supplied
--   element ordering function.
--   
--   Safe version of minimumByEx, only works on monomorphic
--   containers wrapped in a NonNull.
minimumBy :: MonoFoldable mono => (Element mono -> Element mono -> Ordering) -> NonNull mono -> Element mono
openFile :: MonadIO m => FilePath -> IOMode -> m Handle

-- | Equivalent to groupBy (==)
group :: (IsSequence seq, Eq (Element seq)) => seq -> [seq]

-- | forM is mapM with its arguments flipped. For a version
--   that ignores the results see forM_.
forM :: (Traversable t, Monad m) => t a -> (a -> m b) -> m (t b)
throwTo :: (Exception e, MonadIO m) => ThreadId -> e -> m ()
atomicWriteIORef :: MonadIO m => IORef a -> a -> m ()
atomicModifyIORef :: MonadIO m => IORef a -> (a -> (a, b)) -> m b
stdin :: Handle

-- | Repeat an action indefinitely.
--   
--   
Examples
--   
--   A common use of forever is to process input from network
--   sockets, Handles, and channels (e.g. MVar and
--   Chan).
--   
--   For example, here is how we might implement an echo server,
--   using forever both to listen for client connections on a
--   network socket and to echo client input on client connection handles:
--   
--   
--   echoServer :: Socket -> IO ()
--   echoServer socket = forever $ do
--     client <- accept socket
--     forkFinally (echo client) (\_ -> hClose client)
--     where
--       echo :: Handle -> IO ()
--       echo client = forever $
--         hGetLine client >>= hPutStrLn client
--   
--   
--   Note that "forever" isn't necessarily non-terminating. If the action
--   is in a MonadPlus and short-circuits after some number
--   of iterations. then forever actually returns
--   mzero, effectively short-circuiting its caller.
forever :: Applicative f => f a -> f b
hSeek :: MonadIO m => Handle -> SeekMode -> Integer -> m ()
hFlush :: MonadIO m => Handle -> m ()
mask :: MonadUnliftIO m => ((forall a. () => m a -> m a) -> m b) -> m b
newTChanIO :: MonadIO m => m (TChan a)
newBroadcastTChanIO :: MonadIO m => m (TChan a)
newTQueueIO :: MonadIO m => m (TQueue a)
newTBQueueIO :: MonadIO m => Natural -> m (TBQueue a)
newTMVarIO :: MonadIO m => a -> m (TMVar a)

-- | An error indicating that an IO operation failed because one of
--   its arguments does not exist.
isDoesNotExistError :: IOError -> Bool

-- | An error indicating that an IO operation failed because one of
--   its arguments is a single-use resource, which is already being used
--   (for example, opening the same file twice for writing might give this
--   error).
isAlreadyInUseError :: IOError -> Bool

-- | An error indicating that an IO operation failed because the
--   user does not have sufficient operating system privilege to perform
--   that operation.
isPermissionError :: IOError -> Bool

-- | An error indicating that an IO operation failed because the
--   device is full.
isFullError :: IOError -> Bool

-- | An error indicating that an IO operation failed because the end
--   of file has been reached.
isEOFError :: IOError -> Bool

-- | An error indicating that an IO operation failed because the
--   operation was not possible. Any computation which returns an IO
--   result may fail with isIllegalOperation. In some cases, an
--   implementation will not be able to distinguish between the possible
--   error causes. In this case it should fail with
--   isIllegalOperation.
isIllegalOperation :: IOError -> Bool

-- | Split the input between the two argument arrows and combine their
--   output. Note that this is in general not a functor.
--   
--   The default definition may be overridden with a more efficient version
--   if desired.
(***) :: Arrow a => a b c -> a b' c' -> a (b, b') (c, c')
infixr 3 ***

-- | Fanout: send the input to both argument arrows and combine their
--   output.
--   
--   The default definition may be overridden with a more efficient version
--   if desired.
(&&&) :: Arrow a => a b c -> a b c' -> a b (c, c')
infixr 3 &&&
hWaitForInput :: MonadIO m => Handle -> Int -> m Bool

-- | Same as sortBy . comparing.
--   
--   Since 0.7.0
sortOn :: (Ord o, SemiSequence seq) => (Element seq -> o) -> seq -> seq

-- | A variant of <*> with the arguments reversed.
(<**>) :: Applicative f => f a -> f (a -> b) -> f b
infixl 4 <**>

-- | Lift a function to actions. Equivalent to Functor's fmap but
--   implemented using only Applicative's methods: liftA
--   f a = pure f <*> a
--   
--   As such this function may be used to implement a Functor
--   instance from an Applicative one.
--   
--   
Examples
--   
--   Using the Applicative instance for Lists:
--   
--   
--   >>> liftA (+1) [1, 2]
--   [2,3]
--   
--   
--   Or the Applicative instance for Maybe
--   
--   
--   >>> liftA (+1) (Just 3)
--   Just 4
--   
liftA :: Applicative f => (a -> b) -> f a -> f b

-- | Lift a ternary function to actions.
liftA3 :: Applicative f => (a -> b -> c -> d) -> f a -> f b -> f c -> f d

-- | Promote a function to a monad, scanning the monadic arguments from
--   left to right (cf. liftM2).
liftM3 :: Monad m => (a1 -> a2 -> a3 -> r) -> m a1 -> m a2 -> m a3 -> m r

-- | Promote a function to a monad, scanning the monadic arguments from
--   left to right (cf. liftM2).
liftM4 :: Monad m => (a1 -> a2 -> a3 -> a4 -> r) -> m a1 -> m a2 -> m a3 -> m a4 -> m r

-- | Promote a function to a monad, scanning the monadic arguments from
--   left to right (cf. liftM2).
liftM5 :: Monad m => (a1 -> a2 -> a3 -> a4 -> a5 -> r) -> m a1 -> m a2 -> m a3 -> m a4 -> m a5 -> m r

-- | Swap the components of a pair.
swap :: (a, b) -> (b, a)
newEmptyMVar :: MonadIO m => m (MVar a)
newMVar :: MonadIO m => a -> m (MVar a)
takeMVar :: MonadIO m => MVar a -> m a
readMVar :: MonadIO m => MVar a -> m a
putMVar :: MonadIO m => MVar a -> a -> m ()
tryTakeMVar :: MonadIO m => MVar a -> m (Maybe a)
tryPutMVar :: MonadIO m => MVar a -> a -> m Bool
tryReadMVar :: MonadIO m => MVar a -> m (Maybe a)
isEmptyMVar :: MonadIO m => MVar a -> m Bool

-- | Flipped version of <$>.
--   
--   
--   (<&>) = flip fmap
--   
--   
--   
Examples
--   
--   Apply (+1) to a list, a Just and a Right:
--   
--   
--   >>> Just 2 <&> (+1)
--   Just 3
--   
--   
--   
--   >>> [1,2,3] <&> (+1)
--   [2,3,4]
--   
--   
--   
--   >>> Right 3 <&> (+1)
--   Right 4
--   
(<&>) :: Functor f => f a -> (a -> b) -> f b
infixl 1 <&>

-- | Flipped version of <$.
--   
--   
Examples
--   
--   Replace the contents of a Maybe Int with a
--   constant String:
--   
--   
--   >>> Nothing $> "foo"
--   Nothing
--   
--   >>> Just 90210 $> "foo"
--   Just "foo"
--   
--   
--   Replace the contents of an Either Int
--   Int with a constant String, resulting in an
--   Either Int String:
--   
--   
--   >>> Left 8675309 $> "foo"
--   Left 8675309
--   
--   >>> Right 8675309 $> "foo"
--   Right "foo"
--   
--   
--   Replace each element of a list with a constant String:
--   
--   
--   >>> [1,2,3] $> "foo"
--   ["foo","foo","foo"]
--   
--   
--   Replace the second element of a pair with a constant String:
--   
--   
--   >>> (1,2) $> "foo"
--   (1,"foo")
--   
($>) :: Functor f => f a -> b -> f b
infixl 4 $>

-- | Extracts from a list of Either all the Left elements.
--   All the Left elements are extracted in order.
--   
--   
Examples
--   
--   Basic usage:
--   
--   
--   >>> let list = [ Left "foo", Right 3, Left "bar", Right 7, Left "baz" ]
--   
--   >>> lefts list
--   ["foo","bar","baz"]
--   
lefts :: [Either a b] -> [a]

-- | Extracts from a list of Either all the Right elements.
--   All the Right elements are extracted in order.
--   
--   
Examples
--   
--   Basic usage:
--   
--   
--   >>> let list = [ Left "foo", Right 3, Left "bar", Right 7, Left "baz" ]
--   
--   >>> rights list
--   [3,7]
--   
rights :: [Either a b] -> [b]

-- | asProxyTypeOf is a type-restricted version of const. It
--   is usually used as an infix operator, and its typing forces its first
--   argument (which is usually overloaded) to have the same type as the
--   tag of the second.
--   
--   
--   >>> import Data.Word
--   
--   >>> :type asProxyTypeOf 123 (Proxy :: Proxy Word8)
--   asProxyTypeOf 123 (Proxy :: Proxy Word8) :: Word8
--   
--   
--   Note the lower-case proxy in the definition. This allows any
--   type constructor with just one argument to be passed to the function,
--   for example we could also write
--   
--   
--   >>> import Data.Word
--   
--   >>> :type asProxyTypeOf 123 (Just (undefined :: Word8))
--   asProxyTypeOf 123 (Just (undefined :: Word8)) :: Word8
--   
asProxyTypeOf :: a -> proxy a -> a
getMonotonicTime :: MonadIO m => m Double

-- | Synonym for ofold
fold :: (MonoFoldable mono, Monoid (Element mono)) => mono -> Element mono

-- | Synonym for ofoldlM
foldlM :: (MonoFoldable mono, Monad m) => (a -> Element mono -> m a) -> a -> mono -> m a

-- | Synonym for omapM_
mapM_ :: (MonoFoldable mono, Applicative m) => (Element mono -> m ()) -> mono -> m ()

-- | The sum of a collection of actions using (<|>),
--   generalizing concat.
--   
--   asum is just like msum, but generalised to
--   Alternative.
--   
--   
Examples
--   
--   Basic usage:
--   
--   
--   >>> asum [Just "Hello", Nothing, Just "World"]
--   Just "Hello"
--   
asum :: (Foldable t, Alternative f) => t (f a) -> f a

-- | stripPrefix drops the given prefix from a sequence. It returns
--   Nothing if the sequence did not start with the prefix given, or
--   Just the sequence after the prefix, if it does.
--   
--   
--   > stripPrefix "foo" "foobar"
--   Just "bar"
--   > stripPrefix "abc" "foobar"
--   Nothing
--   
stripPrefix :: (IsSequence seq, Eq (Element seq)) => seq -> seq -> Maybe seq

deleteBy :: (IsSequence seq, Eq (Element seq)) => (Element seq -> Element seq -> Bool) -> Element seq -> seq -> seq

-- | An alias for difference.
(\\) :: SetContainer a => a -> a -> a
infixl 9 \\

-- | An alias for intersection.
intersect :: SetContainer a => a -> a -> a
zip4 :: Zip4 f => f a -> f b -> f c -> f d -> f (a, b, c, d)
zipWith4 :: Zip4 f => (a -> b -> c -> d -> e) -> f a -> f b -> f c -> f d -> f e
unzip4 :: Zip4 f => f (a, b, c, d) -> (f a, f b, f c, f d)
zip5 :: Zip5 f => f a -> f b -> f c -> f d -> f e -> f (a, b, c, d, e)
zipWith5 :: Zip5 f => (a -> b -> c -> d -> e -> g) -> f a -> f b -> f c -> f d -> f e -> f g
unzip5 :: Zip5 f => f (a, b, c, d, e) -> (f a, f b, f c, f d, f e)
zip6 :: Zip6 f => f a -> f b -> f c -> f d -> f e -> f g -> f (a, b, c, d, e, g)
zipWith6 :: Zip6 f => (a -> b -> c -> d -> e -> g -> h) -> f a -> f b -> f c -> f d -> f e -> f g -> f h
unzip6 :: Zip6 f => f (a, b, c, d, e, g) -> (f a, f b, f c, f d, f e, f g)
zip7 :: Zip7 f => f a -> f b -> f c -> f d -> f e -> f g -> f h -> f (a, b, c, d, e, g, h)
zipWith7 :: Zip7 f => (a -> b -> c -> d -> e -> g -> h -> i) -> f a -> f b -> f c -> f d -> f e -> f g -> f h -> f i
unzip7 :: Zip7 f => f (a, b, c, d, e, g, h) -> (f a, f b, f c, f d, f e, f g, f h)
catchAny :: MonadUnliftIO m => m a -> (SomeException -> m a) -> m a
onException :: MonadUnliftIO m => m a -> m b -> m a
mask_ :: MonadUnliftIO m => m a -> m a
uninterruptibleMask_ :: MonadUnliftIO m => m a -> m a
uninterruptibleMask :: MonadUnliftIO m => ((forall a. () => m a -> m a) -> m b) -> m b
newIORef :: MonadIO m => a -> m (IORef a)
readIORef :: MonadIO m => IORef a -> m a
writeIORef :: MonadIO m => IORef a -> a -> m ()
atomicModifyIORef' :: MonadIO m => IORef a -> (a -> (a, b)) -> m b
mkWeakIORef :: MonadUnliftIO m => IORef a -> m () -> m (Weak (IORef a))
modifyIORef :: MonadIO m => IORef a -> (a -> a) -> m ()
modifyIORef' :: MonadIO m => IORef a -> (a -> a) -> m ()

asyncExceptionToException :: Exception e => e -> SomeException

asyncExceptionFromException :: Exception e => SomeException -> Maybe e

-- | Compose two alternative STM actions (GHC only).
--   
--   If the first action completes without retrying then it forms the
--   result of the orElse. Otherwise, if the first action retries,
--   then the second action is tried in its place. If both actions retry
--   then the orElse as a whole retries.
orElse :: STM a -> STM a -> STM a

-- | Create a new TVar holding a value supplied
newTVar :: a -> STM (TVar a)
newTVarIO :: MonadIO m => a -> m (TVar a)
readTVarIO :: MonadIO m => TVar a -> m a

-- | Return the current value stored in a TVar.
readTVar :: TVar a -> STM a

-- | Write the supplied value into a TVar.
writeTVar :: TVar a -> a -> STM ()
withMVar :: MonadUnliftIO m => MVar a -> (a -> m b) -> m b
modifyMVar_ :: MonadUnliftIO m => MVar a -> (a -> m a) -> m ()
catchJust :: (MonadUnliftIO m, Exception e) => (e -> Maybe b) -> m a -> (b -> m a) -> m a
handleJust :: (MonadUnliftIO m, Exception e) => (e -> Maybe b) -> (b -> m a) -> m a -> m a
tryJust :: (MonadUnliftIO m, Exception e) => (e -> Maybe b) -> m a -> m (Either b a)
bracket_ :: MonadUnliftIO m => m a -> m b -> m c -> m c
bracketOnError :: MonadUnliftIO m => m a -> (a -> m b) -> (a -> m c) -> m c
catches :: MonadUnliftIO m => m a -> [Handler m a] -> m a
swapMVar :: MonadIO m => MVar a -> a -> m a
withMVarMasked :: MonadUnliftIO m => MVar a -> (a -> m b) -> m b
modifyMVar :: MonadUnliftIO m => MVar a -> (a -> m (a, b)) -> m b
modifyMVarMasked_ :: MonadUnliftIO m => MVar a -> (a -> m a) -> m ()
modifyMVarMasked :: MonadUnliftIO m => MVar a -> (a -> m (a, b)) -> m b
mkWeakMVar :: MonadUnliftIO m => MVar a -> m () -> m (Weak (MVar a))

-- | The construct tryIOError comp exposes IO errors which
--   occur within a computation, and which are not fully handled.
--   
--   Non-I/O exceptions are not caught by this variant; to catch all
--   exceptions, use try from Control.Exception.
tryIOError :: IO a -> IO (Either IOError a)

-- | Construct an IOException of the given type where the second
--   argument describes the error location and the third and fourth
--   argument contain the file handle and file path of the file involved in
--   the error if applicable.
mkIOError :: IOErrorType -> String -> Maybe Handle -> Maybe FilePath -> IOError

-- | An error indicating that an IO operation failed because one of
--   its arguments already exists.
isAlreadyExistsError :: IOError -> Bool

-- | A programmer-defined error value constructed using userError.
isUserError :: IOError -> Bool

-- | An error indicating that the operation failed because the resource
--   vanished. See resourceVanishedErrorType.
isResourceVanishedError :: IOError -> Bool

-- | I/O error where the operation failed because one of its arguments
--   already exists.
alreadyExistsErrorType :: IOErrorType

-- | I/O error where the operation failed because one of its arguments does
--   not exist.
doesNotExistErrorType :: IOErrorType

-- | I/O error where the operation failed because one of its arguments is a
--   single-use resource, which is already being used.
alreadyInUseErrorType :: IOErrorType

-- | I/O error where the operation failed because the device is full.
fullErrorType :: IOErrorType

-- | I/O error where the operation failed because the end of file has been
--   reached.
eofErrorType :: IOErrorType

-- | I/O error where the operation is not possible.
illegalOperationErrorType :: IOErrorType

-- | I/O error where the operation failed because the user does not have
--   sufficient operating system privilege to perform that operation.
permissionErrorType :: IOErrorType

-- | I/O error that is programmer-defined.
userErrorType :: IOErrorType

-- | I/O error where the operation failed because the resource vanished.
--   This happens when, for example, attempting to write to a closed socket
--   or attempting to write to a named pipe that was deleted.
resourceVanishedErrorType :: IOErrorType

-- | I/O error where the operation failed because one of its arguments
--   already exists.
isAlreadyExistsErrorType :: IOErrorType -> Bool

-- | I/O error where the operation failed because one of its arguments does
--   not exist.
isDoesNotExistErrorType :: IOErrorType -> Bool

-- | I/O error where the operation failed because one of its arguments is a
--   single-use resource, which is already being used.
isAlreadyInUseErrorType :: IOErrorType -> Bool

-- | I/O error where the operation failed because the device is full.
isFullErrorType :: IOErrorType -> Bool

-- | I/O error where the operation failed because the end of file has been
--   reached.
isEOFErrorType :: IOErrorType -> Bool

-- | I/O error where the operation is not possible.
isIllegalOperationErrorType :: IOErrorType -> Bool

-- | I/O error where the operation failed because the user does not have
--   sufficient operating system privilege to perform that operation.
isPermissionErrorType :: IOErrorType -> Bool

-- | I/O error that is programmer-defined.
isUserErrorType :: IOErrorType -> Bool

-- | I/O error where the operation failed because the resource vanished.
--   See resourceVanishedErrorType.
isResourceVanishedErrorType :: IOErrorType -> Bool
ioeGetErrorType :: IOError -> IOErrorType
ioeGetErrorString :: IOError -> String
ioeGetLocation :: IOError -> String
ioeGetHandle :: IOError -> Maybe Handle
ioeGetFileName :: IOError -> Maybe FilePath
ioeSetErrorType :: IOError -> IOErrorType -> IOError
ioeSetErrorString :: IOError -> String -> IOError
ioeSetLocation :: IOError -> String -> IOError
ioeSetHandle :: IOError -> Handle -> IOError
ioeSetFileName :: IOError -> FilePath -> IOError

-- | Catch any IOException that occurs in the computation and throw
--   a modified version.
modifyIOError :: (IOError -> IOError) -> IO a -> IO a

-- | Adds a location description and maybe a file path and file handle to
--   an IOException. If any of the file handle or file path is not
--   given the corresponding value in the IOException remains
--   unaltered.
annotateIOError :: IOError -> String -> Maybe Handle -> Maybe FilePath -> IOError
registerDelay :: MonadIO m => Int -> m (TVar Bool)
withFile :: MonadUnliftIO m => FilePath -> IOMode -> (Handle -> m a) -> m a
withBinaryFile :: MonadUnliftIO m => FilePath -> IOMode -> (Handle -> m a) -> m a
hFileSize :: MonadIO m => Handle -> m Integer
hSetFileSize :: MonadIO m => Handle -> Integer -> m ()
hIsEOF :: MonadIO m => Handle -> m Bool
hSetBuffering :: MonadIO m => Handle -> BufferMode -> m ()
hTell :: MonadIO m => Handle -> m Integer
hIsOpen :: MonadIO m => Handle -> m Bool
hIsClosed :: MonadIO m => Handle -> m Bool
hIsReadable :: MonadIO m => Handle -> m Bool
hIsWritable :: MonadIO m => Handle -> m Bool
hGetBuffering :: MonadIO m => Handle -> m BufferMode
hIsSeekable :: MonadIO m => Handle -> m Bool
hSetEcho :: MonadIO m => Handle -> Bool -> m ()
hGetEcho :: MonadIO m => Handle -> m Bool
hIsTerminalDevice :: MonadIO m => Handle -> m Bool
hReady :: MonadIO m => Handle -> m Bool

-- | Left-to-right composition of Kleisli arrows.
--   
--   '(bs >=> cs) a' can be understood as the
--   do expression
--   
--   
--   do b <- bs a
--      cs b
--   
(>=>) :: Monad m => (a -> m b) -> (b -> m c) -> a -> m c
infixr 1 >=>

-- | Right-to-left composition of Kleisli arrows.
--   (>=>), with the arguments flipped.
--   
--   Note how this operator resembles function composition
--   (.):
--   
--   
--   (.)   ::            (b ->   c) -> (a ->   b) -> a ->   c
--   (<=<) :: Monad m => (b -> m c) -> (a -> m b) -> a -> m c
--   
(<=<) :: Monad m => (b -> m c) -> (a -> m b) -> a -> m c
infixr 1 <=<

-- | Like replicateM, but discards the result.
--   
--   
Examples
--   
--   
--   >>> replicateM_ 3 (putStrLn "a")
--   a
--   a
--   a
--   
replicateM_ :: Applicative m => Int -> m a -> m ()

-- | Since 0.5.9
traceShowM :: (Show a, Monad m) => a -> m ()

-- | Since 0.5.9
traceM :: Monad m => String -> m ()

-- | Since 0.5.9
traceId :: String -> String

-- | Prepend an element to a non-null SemiSequence.
(<|) :: SemiSequence seq => Element seq -> NonNull seq -> NonNull seq
infixr 5 <|

-- | Sort elements using the user supplied function to project something
--   out of each element. Inspired by
--   http://hackage.haskell.org/packages/archive/base/latest/doc/html/GHC-Exts.html#v:sortWith.
sortWith :: (Ord a, IsSequence c) => (Element c -> a) -> c -> c
newQSemN :: MonadIO m => Int -> m QSemN
waitQSemN :: MonadIO m => QSemN -> Int -> m ()
signalQSemN :: MonadIO m => QSemN -> Int -> m ()
newQSem :: MonadIO m => Int -> m QSem
waitQSem :: MonadIO m => QSem -> m ()
signalQSem :: MonadIO m => QSem -> m ()
newChan :: MonadIO m => m (Chan a)
writeChan :: MonadIO m => Chan a -> a -> m ()
readChan :: MonadIO m => Chan a -> m a
dupChan :: MonadIO m => Chan a -> m (Chan a)
getChanContents :: MonadIO m => Chan a -> m [a]
writeList2Chan :: MonadIO m => Chan a -> [a] -> m ()
timeout :: MonadUnliftIO m => Int -> m a -> m (Maybe a)
link :: MonadIO m => Async a -> m ()
poll :: MonadIO m => Async a -> m (Maybe (Either SomeException a))

-- | Write a ByteString to the given Handle.
hPut :: MonadIO m => Handle -> ByteString -> m ()

-- | stripSuffix drops the given suffix from a sequence. It returns
--   Nothing if the sequence did not end with the suffix given, or
--   Just the sequence before the suffix, if it does.
--   
--   
--   > stripSuffix "bar" "foobar"
--   Just "foo"
--   > stripSuffix "abc" "foobar"
--   Nothing
--   
stripSuffix :: (IsSequence seq, Eq (Element seq)) => seq -> seq -> Maybe seq

-- | Synonym for ocompareLength
compareLength :: (MonoFoldable mono, Integral i) => mono -> i -> Ordering
link2 :: MonadIO m => Async a -> Async b -> m ()

-- | Add an extension, even if there is already one there, equivalent to
--   addExtension.
--   
--   
--   "/directory/path" <.> "ext" == "/directory/path.ext"
--   "/directory/path" <.> ".ext" == "/directory/path.ext"
--   
(<.>) :: FilePath -> String -> FilePath
infixr 7 <.>
terror :: HasCallStack => Text -> a

-- | the deep analogue of $!. In the expression f $!! x,
--   x is fully evaluated before the function f is
--   applied to it.
($!!) :: NFData a => (a -> b) -> a -> b
infixr 0 $!!

-- | Retrieves a function of the current environment.
asks :: MonadReader r m => (r -> a) -> m a
primToPrim :: (PrimBase m1, PrimMonad m2, PrimState m1 ~ PrimState m2) => m1 a -> m2 a
primToIO :: (PrimBase m, PrimState m ~ RealWorld) => m a -> IO a
primToST :: PrimBase m => m a -> ST (PrimState m) a

-- | Convert to proleptic Gregorian calendar.
toGregorian :: Day -> (Year, MonthOfYear, DayOfMonth)

-- | Convert from proleptic Gregorian calendar. Invalid values will be
--   clipped to the correct range, month first, then day.
fromGregorian :: Year -> MonthOfYear -> DayOfMonth -> Day

-- | Get the current UTCTime from the system clock.
getCurrentTime :: IO UTCTime

-- | Locale representing American usage.
--   
--   knownTimeZones contains only the ten time-zones mentioned in
--   RFC 822 sec. 5: "UT", "GMT", "EST", "EDT", "CST", "CDT", "MST", "MDT",
--   "PST", "PDT". Note that the parsing functions will regardless parse
--   "UTC", single-letter military time-zones, and +HHMM format.
defaultTimeLocale :: TimeLocale

-- | Substitute various time-related information for each %-code in the
--   string, as per formatCharacter.
--   
--   The general form is
--   %<modifier><width><alternate><specifier>,
--   where <modifier>, <width>, and
--   <alternate> are optional.
--   
--   
<modifier>
--   
--   glibc-style modifiers can be used before the specifier (here marked as
--   z):
--   
--   
--   
- %-z no padding
--   
- %_z pad with spaces
--   
- %0z pad with zeros
--   
- %^z convert to upper case
--   
- %#z convert to lower case (consistently, unlike
--   glibc)
--   
--   
--   
<width>
--   
--   Width digits can also be used after any modifiers and before the
--   specifier (here marked as z), for example:
--   
--   
--   
- %4z pad to 4 characters (with default padding
--   character)
--   
- %_12z pad with spaces to 12 characters
--   
--   
--   
<alternate>
--   
--   An optional E character indicates an alternate formatting.
--   Currently this only affects %Z and %z.
--   
--   
--   
- %Ez alternate formatting
--   
--   
--   
<specifier>
--   
--   For all types (note these three are done by formatTime, not by
--   formatCharacter):
--   
--   
--   
- %% %
--   
- %t tab
--   
- %n newline
--   
--   
--   
TimeZone
--   
--   For TimeZone (and ZonedTime and UTCTime):
--   
--   
--   
- %z timezone offset in the format
--   ±HHMM
--   
- %Ez timezone offset in the format
--   ±HH:MM
--   
- %Z timezone name (or else offset in the format
--   ±HHMM)
--   
- %EZ timezone name (or else offset in the format
--   ±HH:MM)
--   
--   
--   
LocalTime
--   
--   For LocalTime (and ZonedTime and UTCTime
--   and UniversalTime):
--   
--   
--   
- %c as dateTimeFmt locale (e.g.
--   %a %b %e %H:%M:%S %Z %Y)
--   
--   
--   
TimeOfDay
--   
--   For TimeOfDay (and LocalTime and ZonedTime
--   and UTCTime and UniversalTime):
--   
--   
--   
- %R same as %H:%M
--   
- %T same as %H:%M:%S
--   
- %X as timeFmt locale (e.g.
--   %H:%M:%S)
--   
- %r as time12Fmt locale (e.g.
--   %I:%M:%S %p)
--   
- %P day-half of day from (amPm
--   locale), converted to lowercase, am,
--   pm
--   
- %p day-half of day from (amPm
--   locale), AM, PM
--   
- %H hour of day (24-hour), 0-padded to two chars,
--   00 - 23
--   
- %k hour of day (24-hour), space-padded to two
--   chars,  0 - 23
--   
- %I hour of day-half (12-hour), 0-padded to two
--   chars, 01 - 12
--   
- %l hour of day-half (12-hour), space-padded to two
--   chars,  1 - 12
--   
- %M minute of hour, 0-padded to two chars,
--   00 - 59
--   
- %S second of minute (without decimal part),
--   0-padded to two chars, 00 - 60
--   
- %q picosecond of second, 0-padded to twelve chars,
--   000000000000 - 999999999999.
--   
- %Q decimal point and fraction of second, up to 12
--   second decimals, without trailing zeros. For a whole number of
--   seconds, %Q omits the decimal point unless padding is
--   specified.
--   
--   
--   
UTCTime and ZonedTime
--   
--   For UTCTime and ZonedTime:
--   
--   
--   
- %s number of whole seconds since the Unix epoch.
--   For times before the Unix epoch, this is a negative number. Note that
--   in %s.%q and %s%Q the decimals are positive, not
--   negative. For example, 0.9 seconds before the Unix epoch is formatted
--   as -1.1 with %s%Q.
--   
--   
--   
DayOfWeek
--   
--   For DayOfWeek (and Day and LocalTime and
--   ZonedTime and UTCTime and UniversalTime):
--   
--   
--   
- %u day of week number for Week Date format,
--   1 (= Monday) - 7 (= Sunday)
--   
- %w day of week number, 0 (= Sunday) -
--   6 (= Saturday)
--   
- %a day of week, short form (snd from
--   wDays locale), Sun - Sat
--   
- %A day of week, long form (fst from
--   wDays locale), Sunday -
--   Saturday
--   
--   
--   
Month
--   
--   For Month (and Day and LocalTime and
--   ZonedTime and UTCTime and UniversalTime):
--   
--   
--   
- %Y year, no padding. Note %0Y and
--   %_Y pad to four chars
--   
- %y year of century, 0-padded to two chars,
--   00 - 99
--   
- %C century, no padding. Note %0C and
--   %_C pad to two chars
--   
- %B month name, long form (fst from
--   months locale), January -
--   December
--   
- %b, %h month name, short form (snd
--   from months locale), Jan - Dec
--   
- %m month of year, 0-padded to two chars,
--   01 - 12
--   
--   
--   
Day
--   
--   For Day (and LocalTime and ZonedTime and
--   UTCTime and UniversalTime):
--   
--   
--   
- %D same as %m/%d/%y
--   
- %F same as %Y-%m-%d
--   
- %x as dateFmt locale (e.g.
--   %m/%d/%y)
--   
- %d day of month, 0-padded to two chars,
--   01 - 31
--   
- %e day of month, space-padded to two chars, 
--   1 - 31
--   
- %j day of year, 0-padded to three chars,
--   001 - 366
--   
- %f century for Week Date format, no padding. Note
--   %0f and %_f pad to two chars
--   
- %V week of year for Week Date format, 0-padded to
--   two chars, 01 - 53
--   
- %U week of year where weeks start on Sunday (as
--   sundayStartWeek), 0-padded to two chars, 00 -
--   53
--   
- %W week of year where weeks start on Monday (as
--   mondayStartWeek), 0-padded to two chars, 00 -
--   53
--   
--   
--   
Duration types
--   
--   The specifiers for DiffTime, NominalDiffTime,
--   CalendarDiffDays, and CalendarDiffTime are
--   semantically separate from the other types. Specifiers on negative
--   time differences will generally be negative (think rem rather
--   than mod).
--   
--   
NominalDiffTime and DiffTime
--   
--   Note that a "minute" of DiffTime is simply 60 SI seconds,
--   rather than a minute of civil time. Use NominalDiffTime to
--   work with civil time, ignoring any leap seconds.
--   
--   For NominalDiffTime and DiffTime:
--   
--   
--   
- %w total whole weeks
--   
- %d total whole days
--   
- %D whole days of week
--   
- %h total whole hours
--   
- %H whole hours of day
--   
- %m total whole minutes
--   
- %M whole minutes of hour
--   
- %s total whole seconds
--   
- %Es total seconds, with decimal point and up to
--   <width> (default 12) decimal places, without trailing zeros. For
--   a whole number of seconds, %Es omits the decimal point unless
--   padding is specified.
--   
- %0Es total seconds, with decimal point and
--   <width> (default 12) decimal places.
--   
- %S whole seconds of minute
--   
- %ES seconds of minute, with decimal point and up
--   to <width> (default 12) decimal places, without trailing zeros.
--   For a whole number of seconds, %ES omits the decimal point
--   unless padding is specified.
--   
- %0ES seconds of minute as two digits, with decimal
--   point and <width> (default 12) decimal places.
--   
--   
--   
CalendarDiffDays
--   
--   For CalendarDiffDays (and CalendarDiffTime):
--   
--   
--   
- %y total years
--   
- %b total months
--   
- %B months of year
--   
- %w total weeks, not including months
--   
- %d total days, not including months
--   
- %D days of week
--   
--   
--   
CalendarDiffTime
--   
--   For CalendarDiffTime:
--   
--   
--   
- %h total hours, not including months
--   
- %H hours of day
--   
- %m total minutes, not including months
--   
- %M minutes of hour
--   
- %s total whole seconds, not including months
--   
- %Es total seconds, not including months, with
--   decimal point and up to <width> (default 12) decimal places,
--   without trailing zeros. For a whole number of seconds, %Es
--   omits the decimal point unless padding is specified.
--   
- %0Es total seconds, not including months, with
--   decimal point and <width> (default 12) decimal places.
--   
- %S whole seconds of minute
--   
- %ES seconds of minute, with decimal point and up
--   to <width> (default 12) decimal places, without trailing zeros.
--   For a whole number of seconds, %ES omits the decimal point
--   unless padding is specified.
--   
- %0ES seconds of minute as two digits, with decimal
--   point and <width> (default 12) decimal places.
--   
formatTime :: FormatTime t => TimeLocale -> String -> t -> String

-- | Parses a time value given a format string. Missing information will be
--   derived from 1970-01-01 00:00 UTC (which was a Thursday). Supports the
--   same %-codes as formatTime, including %-,
--   %_ and %0 modifiers, however padding widths are not
--   supported. Case is not significant in the input string. Some
--   variations in the input are accepted:
--   
--   
--   
- %z %Ez accepts any of ±HHMM or
--   ±HH:MM.
--   
- %Z %EZ accepts any string of letters, or
--   any of the formats accepted by %z.
--   
- %0Y accepts exactly four digits.
--   
- %0G accepts exactly four digits.
--   
- %0C accepts exactly two digits.
--   
- %0f accepts exactly two digits.
--   
--   
--   For example, to parse a date in YYYY-MM-DD format, while allowing the
--   month and date to have optional leading zeros (notice the -
--   modifier used for %m and %d):
--   
--   
--   Prelude Data.Time> parseTimeM True defaultTimeLocale "%Y-%-m-%-d" "2010-3-04" :: Maybe Day
--   Just 2010-03-04
--   
parseTimeM :: (MonadFail m, ParseTime t) => Bool -> TimeLocale -> String -> String -> m t
tshow :: Show a => a -> Text
tlshow :: Show a => a -> LText

-- | Convert a character to lower case.
--   
--   Character-based case conversion is lossy in comparison to string-based
--   toLower. For instance, İ will be converted to i, instead of i̇.
charToLower :: Char -> Char

-- | Convert a character to upper case.
--   
--   Character-based case conversion is lossy in comparison to string-based
--   toUpper. For instance, ß won't be converted to SS.
charToUpper :: Char -> Char
readMay :: (Element c ~ Char, MonoFoldable c, Read a) => c -> Maybe a
asByteString :: ByteString -> ByteString
asLByteString :: LByteString -> LByteString
asHashMap :: HashMap k v -> HashMap k v
asHashSet :: HashSet a -> HashSet a
asText :: Text -> Text
asLText :: LText -> LText
asList :: [a] -> [a]
asMap :: Map k v -> Map k v
asIntMap :: IntMap v -> IntMap v
asMaybe :: Maybe a -> Maybe a
asSet :: Set a -> Set a
asIntSet :: IntSet -> IntSet
asVector :: Vector a -> Vector a
asUVector :: UVector a -> UVector a
asSVector :: SVector a -> SVector a
asString :: [Char] -> [Char]

-- | Originally yield.
yieldThread :: MonadIO m => m ()

-- | same behavior as nub, but requires Hashable &
--   Eq and is O(n log n)
--   
--   https://github.com/nh2/haskell-ordnub
hashNub :: (Hashable a, Eq a) => [a] -> [a]

-- | Synonym for orElse.
orElseSTM :: STM a -> STM a -> STM a

-- | Only perform the action if the predicate returns True.
--   
--   Since 0.9.2
whenM :: Monad m => m Bool -> m () -> m ()

-- | Only perform the action if the predicate returns False.
--   
--   Since 0.9.2
unlessM :: Monad m => m Bool -> m () -> m ()

-- | Force type to a DList
--   
--   Since 0.11.0
asDList :: DList a -> DList a

-- | Synonym for apply
--   
--   Since 0.11.0
applyDList :: DList a -> [a] -> [a]

-- | && lifted to an Applicative.
(<&&>) :: Applicative a => a Bool -> a Bool -> a Bool
infixr 3 <&&>

-- | || lifted to an Applicative.
(<||>) :: Applicative a => a Bool -> a Bool -> a Bool
infixr 2 <||>

-- | Convert a ByteString into a storable Vector.
toByteVector :: ByteString -> SVector Word8

-- | Convert a storable Vector into a ByteString.
fromByteVector :: SVector Word8 -> ByteString

-- | waitSTM for any MonadIO
waitAsync :: MonadIO m => Async a -> m a

-- | pollSTM for any MonadIO
pollAsync :: MonadIO m => Async a -> m (Maybe (Either SomeException a))

-- | waitCatchSTM for any MonadIO
waitCatchAsync :: MonadIO m => Async a -> m (Either SomeException a)

-- | link generalized to any MonadIO
linkAsync :: MonadIO m => Async a -> m ()

-- | link2 generalized to any MonadIO
link2Async :: MonadIO m => Async a -> Async b -> m ()

-- | Strictly read a file into a Text using a UTF-8 character
--   encoding. In the event of a character encoding error, a Unicode
--   replacement character will be used (a.k.a., lenientDecode).
readFileUtf8 :: MonadIO m => FilePath -> m Text

-- | Write a Text to a file using a UTF-8 character encoding.
writeFileUtf8 :: MonadIO m => FilePath -> Text -> m ()

-- | Read a single chunk of data as a ByteString from the given
--   Handle.
--   
--   Under the surface, this uses hGetSome with the default chunk
--   size.
hGetChunk :: MonadIO m => Handle -> m ByteString
parseTime :: ParseTime t => TimeLocale -> String -> String -> Maybe t
waitSTM :: Async a -> STM a
pollSTM :: Async a -> STM (Maybe (Either SomeException a))
waitCatchSTM :: Async a -> STM (Either SomeException a)
asyncBound :: MonadUnliftIO m => m a -> m (Async a)
asyncOn :: MonadUnliftIO m => Int -> m a -> m (Async a)
asyncWithUnmask :: MonadUnliftIO m => ((forall b. () => m b -> m b) -> m a) -> m (Async a)
asyncOnWithUnmask :: MonadUnliftIO m => Int -> ((forall b. () => m b -> m b) -> m a) -> m (Async a)
withAsyncBound :: MonadUnliftIO m => m a -> (Async a -> m b) -> m b
withAsyncOn :: MonadUnliftIO m => Int -> m a -> (Async a -> m b) -> m b
withAsyncWithUnmask :: MonadUnliftIO m => ((forall c. () => m c -> m c) -> m a) -> (Async a -> m b) -> m b
withAsyncOnWithUnmask :: MonadUnliftIO m => Int -> ((forall c. () => m c -> m c) -> m a) -> (Async a -> m b) -> m b
cancelWith :: (Exception e, MonadIO m) => Async a -> e -> m ()
waitAnyCatch :: MonadIO m => [Async a] -> m (Async a, Either SomeException a)
waitAnyCatchSTM :: [Async a] -> STM (Async a, Either SomeException a)
waitAnyCatchCancel :: MonadIO m => [Async a] -> m (Async a, Either SomeException a)
waitAny :: MonadIO m => [Async a] -> m (Async a, a)
waitAnySTM :: [Async a] -> STM (Async a, a)
waitAnyCancel :: MonadIO m => [Async a] -> m (Async a, a)
waitEitherCatch :: MonadIO m => Async a -> Async b -> m (Either (Either SomeException a) (Either SomeException b))
waitEitherCatchSTM :: Async a -> Async b -> STM (Either (Either SomeException a) (Either SomeException b))
waitEitherCatchCancel :: MonadIO m => Async a -> Async b -> m (Either (Either SomeException a) (Either SomeException b))
waitEither :: MonadIO m => Async a -> Async b -> m (Either a b)
waitEitherSTM :: Async a -> Async b -> STM (Either a b)
waitEither_ :: MonadIO m => Async a -> Async b -> m ()
waitEitherSTM_ :: Async a -> Async b -> STM ()
waitEitherCancel :: MonadIO m => Async a -> Async b -> m (Either a b)
waitBoth :: MonadIO m => Async a -> Async b -> m (a, b)
waitBothSTM :: Async a -> Async b -> STM (a, b)
race :: MonadUnliftIO m => m a -> m b -> m (Either a b)
race_ :: MonadUnliftIO m => m a -> m b -> m ()
concurrently_ :: MonadUnliftIO m => m a -> m b -> m ()
mapConcurrently :: (MonadUnliftIO m, Traversable t) => (a -> m b) -> t a -> m (t b)
forConcurrently :: (MonadUnliftIO m, Traversable t) => t a -> (a -> m b) -> m (t b)
mapConcurrently_ :: (MonadUnliftIO m, Foldable f) => (a -> m b) -> f a -> m ()
forConcurrently_ :: (MonadUnliftIO m, Foldable f) => f a -> (a -> m b) -> m ()
replicateConcurrently :: MonadUnliftIO f => Int -> f a -> f [a]
replicateConcurrently_ :: (Applicative m, MonadUnliftIO m) => Int -> m a -> m ()

-- | Builds and returns a new instance of TBQueue.
newTBQueue :: Natural -> STM (TBQueue a)

-- | Write a value to a TBQueue; blocks if the queue is full.
writeTBQueue :: TBQueue a -> a -> STM ()

-- | Read the next value from the TBQueue.
readTBQueue :: TBQueue a -> STM a

-- | A version of readTBQueue which does not retry. Instead it
--   returns Nothing if no value is available.
tryReadTBQueue :: TBQueue a -> STM (Maybe a)

-- | Efficiently read the entire contents of a TBQueue into a list.
--   This function never retries.
flushTBQueue :: TBQueue a -> STM [a]

-- | Get the next value from the TBQueue without removing it,
--   retrying if the channel is empty.
peekTBQueue :: TBQueue a -> STM a

-- | A version of peekTBQueue which does not retry. Instead it
--   returns Nothing if no value is available.
tryPeekTBQueue :: TBQueue a -> STM (Maybe a)

-- | Put a data item back onto a channel, where it will be the next item
--   read. Blocks if the queue is full.
unGetTBQueue :: TBQueue a -> a -> STM ()

-- | Return the length of a TBQueue.
lengthTBQueue :: TBQueue a -> STM Natural

-- | Returns True if the supplied TBQueue is empty.
isEmptyTBQueue :: TBQueue a -> STM Bool

-- | Returns True if the supplied TBQueue is full.
isFullTBQueue :: TBQueue a -> STM Bool

-- | Build and return a new instance of TChan
newTChan :: STM (TChan a)

-- | Create a write-only TChan. More precisely, readTChan
--   will retry even after items have been written to the channel.
--   The only way to read a broadcast channel is to duplicate it with
--   dupTChan.
--   
--   Consider a server that broadcasts messages to clients:
--   
--   
--   serve :: TChan Message -> Client -> IO loop
--   serve broadcastChan client = do
--       myChan <- dupTChan broadcastChan
--       forever $ do
--           message <- readTChan myChan
--           send client message
--   
--   
--   The problem with using newTChan to create the broadcast channel
--   is that if it is only written to and never read, items will pile up in
--   memory. By using newBroadcastTChan to create the broadcast
--   channel, items can be garbage collected after clients have seen them.
newBroadcastTChan :: STM (TChan a)

-- | Write a value to a TChan.
writeTChan :: TChan a -> a -> STM ()

-- | Read the next value from the TChan.
readTChan :: TChan a -> STM a

-- | A version of readTChan which does not retry. Instead it returns
--   Nothing if no value is available.
tryReadTChan :: TChan a -> STM (Maybe a)

-- | Get the next value from the TChan without removing it,
--   retrying if the channel is empty.
peekTChan :: TChan a -> STM a

-- | A version of peekTChan which does not retry. Instead it returns
--   Nothing if no value is available.
tryPeekTChan :: TChan a -> STM (Maybe a)

-- | Duplicate a TChan: the duplicate channel begins empty, but data
--   written to either channel from then on will be available from both.
--   Hence this creates a kind of broadcast channel, where data written by
--   anyone is seen by everyone else.
dupTChan :: TChan a -> STM (TChan a)

-- | Put a data item back onto a channel, where it will be the next item
--   read.
unGetTChan :: TChan a -> a -> STM ()

-- | Returns True if the supplied TChan is empty.
isEmptyTChan :: TChan a -> STM Bool

-- | Clone a TChan: similar to dupTChan, but the cloned channel
--   starts with the same content available as the original channel.
cloneTChan :: TChan a -> STM (TChan a)

-- | Create a TMVar which contains the supplied value.
newTMVar :: a -> STM (TMVar a)

-- | Create a TMVar which is initially empty.
newEmptyTMVar :: STM (TMVar a)
newEmptyTMVarIO :: MonadIO m => m (TMVar a)

-- | Return the contents of the TMVar. If the TMVar is
--   currently empty, the transaction will retry. After a
--   takeTMVar, the TMVar is left empty.
takeTMVar :: TMVar a -> STM a

-- | A version of takeTMVar that does not retry. The
--   tryTakeTMVar function returns Nothing if the
--   TMVar was empty, or Just a if the TMVar
--   was full with contents a. After tryTakeTMVar, the
--   TMVar is left empty.
tryTakeTMVar :: TMVar a -> STM (Maybe a)

-- | Put a value into a TMVar. If the TMVar is currently
--   full, putTMVar will retry.
putTMVar :: TMVar a -> a -> STM ()

-- | A version of putTMVar that does not retry. The
--   tryPutTMVar function attempts to put the value a into
--   the TMVar, returning True if it was successful, or
--   False otherwise.
tryPutTMVar :: TMVar a -> a -> STM Bool

-- | This is a combination of takeTMVar and putTMVar; ie. it
--   takes the value from the TMVar, puts it back, and also returns
--   it.
readTMVar :: TMVar a -> STM a

-- | A version of readTMVar which does not retry. Instead it returns
--   Nothing if no value is available.
tryReadTMVar :: TMVar a -> STM (Maybe a)

-- | Swap the contents of a TMVar for a new value.
swapTMVar :: TMVar a -> a -> STM a

-- | Non-blocking write of a new value to a TMVar Puts if empty.
--   Replaces if populated.
writeTMVar :: TMVar a -> a -> STM ()

-- | Check whether a given TMVar is empty.
isEmptyTMVar :: TMVar a -> STM Bool
mkWeakTMVar :: MonadUnliftIO m => TMVar a -> m () -> m (Weak (TMVar a))

-- | Build and returns a new instance of TQueue
newTQueue :: STM (TQueue a)

-- | Write a value to a TQueue.
writeTQueue :: TQueue a -> a -> STM ()

-- | Read the next value from the TQueue.
readTQueue :: TQueue a -> STM a

-- | A version of readTQueue which does not retry. Instead it
--   returns Nothing if no value is available.
tryReadTQueue :: TQueue a -> STM (Maybe a)

-- | Get the next value from the TQueue without removing it,
--   retrying if the channel is empty.
peekTQueue :: TQueue a -> STM a

-- | A version of peekTQueue which does not retry. Instead it
--   returns Nothing if no value is available.
tryPeekTQueue :: TQueue a -> STM (Maybe a)

-- | Put a data item back onto a channel, where it will be the next item
--   read.
unGetTQueue :: TQueue a -> a -> STM ()

-- | Returns True if the supplied TQueue is empty.
isEmptyTQueue :: TQueue a -> STM Bool

-- | Mutate the contents of a TVar. N.B., this version is
--   non-strict.
modifyTVar :: TVar a -> (a -> a) -> STM ()

-- | Strict version of modifyTVar.
modifyTVar' :: TVar a -> (a -> a) -> STM ()

-- | Like modifyTVar' but the function is a simple state transition
--   that can return a side value which is passed on as the result of the
--   STM.
stateTVar :: TVar s -> (s -> (a, s)) -> STM a

-- | Swap the contents of a TVar for a new value.
swapTVar :: TVar a -> a -> STM a
mkWeakTVar :: MonadUnliftIO m => TVar a -> m () -> m (Weak (TVar a))
catchDeep :: (MonadUnliftIO m, Exception e, NFData a) => m a -> (e -> m a) -> m a
catchAnyDeep :: (NFData a, MonadUnliftIO m) => m a -> (SomeException -> m a) -> m a
catchSyncOrAsync :: (MonadUnliftIO m, Exception e) => m a -> (e -> m a) -> m a
handleIO :: MonadUnliftIO m => (IOException -> m a) -> m a -> m a
handleAny :: MonadUnliftIO m => (SomeException -> m a) -> m a -> m a
handleDeep :: (MonadUnliftIO m, Exception e, NFData a) => (e -> m a) -> m a -> m a
handleAnyDeep :: (MonadUnliftIO m, NFData a) => (SomeException -> m a) -> m a -> m a
handleSyncOrAsync :: (MonadUnliftIO m, Exception e) => (e -> m a) -> m a -> m a
tryAny :: MonadUnliftIO m => m a -> m (Either SomeException a)
tryDeep :: (MonadUnliftIO m, Exception e, NFData a) => m a -> m (Either e a)
tryAnyDeep :: (MonadUnliftIO m, NFData a) => m a -> m (Either SomeException a)
trySyncOrAsync :: (MonadUnliftIO m, Exception e) => m a -> m (Either e a)
pureTry :: a -> Either SomeException a
pureTryDeep :: NFData a => a -> Either SomeException a
catchesDeep :: (MonadUnliftIO m, NFData a) => m a -> [Handler m a] -> m a
evaluateDeep :: (MonadIO m, NFData a) => a -> m a
bracketOnError_ :: MonadUnliftIO m => m a -> m b -> m c -> m c
withException :: (MonadUnliftIO m, Exception e) => m a -> (e -> m b) -> m a
toSyncException :: Exception e => e -> SomeException
toAsyncException :: Exception e => e -> SomeException
fromExceptionUnwrap :: Exception e => SomeException -> Maybe e
isSyncException :: Exception e => e -> Bool
isAsyncException :: Exception e => e -> Bool
throwString :: (MonadIO m, HasCallStack) => String -> m a
stringException :: HasCallStack => String -> StringException
impureThrow :: Exception e => e -> a
fromEither :: (Exception e, MonadIO m) => Either e a -> m a
fromEitherIO :: (Exception e, MonadIO m) => IO (Either e a) -> m a
fromEitherM :: (Exception e, MonadIO m) => m (Either e a) -> m a
mapExceptionM :: (Exception e1, Exception e2, MonadUnliftIO m) => (e1 -> e2) -> m a -> m a
conc :: m a -> Conc m a
runConc :: MonadUnliftIO m => Conc m a -> m a
pooledMapConcurrentlyN :: (MonadUnliftIO m, Traversable t) => Int -> (a -> m b) -> t a -> m (t b)
pooledMapConcurrently :: (MonadUnliftIO m, Traversable t) => (a -> m b) -> t a -> m (t b)
pooledForConcurrentlyN :: (MonadUnliftIO m, Traversable t) => Int -> t a -> (a -> m b) -> m (t b)
pooledForConcurrently :: (MonadUnliftIO m, Traversable t) => t a -> (a -> m b) -> m (t b)
pooledMapConcurrentlyN_ :: (MonadUnliftIO m, Foldable f) => Int -> (a -> m b) -> f a -> m ()
pooledMapConcurrently_ :: (MonadUnliftIO m, Foldable f) => (a -> m b) -> f a -> m ()
pooledForConcurrently_ :: (MonadUnliftIO m, Foldable f) => f a -> (a -> m b) -> m ()
pooledForConcurrentlyN_ :: (MonadUnliftIO m, Foldable t) => Int -> t a -> (a -> m b) -> m ()
pooledReplicateConcurrentlyN :: MonadUnliftIO m => Int -> Int -> m a -> m [a]
pooledReplicateConcurrently :: MonadUnliftIO m => Int -> m a -> m [a]
pooledReplicateConcurrentlyN_ :: MonadUnliftIO m => Int -> Int -> m a -> m ()
pooledReplicateConcurrently_ :: MonadUnliftIO m => Int -> m a -> m ()
runMemoized :: MonadIO m => Memoized a -> m a
memoizeRef :: MonadUnliftIO m => m a -> m (Memoized a)
memoizeMVar :: MonadUnliftIO m => m a -> m (Memoized a)
withQSem :: MonadUnliftIO m => QSem -> m a -> m a
withQSemN :: MonadUnliftIO m => QSemN -> Int -> m a -> m a
retrySTM :: STM a
checkSTM :: Bool -> STM ()
withSystemTempFile :: MonadUnliftIO m => String -> (FilePath -> Handle -> m a) -> m a
withSystemTempDirectory :: MonadUnliftIO m => String -> (FilePath -> m a) -> m a
askUnliftIO :: MonadUnliftIO m => m (UnliftIO m)
askRunInIO :: MonadUnliftIO m => m (m a -> IO a)
withUnliftIO :: MonadUnliftIO m => (UnliftIO m -> IO a) -> m a
toIO :: MonadUnliftIO m => m a -> m (IO a)
wrappedWithRunInIO :: MonadUnliftIO n => (n b -> m b) -> (forall a. () => m a -> n a) -> ((forall a. () => m a -> IO a) -> IO b) -> m b
liftIOOp :: MonadUnliftIO m => (IO a -> IO b) -> m a -> m b
asIORef :: IORef a -> IORef a
asSTRef :: STRef s a -> STRef s a
asMutVar :: MutVar s a -> MutVar s a
asBRef :: BRef s a -> BRef s a
asDLList :: DLList s a -> DLList s a
asUDeque :: UDeque s a -> UDeque s a
asSDeque :: SDeque s a -> SDeque s a
asBDeque :: BDeque s a -> BDeque s a
asPRef :: PRef s a -> PRef s a
asSRef :: SRef s a -> SRef s a
asURef :: URef s a -> URef s a
newTBChan :: Int -> STM (TBChan a)
newTBChanIO :: Int -> IO (TBChan a)
readTBChan :: TBChan a -> STM a
tryReadTBChan :: TBChan a -> STM (Maybe a)
peekTBChan :: TBChan a -> STM a
tryPeekTBChan :: TBChan a -> STM (Maybe a)
writeTBChan :: TBChan a -> a -> STM ()
tryWriteTBChan :: TBChan a -> a -> STM Bool
unGetTBChan :: TBChan a -> a -> STM ()
isEmptyTBChan :: TBChan a -> STM Bool
isFullTBChan :: TBChan a -> STM Bool
estimateFreeSlotsTBChan :: TBChan a -> STM Int
freeSlotsTBChan :: TBChan a -> STM Int
newTBMChan :: Int -> STM (TBMChan a)
newTBMChanIO :: Int -> IO (TBMChan a)
readTBMChan :: TBMChan a -> STM (Maybe a)
tryReadTBMChan :: TBMChan a -> STM (Maybe (Maybe a))
peekTBMChan :: TBMChan a -> STM (Maybe a)
tryPeekTBMChan :: TBMChan a -> STM (Maybe (Maybe a))
writeTBMChan :: TBMChan a -> a -> STM ()
tryWriteTBMChan :: TBMChan a -> a -> STM (Maybe Bool)
unGetTBMChan :: TBMChan a -> a -> STM ()
closeTBMChan :: TBMChan a -> STM ()
isClosedTBMChan :: TBMChan a -> STM Bool
isEmptyTBMChan :: TBMChan a -> STM Bool
isFullTBMChan :: TBMChan a -> STM Bool
estimateFreeSlotsTBMChan :: TBMChan a -> STM Int
freeSlotsTBMChan :: TBMChan a -> STM Int
newTBMQueue :: Int -> STM (TBMQueue a)
newTBMQueueIO :: Int -> IO (TBMQueue a)
readTBMQueue :: TBMQueue a -> STM (Maybe a)
tryReadTBMQueue :: TBMQueue a -> STM (Maybe (Maybe a))
peekTBMQueue :: TBMQueue a -> STM (Maybe a)
tryPeekTBMQueue :: TBMQueue a -> STM (Maybe (Maybe a))
writeTBMQueue :: TBMQueue a -> a -> STM ()
tryWriteTBMQueue :: TBMQueue a -> a -> STM (Maybe Bool)
unGetTBMQueue :: TBMQueue a -> a -> STM ()
closeTBMQueue :: TBMQueue a -> STM ()
isClosedTBMQueue :: TBMQueue a -> STM Bool
isEmptyTBMQueue :: TBMQueue a -> STM Bool
isFullTBMQueue :: TBMQueue a -> STM Bool
estimateFreeSlotsTBMQueue :: TBMQueue a -> STM Int
freeSlotsTBMQueue :: TBMQueue a -> STM Int
newTMChan :: STM (TMChan a)
newTMChanIO :: IO (TMChan a)
newBroadcastTMChan :: STM (TMChan a)
newBroadcastTMChanIO :: IO (TMChan a)
dupTMChan :: TMChan a -> STM (TMChan a)
readTMChan :: TMChan a -> STM (Maybe a)
tryReadTMChan :: TMChan a -> STM (Maybe (Maybe a))
peekTMChan :: TMChan a -> STM (Maybe a)
tryPeekTMChan :: TMChan a -> STM (Maybe (Maybe a))
writeTMChan :: TMChan a -> a -> STM ()
unGetTMChan :: TMChan a -> a -> STM ()
closeTMChan :: TMChan a -> STM ()
isClosedTMChan :: TMChan a -> STM Bool
isEmptyTMChan :: TMChan a -> STM Bool
newTMQueue :: STM (TMQueue a)
newTMQueueIO :: IO (TMQueue a)
readTMQueue :: TMQueue a -> STM (Maybe a)
tryReadTMQueue :: TMQueue a -> STM (Maybe (Maybe a))
peekTMQueue :: TMQueue a -> STM (Maybe a)
tryPeekTMQueue :: TMQueue a -> STM (Maybe (Maybe a))
writeTMQueue :: TMQueue a -> a -> STM ()
unGetTMQueue :: TMQueue a -> a -> STM ()
closeTMQueue :: TMQueue a -> STM ()
isClosedTMQueue :: TMQueue a -> STM Bool
isEmptyTMQueue :: TMQueue a -> STM Bool
newMutVar :: PrimMonad m => a -> m (MutVar (PrimState m) a)
readMutVar :: PrimMonad m => MutVar (PrimState m) a -> m a
writeMutVar :: PrimMonad m => MutVar (PrimState m) a -> a -> m ()
atomicModifyMutVar :: PrimMonad m => MutVar (PrimState m) a -> (a -> (a, b)) -> m b
atomicModifyMutVar' :: PrimMonad m => MutVar (PrimState m) a -> (a -> (a, b)) -> m b
modifyMutVar :: PrimMonad m => MutVar (PrimState m) a -> (a -> a) -> m ()
modifyMutVar' :: PrimMonad m => MutVar (PrimState m) a -> (a -> a) -> m ()

-- | replaceElem old new replaces all old elements
--   with new.
replaceElem :: (MonoFunctor mono, Eq (Element mono)) => Element mono -> Element mono -> mono -> mono
replaceElemStrictText :: Char -> Char -> Text -> Text
replaceElemLazyText :: Char -> Char -> Text -> Text

-- | Safe version of headEx.
--   
--   Returns Nothing instead of throwing an exception when
--   encountering an empty monomorphic container.
headMay :: MonoFoldable mono => mono -> Maybe (Element mono)

-- | Safe version of lastEx.
--   
--   Returns Nothing instead of throwing an exception when
--   encountering an empty monomorphic container.
lastMay :: MonoFoldable mono => mono -> Maybe (Element mono)

-- | osum computes the sum of the numbers of a monomorphic
--   container.
osum :: (MonoFoldable mono, Num (Element mono)) => mono -> Element mono

-- | oproduct computes the product of the numbers of a monomorphic
--   container.
oproduct :: (MonoFoldable mono, Num (Element mono)) => mono -> Element mono

-- | Are all of the elements True?
oand :: (Element mono ~ Bool, MonoFoldable mono) => mono -> Bool

-- | Are any of the elements True?
oor :: (Element mono ~ Bool, MonoFoldable mono) => mono -> Bool

-- | Synonym for ofoldMap
oconcatMap :: (MonoFoldable mono, Monoid m) => (Element mono -> m) -> mono -> m

-- | Monoidally combine all values in the container
ofold :: (MonoFoldable mono, Monoid (Element mono)) => mono -> Element mono

-- | Synonym for ofold
oconcat :: (MonoFoldable mono, Monoid (Element mono)) => mono -> Element mono

-- | Synonym for ofoldlM
ofoldM :: (MonoFoldable mono, Monad m) => (a -> Element mono -> m a) -> a -> mono -> m a

-- | Perform all actions in the given container
osequence_ :: (Applicative m, MonoFoldable mono, Element mono ~ m ()) => mono -> m ()

-- | Get the minimum element of a monomorphic container.
--   
--   Note: this is a partial function. On an empty MonoFoldable, it
--   will throw an exception.
--   
--   See maximum from Data.NonNull for a total version of
--   this function.
maximumEx :: (MonoFoldable mono, Ord (Element mono)) => mono -> Element mono

-- | Get the maximum element of a monomorphic container.
--   
--   Note: this is a partial function. On an empty MonoFoldable, it
--   will throw an exception.
--   
--   See minimum from Data.NonNull for a total version of
--   this function.
minimumEx :: (MonoFoldable mono, Ord (Element mono)) => mono -> Element mono

-- | Safe version of maximumEx.
--   
--   Returns Nothing instead of throwing an exception when
--   encountering an empty monomorphic container.
maximumMay :: (MonoFoldable mono, Ord (Element mono)) => mono -> Maybe (Element mono)

-- | Safe version of maximumByEx.
--   
--   Returns Nothing instead of throwing an exception when
--   encountering an empty monomorphic container.
maximumByMay :: MonoFoldable mono => (Element mono -> Element mono -> Ordering) -> mono -> Maybe (Element mono)

-- | Safe version of minimumEx.
--   
--   Returns Nothing instead of throwing an exception when
--   encountering an empty monomorphic container.
minimumMay :: (MonoFoldable mono, Ord (Element mono)) => mono -> Maybe (Element mono)

-- | Safe version of minimumByEx.
--   
--   Returns Nothing instead of throwing an exception when
--   encountering an empty monomorphic container.
minimumByMay :: MonoFoldable mono => (Element mono -> Element mono -> Ordering) -> mono -> Maybe (Element mono)

-- | ofor is otraverse with its arguments flipped.
ofor :: (MonoTraversable mono, Applicative f) => mono -> (Element mono -> f (Element mono)) -> f mono

-- | oforM is omapM with its arguments flipped.
oforM :: (MonoTraversable mono, Applicative f) => mono -> (Element mono -> f (Element mono)) -> f mono

-- | A strict left fold, together with an unwrap function.
--   
--   This is convenient when the accumulator value is not the same as the
--   final expected type. It is provided mainly for integration with the
--   foldl package, to be used in conjunction with
--   purely.
ofoldlUnwrap :: MonoFoldable mono => (x -> Element mono -> x) -> x -> (x -> b) -> mono -> b

-- | A monadic strict left fold, together with an unwrap function.
--   
--   Similar to foldlUnwrap, but allows monadic actions. To be
--   used with impurely from foldl.
ofoldMUnwrap :: (Monad m, MonoFoldable mono) => (x -> Element mono -> m x) -> m x -> (x -> m b) -> mono -> m b

-- | intercalate seq seqs inserts seq in between
--   seqs and concatenates the result.
ointercalate :: (MonoFoldable mono, Monoid (Element mono)) => Element mono -> mono -> Element mono

-- | Unwraps a WrappedMono.
unwrapMono :: WrappedMono mono a -> mono

-- | Synonym for olength64
length64 :: MonoFoldable mono => mono -> Int64

-- | Synonym for ofoldMap1Ex
foldMap1Ex :: (MonoFoldable mono, Semigroup m) => (Element mono -> m) -> mono -> m

-- | Synonym for ofoldr1Ex
foldr1Ex :: MonoFoldable mono => (Element mono -> Element mono -> Element mono) -> mono -> Element mono

-- | Synonym for ofoldl1Ex'
foldl1Ex' :: MonoFoldable mono => (Element mono -> Element mono -> Element mono) -> mono -> Element mono

-- | Synonym for opoint
point :: MonoPointed mono => Element mono -> mono

-- | Use Data.List's implementation of find.
defaultFind :: MonoFoldable seq => (Element seq -> Bool) -> seq -> Maybe (Element seq)

-- | Use Data.List's implementation of intersperse.
defaultIntersperse :: IsSequence seq => Element seq -> seq -> seq

-- | Use Data.List's implementation of reverse.
defaultReverse :: IsSequence seq => seq -> seq

-- | Use Data.List's implementation of sortBy.
defaultSortBy :: IsSequence seq => (Element seq -> Element seq -> Ordering) -> seq -> seq

-- | Use splitWhen from Data.List.Split
defaultSplitWhen :: IsSequence seq => (Element seq -> Bool) -> seq -> [seq]

-- | Sort a vector using an supplied element ordering function.
vectorSortBy :: Vector v e => (e -> e -> Ordering) -> v e -> v e

-- | Sort a vector.
vectorSort :: (Vector v e, Ord e) => v e -> v e

-- | Use Data.List's : to prepend an element to a sequence.
defaultCons :: IsSequence seq => Element seq -> seq -> seq

-- | Use Data.List's ++ to append an element to a sequence.
defaultSnoc :: IsSequence seq => seq -> Element seq -> seq

-- | like Data.List.tail, but an input of mempty returns
--   mempty
tailDef :: IsSequence seq => seq -> seq

-- | like Data.List.init, but an input of mempty returns
--   mempty
initDef :: IsSequence seq => seq -> seq

-- | splitElem splits a sequence into components delimited
--   by separator element. It's equivalent to splitWhen with
--   equality predicate:
--   
--   
--   splitElem sep === splitWhen (== sep)
--   
--   
--   Since 0.9.3
splitElem :: (IsSequence seq, Eq (Element seq)) => Element seq -> seq -> [seq]

-- | splitSeq splits a sequence into components delimited
--   by separator subsequence. splitSeq is the right inverse of
--   intercalate:
--   
--   
--   ointercalate x . splitSeq x === id
--   
--   
--   splitElem can be considered a special case of splitSeq
--   
--   
--   splitSeq (singleton sep) === splitElem sep
--   
--   
--   splitSeq mempty is another special case: it splits
--   just before each element, and in line with splitWhen rules, it
--   has at least one output component:
--   
--   
--   > splitSeq "" ""
--   [""]
--   > splitSeq "" "a"
--   ["", "a"]
--   > splitSeq "" "ab"
--   ["", "a", "b"]
--   
--   
--   Since 0.9.3
splitSeq :: (IsSequence seq, Eq (Element seq)) => seq -> seq -> [seq]

-- | replaceSeq old new replaces all old
--   subsequences with new.
--   
--   
--   replaceSeq old new === ointercalate new . splitSeq old
--   
replaceSeq :: (IsSequence seq, Eq (Element seq)) => seq -> seq -> seq -> seq

-- | dropPrefix drops the given prefix from a sequence. It returns
--   the original sequence if the sequence doesn't start with the given
--   prefix.
--   
--   
--   > dropPrefix "foo" "foobar"
--   "bar"
--   > dropPrefix "abc" "foobar"
--   "foobar"
--   
dropPrefix :: (IsSequence seq, Eq (Element seq)) => seq -> seq -> seq

-- | dropSuffix drops the given suffix from a sequence. It returns
--   the original sequence if the sequence doesn't end with the given
--   suffix.
--   
--   
--   > dropSuffix "bar" "foobar"
--   "foo"
--   > dropSuffix "abc" "foobar"
--   "foobar"
--   
dropSuffix :: (IsSequence seq, Eq (Element seq)) => seq -> seq -> seq

-- | ensurePrefix will add a prefix to a sequence if it doesn't
--   exist, and otherwise have no effect.
--   
--   
--   > ensurePrefix "foo" "foobar"
--   "foobar"
--   > ensurePrefix "abc" "foobar"
--   "abcfoobar"
--   
ensurePrefix :: (Eq (Element seq), IsSequence seq) => seq -> seq -> seq

-- | Append a suffix to a sequence, unless it already has that suffix.
--   
--   
--   > ensureSuffix "bar" "foobar"
--   "foobar"
--   > ensureSuffix "abc" "foobar"
--   "foobarabc"
--   
ensureSuffix :: (Eq (Element seq), IsSequence seq) => seq -> seq -> seq

-- | Similar to standard group, but operates on the whole
--   collection, not just the consecutive items.
--   
--   Equivalent to groupAllOn id
groupAll :: (IsSequence seq, Eq (Element seq)) => seq -> [seq]
splitElemStrictBS :: Word8 -> ByteString -> [ByteString]
stripPrefixStrictBS :: ByteString -> ByteString -> Maybe ByteString
stripSuffixStrictBS :: ByteString -> ByteString -> Maybe ByteString
splitSeqLazyBS :: Word8 -> ByteString -> [ByteString]
stripPrefixLazyBS :: ByteString -> ByteString -> Maybe ByteString
stripSuffixLazyBS :: ByteString -> ByteString -> Maybe ByteString
splitSeqStrictText :: Text -> Text -> [Text]
replaceSeqStrictText :: Text -> Text -> Text -> Text
splitSeqLazyText :: Text -> Text -> [Text]
replaceSeqLazyText :: Text -> Text -> Text -> Text

-- | Repack from one type to another, dropping to a list in the middle.
--   
--   repack = pack . unpack.
repack :: (MonoFoldable a, IsSequence b, Element a ~ Element b) => a -> b
textToBuilder :: ToBuilder Text builder => Text -> builder

-- | Map each element of a monomorphic container to a semigroup, and
--   combine the results.
--   
--   Safe version of ofoldMap1Ex, only works on monomorphic
--   containers wrapped in a NonNull.
--   
--   
Examples
--   
--   
--   > let xs = ncons ("hello", 1 :: Integer) [(" world", 2)]
--   > ofoldMap1 fst xs
--   "hello world"
--   
ofoldMap1 :: (MonoFoldable mono, Semigroup m) => (Element mono -> m) -> NonNull mono -> m

-- | Right-associative fold of a monomorphic container with no base
--   element.
--   
--   Safe version of ofoldr1Ex, only works on monomorphic containers
--   wrapped in a NonNull.
--   
--   
--   foldr1 f = Prelude.foldr1 f . otoList
--   
--   
--   
Examples
--   
--   
--   > let xs = ncons "a" ["b", "c"]
--   > ofoldr1 (++) xs
--   "abc"
--   
ofoldr1 :: MonoFoldable mono => (Element mono -> Element mono -> Element mono) -> NonNull mono -> Element mono

-- | Strict left-associative fold of a monomorphic container with no base
--   element.
--   
--   Safe version of ofoldl1Ex', only works on monomorphic
--   containers wrapped in a NonNull.
--   
--   
--   foldl1' f = Prelude.foldl1' f . otoList
--   
--   
--   
Examples
--   
--   
--   > let xs = ncons "a" ["b", "c"]
--   > ofoldl1' (++) xs
--   "abc"
--   
ofoldl1' :: MonoFoldable mono => (Element mono -> Element mono -> Element mono) -> NonNull mono -> Element mono

-- | Safely convert from an unsafe monomorphic container to a
--   safe non-null monomorphic container.
fromNullable :: MonoFoldable mono => mono -> Maybe (NonNull mono)

-- | Unsafely convert from an unsafe monomorphic container to
--   a safe non-null monomorphic container.
--   
--   Throws an exception if the monomorphic container is empty.
impureNonNull :: MonoFoldable mono => mono -> NonNull mono

-- | Old synonym for impureNonNull
nonNull :: MonoFoldable mono => mono -> NonNull mono

-- | Specializes fromNonEmpty to lists only.
toMinList :: NonEmpty a -> NonNull [a]

-- | Prepend an element to a SemiSequence, creating a non-null
--   SemiSequence.
--   
--   Generally this uses cons underneath. cons is not efficient for most
--   data structures.
--   
--   Alternatives:
--   
--   
--   
- if you don't need to cons, use fromNullable or
--   nonNull if you can create your structure in one go.
--   
- if you need to cons, you might be able to start off with an
--   efficient data structure such as a NonEmpty List.
--   fromNonEmpty will convert that to your data structure using the
--   structure's fromList function.
--   
ncons :: SemiSequence seq => Element seq -> seq -> NonNull seq

-- | Extract the first element of a sequence and the rest of the non-null
--   sequence if it exists.
nuncons :: IsSequence seq => NonNull seq -> (Element seq, Maybe (NonNull seq))

-- | Same as nuncons with no guarantee that the rest of the sequence
--   is non-null.
splitFirst :: IsSequence seq => NonNull seq -> (Element seq, seq)

-- | Equivalent to Data.Sequences.filter, but works
--   on non-nullable sequences.
nfilter :: IsSequence seq => (Element seq -> Bool) -> NonNull seq -> seq

-- | Equivalent to Data.Sequences.filterM, but works
--   on non-nullable sequences.
nfilterM :: (Monad m, IsSequence seq) => (Element seq -> m Bool) -> NonNull seq -> m seq

-- | Equivalent to Data.Sequences.replicate
--   
--   i must be > 0
--   
--   i <= 0 is treated the same as providing 1
nReplicate :: IsSequence seq => Index seq -> Element seq -> NonNull seq

-- | Join a monomorphic container, whose elements are Semigroups,
--   together.
--   
--   Safe, only works on monomorphic containers wrapped in a
--   NonNull.
--   
--   
Examples
--   
--   
--   > let xs = ncons "a" ["b", "c"]
--   > xs
--   NonNull {toNullable = ["a","b","c"]}
--   
--   > ofold1 xs
--   "abc"
--   
ofold1 :: (MonoFoldable mono, Semigroup (Element mono)) => NonNull mono -> Element mono

-- | fmap over the underlying container in a NonNull.
mapNonNull :: (Functor f, MonoFoldable (f b)) => (a -> b) -> NonNull (f a) -> NonNull (f b)
sayString :: MonadIO m => String -> m ()
sayShow :: (MonadIO m, Show a) => a -> m ()
sayErr :: MonadIO m => Text -> m ()
sayErrString :: MonadIO m => String -> m ()
sayErrShow :: (MonadIO m, Show a) => a -> m ()
hSay :: MonadIO m => Handle -> Text -> m ()
hSayString :: MonadIO m => Handle -> String -> m ()
hSayShow :: (MonadIO m, Show a) => Handle -> a -> m ()
hPutStrLn :: MonadIO m => Handle -> Text -> m ()
whenJust :: Monoid m => Maybe a -> (a -> m) -> m

-- | This module contains two things:
--   
--   
--   
- Extension functions to libraries like GTK. These functions wrap up
--   some generic GTK functionality. They are not Termonad-specific.
--   
- Wrappers around functionality that is only specific to certain
--   versions of libraries like GTK or VTE.
--   
--   
--   For instance, terminalSetEnableSixelIfExists is a wrapper
--   around terminalSetEnableSixel. Sixel support is only availble
--   in vte >= 0.63, so if a user tries to compile Termonad with a
--   version of vte less than 0.63, this function won't do anything.
module Termonad.Gtk
objFromBuildUnsafe :: GObject o => Builder -> Text -> (ManagedPtr o -> o) -> IO o

-- | Unsafely creates a new Application. This calls fail if
--   it cannot create the Application for some reason.
--   
--   This can fail for different reasons, one of which being that
--   application name does not have a period in it.
appNew :: (HasCallStack, MonadIO m, MonadFail m) => Maybe Text -> [ApplicationFlags] -> m Application

-- | Tests to see if two GTK widgets point to the same thing. This should
--   only happen if they are actually the same thing.
widgetEq :: (MonadIO m, IsWidget a, IsWidget b) => a -> b -> m Bool

-- | Wrapper around terminalSetEnableSixel. The
--   terminalSetEnableSixel function is only available starting
--   with vte-0.63. This function has no effect when compiling against
--   previous versions of vte.
terminalSetEnableSixelIfExists :: (HasCallStack, MonadIO m, IsTerminal t) => t -> Bool -> m ()

module Termonad.Types

-- | A wrapper around a VTE Terminal. This also stores the process
--   ID of the process running on this terminal, as well as a Unique
--   that can be used for comparing terminals.
data TMTerm
TMTerm :: !Terminal -> !Int -> !Unique -> TMTerm

-- | The actual Terminal.
[term] :: TMTerm -> !Terminal

-- | The process ID of the process running in term.
[pid] :: TMTerm -> !Int

-- | A Unique for comparing different TMTerm for uniqueness.
[unique] :: TMTerm -> !Unique

-- | A container that holds everything in a given terminal window. The
--   term in the TMTerm is inside the
--   tmNotebookTabTermContainer ScrolledWindow. The notebook
--   tab Label is also available.
data TMNotebookTab
TMNotebookTab :: !ScrolledWindow -> !TMTerm -> !Label -> TMNotebookTab

-- | The ScrolledWindow holding the VTE Terminal.
[tmNotebookTabTermContainer] :: TMNotebookTab -> !ScrolledWindow

-- | The Terminal insidie the ScrolledWindow.
[tmNotebookTabTerm] :: TMNotebookTab -> !TMTerm

-- | The Label holding the title of the Terminal in the
--   Notebook tab.
[tmNotebookTabLabel] :: TMNotebookTab -> !Label

-- | This holds the GTK Notebook containing multiple tabs of
--   Terminals. We keep a separate list of terminals in
--   tmNotebookTabs.
data TMNotebook
TMNotebook :: !Notebook -> !FocusList TMNotebookTab -> TMNotebook

-- | This is the GTK Notebook that holds multiple tabs of
--   Terminals.
[tmNotebook] :: TMNotebook -> !Notebook

-- | A FocusList containing references to each individual
--   TMNotebookTab.
[tmNotebookTabs] :: TMNotebook -> !FocusList TMNotebookTab
data TMState'
TMState :: !Application -> !ApplicationWindow -> !TMNotebook -> !FontDescription -> !TMConfig -> TMState'
[tmStateApp] :: TMState' -> !Application
[tmStateAppWin] :: TMState' -> !ApplicationWindow
[tmStateNotebook] :: TMState' -> !TMNotebook
[tmStateFontDesc] :: TMState' -> !FontDescription
[tmStateConfig] :: TMState' -> !TMConfig
type TMState = MVar TMState'
createTMTerm :: Terminal -> Int -> Unique -> TMTerm
newTMTerm :: Terminal -> Int -> IO TMTerm
getFocusedTermFromState :: TMState -> IO (Maybe Terminal)
createTMNotebookTab :: Label -> ScrolledWindow -> TMTerm -> TMNotebookTab
createTMNotebook :: Notebook -> FocusList TMNotebookTab -> TMNotebook
createEmptyTMNotebook :: Notebook -> TMNotebook
notebookToList :: Notebook -> IO [Widget]
newTMState :: TMConfig -> Application -> ApplicationWindow -> TMNotebook -> FontDescription -> IO TMState
newEmptyTMState :: TMConfig -> Application -> ApplicationWindow -> Notebook -> FontDescription -> IO TMState
newTMStateSingleTerm :: TMConfig -> Application -> ApplicationWindow -> Notebook -> Label -> ScrolledWindow -> Terminal -> Int -> FontDescription -> IO TMState
traceShowMTMState :: TMState -> IO ()

-- | The font size for the Termonad terminal. There are two ways to set the
--   fontsize, corresponding to the two different ways to set the font size
--   in the Pango font rendering library.
--   
--   If you're not sure which to use, try FontSizePoints first and
--   see how it looks. It should generally correspond to font sizes you are
--   used to from other applications.
data FontSize

-- | This sets the font size based on "points". The conversion between a
--   point and an actual size depends on the system configuration and the
--   output device. The function fontDescriptionSetSize is used to
--   set the font size. See the documentation for that function for more
--   info.
FontSizePoints :: Int -> FontSize

-- | This sets the font size based on "device units". In general, this can
--   be thought of as one pixel. The function
--   fontDescriptionSetAbsoluteSize is used to set the font size.
--   See the documentation for that function for more info.
FontSizeUnits :: Double -> FontSize

-- | The default FontSize used if not specified.
--   
--   
--   >>> defaultFontSize
--   FontSizePoints 12
--   
defaultFontSize :: FontSize

-- | Modify a FontSize by adding some value.
--   
--   
--   >>> modFontSize 1 (FontSizePoints 13)
--   FontSizePoints 14
--   
--   >>> modFontSize 1 (FontSizeUnits 9.0)
--   FontSizeUnits 10.0
--   
--   
--   You can reduce the font size by passing a negative value.
--   
--   
--   >>> modFontSize (-2) (FontSizePoints 13)
--   FontSizePoints 11
--   
--   
--   If you try to create a font size less than 1, then the old font size
--   will be used.
--   
--   
--   >>> modFontSize (-10) (FontSizePoints 5)
--   FontSizePoints 5
--   
--   >>> modFontSize (-1) (FontSizeUnits 1.0)
--   FontSizeUnits 1.0
--   
modFontSize :: Int -> FontSize -> FontSize

-- | Settings for the font to be used in Termonad.
data FontConfig
FontConfig :: !Text -> !FontSize -> FontConfig

-- | The font family to use. Example: "DejaVu Sans Mono" or
--   "Source Code Pro"
[fontFamily] :: FontConfig -> !Text

-- | The font size.
[fontSize] :: FontConfig -> !FontSize

-- | The default FontConfig to use if not specified.
--   
--   
--   >>> defaultFontConfig == FontConfig {fontFamily = "Monospace", fontSize = defaultFontSize}
--   True
--   
defaultFontConfig :: FontConfig

-- | This data type represents an option that can either be Option
--   or Unset.
--   
--   This data type is used in situations where leaving an option unset
--   results in a special state that is not representable by setting any
--   specific value.
--   
--   Examples of this include the cursorFgColour and
--   cursorBgColour options supplied by the ColourConfig
--   ConfigExtension. By default, cursorFgColour and
--   cursorBgColour are both Unset. However, when
--   cursorBgColour is Option, cursorFgColour
--   defaults to the color of the text underneath. There is no way to
--   represent this by setting cursorFgColour.
data Option a
Unset :: Option a
Set :: !a -> Option a

-- | Run a function over the value contained in an Option. Return
--   mempty when Option is Unset.
--   
--   
--   >>> whenSet (Set [1,2,3]) (++ [4,5,6]) :: [Int]
--   [1,2,3,4,5,6]
--   
--   >>> whenSet Unset (++ [4,5,6]) :: [Int]
--   []
--   
whenSet :: Monoid m => Option a -> (a -> m) -> m

-- | Whether or not to show the scroll bar in a terminal.
data ShowScrollbar

-- | Never show the scroll bar, even if there are too many lines on the
--   terminal to show all at once. You should still be able to scroll with
--   the mouse wheel.
ShowScrollbarNever :: ShowScrollbar

-- | Always show the scrollbar, even if it is not needed.
ShowScrollbarAlways :: ShowScrollbar

-- | Only show the scrollbar if there are too many lines on the terminal to
--   show all at once.
ShowScrollbarIfNeeded :: ShowScrollbar

-- | Whether or not to show the tab bar for switching tabs.
data ShowTabBar

-- | Never show the tab bar, even if there are multiple tabs open. This may
--   be confusing if you plan on using multiple tabs.
ShowTabBarNever :: ShowTabBar

-- | Always show the tab bar, even if you only have one tab open.
ShowTabBarAlways :: ShowTabBar

-- | Only show the tab bar if you have multiple tabs open.
ShowTabBarIfNeeded :: ShowTabBar

-- | Configuration options for Termonad.
--   
--   See defaultConfigOptions for the default values.
data ConfigOptions
ConfigOptions :: !FontConfig -> !ShowScrollbar -> !Integer -> !Bool -> !Text -> !Bool -> !ShowTabBar -> !CursorBlinkMode -> !Bool -> !Bool -> !Bool -> ConfigOptions

-- | Specific options for fonts.
[fontConfig] :: ConfigOptions -> !FontConfig

-- | When to show the scroll bar.
[showScrollbar] :: ConfigOptions -> !ShowScrollbar

-- | The number of lines to keep in the scroll back history for each
--   terminal.
[scrollbackLen] :: ConfigOptions -> !Integer

-- | Whether or not to ask you for confirmation when closing individual
--   terminals or Termonad itself. It is generally safer to keep this as
--   True.
[confirmExit] :: ConfigOptions -> !Bool

-- | When double-clicking on text in the terminal with the mouse, Termonad
--   will use this value to determine what to highlight. The individual
--   characters in this list will be counted as part of a word.
--   
--   For instance if wordCharExceptions is "", then when
--   you double-click on the text http://, only the http
--   portion will be highlighted. If wordCharExceptions is
--   ":", then the http: portion will be highlighted.
[wordCharExceptions] :: ConfigOptions -> !Text

-- | Whether or not to show the File Edit etc menu.
[showMenu] :: ConfigOptions -> !Bool

-- | When to show the tab bar.
[showTabBar] :: ConfigOptions -> !ShowTabBar

-- | How to handle cursor blink.
[cursorBlinkMode] :: ConfigOptions -> !CursorBlinkMode

-- | This option controls whether or not to force bold text to use colors
--   from the ExtendedPalatte.
--   
--   If True, then colored bold text will always use colors
--   from the ExtendedPalatte. There will be no way to print bold
--   text colored with the BasicPalatte.
--   
--   This often isn't a big problem, since many TUI applications use bold
--   in combination with colors from the ExtendedPalatte. Also, the
--   VTE default blue color can be difficult to read with a dark
--   background, and enabling this can work around the problem. See
--   https://github.com/cdepillabout/termonad/issues/177 for more
--   information.
--   
--   If False, then bold can be applied separately to colors from
--   both the BasicPalatte and ExtendedPalatte.
[boldIsBright] :: ConfigOptions -> !Bool

-- | Enable SIXEL to draw graphics in a terminal.
--   
--   In order for this option to do anything, you need to be using a
--   version of VTE >= 0.63, and compile VTE with SIXEL support.
--   
--   Note that even if you do the above, there may still be some problems
--   with SIXEL support in VTE. Follow
--   https://gitlab.gnome.org/GNOME/vte/-/issues/253 for more
--   information.
[enableSixel] :: ConfigOptions -> !Bool

-- | Allow terminal to use bold text.
--   
--   You may want to disable this, for instance, if you use a font that
--   doesn't look good when bold.
[allowBold] :: ConfigOptions -> !Bool

-- | The default ConfigOptions.
--   
--   
--   >>> :{
--     let defConfOpt =
--           ConfigOptions
--             { fontConfig = defaultFontConfig
--             , showScrollbar = ShowScrollbarIfNeeded
--             , scrollbackLen = 10000
--             , confirmExit = True
--             , wordCharExceptions = "-#%&+,./=?@\\_~\183:"
--             , showMenu = True
--             , showTabBar = ShowTabBarIfNeeded
--             , cursorBlinkMode = CursorBlinkModeOn
--             , boldIsBright = False
--             , enableSixel = False
--             , allowBold = True
--             }
--     in defaultConfigOptions == defConfOpt
--   :}
--   True
--   
defaultConfigOptions :: ConfigOptions

-- | The Termonad ConfigOptions along with the ConfigHooks.
data TMConfig
TMConfig :: !ConfigOptions -> !ConfigHooks -> TMConfig
[options] :: TMConfig -> !ConfigOptions
[hooks] :: TMConfig -> !ConfigHooks

-- | The default TMConfig.
--   
--   options is defaultConfigOptions and hooks is
--   defaultConfigHooks.
defaultTMConfig :: TMConfig

-- | Hooks into certain termonad operations and VTE events. Used to modify
--   termonad's behaviour in order to implement new functionality. Fields
--   should have sane Semigroup and Monoid instances so
--   that config extensions can be combined uniformly and new hooks can be
--   added without incident.
newtype ConfigHooks
ConfigHooks :: (TMState -> Terminal -> IO ()) -> ConfigHooks

-- | Produce an IO action to run on creation of new Terminal,
--   given TMState and the Terminal in question.
[createTermHook] :: ConfigHooks -> TMState -> Terminal -> IO ()

-- | Default values for the ConfigHooks.
--   
--   
--   
- The default function for createTermHook is
--   defaultCreateTermHook.
--   
defaultConfigHooks :: ConfigHooks

-- | Default value for createTermHook. Does nothing.
defaultCreateTermHook :: TMState -> Terminal -> IO ()
data FocusNotSameErr
FocusListFocusExistsButNoNotebookTabWidget :: FocusNotSameErr
NotebookTabWidgetDiffersFromFocusListFocus :: FocusNotSameErr
NotebookTabWidgetExistsButNoFocusListFocus :: FocusNotSameErr
data TabsDoNotMatch

-- | The first Int is the number of tabs in the actual GTK
--   Notebook. The second Int is the number of tabs in the
--   FocusList.
TabLengthsDifferent :: Int -> Int -> TabsDoNotMatch

-- | The tab at index Int is different between the actual GTK
--   Notebook and the FocusList.
TabAtIndexDifferent :: Int -> TabsDoNotMatch
data TMStateInvariantErr
FocusNotSame :: FocusNotSameErr -> Int -> TMStateInvariantErr
TabsDoNotMatch :: TabsDoNotMatch -> TMStateInvariantErr

-- | Gather up the invariants for TMState' and return them as a
--   list.
--   
--   If no invariants have been violated, then this function should return
--   an empty list.
invariantTMState' :: TMState' -> IO [TMStateInvariantErr]

-- | Check the invariants for TMState', and call fail if we
--   find that they have been violated.
assertInvariantTMState :: TMState -> IO ()
pPrintTMState :: TMState -> IO ()
instance Data.Aeson.Types.ToJSON.ToJSON Termonad.Types.FontSize
instance GHC.Show.Show Termonad.Types.FontSize
instance GHC.Generics.Generic Termonad.Types.FontSize
instance Data.Aeson.Types.FromJSON.FromJSON Termonad.Types.FontSize
instance GHC.Classes.Eq Termonad.Types.FontSize
instance Data.Aeson.Types.ToJSON.ToJSON Termonad.Types.FontConfig
instance GHC.Show.Show Termonad.Types.FontConfig
instance GHC.Generics.Generic Termonad.Types.FontConfig
instance Data.Aeson.Types.FromJSON.FromJSON Termonad.Types.FontConfig
instance GHC.Classes.Eq Termonad.Types.FontConfig
instance Data.Foldable.Foldable Termonad.Types.Option
instance GHC.Base.Functor Termonad.Types.Option
instance GHC.Classes.Ord a => GHC.Classes.Ord (Termonad.Types.Option a)
instance GHC.Classes.Eq a => GHC.Classes.Eq (Termonad.Types.Option a)
instance GHC.Read.Read a => GHC.Read.Read (Termonad.Types.Option a)
instance GHC.Show.Show a => GHC.Show.Show (Termonad.Types.Option a)
instance Data.Aeson.Types.ToJSON.ToJSON Termonad.Types.ShowScrollbar
instance GHC.Show.Show Termonad.Types.ShowScrollbar
instance Data.Aeson.Types.FromJSON.FromJSON Termonad.Types.ShowScrollbar
instance GHC.Generics.Generic Termonad.Types.ShowScrollbar
instance GHC.Classes.Eq Termonad.Types.ShowScrollbar
instance GHC.Enum.Enum Termonad.Types.ShowScrollbar
instance Data.Aeson.Types.ToJSON.ToJSON Termonad.Types.ShowTabBar
instance GHC.Show.Show Termonad.Types.ShowTabBar
instance Data.Aeson.Types.FromJSON.FromJSON Termonad.Types.ShowTabBar
instance GHC.Generics.Generic Termonad.Types.ShowTabBar
instance GHC.Classes.Eq Termonad.Types.ShowTabBar
instance GHC.Enum.Enum Termonad.Types.ShowTabBar
instance Data.Aeson.Types.ToJSON.ToJSON Termonad.Types.ConfigOptions
instance GHC.Show.Show Termonad.Types.ConfigOptions
instance Data.Aeson.Types.FromJSON.FromJSON Termonad.Types.ConfigOptions
instance GHC.Generics.Generic Termonad.Types.ConfigOptions
instance GHC.Classes.Eq Termonad.Types.ConfigOptions
instance GHC.Show.Show Termonad.Types.TMConfig
instance GHC.Show.Show Termonad.Types.FocusNotSameErr
instance GHC.Show.Show Termonad.Types.TabsDoNotMatch
instance GHC.Show.Show Termonad.Types.TMStateInvariantErr
instance GHC.Show.Show Termonad.Types.TMState'
instance GHC.Show.Show Termonad.Types.ConfigHooks
instance GHC.Show.Show Termonad.Types.TMNotebook
instance GHC.Show.Show Termonad.Types.TMNotebookTab
instance GHC.Classes.Eq Termonad.Types.TMNotebookTab
instance GHC.Show.Show Termonad.Types.TMTerm
instance GHC.Classes.Eq Termonad.Types.TMTerm
instance Data.Aeson.Types.FromJSON.FromJSON GI.Vte.Enums.CursorBlinkMode
instance Data.Aeson.Types.ToJSON.ToJSON GI.Vte.Enums.CursorBlinkMode

module Termonad.PreferencesFile

-- | Get the path to the preferences file
--   ~/.config/termonad/termonad.yaml.
getPreferencesFile :: IO FilePath

-- | Read the configuration for the preferences file
--   ~/.config/termonad/termonad.yaml. This file stores only the
--   options of TMConfig so hooks are initialized with
--   defaultConfigHooks. If the file doesn't exist, create it with
--   the default values.
--   
--   Any options that do not exist will get initialized with values from
--   defaultConfigOptions.
tmConfigFromPreferencesFile :: IO TMConfig

-- | Read the ConfigOptions out of a configuration file.
--   
--   Merge the raw ConfigOptions with defaultConfigOptions.
--   This makes sure that old versions of the configuration file will still
--   be able to be read even if new options are added to
--   ConfigOptions in new versions of Termonad.
readFileWithDefaults :: FilePath -> IO (Either Text ConfigOptions)

-- | Merge Values recursively.
--   
--   This merges Values recursively in Object values, taking
--   values that have been explicitly over the defaults. The defaults are
--   only used if there is no value that has been explicitly set.
--   
--   For Array, Value, Number, Value, and
--   Null, take the first Value (the one that has been
--   explicitly set in the user's config file):
--   
--   
--   >>> mergeObjVals (Array [Number 1, Number 2]) (Array [String "hello"])
--   Array [Number 1.0,Number 2.0]
--   
--   >>> mergeObjVals (String "hello") (String "bye")
--   String "hello"
--   
--   >>> mergeObjVals (Number 1) (Number 2)
--   Number 1.0
--   
--   >>> mergeObjVals (Bool True) (Bool False)
--   Bool True
--   
--   >>> mergeObjVals Null Null
--   Null
--   
--   
--   Note that Values in Arrays are not recursed into:
--   
--   
--   >>> let obj1 = object ["hello" .= Number 2]
--   
--   >>> let obj2 = object ["hello" .= String "bye"]
--   
--   >>> mergeObjVals (Array [obj1]) (Array [obj2])
--   Array [Object (fromList [("hello",Number 2.0)])]
--   
--   
--   Objects are recursed into. Unique keys from both Maps will be
--   used. Keys that are in both Maps will be merged according to the rules
--   above:
--   
--   
--   >>> let object1 = object ["hello" .= Number 1, "bye" .= Number 100]
--   
--   >>> let object2 = object ["hello" .= Number 2, "goat" .= String "chicken"]
--   
--   >>> mergeObjVals object1 object2
--   Object (fromList [("bye",Number 100.0),("goat",String "chicken"),("hello",Number 1.0)])
--   
--   
--   Values of different types will use the second Value:
--   
--   
--   >>> mergeObjVals Null (String "bye")
--   String "bye"
--   
--   >>> mergeObjVals (Bool True) (Number 2)
--   Number 2.0
--   
--   >>> mergeObjVals (Object mempty) (Bool False)
--   Bool False
--   
mergeObjVals :: Value -> Value -> Value
writePreferencesFile :: FilePath -> ConfigOptions -> IO ()

-- | Save the configuration to the preferences file
--   ~/.config/termonad/termonad.yaml
saveToPreferencesFile :: TMConfig -> IO ()

module Termonad.Lenses
lensUnique :: Lens' TMTerm Unique
lensTerm :: Lens' TMTerm Terminal
lensPid :: Lens' TMTerm Int
lensTMNotebookTabTermContainer :: Lens' TMNotebookTab ScrolledWindow
lensTMNotebookTabTerm :: Lens' TMNotebookTab TMTerm
lensTMNotebookTabLabel :: Lens' TMNotebookTab Label
lensTMNotebookTabs :: Lens' TMNotebook (FocusList TMNotebookTab)
lensTMNotebook :: Lens' TMNotebook Notebook
lensTMStateNotebook :: Lens' TMState' TMNotebook
lensTMStateFontDesc :: Lens' TMState' FontDescription
lensTMStateConfig :: Lens' TMState' TMConfig
lensTMStateAppWin :: Lens' TMState' ApplicationWindow
lensTMStateApp :: Lens' TMState' Application
_FontSizeUnits :: Prism' FontSize Double
_FontSizePoints :: Prism' FontSize Int
lensFontSize :: Lens' FontConfig FontSize
lensFontFamily :: Lens' FontConfig Text
lensWordCharExceptions :: Lens' ConfigOptions Text
lensShowTabBar :: Lens' ConfigOptions ShowTabBar
lensShowScrollbar :: Lens' ConfigOptions ShowScrollbar
lensShowMenu :: Lens' ConfigOptions Bool
lensScrollbackLen :: Lens' ConfigOptions Integer
lensFontConfig :: Lens' ConfigOptions FontConfig
lensEnableSixel :: Lens' ConfigOptions Bool
lensCursorBlinkMode :: Lens' ConfigOptions CursorBlinkMode
lensConfirmExit :: Lens' ConfigOptions Bool
lensBoldIsBright :: Lens' ConfigOptions Bool
lensAllowBold :: Lens' ConfigOptions Bool
lensCreateTermHook :: Iso' ConfigHooks (TMState -> Terminal -> IO ())
lensOptions :: Lens' TMConfig ConfigOptions
lensHooks :: Lens' TMConfig ConfigHooks

module Termonad.Term
focusTerm :: Int -> TMState -> IO ()
altNumSwitchTerm :: Int -> TMState -> IO ()
termNextPage :: TMState -> IO ()
termPrevPage :: TMState -> IO ()
termExitFocused :: TMState -> IO ()
termClose :: TMNotebookTab -> TMState -> IO ()
termExitWithConfirmation :: TMNotebookTab -> TMState -> IO ()
termExit :: TMNotebookTab -> TMState -> IO ()
relabelTabs :: TMState -> IO ()

-- | Compute the text for a Label for a GTK Notebook tab.
--   
--   
--   >>> computeTabLabel 0 (Just "me@machine:~")
--   "1. me@machine:~"
--   
--   
--   
--   >>> computeTabLabel 5 (Just "bash process")
--   "6. bash process"
--   
--   
--   
--   >>> computeTabLabel 2 Nothing
--   "3. shell"
--   
computeTabLabel :: Int -> Maybe Text -> Text

-- | Update the given Label for a GTK Notebook tab.
--   
--   The new text for the label is determined by the computeTabLabel
--   function.
relabelTab :: Notebook -> Label -> ScrolledWindow -> Terminal -> IO ()
showScrollbarToPolicy :: ShowScrollbar -> PolicyType
createScrolledWin :: TMState -> IO ScrolledWindow
createNotebookTabLabel :: IO (Box, Label, Button)
setShowTabs :: TMConfig -> Notebook -> IO ()
toRGBA :: Colour Double -> IO RGBA

-- | TODO: This should probably be implemented in an external package,
--   since it is a generally useful utility.
--   
--   It should also be implemented for windows and osx.
cwdOfPid :: Int -> IO (Maybe Text)

-- | Get the current working directory from the shell in the focused tab of
--   a notebook.
--   
--   Returns Nothing if there is no focused tab of the notebook, or
--   the current working directory could not be detected for the shell.
getCWDFromFocusedTab :: TMNotebook -> IO (Maybe Text)

-- | Create the VTE Terminal, set the fonts and options
createAndInitVteTerm :: FontDescription -> ConfigOptions -> IO Terminal

-- | Starts a shell in a terminal and return a new TMTerm
launchShell :: Terminal -> Maybe Text -> IO Int

-- | Add a page to the notebook and switch to it.
addPage :: TMState -> TMNotebookTab -> Box -> IO ()

-- | Set the keyboard focus on a vte terminal
setFocusOn :: ApplicationWindow -> Terminal -> IO ()

-- | Create a new TMTerm, setting it up and adding it to the
--   GTKNotebook.
createTerm :: (TMState -> EventKey -> IO Bool) -> TMState -> IO TMTerm

-- | Popup the context menu on right click
handleMousePress :: ApplicationWindow -> Terminal -> EventButton -> IO Bool
eventButtonToEvent :: EventButton -> Event

module Termonad.Keys
showKeys :: EventKey -> IO Bool
data Key
Key :: Word32 -> Set ModifierType -> Key
[keyVal] :: Key -> Word32
[keyMods] :: Key -> Set ModifierType
toKey :: Word32 -> Set ModifierType -> Key
keyMap :: Map Key (TMState -> IO Bool)
stopProp :: (TMState -> IO a) -> TMState -> IO Bool
removeStrangeModifiers :: Key -> Key
handleKeyPress :: TMState -> EventKey -> IO Bool
instance GHC.Show.Show Termonad.Keys.Key
instance GHC.Classes.Ord Termonad.Keys.Key
instance GHC.Classes.Eq Termonad.Keys.Key

-- | To use this config extension in your
--   ~/.config/termonad/termonad.hs, first import this module.
--   Create a new ColourExtension with the
--   createColourExtension function. Then add the
--   ColourExtension to your TMConfig with the
--   addColourExtension function.
--   
--   See this code for a simple example.
--   
--   When setting colors, you may find it convenient to use the
--   print-console-colors package, which provides an executable
--   called print-console-colors that prints all of the colors for
--   your terminal.
module Termonad.Config.Colour

-- | The configuration for the colors used by Termonad.
--   
--   foregroundColour and backgroundColour allow you to set
--   the color of the foreground text and background of the terminal.
--   
--   highlightFgColour and highlightBgColour allow you to set
--   the color of the foreground and background of the highlighted text.
--   
--   palette allows you to set the full color palette used by the
--   terminal. See Palette for more information.
--   
--   If you don't set foregroundColour, backgroundColour,
--   highlightFgColour, highlightBgColour, or palette,
--   the defaults from VTE are used.
--   
--   If you want to use a terminal with a white (or light) background and a
--   black foreground, it may be a good idea to change some of the colors
--   in the Palette as well.
--   
--   VTE works as follows: if you don't explicitly set a background or
--   foreground color, it takes the 0th colour from the palette to
--   be the background color, and the 7th colour from the palette to
--   be the foreground color. If you notice oddities with colouring in
--   certain applications, it may be helpful to make sure that these
--   palette colours match up with the backgroundColour and
--   foregroundColour you have set.)
--   
--   cursorFgColour and cursorBgColour allow you to set the
--   foreground color of the text under the cursor, as well as the color of
--   the cursor itself.
--   
--   Termonad will behave differently depending on the combination
--   cursorFgColour and cursorBgColour being Set vs.
--   Unset. Here is the summary of the different possibilities:
--   
--   
--   
- cursorFgColour is Set and cursorBgColour is
--   SetThe foreground and background colors of the cursor are as
--   you have set.
--   
- cursorFgColour is Set and cursorBgColour is
--   UnsetThe cursor background color turns completely black so that
--   it is not visible. The foreground color of the cursor is the color
--   that you have Set. This ends up being mostly unusable, so you
--   are recommended to always Set cursorBgColour when you
--   have Set cursorFgColour.
--   
- cursorFgColour is Unset and cursorBgColour is
--   SetThe cursor background color becomes the color you
--   Set, while the cursor foreground color doesn't change from the
--   letter it is over. For instance, imagine there is a letter on the
--   screen with a black background and a green foreground. If you bring
--   the cursor overtop of it, the cursor background will be the color you
--   have Set, while the cursor foreground will be green.This is
--   completely usable, but is slightly annoying if you place the cursor
--   over a letter with the same foreground color as the cursor's
--   background color, because the letter will not be readable. For
--   instance, imagine you have set your cursor background color to red,
--   and somewhere on the screen there is a letter with a black background
--   and a red foreground. If you move your cursor over the letter, the
--   background of the cursor will be red (as you have set), and the cursor
--   foreground will be red (to match the original foreground color of the
--   letter). This will make it so you can't actually read the letter,
--   because the foreground and background are both red.
--   
- cursorFgColour is Unset and cursorBgColour is
--   UnsetThis combination makes the cursor inverse of whatever text
--   it is over. If your cursor is over red text with a black background,
--   the cursor background will be red and the cursor foreground will be
--   black.This is the default.
--   
--   
--   cursorFgColour is not supported in vte-2.91 versions
--   older than 0.44. (This is somewhat confusing. Note that
--   vte-2.91 is the name of the system library, and 0.44
--   is its version number.)
--   
--   See defaultColourConfig for the defaults for
--   ColourConfig used in Termonad.
data ColourConfig c
ColourConfig :: !Option c -> !Option c -> !Option c -> !Option c -> !Option c -> !Option c -> !Palette c -> ColourConfig c

-- | Foreground color of the cursor. This is the color of the text that the
--   cursor is over. This is not supported on older versions of VTE.
[cursorFgColour] :: ColourConfig c -> !Option c

-- | Background color of the cursor. This is the color of the cursor
--   itself.
[cursorBgColour] :: ColourConfig c -> !Option c

-- | Color of the default foreground text in the terminal.
[foregroundColour] :: ColourConfig c -> !Option c

-- | Background color for the terminal
[backgroundColour] :: ColourConfig c -> !Option c

-- | Foreground color for the highlighted text.
[highlightFgColour] :: ColourConfig c -> !Option c

-- | Background color for the highlighted text.
[highlightBgColour] :: ColourConfig c -> !Option c

-- | Color palette for the terminal. See Palette.
[palette] :: ColourConfig c -> !Palette c

-- | Default setting for a ColourConfig. The cursor colors, font
--   foreground color, background color, highlighted text color, and color
--   palette are all left at the defaults set by VTE.
--   
--   
--   >>> defaultColourConfig
--   ColourConfig {cursorFgColour = Unset, cursorBgColour = Unset, foregroundColour = Unset, backgroundColour = Unset, highlightFgColour = Unset, highlightBgColour = Unset, palette = NoPalette}
--   
defaultColourConfig :: ColourConfig (AlphaColour Double)

-- | This newtype is for length 8 lists. Construct it with mkList8
--   or unsafeMkList8
data List8 a

-- | This newtype is for length 6 lists. Construct it with mkList6
--   or unsafeMkList6
data List6 a

-- | This newtype is for length 24 lists. Construct it with mkList24
--   or unsafeMkList24
data List24 a

-- | This newtype is for 6x6x6 matrices.. Construct it with mkMatrix
--   or unsafeMkMatrix
data Matrix a

-- | Typesafe smart constructor for length 8 lists.
mkList8 :: [a] -> Maybe (List8 a)

-- | Unsafe smart constructor for length 8 lists.
unsafeMkList8 :: [a] -> List8 a

-- | Set a given value in a List8.
--   
--   Internally uses setAt. See documentation on setAt for
--   some examples.
setAtList8 :: Int -> a -> List8 a -> List8 a

-- | Set a given value in a List8.
--   
--   Internally uses overAt. See documentation on overAt for
--   some examples.
overAtList8 :: Int -> (a -> a) -> List8 a -> List8 a

-- | Typesafe smart constructor for length 6 lists.
mkList6 :: [a] -> Maybe (List6 a)

-- | Unsafe smart constructor for length 6 lists.
unsafeMkList6 :: [a] -> List6 a

-- | Set a given value in a List6.
--   
--   Internally uses setAt. See documentation on setAt for
--   some examples.
setAtList6 :: Int -> a -> List6 a -> List6 a

-- | Set a given value in a List6.
--   
--   Internally uses overAt. See documentation on overAt for
--   some examples.
overAtList6 :: Int -> (a -> a) -> List6 a -> List6 a

-- | Typesafe smart constructor for length 24 lists.
mkList24 :: [a] -> Maybe (List24 a)

-- | Unsafe smart constructor for length 24 lists.
unsafeMkList24 :: [a] -> List24 a

-- | Set a given value in a List24.
--   
--   Internally uses setAt. See documentation on setAt for
--   some examples.
setAtList24 :: Int -> a -> List24 a -> List24 a

-- | Set a given value in a List24.
--   
--   Internally uses overAt. See documentation on overAt for
--   some examples.
overAtList24 :: Int -> (a -> a) -> List24 a -> List24 a

-- | Unsafe smart constructor for 6x6x6 Matrices.
mkMatrix :: [[[a]]] -> Maybe (Matrix a)

-- | Unsafe smart constructor for 6x6x6 Matrices.
unsafeMkMatrix :: [[[a]]] -> Matrix a

-- | Set a given value in a Matrix.
--   
--   Internally uses setAt. See documentation on setAt for
--   some examples.
setAtMatrix :: Int -> Int -> Int -> a -> Matrix a -> Matrix a

-- | Set a given value in a Matrix.
--   
--   Internally uses overAt. See documentation on overAt for
--   some examples.
overAtMatrix :: Int -> Int -> Int -> (a -> a) -> Matrix a -> Matrix a
lensCursorFgColour :: forall c_a1ikz. Lens' (ColourConfig c_a1ikz) (Option c_a1ikz)
lensCursorBgColour :: forall c_a1ikz. Lens' (ColourConfig c_a1ikz) (Option c_a1ikz)
lensForegroundColour :: forall c_a1ikz. Lens' (ColourConfig c_a1ikz) (Option c_a1ikz)
lensBackgroundColour :: forall c_a1ikz. Lens' (ColourConfig c_a1ikz) (Option c_a1ikz)
lensHighlightFgColour :: forall c_a1ikz. Lens' (ColourConfig c_a1ikz) (Option c_a1ikz)
lensHighlightBgColour :: forall c_a1ikz. Lens' (ColourConfig c_a1ikz) (Option c_a1ikz)
lensPalette :: forall c_a1ikz. Lens' (ColourConfig c_a1ikz) (Palette c_a1ikz)

-- | Extension that allows setting colors for terminals in Termonad.
data ColourExtension
ColourExtension :: MVar (ColourConfig (AlphaColour Double)) -> (TMState -> Terminal -> IO ()) -> ColourExtension

-- | MVar holding the current ColourConfig. This could
--   potentially be passed to other extensions or user code. This would
--   allow changing the colors for new terminals in realtime.
[colourExtConf] :: ColourExtension -> MVar (ColourConfig (AlphaColour Double))

-- | The createTermHook used by the ColourExtension. This
--   sets the colors for a new terminal based on the ColourConfig in
--   colourExtConf.
[colourExtCreateTermHook] :: ColourExtension -> TMState -> Terminal -> IO ()

-- | Create a ColourExtension based on a given ColourConfig.
--   
--   Most users will want to use this.
createColourExtension :: ColourConfig (AlphaColour Double) -> IO ColourExtension

-- | Create a ColourExtension based on defaultColourConfig.
--   
--   Note that this is not needed if you just want to use the default
--   colors for Termonad. However, if you want to pass around the
--   MVar ColourConfig for extensions to use, then you may
--   need this function.
createDefColourExtension :: IO ColourExtension

-- | This is similar to addColourConfig, but can be used on a
--   ColourExtension created with createColourExtension.
addColourExtension :: TMConfig -> ColourExtension -> TMConfig

-- | Add a given ColourConfig to a TMConfig. This adds
--   colourHook to the createTermHook in TMConfig.
addColourConfig :: TMConfig -> ColourConfig (AlphaColour Double) -> IO TMConfig

-- | The default createTermHook for
--   colourExtCreateTermHook. Set the colors for a terminal based on
--   the given ColourConfig.
colourHook :: MVar (ColourConfig (AlphaColour Double)) -> TMState -> Terminal -> IO ()

-- | This function shows how to combine createTermHooks.
--   
--   This first runs the old hook, followed by the new hook.
--   
--   This is used internally by addColourConfig and
--   addColourExtension.
addColourHook :: (TMState -> Terminal -> IO ()) -> (TMState -> Terminal -> IO ()) -> TMState -> Terminal -> IO ()

-- | This is the color palette to use for the terminal. Each data
--   constructor lets you set progressively more colors. These colors are
--   used by the terminal to render ANSI escape color codes.
--   
--   There are 256 total terminal colors. BasicPalette lets you set
--   the first 8, ExtendedPalette lets you set the first 16,
--   ColourCubePalette lets you set the first 232, and
--   FullPalette lets you set all 256.
--   
--   The first 8 colors codes are the standard colors. The next 8 are the
--   extended (light) colors. The next 216 are a full color cube. The last
--   24 are a grey scale.
--   
--   The following image gives an idea of what each individual color looks
--   like:
--   
--   
--   This picture does not exactly match up with Termonad's default colors,
--   but it gives an idea of what each block of colors represents.
--   
--   You can use defaultStandardColours, defaultLightColours,
--   defaultColourCube, and defaultGreyscale as a starting
--   point to customize the colors. The only time you'd need to use a
--   constructor other than NoPalette is when you want to customize
--   the default colors. That is to say, using FullPalette with all
--   the defaults should give you the same result as using
--   NoPalette.
data Palette c

-- | Don't set any colors and just use the default from VTE. This is a
--   black background with light grey text.
NoPalette :: Palette c

-- | Set the colors from the standard colors.
BasicPalette :: !List8 c -> Palette c

-- | Set the colors from the extended (light) colors (as well as standard
--   colors).
ExtendedPalette :: !List8 c -> !List8 c -> Palette c

-- | Set the colors from the color cube (as well as the standard colors and
--   extended colors).
ColourCubePalette :: !List8 c -> !List8 c -> !Matrix c -> Palette c

-- | Set the colors from the grey scale (as well as the standard colors,
--   extended colors, and color cube).
FullPalette :: !List8 c -> !List8 c -> !Matrix c -> !List24 c -> Palette c

-- | A Vec of standard colors. Default value for
--   BasicPalette.
--   
--   
--   >>> showColourVec defaultStandardColours
--   ["#000000ff","#c00000ff","#00c000ff","#c0c000ff","#0000c0ff","#c000c0ff","#00c0c0ff","#c0c0c0ff"]
--   
defaultStandardColours :: (Ord b, Floating b) => List8 (AlphaColour b)

-- | A Vec of extended (light) colors. Default value for
--   ExtendedPalette.
--   
--   
--   >>> showColourVec defaultLightColours
--   ["#3f3f3fff","#ff3f3fff","#3fff3fff","#ffff3fff","#3f3fffff","#ff3fffff","#3fffffff","#ffffffff"]
--   
defaultLightColours :: (Ord b, Floating b) => List8 (AlphaColour b)

-- | A matrix of a 6 x 6 x 6 color cube. Default value for
--   ColourCubePalette.
--   
--   
--   >>> putStrLn $ pack $ showColourCube defaultColourCube
--   [ [ #000000ff, #00005fff, #000087ff, #0000afff, #0000d7ff, #0000ffff
--     , #005f00ff, #005f5fff, #005f87ff, #005fafff, #005fd7ff, #005fffff
--     , #008700ff, #00875fff, #008787ff, #0087afff, #0087d7ff, #0087ffff
--     , #00af00ff, #00af5fff, #00af87ff, #00afafff, #00afd7ff, #00afffff
--     , #00d700ff, #00d75fff, #00d787ff, #00d7afff, #00d7d7ff, #00d7ffff
--     , #00ff00ff, #00ff5fff, #00ff87ff, #00ffafff, #00ffd7ff, #00ffffff
--     ]
--   , [ #5f0000ff, #5f005fff, #5f0087ff, #5f00afff, #5f00d7ff, #5f00ffff
--     , #5f5f00ff, #5f5f5fff, #5f5f87ff, #5f5fafff, #5f5fd7ff, #5f5fffff
--     , #5f8700ff, #5f875fff, #5f8787ff, #5f87afff, #5f87d7ff, #5f87ffff
--     , #5faf00ff, #5faf5fff, #5faf87ff, #5fafafff, #5fafd7ff, #5fafffff
--     , #5fd700ff, #5fd75fff, #5fd787ff, #5fd7afff, #5fd7d7ff, #5fd7ffff
--     , #5fff00ff, #5fff5fff, #5fff87ff, #5fffafff, #5fffd7ff, #5fffffff
--     ]
--   , [ #870000ff, #87005fff, #870087ff, #8700afff, #8700d7ff, #8700ffff
--     , #875f00ff, #875f5fff, #875f87ff, #875fafff, #875fd7ff, #875fffff
--     , #878700ff, #87875fff, #878787ff, #8787afff, #8787d7ff, #8787ffff
--     , #87af00ff, #87af5fff, #87af87ff, #87afafff, #87afd7ff, #87afffff
--     , #87d700ff, #87d75fff, #87d787ff, #87d7afff, #87d7d7ff, #87d7ffff
--     , #87ff00ff, #87ff5fff, #87ff87ff, #87ffafff, #87ffd7ff, #87ffffff
--     ]
--   , [ #af0000ff, #af005fff, #af0087ff, #af00afff, #af00d7ff, #af00ffff
--     , #af5f00ff, #af5f5fff, #af5f87ff, #af5fafff, #af5fd7ff, #af5fffff
--     , #af8700ff, #af875fff, #af8787ff, #af87afff, #af87d7ff, #af87ffff
--     , #afaf00ff, #afaf5fff, #afaf87ff, #afafafff, #afafd7ff, #afafffff
--     , #afd700ff, #afd75fff, #afd787ff, #afd7afff, #afd7d7ff, #afd7ffff
--     , #afff00ff, #afff5fff, #afff87ff, #afffafff, #afffd7ff, #afffffff
--     ]
--   , [ #d70000ff, #d7005fff, #d70087ff, #d700afff, #d700d7ff, #d700ffff
--     , #d75f00ff, #d75f5fff, #d75f87ff, #d75fafff, #d75fd7ff, #d75fffff
--     , #d78700ff, #d7875fff, #d78787ff, #d787afff, #d787d7ff, #d787ffff
--     , #d7af00ff, #d7af5fff, #d7af87ff, #d7afafff, #d7afd7ff, #d7afffff
--     , #d7d700ff, #d7d75fff, #d7d787ff, #d7d7afff, #d7d7d7ff, #d7d7ffff
--     , #d7ff00ff, #d7ff5fff, #d7ff87ff, #d7ffafff, #d7ffd7ff, #d7ffffff
--     ]
--   , [ #ff0000ff, #ff005fff, #ff0087ff, #ff00afff, #ff00d7ff, #ff00ffff
--     , #ff5f00ff, #ff5f5fff, #ff5f87ff, #ff5fafff, #ff5fd7ff, #ff5fffff
--     , #ff8700ff, #ff875fff, #ff8787ff, #ff87afff, #ff87d7ff, #ff87ffff
--     , #ffaf00ff, #ffaf5fff, #ffaf87ff, #ffafafff, #ffafd7ff, #ffafffff
--     , #ffd700ff, #ffd75fff, #ffd787ff, #ffd7afff, #ffd7d7ff, #ffd7ffff
--     , #ffff00ff, #ffff5fff, #ffff87ff, #ffffafff, #ffffd7ff, #ffffffff
--     ]
--   ]
--   
defaultColourCube :: (Ord b, Floating b) => Matrix (AlphaColour b)

-- | A List of a grey scale. Default value for FullPalette.
--   
--   
--   >>> fmap sRGB32show defaultGreyscale
--   List24 {getList24 = ["#080808ff","#121212ff","#1c1c1cff","#262626ff","#303030ff","#3a3a3aff","#444444ff","#4e4e4eff","#585858ff","#626262ff","#6c6c6cff","#767676ff","#808080ff","#8a8a8aff","#949494ff","#9e9e9eff","#a8a8a8ff","#b2b2b2ff","#bcbcbcff","#c6c6c6ff","#d0d0d0ff","#dadadaff","#e4e4e4ff","#eeeeeeff"]}
--   
defaultGreyscale :: (Ord b, Floating b) => List24 (AlphaColour b)

-- | This type represents a Colour that may be semi-transparent.
--   
--   The Monoid instance allows you to composite colours.
--   
--   
--   x `mappend` y == x `over` y
--   
--   
--   To get the (pre-multiplied) colour channel of an AlphaColour
--   c, simply composite c over black.
--   
--   
--   c `over` black
--   
data () => AlphaColour a

-- | Create an AlphaColour that is fully opaque.
--   
--   
--   >>> sRGB32show $ createColour 64 96 128
--   "#406080ff"
--   
--   >>> sRGB32show $ createColour 0 0 0
--   "#000000ff"
--   
--   
--   Similar to sRGB24 but for AlphaColour.
createColour :: Word8 -> Word8 -> Word8 -> AlphaColour Double

-- | Create an AlphaColour from a four Word8s.
--   
--   
--   >>> sRGB32show $ sRGB32 64 96 128 255
--   "#406080ff"
--   
--   >>> sRGB32show $ sRGB32 0x08 0x10 0x20 0x01
--   "#08102001"
--   
--   
--   Note that if you specify the alpha as 0 (which means completely
--   translucent), all the color channels will be set to 0 as well.
--   
--   
--   >>> sRGB32show $ sRGB32 100 150 200 0
--   "#00000000"
--   
--   
--   Similar to sRGB24 but also includes an alpha channel. Most
--   users will probably want to use createColour instead.
sRGB32 :: Word8 -> Word8 -> Word8 -> Word8 -> AlphaColour Double

-- | Show an AlphaColour in hex.
--   
--   
--   >>> sRGB32show (opaque red)
--   "#ff0000ff"
--   
--   
--   Similar to sRGB24show.
sRGB32show :: AlphaColour Double -> String

-- | Creates an opaque AlphaColour from a Colour.
opaque :: Num a => Colour a -> AlphaColour a

-- | This AlphaColour is entirely transparent and has no associated
--   colour channel.
transparent :: Num a => AlphaColour a

-- | A helper function for showing all the colors in Vec of
--   colors.
showColourVec :: List8 (AlphaColour Double) -> [String]

-- | Helper function for showing all the colors in a color cube. This is
--   used for debugging.
showColourCube :: Matrix (AlphaColour Double) -> String

-- | Convert a Palette to a list of colors. This is helpful for
--   debugging.
paletteToList :: Palette c -> [c]

-- | Create a vector of colors based on input bits.
--   
--   This is used to derive defaultStandardColours and
--   defaultLightColours.
--   
--   
--   >>> coloursFromBits 192 0 == defaultStandardColours
--   True
--   
--   
--   
--   >>> coloursFromBits 192 63 == defaultLightColours
--   True
--   
--   
--   In general, as an end-user, you shouldn't need to use this.
coloursFromBits :: forall b. (Ord b, Floating b) => Word8 -> Word8 -> List8 (AlphaColour b)

-- | Specify a colour cube with one colour vector for its displacement and
--   three colour vectors for its edges. Produces a uniform 6x6x6 grid
--   bounded by and orthognal to the faces.
cube :: forall b. Fractional b => AlphaColour b -> AlphaColour b -> AlphaColour b -> AlphaColour b -> Matrix (AlphaColour b)

-- | Set a given value in a list.
--   
--   
--   >>> setAt 2 "hello" ["a","b","c","d"]
--   ["a","b","hello","d"]
--   
--   
--   You can set the first and last values in the list as well:
--   
--   
--   >>> setAt 0 "hello" ["a","b","c","d"]
--   ["hello","b","c","d"]
--   
--   >>> setAt 3 "hello" ["a","b","c","d"]
--   ["a","b","c","hello"]
--   
--   
--   If you try to set a value outside of the list, you'll get back the
--   same list:
--   
--   
--   >>> setAt (-10) "hello" ["a","b","c","d"]
--   ["a","b","c","d"]
--   
--   >>> setAt 100 "hello" ["a","b","c","d"]
--   ["a","b","c","d"]
--   
setAt :: forall a. Int -> a -> [a] -> [a]

-- | Update a given value in a list.
--   
--   
--   >>> overAt 2 (\x -> x ++ x) ["a","b","c","d"]
--   ["a","b","cc","d"]
--   
--   
--   You can update the first and last values in the list as well:
--   
--   
--   >>> overAt 0 (\x -> "bye") ["a","b","c","d"]
--   ["bye","b","c","d"]
--   
--   >>> overAt 3 (\x -> "") ["a","b","c","d"]
--   ["a","b","c",""]
--   
--   
--   If you try to set a value outside of the list, you'll get back the
--   same list:
--   
--   
--   >>> overAt (-10) (\_ -> "foobar") ["a","b","c","d"]
--   ["a","b","c","d"]
--   
--   >>> overAt 100 (\_ -> "baz") ["a","b","c","d"]
--   ["a","b","c","d"]
--   
overAt :: forall a. Int -> (a -> a) -> [a] -> [a]
instance GHC.Base.Functor Termonad.Config.Colour.List8
instance Data.Foldable.Foldable Termonad.Config.Colour.List8
instance GHC.Classes.Eq a => GHC.Classes.Eq (Termonad.Config.Colour.List8 a)
instance GHC.Show.Show a => GHC.Show.Show (Termonad.Config.Colour.List8 a)
instance GHC.Base.Functor Termonad.Config.Colour.List6
instance Data.Foldable.Foldable Termonad.Config.Colour.List6
instance GHC.Classes.Eq a => GHC.Classes.Eq (Termonad.Config.Colour.List6 a)
instance GHC.Show.Show a => GHC.Show.Show (Termonad.Config.Colour.List6 a)
instance GHC.Base.Functor Termonad.Config.Colour.List24
instance Data.Foldable.Foldable Termonad.Config.Colour.List24
instance GHC.Classes.Eq a => GHC.Classes.Eq (Termonad.Config.Colour.List24 a)
instance GHC.Show.Show a => GHC.Show.Show (Termonad.Config.Colour.List24 a)
instance Data.Foldable.Foldable Termonad.Config.Colour.Matrix
instance GHC.Base.Functor Termonad.Config.Colour.Matrix
instance GHC.Classes.Eq a => GHC.Classes.Eq (Termonad.Config.Colour.Matrix a)
instance GHC.Show.Show a => GHC.Show.Show (Termonad.Config.Colour.Matrix a)
instance Data.Foldable.Foldable Termonad.Config.Colour.Palette
instance GHC.Base.Functor Termonad.Config.Colour.Palette
instance GHC.Show.Show c => GHC.Show.Show (Termonad.Config.Colour.Palette c)
instance GHC.Classes.Eq c => GHC.Classes.Eq (Termonad.Config.Colour.Palette c)
instance GHC.Base.Functor Termonad.Config.Colour.ColourConfig
instance GHC.Show.Show c => GHC.Show.Show (Termonad.Config.Colour.ColourConfig c)
instance GHC.Classes.Eq c => GHC.Classes.Eq (Termonad.Config.Colour.ColourConfig c)

-- | This module exposes termonad's basic configuration options. To set
--   these options in your config, first ensure you've imported
--   Termonad.
--   
--   Then for your main, apply start or defaultMain to a
--   TMConfig value. We suggest you build such values by performing
--   record updates on the defaultTMConfig rather than using the
--   TMConfig constructor, as the latter is much more likely to
--   break when there are changes to the TMConfig type.
--   
--   E.g.
--   
--   
--   -- Re-exports this module.
--   import Termonad
--   
--   main :: IO ()
--   main = start $ defaultTMConfig
--     { showScrollbar = ShowScrollbarNever
--     , confirmExit = False
--     , showMenu = False
--     , cursorBlinkMode = CursorBlinkModeOff
--     }
--   
--   
--   Additional options can be found in the following modules.
--   
--   
--   
- Termonad.Config.Colour
--   
--   
--   If you want to see an example configuration file, as well as an
--   explanation for how to use Termonad, see the Termonad README.
module Termonad.Config

-- | The Termonad ConfigOptions along with the ConfigHooks.
data TMConfig
TMConfig :: !ConfigOptions -> !ConfigHooks -> TMConfig
[options] :: TMConfig -> !ConfigOptions
[hooks] :: TMConfig -> !ConfigHooks

-- | The default TMConfig.
--   
--   options is defaultConfigOptions and hooks is
--   defaultConfigHooks.
defaultTMConfig :: TMConfig

-- | Configuration options for Termonad.
--   
--   See defaultConfigOptions for the default values.
data ConfigOptions
ConfigOptions :: !FontConfig -> !ShowScrollbar -> !Integer -> !Bool -> !Text -> !Bool -> !ShowTabBar -> !CursorBlinkMode -> !Bool -> !Bool -> !Bool -> ConfigOptions

-- | Specific options for fonts.
[fontConfig] :: ConfigOptions -> !FontConfig

-- | When to show the scroll bar.
[showScrollbar] :: ConfigOptions -> !ShowScrollbar

-- | The number of lines to keep in the scroll back history for each
--   terminal.
[scrollbackLen] :: ConfigOptions -> !Integer

-- | Whether or not to ask you for confirmation when closing individual
--   terminals or Termonad itself. It is generally safer to keep this as
--   True.
[confirmExit] :: ConfigOptions -> !Bool

-- | When double-clicking on text in the terminal with the mouse, Termonad
--   will use this value to determine what to highlight. The individual
--   characters in this list will be counted as part of a word.
--   
--   For instance if wordCharExceptions is "", then when
--   you double-click on the text http://, only the http
--   portion will be highlighted. If wordCharExceptions is
--   ":", then the http: portion will be highlighted.
[wordCharExceptions] :: ConfigOptions -> !Text

-- | Whether or not to show the File Edit etc menu.
[showMenu] :: ConfigOptions -> !Bool

-- | When to show the tab bar.
[showTabBar] :: ConfigOptions -> !ShowTabBar

-- | How to handle cursor blink.
[cursorBlinkMode] :: ConfigOptions -> !CursorBlinkMode

-- | This option controls whether or not to force bold text to use colors
--   from the ExtendedPalatte.
--   
--   If True, then colored bold text will always use colors
--   from the ExtendedPalatte. There will be no way to print bold
--   text colored with the BasicPalatte.
--   
--   This often isn't a big problem, since many TUI applications use bold
--   in combination with colors from the ExtendedPalatte. Also, the
--   VTE default blue color can be difficult to read with a dark
--   background, and enabling this can work around the problem. See
--   https://github.com/cdepillabout/termonad/issues/177 for more
--   information.
--   
--   If False, then bold can be applied separately to colors from
--   both the BasicPalatte and ExtendedPalatte.
[boldIsBright] :: ConfigOptions -> !Bool

-- | Enable SIXEL to draw graphics in a terminal.
--   
--   In order for this option to do anything, you need to be using a
--   version of VTE >= 0.63, and compile VTE with SIXEL support.
--   
--   Note that even if you do the above, there may still be some problems
--   with SIXEL support in VTE. Follow
--   https://gitlab.gnome.org/GNOME/vte/-/issues/253 for more
--   information.
[enableSixel] :: ConfigOptions -> !Bool

-- | Allow terminal to use bold text.
--   
--   You may want to disable this, for instance, if you use a font that
--   doesn't look good when bold.
[allowBold] :: ConfigOptions -> !Bool

-- | The default ConfigOptions.
--   
--   
--   >>> :{
--     let defConfOpt =
--           ConfigOptions
--             { fontConfig = defaultFontConfig
--             , showScrollbar = ShowScrollbarIfNeeded
--             , scrollbackLen = 10000
--             , confirmExit = True
--             , wordCharExceptions = "-#%&+,./=?@\\_~\183:"
--             , showMenu = True
--             , showTabBar = ShowTabBarIfNeeded
--             , cursorBlinkMode = CursorBlinkModeOn
--             , boldIsBright = False
--             , enableSixel = False
--             , allowBold = True
--             }
--     in defaultConfigOptions == defConfOpt
--   :}
--   True
--   
defaultConfigOptions :: ConfigOptions

-- | Hooks into certain termonad operations and VTE events. Used to modify
--   termonad's behaviour in order to implement new functionality. Fields
--   should have sane Semigroup and Monoid instances so
--   that config extensions can be combined uniformly and new hooks can be
--   added without incident.
newtype ConfigHooks
ConfigHooks :: (TMState -> Terminal -> IO ()) -> ConfigHooks

-- | Produce an IO action to run on creation of new Terminal,
--   given TMState and the Terminal in question.
[createTermHook] :: ConfigHooks -> TMState -> Terminal -> IO ()

-- | Default values for the ConfigHooks.
--   
--   
--   
- The default function for createTermHook is
--   defaultCreateTermHook.
--   
defaultConfigHooks :: ConfigHooks

-- | The font size for the Termonad terminal. There are two ways to set the
--   fontsize, corresponding to the two different ways to set the font size
--   in the Pango font rendering library.
--   
--   If you're not sure which to use, try FontSizePoints first and
--   see how it looks. It should generally correspond to font sizes you are
--   used to from other applications.
data FontSize

-- | This sets the font size based on "points". The conversion between a
--   point and an actual size depends on the system configuration and the
--   output device. The function fontDescriptionSetSize is used to
--   set the font size. See the documentation for that function for more
--   info.
FontSizePoints :: Int -> FontSize

-- | This sets the font size based on "device units". In general, this can
--   be thought of as one pixel. The function
--   fontDescriptionSetAbsoluteSize is used to set the font size.
--   See the documentation for that function for more info.
FontSizeUnits :: Double -> FontSize

-- | The default FontSize used if not specified.
--   
--   
--   >>> defaultFontSize
--   FontSizePoints 12
--   
defaultFontSize :: FontSize

-- | Settings for the font to be used in Termonad.
data FontConfig
FontConfig :: !Text -> !FontSize -> FontConfig

-- | The font family to use. Example: "DejaVu Sans Mono" or
--   "Source Code Pro"
[fontFamily] :: FontConfig -> !Text

-- | The font size.
[fontSize] :: FontConfig -> !FontSize

-- | The default FontConfig to use if not specified.
--   
--   
--   >>> defaultFontConfig == FontConfig {fontFamily = "Monospace", fontSize = defaultFontSize}
--   True
--   
defaultFontConfig :: FontConfig

-- | This data type represents an option that can either be Option
--   or Unset.
--   
--   This data type is used in situations where leaving an option unset
--   results in a special state that is not representable by setting any
--   specific value.
--   
--   Examples of this include the cursorFgColour and
--   cursorBgColour options supplied by the ColourConfig
--   ConfigExtension. By default, cursorFgColour and
--   cursorBgColour are both Unset. However, when
--   cursorBgColour is Option, cursorFgColour
--   defaults to the color of the text underneath. There is no way to
--   represent this by setting cursorFgColour.
data Option a
Unset :: Option a
Set :: !a -> Option a

-- | Whether or not to show the scroll bar in a terminal.
data ShowScrollbar

-- | Never show the scroll bar, even if there are too many lines on the
--   terminal to show all at once. You should still be able to scroll with
--   the mouse wheel.
ShowScrollbarNever :: ShowScrollbar

-- | Always show the scrollbar, even if it is not needed.
ShowScrollbarAlways :: ShowScrollbar

-- | Only show the scrollbar if there are too many lines on the terminal to
--   show all at once.
ShowScrollbarIfNeeded :: ShowScrollbar

-- | Whether or not to show the tab bar for switching tabs.
data ShowTabBar

-- | Never show the tab bar, even if there are multiple tabs open. This may
--   be confusing if you plan on using multiple tabs.
ShowTabBarNever :: ShowTabBar

-- | Always show the tab bar, even if you only have one tab open.
ShowTabBarAlways :: ShowTabBar

-- | Only show the tab bar if you have multiple tabs open.
ShowTabBarIfNeeded :: ShowTabBar

-- | An enumerated type which can be used to indicate the cursor blink mode
--   for the terminal.
data () => CursorBlinkMode

-- | Follow GTK+ settings for cursor blinking.
CursorBlinkModeSystem :: CursorBlinkMode

-- | Cursor blinks.
CursorBlinkModeOn :: CursorBlinkMode

-- | Cursor does not blink.
CursorBlinkModeOff :: CursorBlinkMode

-- | Catch-all for unknown values
AnotherCursorBlinkMode :: Int -> CursorBlinkMode

-- | Read the configuration for the preferences file
--   ~/.config/termonad/termonad.yaml. This file stores only the
--   options of TMConfig so hooks are initialized with
--   defaultConfigHooks. If the file doesn't exist, create it with
--   the default values.
--   
--   Any options that do not exist will get initialized with values from
--   defaultConfigOptions.
tmConfigFromPreferencesFile :: IO TMConfig

module Termonad.XML
interfaceDoc :: Document
interfaceText :: Text
menuDoc :: Document
menuText :: Text
aboutDoc :: Document
aboutText :: Text
closeTabDoc :: Document
closeTabText :: Text
preferencesText :: Text

module Termonad.App
setupScreenStyle :: IO ()
createFontDescFromConfig :: TMConfig -> IO FontDescription
createFontDesc :: FontSize -> Text -> IO FontDescription
setFontDescSize :: FontDescription -> FontSize -> IO ()
adjustFontDescSize :: (FontSize -> FontSize) -> FontDescription -> IO ()
modifyFontSizeForAllTerms :: (FontSize -> FontSize) -> TMState -> IO ()
fontSizeFromFontDescription :: FontDescription -> IO FontSize
fontConfigFromFontDescription :: FontDescription -> IO (Maybe FontConfig)
compareScrolledWinAndTab :: ScrolledWindow -> TMNotebookTab -> Bool
updateFLTabPos :: TMState -> Int -> Int -> IO ()

-- | Try to figure out whether Termonad should exit. This also used to
--   figure out if Termonad should close a given terminal.
--   
--   This reads the confirmExit setting from ConfigOptions to
--   check whether the user wants to be notified when either Termonad or a
--   given terminal is about to be closed.
--   
--   If confirmExit is True, then a dialog is presented to
--   the user asking them if they really want to exit or close the
--   terminal. Their response is sent back as a ResponseType.
--   
--   If confirmExit is False, then this function always
--   returns ResponseTypeYes.
askShouldExit :: TMState -> IO ResponseType

-- | Force Termonad to exit without asking the user whether or not to do
--   so.
forceQuit :: TMState -> IO ()
setupTermonad :: TMConfig -> Application -> ApplicationWindow -> Builder -> IO ()
appActivate :: TMConfig -> Application -> IO ()
showAboutDialog :: Application -> IO ()
showFindDialog :: Application -> IO (Maybe Text)
doFind :: TMState -> IO ()
findAbove :: TMState -> IO ()
findBelow :: TMState -> IO ()
setShowMenuBar :: Application -> Bool -> IO ()

-- | Fill a combo box with ids and labels
--   
--   The ids are stored in the combobox as Text, so their type
--   should be an instance of the Show type class.
comboBoxFill :: forall a. Show a => ComboBoxText -> [(a, Text)] -> IO ()

-- | Set the current active item in a combobox given an input id.
comboBoxSetActive :: Show a => ComboBoxText -> a -> IO ()

-- | Get the current active item in a combobox
--   
--   The list of values to be searched in the combobox must be given as a
--   parameter. These values are converted to Text then compared to the
--   current id.
comboBoxGetActive :: forall a. (Show a, Enum a) => ComboBoxText -> [a] -> IO (Maybe a)
applyNewPreferences :: TMState -> IO ()
applyNewPreferencesToTab :: TMState -> TMNotebookTab -> IO ()

-- | Show the preferences dialog.
--   
--   When the user clicks on the Ok button, it copies the new settings to
--   TMState. Then apply them to the current terminals.
showPreferencesDialog :: TMState -> IO ()
appStartup :: Application -> IO ()

-- | Run Termonad with the given TMConfig.
--   
--   Do not perform any of the recompilation operations that the
--   defaultMain function does.
start :: TMConfig -> IO ()

-- | Run Termonad with the given TMConfig.
--   
--   This function will check if there is a
--   ~/.config/termonad/termonad.hs file and a
--   ~/.cache/termonad/termonad-linux-x86_64 binary. Termonad will
--   perform different actions based on whether or not these two files
--   exist.
--   
--   Here are the four different possible actions based on the existence of
--   these two files.
--   
--   
--   
- ~/.config/termonad/termonad.hs exists,
--   ~/.cache/termonad/termonad-linux-x86_64 existsThe timestamps
--   of these two files are checked. If the
--   ~/.config/termonad/termonad.hs file has been modified after
--   the ~/.cache/termonad/termonad-linux-x86_64 binary, then
--   Termonad will use GHC to recompile the
--   ~/.config/termonad/termonad.hs file, producing a new binary
--   at ~/.cache/termonad/termonad-linux-x86_64. This new binary
--   will be re-executed. The TMConfig passed to this
--   defaultMain will be effectively thrown away.If GHC fails to
--   recompile the ~/.config/termonad/termonad.hs file, then
--   Termonad will just execute start with the TMConfig
--   passed in.If the ~/.cache/termonad/termonad-linux-x86_64
--   binary has been modified after the
--   ~/.config/termonad/termonad.hs file, then Termonad will
--   re-exec the ~/.cache/termonad/termonad-linux-x86_64 binary.
--   The TMConfig passed to this defaultMain will be
--   effectively thrown away.
--   
- ~/.config/termonad/termonad.hs exists,
--   ~/.cache/termonad/termonad-linux-x86_64 does not
--   existTermonad will use GHC to recompile the
--   ~/.config/termonad/termonad.hs file, producing a new binary
--   at ~/.cache/termonad/termonad-linux-x86_64. This new binary
--   will be re-executed. The TMConfig passed to this
--   defaultMain will be effectively thrown away.If GHC fails to
--   recompile the ~/.config/termonad/termonad.hs file, then
--   Termonad will just execute start with the TMConfig
--   passed in.
--   
- ~/.config/termonad/termonad.hs does not exist,
--   ~/.cache/termonad/termonad-linux-x86_64 existsTermonad will
--   ignore the ~/.cache/termonad/termonad-linux-x86_64 binary and
--   just run start with the TMConfig passed to this
--   function.
--   
- ~/.config/termonad/termonad.hs does not exist,
--   ~/.cache/termonad/termonad-linux-x86_64 does not
--   existTermonad will run start with the TMConfig passed to
--   this function.
--   
--   
--   Other notes:
--   
--   
--   
- That the locations of ~/.config/termonad/termonad.hs and
--   ~/.cache/termonad/termonad-linux-x86_64 may differ depending
--   on your system.
--   
- In your own ~/.config/termonad/termonad.hs file, you can
--   use either defaultMain or start. As long as you always
--   execute the system-wide termonad binary (instead of the
--   binary produced as ~/.cache/termonad/termonad-linux-x86_64),
--   the effect should be the same.
--   
defaultMain :: TMConfig -> IO ()

-- | This module exposes termonad's basic configuration options, as well as
--   defaultMain.
--   
--   If you want to configure Termonad, please take a look at
--   Termonad.Config.
module Termonad

-- | Run Termonad with the given TMConfig.
--   
--   This function will check if there is a
--   ~/.config/termonad/termonad.hs file and a
--   ~/.cache/termonad/termonad-linux-x86_64 binary. Termonad will
--   perform different actions based on whether or not these two files
--   exist.
--   
--   Here are the four different possible actions based on the existence of
--   these two files.
--   
--   
--   
- ~/.config/termonad/termonad.hs exists,
--   ~/.cache/termonad/termonad-linux-x86_64 existsThe timestamps
--   of these two files are checked. If the
--   ~/.config/termonad/termonad.hs file has been modified after
--   the ~/.cache/termonad/termonad-linux-x86_64 binary, then
--   Termonad will use GHC to recompile the
--   ~/.config/termonad/termonad.hs file, producing a new binary
--   at ~/.cache/termonad/termonad-linux-x86_64. This new binary
--   will be re-executed. The TMConfig passed to this
--   defaultMain will be effectively thrown away.If GHC fails to
--   recompile the ~/.config/termonad/termonad.hs file, then
--   Termonad will just execute start with the TMConfig
--   passed in.If the ~/.cache/termonad/termonad-linux-x86_64
--   binary has been modified after the
--   ~/.config/termonad/termonad.hs file, then Termonad will
--   re-exec the ~/.cache/termonad/termonad-linux-x86_64 binary.
--   The TMConfig passed to this defaultMain will be
--   effectively thrown away.
--   
- ~/.config/termonad/termonad.hs exists,
--   ~/.cache/termonad/termonad-linux-x86_64 does not
--   existTermonad will use GHC to recompile the
--   ~/.config/termonad/termonad.hs file, producing a new binary
--   at ~/.cache/termonad/termonad-linux-x86_64. This new binary
--   will be re-executed. The TMConfig passed to this
--   defaultMain will be effectively thrown away.If GHC fails to
--   recompile the ~/.config/termonad/termonad.hs file, then
--   Termonad will just execute start with the TMConfig
--   passed in.
--   
- ~/.config/termonad/termonad.hs does not exist,
--   ~/.cache/termonad/termonad-linux-x86_64 existsTermonad will
--   ignore the ~/.cache/termonad/termonad-linux-x86_64 binary and
--   just run start with the TMConfig passed to this
--   function.
--   
- ~/.config/termonad/termonad.hs does not exist,
--   ~/.cache/termonad/termonad-linux-x86_64 does not
--   existTermonad will run start with the TMConfig passed to
--   this function.
--   
--   
--   Other notes:
--   
--   
--   
- That the locations of ~/.config/termonad/termonad.hs and
--   ~/.cache/termonad/termonad-linux-x86_64 may differ depending
--   on your system.
--   
- In your own ~/.config/termonad/termonad.hs file, you can
--   use either defaultMain or start. As long as you always
--   execute the system-wide termonad binary (instead of the
--   binary produced as ~/.cache/termonad/termonad-linux-x86_64),
--   the effect should be the same.
--   
defaultMain :: TMConfig -> IO ()

-- | Run Termonad with the given TMConfig.
--   
--   Do not perform any of the recompilation operations that the
--   defaultMain function does.
start :: TMConfig -> IO ()
