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

-- | base-compat with extra batteries
--   
--   Provides functions available in later versions of base to a
--   wider range of compilers, without requiring you to use CPP pragmas in
--   your code.
--   
--   This package provides the same API as the base-compat
--   library, but depends on compatibility packages (such as
--   semigroups) to offer a wider support window than
--   base-compat, which has no dependencies. Most of the modules
--   in this library have the same names as in base-compat to make
--   it easier to switch between the two. There also exist versions of each
--   module with the suffix .Repl.Batteries, which are distinct
--   from anything in base-compat, to allow for easier use in
--   GHCi.
--   
--   See here for a more comprehensive list of differences
--   between base-compat and base-compat-batteries.
@package base-compat-batteries
@version 0.10.5

module Control.Concurrent.Compat

-- | Reexports Control.Concurrent.Compat from a globally unique
--   namespace.
module Control.Concurrent.Compat.Repl.Batteries

module Control.Concurrent.MVar.Compat

-- | Reexports Control.Concurrent.MVar.Compat from a globally unique
--   namespace.
module Control.Concurrent.MVar.Compat.Repl.Batteries

module Control.Exception.Compat

-- | Reexports Control.Exception.Compat from a globally unique
--   namespace.
module Control.Exception.Compat.Repl.Batteries

module Control.Monad.Compat

-- | Reexports Control.Monad.Compat from a globally unique
--   namespace.
module Control.Monad.Compat.Repl.Batteries

module Control.Monad.Fail.Compat

-- | Reexports Control.Monad.Fail.Compat from a globally unique
--   namespace.
module Control.Monad.Fail.Compat.Repl.Batteries

module Control.Monad.IO.Class.Compat

-- | Reexports Control.Monad.IO.Class.Compat from a globally unique
--   namespace.
module Control.Monad.IO.Class.Compat.Repl.Batteries

module Control.Monad.ST.Lazy.Unsafe.Compat

-- | Reexports Control.Monad.ST.Lazy.Unsafe.Compat from a globally
--   unique namespace.
module Control.Monad.ST.Lazy.Unsafe.Compat.Repl.Batteries

module Control.Monad.ST.Unsafe.Compat

-- | Reexports Control.Monad.ST.Unsafe.Compat from a globally unique
--   namespace.
module Control.Monad.ST.Unsafe.Compat.Repl.Batteries

module Data.Bifoldable.Compat

-- | Reexports Data.Bifoldable.Compat from a globally unique
--   namespace.
module Data.Bifoldable.Compat.Repl.Batteries

module Data.Bifunctor.Compat

-- | Reexports Data.Bifunctor.Compat from a globally unique
--   namespace.
module Data.Bifunctor.Compat.Repl.Batteries

module Data.Bitraversable.Compat

-- | Reexports Data.Bitraversable.Compat from a globally unique
--   namespace.
module Data.Bitraversable.Compat.Repl.Batteries

module Data.Bits.Compat

-- | Reexports Data.Bits.Compat from a globally unique namespace.
module Data.Bits.Compat.Repl.Batteries

module Data.Bool.Compat

-- | Reexports Data.Bool.Compat from a globally unique namespace.
module Data.Bool.Compat.Repl.Batteries

module Data.Complex.Compat

-- | Reexports Data.Complex.Compat from a globally unique namespace.
module Data.Complex.Compat.Repl.Batteries

module Data.Either.Compat

-- | Reexports Data.Either.Compat from a globally unique namespace.
module Data.Either.Compat.Repl.Batteries

module Data.Foldable.Compat

-- | Reexports Data.Foldable.Compat from a globally unique
--   namespace.
module Data.Foldable.Compat.Repl.Batteries

module Data.Function.Compat

-- | Reexports Data.Function.Compat from a globally unique
--   namespace.
module Data.Function.Compat.Repl.Batteries

module Data.Functor.Compat

-- | The Functor class is used for types that can be mapped over.
--   Instances of Functor should satisfy the following laws:
--   
--   
--   fmap id  ==  id
--   fmap (f . g)  ==  fmap f . fmap g
--   
--   
--   The instances of Functor for lists, Maybe and IO
--   satisfy these laws.
class Functor (f :: Type -> Type)
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.
(<$) :: Functor f => a -> f b -> f a
infixl 4 <$

-- | 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 $>

-- | 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 ()

-- | 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 <&>

-- | Reexports Data.Functor.Compat from a globally unique namespace.
module Data.Functor.Compat.Repl.Batteries

module Data.Functor.Compose.Compat

-- | Reexports Data.Functor.Compose.Compat from a globally unique
--   namespace.
module Data.Functor.Compose.Compat.Repl.Batteries

module Data.Functor.Const.Compat

-- | Reexports Data.Functor.Const.Compat from a globally unique
--   namespace.
module Data.Functor.Const.Compat.Repl.Batteries

module Data.Functor.Contravariant.Compat

-- | Reexports Data.Functor.Contravariant.Compat from a globally
--   unique namespace.
module Data.Functor.Contravariant.Compat.Repl.Batteries

module Data.Functor.Identity.Compat

-- | Reexports Data.Functor.Identity.Compat from a globally unique
--   namespace.
module Data.Functor.Identity.Compat.Repl.Batteries

module Data.Functor.Product.Compat

-- | Reexports Data.Functor.Product.Compat from a globally unique
--   namespace.
module Data.Functor.Product.Compat.Repl.Batteries

module Data.Functor.Sum.Compat

-- | Reexports Data.Functor.Sum.Compat from a globally unique
--   namespace.
module Data.Functor.Sum.Compat.Repl.Batteries

module Data.IORef.Compat

-- | Reexports Data.IORef.Compat from a globally unique namespace.
module Data.IORef.Compat.Repl.Batteries

module Data.List.Compat

-- | Reexports Data.List.Compat from a globally unique namespace.
module Data.List.Compat.Repl.Batteries

-- | This backports the modern Data.Semigroup interface back to
--   base-4.9/GHC 8.0.
module Data.List.NonEmpty.Compat

-- | Non-empty (and non-strict) list type.
data NonEmpty a
(:|) :: a -> [a] -> NonEmpty a
infixr 5 :|

-- | Map a function over a NonEmpty stream.
map :: () => (a -> b) -> NonEmpty a -> NonEmpty b

-- | 'intersperse x xs' alternates elements of the list with copies of
--   x.
--   
--   
--   intersperse 0 (1 :| [2,3]) == 1 :| [0,2,0,3]
--   
intersperse :: () => a -> NonEmpty a -> NonEmpty a

-- | scanl is similar to foldl, but returns a stream of
--   successive reduced values from the left:
--   
--   
--   scanl f z [x1, x2, ...] == z :| [z `f` x1, (z `f` x1) `f` x2, ...]
--   
--   
--   Note that
--   
--   
--   last (scanl f z xs) == foldl f z xs.
--   
scanl :: Foldable f => (b -> a -> b) -> b -> f a -> NonEmpty b

-- | scanr is the right-to-left dual of scanl. Note that
--   
--   
--   head (scanr f z xs) == foldr f z xs.
--   
scanr :: Foldable f => (a -> b -> b) -> b -> f a -> NonEmpty b

-- | scanl1 is a variant of scanl that has no starting value
--   argument:
--   
--   
--   scanl1 f [x1, x2, ...] == x1 :| [x1 `f` x2, x1 `f` (x2 `f` x3), ...]
--   
scanl1 :: () => (a -> a -> a) -> NonEmpty a -> NonEmpty a

-- | scanr1 is a variant of scanr that has no starting value
--   argument.
scanr1 :: () => (a -> a -> a) -> NonEmpty a -> NonEmpty a

-- | transpose for NonEmpty, behaves the same as
--   transpose The rows/columns need not be the same length, in
--   which case > transpose . transpose /= id
transpose :: () => NonEmpty (NonEmpty a) -> NonEmpty (NonEmpty a)

-- | sortBy for NonEmpty, behaves the same as sortBy
sortBy :: () => (a -> a -> Ordering) -> NonEmpty a -> NonEmpty a

-- | sortWith for NonEmpty, behaves the same as:
--   
--   
--   sortBy . comparing
--   
sortWith :: Ord o => (a -> o) -> NonEmpty a -> NonEmpty a

-- | Number of elements in NonEmpty list.
length :: () => NonEmpty a -> Int

-- | Extract the first element of the stream.
head :: () => NonEmpty a -> a

-- | Extract the possibly-empty tail of the stream.
tail :: () => NonEmpty a -> [a]

-- | Extract the last element of the stream.
last :: () => NonEmpty a -> a

-- | Extract everything except the last element of the stream.
init :: () => NonEmpty a -> [a]

-- | Prepend an element to the stream.
(<|) :: () => a -> NonEmpty a -> NonEmpty a
infixr 5 <|

-- | Synonym for <|.
cons :: () => a -> NonEmpty a -> NonEmpty a

-- | uncons produces the first element of the stream, and a stream
--   of the remaining elements, if any.
uncons :: () => NonEmpty a -> (a, Maybe (NonEmpty a))

-- | The unfoldr function is analogous to Data.List's
--   unfoldr operation.
unfoldr :: () => (a -> (b, Maybe a)) -> a -> NonEmpty b

-- | Sort a stream.
sort :: Ord a => NonEmpty a -> NonEmpty a

-- | reverse a finite NonEmpty stream.
reverse :: () => NonEmpty a -> NonEmpty a

-- | The inits function takes a stream xs and returns all
--   the finite prefixes of xs.
inits :: Foldable f => f a -> NonEmpty [a]

-- | The tails function takes a stream xs and returns all
--   the suffixes of xs.
tails :: Foldable f => f a -> NonEmpty [a]

-- | iterate f x produces the infinite sequence of repeated
--   applications of f to x.
--   
--   
--   iterate f x = x :| [f x, f (f x), ..]
--   
iterate :: () => (a -> a) -> a -> NonEmpty a

-- | repeat x returns a constant stream, where all elements
--   are equal to x.
repeat :: () => a -> NonEmpty a

-- | cycle xs returns the infinite repetition of
--   xs:
--   
--   
--   cycle (1 :| [2,3]) = 1 :| [2,3,1,2,3,...]
--   
cycle :: () => NonEmpty a -> NonEmpty a

-- | unfold produces a new stream by repeatedly applying the
--   unfolding function to the seed value to produce an element of type
--   b and a new seed value. When the unfolding function returns
--   Nothing instead of a new seed value, the stream ends.
unfold :: () => (a -> (b, Maybe a)) -> a -> NonEmpty b

-- | insert x xs inserts x into the last position
--   in xs where it is still less than or equal to the next
--   element. In particular, if the list is sorted beforehand, the result
--   will also be sorted.
insert :: (Foldable f, Ord a) => a -> f a -> NonEmpty a

-- | some1 x sequences x one or more times.
some1 :: Alternative f => f a -> f (NonEmpty a)

-- | take n xs returns the first n elements of
--   xs.
take :: () => Int -> NonEmpty a -> [a]

-- | drop n xs drops the first n elements off the
--   front of the sequence xs.
drop :: () => Int -> NonEmpty a -> [a]

-- | splitAt n xs returns a pair consisting of the prefix
--   of xs of length n and the remaining stream
--   immediately following this prefix.
--   
--   
--   'splitAt' n xs == ('take' n xs, 'drop' n xs)
--   xs == ys ++ zs where (ys, zs) = 'splitAt' n xs
--   
splitAt :: () => Int -> NonEmpty a -> ([a], [a])

-- | takeWhile p xs returns the longest prefix of the
--   stream xs for which the predicate p holds.
takeWhile :: () => (a -> Bool) -> NonEmpty a -> [a]

-- | dropWhile p xs returns the suffix remaining after
--   takeWhile p xs.
dropWhile :: () => (a -> Bool) -> NonEmpty a -> [a]

-- | span p xs returns the longest prefix of xs
--   that satisfies p, together with the remainder of the stream.
--   
--   
--   'span' p xs == ('takeWhile' p xs, 'dropWhile' p xs)
--   xs == ys ++ zs where (ys, zs) = 'span' p xs
--   
span :: () => (a -> Bool) -> NonEmpty a -> ([a], [a])

-- | The break p function is equivalent to span
--   (not . p).
break :: () => (a -> Bool) -> NonEmpty a -> ([a], [a])

-- | filter p xs removes any elements from xs that
--   do not satisfy p.
filter :: () => (a -> Bool) -> NonEmpty a -> [a]

-- | The partition function takes a predicate p and a
--   stream xs, and returns a pair of lists. The first list
--   corresponds to the elements of xs for which p holds;
--   the second corresponds to the elements of xs for which
--   p does not hold.
--   
--   
--   'partition' p xs = ('filter' p xs, 'filter' (not . p) xs)
--   
partition :: () => (a -> Bool) -> NonEmpty a -> ([a], [a])

-- | The group function takes a stream and returns a list of streams
--   such that flattening the resulting list is equal to the argument.
--   Moreover, each stream in the resulting list contains only equal
--   elements. For example, in list notation:
--   
--   
--   'group' $ 'cycle' "Mississippi"
--     = "M" : "i" : "ss" : "i" : "ss" : "i" : "pp" : "i" : "M" : "i" : ...
--   
group :: (Foldable f, Eq a) => f a -> [NonEmpty a]

-- | groupBy operates like group, but uses the provided
--   equality predicate instead of ==.
groupBy :: Foldable f => (a -> a -> Bool) -> f a -> [NonEmpty a]

-- | groupWith operates like group, but uses the provided
--   projection when comparing for equality
groupWith :: (Foldable f, Eq b) => (a -> b) -> f a -> [NonEmpty a]

-- | groupAllWith operates like groupWith, but sorts the list
--   first so that each equivalence class has, at most, one list in the
--   output
groupAllWith :: Ord b => (a -> b) -> [a] -> [NonEmpty a]

-- | group1 operates like group, but uses the knowledge that
--   its input is non-empty to produce guaranteed non-empty output.
group1 :: Eq a => NonEmpty a -> NonEmpty (NonEmpty a)

-- | groupBy1 is to group1 as groupBy is to
--   group.
groupBy1 :: () => (a -> a -> Bool) -> NonEmpty a -> NonEmpty (NonEmpty a)

-- | groupWith1 is to group1 as groupWith is to
--   group
groupWith1 :: Eq b => (a -> b) -> NonEmpty a -> NonEmpty (NonEmpty a)

-- | groupAllWith1 is to groupWith1 as groupAllWith is
--   to groupWith
groupAllWith1 :: Ord b => (a -> b) -> NonEmpty a -> NonEmpty (NonEmpty a)

-- | The isPrefix function returns True if the first
--   argument is a prefix of the second.
isPrefixOf :: Eq a => [a] -> NonEmpty a -> Bool

-- | The nub function removes duplicate elements from a list. In
--   particular, it keeps only the first occurrence of each element. (The
--   name nub means 'essence'.) It is a special case of
--   nubBy, which allows the programmer to supply their own
--   inequality test.
nub :: Eq a => NonEmpty a -> NonEmpty a

-- | The nubBy function behaves just like nub, except it uses
--   a user-supplied equality predicate instead of the overloaded ==
--   function.
nubBy :: () => (a -> a -> Bool) -> NonEmpty a -> NonEmpty a

-- | xs !! n returns the element of the stream xs at
--   index n. Note that the head of the stream has index 0.
--   
--   Beware: a negative or out-of-bounds index will cause an error.
(!!) :: () => NonEmpty a -> Int -> a
infixl 9 !!

-- | The zip function takes two streams and returns a stream of
--   corresponding pairs.
zip :: () => NonEmpty a -> NonEmpty b -> NonEmpty (a, b)

-- | The zipWith function generalizes zip. Rather than
--   tupling the elements, the elements are combined using the function
--   passed as the first argument.
zipWith :: () => (a -> b -> c) -> NonEmpty a -> NonEmpty b -> NonEmpty c

-- | The unzip function is the inverse of the zip function.
unzip :: Functor f => f (a, b) -> (f a, f b)

-- | Converts a normal list to a NonEmpty stream.
--   
--   Raises an error if given an empty list.
fromList :: () => [a] -> NonEmpty a

-- | Convert a stream to a normal list efficiently.
toList :: () => NonEmpty a -> [a]

-- | nonEmpty efficiently turns a normal list into a NonEmpty
--   stream, producing Nothing if the input is empty.
nonEmpty :: () => [a] -> Maybe (NonEmpty a)

-- | Compute n-ary logic exclusive OR operation on NonEmpty list.
xor :: NonEmpty Bool -> Bool

-- | Reexports Data.List.NonEmpty.Compat from a globally unique
--   namespace.
module Data.List.NonEmpty.Compat.Repl.Batteries

module Data.Monoid.Compat

-- | The class of monoids (types with an associative binary operation that
--   has an identity). Instances should satisfy the following laws:
--   
--   
--   
- 
x <> mempty = x

--   
- 
mempty <> x = x

--   
- x <> (y <> z) = (x <>
--   y) <> z (Semigroup law)
--   
- 
mconcat = foldr '(<>)'
--   mempty

--   
--   
--   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
mempty :: Monoid a => a

-- | An associative operation
--   
--   NOTE: This method is redundant and has the default
--   implementation mappend = '(<>)' since
--   base-4.11.0.0.
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 :: Monoid a => [a] -> a

-- | Maybe monoid returning the leftmost non-Nothing value.
--   
--   First a is isomorphic to Alt Maybe
--   a, but precedes it historically.
--   
--   
--   >>> getFirst (First (Just "hello") <> First Nothing <> First (Just "world"))
--   Just "hello"
--   
--   
--   Use of this type is discouraged. Note the following equivalence:
--   
--   
--   Data.Monoid.First x === Maybe (Data.Semigroup.First x)
--   
--   
--   In addition to being equivalent in the structural sense, the two also
--   have Monoid instances that behave the same. This type will be
--   marked deprecated in GHC 8.8, and removed in GHC 8.10. Users are
--   advised to use the variant from Data.Semigroup and wrap it in
--   Maybe.
newtype First a
First :: Maybe a -> First a
[getFirst] :: First a -> Maybe a

-- | Maybe monoid returning the rightmost non-Nothing value.
--   
--   Last a is isomorphic to Dual (First
--   a), and thus to Dual (Alt Maybe a)
--   
--   
--   >>> getLast (Last (Just "hello") <> Last Nothing <> Last (Just "world"))
--   Just "world"
--   
--   
--   Use of this type is discouraged. Note the following equivalence:
--   
--   
--   Data.Monoid.Last x === Maybe (Data.Semigroup.Last x)
--   
--   
--   In addition to being equivalent in the structural sense, the two also
--   have Monoid instances that behave the same. This type will be
--   marked deprecated in GHC 8.8, and removed in GHC 8.10. Users are
--   advised to use the variant from Data.Semigroup and wrap it in
--   Maybe.
newtype Last a
Last :: Maybe a -> Last a
[getLast] :: Last a -> Maybe a

-- | This data type witnesses the lifting of a Monoid into an
--   Applicative pointwise.
newtype Ap (f :: k -> Type) (a :: k) :: forall k. () => k -> Type -> k -> Type
Ap :: f a -> Ap
[getAp] :: Ap -> f a

-- | The dual of a Monoid, obtained by swapping the arguments of
--   mappend.
--   
--   
--   >>> getDual (mappend (Dual "Hello") (Dual "World"))
--   "WorldHello"
--   
newtype Dual a
Dual :: a -> Dual a
[getDual] :: Dual a -> a

-- | The monoid of endomorphisms under composition.
--   
--   
--   >>> let computation = Endo ("Hello, " ++) <> Endo (++ "!")
--   
--   >>> appEndo computation "Haskell"
--   "Hello, Haskell!"
--   
newtype Endo a
Endo :: (a -> a) -> Endo a
[appEndo] :: Endo a -> a -> a

-- | Boolean monoid under conjunction (&&).
--   
--   
--   >>> getAll (All True <> mempty <> All False)
--   False
--   
--   
--   
--   >>> getAll (mconcat (map (\x -> All (even x)) [2,4,6,7,8]))
--   False
--   
newtype All
All :: Bool -> All
[getAll] :: All -> Bool

-- | Boolean monoid under disjunction (||).
--   
--   
--   >>> getAny (Any True <> mempty <> Any False)
--   True
--   
--   
--   
--   >>> getAny (mconcat (map (\x -> Any (even x)) [2,4,6,7,8]))
--   True
--   
newtype Any
Any :: Bool -> Any
[getAny] :: Any -> Bool

-- | Monoid under addition.
--   
--   
--   >>> getSum (Sum 1 <> Sum 2 <> mempty)
--   3
--   
newtype Sum a
Sum :: a -> Sum a
[getSum] :: Sum a -> a

-- | Monoid under multiplication.
--   
--   
--   >>> getProduct (Product 3 <> Product 4 <> mempty)
--   12
--   
newtype Product a
Product :: a -> Product a
[getProduct] :: Product a -> a

-- | Monoid under <|>.
newtype Alt (f :: k -> Type) (a :: k) :: forall k. () => k -> Type -> k -> Type
Alt :: f a -> Alt
[getAlt] :: Alt -> f a

-- | An associative operation.
(<>) :: Semigroup a => a -> a -> a
infixr 6 <>

-- | Reexports Data.Monoid.Compat from a globally unique namespace.
module Data.Monoid.Compat.Repl.Batteries

module Data.Proxy.Compat

-- | Reexports Data.Proxy.Compat from a globally unique namespace.
module Data.Proxy.Compat.Repl.Batteries

module Data.Ratio.Compat

-- | Reexports Data.Ratio.Compat from a globally unique namespace.
module Data.Ratio.Compat.Repl.Batteries

module Data.STRef.Compat

-- | Reexports Data.STRef.Compat from a globally unique namespace.
module Data.STRef.Compat.Repl.Batteries

module Data.Semigroup.Compat

-- | The class of semigroups (types with an associative binary operation).
--   
--   Instances should satisfy the associativity law:
--   
--   
--   
- 
x <> (y <> z) = (x <>
--   y) <> z

--   
class Semigroup a

-- | An associative operation.
(<>) :: Semigroup a => a -> a -> a

-- | Reduce a non-empty list with <>
--   
--   The default definition should be sufficient, but this can be
--   overridden for efficiency.
sconcat :: Semigroup a => NonEmpty a -> a

-- | Repeat a value n times.
--   
--   Given that this works on a Semigroup it is allowed to fail if
--   you request 0 or fewer repetitions, and the default definition will do
--   so.
--   
--   By making this a member of the class, idempotent semigroups and
--   monoids can upgrade this to execute in O(1) by picking
--   stimes = stimesIdempotent or stimes =
--   stimesIdempotentMonoid respectively.
stimes :: (Semigroup a, Integral b) => b -> a -> a
infixr 6 <>

-- | This is a valid definition of stimes for a Monoid.
--   
--   Unlike the default definition of stimes, it is defined for 0
--   and so it should be preferred where possible.
stimesMonoid :: (Integral b, Monoid a) => b -> a -> a

-- | This is a valid definition of stimes for an idempotent
--   Semigroup.
--   
--   When x <> x = x, this definition should be preferred,
--   because it works in O(1) rather than O(log n).
stimesIdempotent :: Integral b => b -> a -> a

-- | This is a valid definition of stimes for an idempotent
--   Monoid.
--   
--   When mappend x x = x, this definition should be preferred,
--   because it works in O(1) rather than O(log n)
stimesIdempotentMonoid :: (Integral b, Monoid a) => b -> a -> a

-- | Repeat a value n times.
--   
--   
--   mtimesDefault n a = a <> a <> ... <> a  -- using <> (n-1) times
--   
--   
--   Implemented using stimes and mempty.
--   
--   This is a suitable definition for an mtimes member of
--   Monoid.
mtimesDefault :: (Integral b, Monoid a) => b -> a -> a
newtype Min a
Min :: a -> Min a
[getMin] :: Min a -> a
newtype Max a
Max :: a -> Max a
[getMax] :: Max a -> a

-- | Use Option (First a) to get the behavior of
--   First from Data.Monoid.
newtype First a
First :: a -> First a
[getFirst] :: First a -> a

-- | Use Option (Last a) to get the behavior of
--   Last from Data.Monoid
newtype Last a
Last :: a -> Last a
[getLast] :: Last a -> a

-- | 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.
newtype WrappedMonoid m
WrapMonoid :: m -> WrappedMonoid m
[unwrapMonoid] :: WrappedMonoid m -> m

-- | The dual of a Monoid, obtained by swapping the arguments of
--   mappend.
--   
--   
--   >>> getDual (mappend (Dual "Hello") (Dual "World"))
--   "WorldHello"
--   
newtype Dual a
Dual :: a -> Dual a
[getDual] :: Dual a -> a

-- | The monoid of endomorphisms under composition.
--   
--   
--   >>> let computation = Endo ("Hello, " ++) <> Endo (++ "!")
--   
--   >>> appEndo computation "Haskell"
--   "Hello, Haskell!"
--   
newtype Endo a
Endo :: (a -> a) -> Endo a
[appEndo] :: Endo a -> a -> a

-- | Boolean monoid under conjunction (&&).
--   
--   
--   >>> getAll (All True <> mempty <> All False)
--   False
--   
--   
--   
--   >>> getAll (mconcat (map (\x -> All (even x)) [2,4,6,7,8]))
--   False
--   
newtype All
All :: Bool -> All
[getAll] :: All -> Bool

-- | Boolean monoid under disjunction (||).
--   
--   
--   >>> getAny (Any True <> mempty <> Any False)
--   True
--   
--   
--   
--   >>> getAny (mconcat (map (\x -> Any (even x)) [2,4,6,7,8]))
--   True
--   
newtype Any
Any :: Bool -> Any
[getAny] :: Any -> Bool

-- | Monoid under addition.
--   
--   
--   >>> getSum (Sum 1 <> Sum 2 <> mempty)
--   3
--   
newtype Sum a
Sum :: a -> Sum a
[getSum] :: Sum a -> a

-- | Monoid under multiplication.
--   
--   
--   >>> getProduct (Product 3 <> Product 4 <> mempty)
--   12
--   
newtype Product a
Product :: a -> Product a
[getProduct] :: Product a -> a

-- | Option is effectively Maybe with a better instance of
--   Monoid, built off of an underlying Semigroup instead of
--   an underlying Monoid.
--   
--   Ideally, this type would not exist at all and we would just fix the
--   Monoid instance of Maybe.
--   
--   In GHC 8.4 and higher, the Monoid instance for Maybe has
--   been corrected to lift a Semigroup instance instead of a
--   Monoid instance. Consequently, this type is no longer useful.
--   It will be marked deprecated in GHC 8.8 and removed in GHC 8.10.
newtype Option a
Option :: Maybe a -> Option a
[getOption] :: Option a -> Maybe a

-- | Fold an Option case-wise, just like maybe.
option :: () => b -> (a -> b) -> Option a -> b

-- | This lets you use a difference list of a Semigroup as a
--   Monoid.
diff :: Semigroup m => m -> Endo m

-- | A generalization of cycle to an arbitrary Semigroup. May
--   fail to terminate for some values in some semigroups.
cycle1 :: Semigroup m => m -> m

-- | Arg isn't itself a Semigroup in its own right, but it
--   can be placed inside Min and Max to compute an arg min
--   or arg max.
data Arg a b
Arg :: a -> b -> Arg a b
type ArgMin a b = Min Arg a b
type ArgMax a b = Max Arg a b

-- | Reexports Data.Semigroup.Compat from a globally unique
--   namespace.
module Data.Semigroup.Compat.Repl.Batteries

module Data.String.Compat

-- | Reexports Data.String.Compat from a globally unique namespace.
module Data.String.Compat.Repl.Batteries

module Data.Type.Coercion.Compat

-- | Reexports Data.Type.Coercion.Compat from a globally unique
--   namespace.
module Data.Type.Coercion.Compat.Repl.Batteries

module Data.Version.Compat

-- | Reexports Data.Version.Compat from a globally unique namespace.
module Data.Version.Compat.Repl.Batteries

module Data.Void.Compat

-- | Uninhabited data type
data Void

-- | Since Void values logically don't exist, this witnesses the
--   logical reasoning tool of "ex falso quodlibet".
--   
--   
--   >>> let x :: Either Void Int; x = Right 5
--   
--   >>> :{
--   case x of
--       Right r -> r
--       Left l  -> absurd l
--   :}
--   5
--   
absurd :: () => Void -> a

-- | If Void is uninhabited then any Functor that holds only
--   values of type Void is holding no values.
vacuous :: Functor f => f Void -> f a

-- | Reexports Data.Void.Compat from a globally unique namespace.
module Data.Void.Compat.Repl.Batteries

module Data.Word.Compat

-- | Reexports Data.Word.Compat from a globally unique namespace.
module Data.Word.Compat.Repl.Batteries

module Debug.Trace.Compat

-- | Reexports Debug.Trace.Compat from a globally unique namespace.
module Debug.Trace.Compat.Repl.Batteries

module Foreign.Compat

-- | Reexports Foreign.Compat from a globally unique namespace.
module Foreign.Compat.Repl.Batteries

module Foreign.ForeignPtr.Compat

-- | Reexports Foreign.ForeignPtr.Compat from a globally unique
--   namespace.
module Foreign.ForeignPtr.Compat.Repl.Batteries

module Foreign.ForeignPtr.Safe.Compat

-- | Reexports Foreign.ForeignPtr.Safe.Compat from a globally unique
--   namespace.
module Foreign.ForeignPtr.Safe.Compat.Repl.Batteries

module Foreign.ForeignPtr.Unsafe.Compat

-- | Reexports Foreign.ForeignPtr.Unsafe.Compat from a globally
--   unique namespace.
module Foreign.ForeignPtr.Unsafe.Compat.Repl.Batteries

module Foreign.Marshal.Alloc.Compat

-- | Reexports Foreign.Marshal.Alloc.Compat from a globally unique
--   namespace.
module Foreign.Marshal.Alloc.Compat.Repl.Batteries

module Foreign.Marshal.Array.Compat

-- | Reexports Foreign.Marshal.Array.Compat from a globally unique
--   namespace.
module Foreign.Marshal.Array.Compat.Repl.Batteries

module Foreign.Marshal.Compat

-- | Reexports Foreign.Marshal.Compat from a globally unique
--   namespace.
module Foreign.Marshal.Compat.Repl.Batteries

module Foreign.Marshal.Safe.Compat

-- | Reexports Foreign.Marshal.Safe.Compat from a globally unique
--   namespace.
module Foreign.Marshal.Safe.Compat.Repl.Batteries

module Foreign.Marshal.Unsafe.Compat

-- | Reexports Foreign.Marshal.Unsafe.Compat from a globally unique
--   namespace.
module Foreign.Marshal.Unsafe.Compat.Repl.Batteries

module Foreign.Marshal.Utils.Compat

-- | Reexports Foreign.Marshal.Utils.Compat from a globally unique
--   namespace.
module Foreign.Marshal.Utils.Compat.Repl.Batteries

module Numeric.Compat

-- | Reexports Numeric.Compat from a globally unique namespace.
module Numeric.Compat.Repl.Batteries

module Numeric.Natural.Compat

-- | Reexports Numeric.Natural.Compat from a globally unique
--   namespace.
module Numeric.Natural.Compat.Repl.Batteries

module Prelude.Compat

-- | Reexports Prelude.Compat from a globally unique namespace.
module Prelude.Compat.Repl.Batteries

module System.Environment.Compat

-- | Reexports System.Environment.Compat from a globally unique
--   namespace.
module System.Environment.Compat.Repl.Batteries

module System.Exit.Compat

-- | Reexports System.Exit.Compat from a globally unique namespace.
module System.Exit.Compat.Repl.Batteries

module System.IO.Unsafe.Compat

-- | Reexports System.IO.Unsafe.Compat from a globally unique
--   namespace.
module System.IO.Unsafe.Compat.Repl.Batteries

module Text.Read.Compat

-- | Reexports Text.Read.Compat from a globally unique namespace.
module Text.Read.Compat.Repl.Batteries

module Type.Reflection.Compat

-- | Reexports Type.Reflection.Compat from a globally unique
--   namespace.
module Type.Reflection.Compat.Repl.Batteries
