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


-- | A standard library for Haskell
--   
--   See README and Haddocks at <a>https://www.stackage.org/package/rio</a>
@package rio
@version 0.1.18.0


-- | Lazy <tt>ByteString</tt> partial functions. Import as:
--   
--   <pre>
--   import qualified RIO.ByteString.Lazy.Partial as BL'
--   </pre>
module RIO.ByteString.Lazy.Partial
head :: ByteString -> Word8
last :: ByteString -> Word8
tail :: ByteString -> ByteString
init :: ByteString -> ByteString
foldl1 :: (Word8 -> Word8 -> Word8) -> ByteString -> Word8
foldl1' :: (Word8 -> Word8 -> Word8) -> ByteString -> Word8
foldr1 :: (Word8 -> Word8 -> Word8) -> ByteString -> Word8
maximum :: ByteString -> Word8
minimum :: ByteString -> Word8


-- | Strict <tt>ByteString</tt> partial functions. Import as:
--   
--   <pre>
--   import qualified RIO.ByteString.Partial as B'
--   </pre>
module RIO.ByteString.Partial
head :: ByteString -> Word8
last :: ByteString -> Word8
tail :: ByteString -> ByteString
init :: ByteString -> ByteString
foldl1 :: (Word8 -> Word8 -> Word8) -> ByteString -> Word8
foldl1' :: (Word8 -> Word8 -> Word8) -> ByteString -> Word8
foldr1 :: (Word8 -> Word8 -> Word8) -> ByteString -> Word8
foldr1' :: (Word8 -> Word8 -> Word8) -> ByteString -> Word8
maximum :: ByteString -> Word8
minimum :: ByteString -> Word8


-- | Unicode <tt>Char</tt>. Import as:
--   
--   <pre>
--   import qualified RIO.Char as C
--   </pre>
--   
--   This module does not export any partial functions. For those, see
--   <a>RIO.Char.Partial</a>
module RIO.Char
data Char
isControl :: Char -> Bool
isSpace :: Char -> Bool
isLower :: Char -> Bool
isUpper :: Char -> Bool
isAlpha :: Char -> Bool
isAlphaNum :: Char -> Bool
isPrint :: Char -> Bool
isDigit :: Char -> Bool
isOctDigit :: Char -> Bool
isHexDigit :: Char -> Bool
isLetter :: Char -> Bool
isMark :: Char -> Bool
isNumber :: Char -> Bool
isPunctuation :: Char -> Bool
isSymbol :: Char -> Bool
isSeparator :: Char -> Bool
isAscii :: Char -> Bool
isLatin1 :: Char -> Bool
isAsciiUpper :: Char -> Bool
isAsciiLower :: Char -> Bool
data GeneralCategory
UppercaseLetter :: GeneralCategory
LowercaseLetter :: GeneralCategory
TitlecaseLetter :: GeneralCategory
ModifierLetter :: GeneralCategory
OtherLetter :: GeneralCategory
NonSpacingMark :: GeneralCategory
SpacingCombiningMark :: GeneralCategory
EnclosingMark :: GeneralCategory
DecimalNumber :: GeneralCategory
LetterNumber :: GeneralCategory
OtherNumber :: GeneralCategory
ConnectorPunctuation :: GeneralCategory
DashPunctuation :: GeneralCategory
OpenPunctuation :: GeneralCategory
ClosePunctuation :: GeneralCategory
InitialQuote :: GeneralCategory
FinalQuote :: GeneralCategory
OtherPunctuation :: GeneralCategory
MathSymbol :: GeneralCategory
CurrencySymbol :: GeneralCategory
ModifierSymbol :: GeneralCategory
OtherSymbol :: GeneralCategory
Space :: GeneralCategory
LineSeparator :: GeneralCategory
ParagraphSeparator :: GeneralCategory
Control :: GeneralCategory
Format :: GeneralCategory
Surrogate :: GeneralCategory
PrivateUse :: GeneralCategory
NotAssigned :: GeneralCategory
generalCategory :: Char -> GeneralCategory
toUpper :: Char -> Char
toLower :: Char -> Char
toTitle :: Char -> Char
ord :: Char -> Int
showLitChar :: Char -> ShowS
lexLitChar :: ReadS String
readLitChar :: ReadS Char


-- | Unicode <tt>Char</tt> partial functions. Import as:
--   
--   <pre>
--   import qualified RIO.Char.Partial as C'
--   </pre>
module RIO.Char.Partial
digitToInt :: Char -> Int
intToDigit :: Int -> Char
chr :: Int -> Char

module RIO.Directory


-- | <h2>Rationale</h2>
--   
--   This module offers functions to handle files that offer better
--   durability and/or atomicity.
--   
--   See <a>UnliftIO.IO.File</a> for the rationale behind this module,
--   since all of the functions were moved upstream and are now simply
--   re-exported from here.
module RIO.File

-- | Unlifted version of <a>withBinaryFile</a>.
withBinaryFile :: MonadUnliftIO m => FilePath -> IOMode -> (Handle -> m a) -> m a

-- | Lifted version of <a>writeFile</a>
writeBinaryFile :: MonadIO m => FilePath -> ByteString -> m ()

-- | Perform an action on a new or existing file at the destination file
--   path. If previously the file existed at the supplied file path then:
--   
--   <ul>
--   <li>in case of <a>WriteMode</a> it will be overwritten</li>
--   <li>upon <a>ReadWriteMode</a> or <a>AppendMode</a> files contents will
--   be copied over into a temporary file, thus making sure no corruption
--   can happen to an existing file upon any failures, even catastrophic
--   one, yet its contents are availble for modification.</li>
--   <li>There is nothing atomic about <a>ReadMode</a>, so no special
--   treatment there.</li>
--   </ul>
--   
--   It is similar to <a>withBinaryFileDurableAtomic</a>, but without the
--   durability part. It means that all modification can still disappear
--   after it has been succesfully written due to some extreme event like
--   an abrupt power loss, but the contents will not be corrupted in case
--   when the file write did not end successfully.
--   
--   The same performance caveats apply as for
--   <a>withBinaryFileDurableAtomic</a> due to making a copy of the content
--   of existing files during non-truncating writes.
--   
--   <b>Important</b> - Do not close the handle, otherwise it will result
--   in <tt>invalid argument (Bad file descriptor)</tt> exception
--   
--   <b>Note</b> - on Linux operating system and only with supported file
--   systems an anonymous temporary file will be used while working on the
--   file (see <tt>O_TMPFILE</tt> in <tt>man openat</tt>). In case when
--   such feature is not available or not supported a temporary file
--   ".target-file-nameXXX.ext.tmp", where XXX is some random number, will
--   be created alongside the target file in the same directory
withBinaryFileAtomic :: MonadUnliftIO m => FilePath -> IOMode -> (Handle -> m r) -> m r

-- | Same as <a>writeBinaryFileDurableAtomic</a>, except it does not
--   guarantee durability.
--   
--   <h3>Cross-Platform support</h3>
--   
--   This function behaves the same as <a>writeBinaryFile</a> on Windows
--   platforms.
writeBinaryFileAtomic :: MonadIO m => FilePath -> ByteString -> m ()

-- | Opens a file with the following guarantees:
--   
--   <ul>
--   <li>It successfully closes the file in case of an asynchronous
--   exception</li>
--   <li>It reliably saves the file in the correct directory; including
--   edge case situations like a different device being mounted to the
--   current directory, or the current directory being renamed to some
--   other name while the file is being used.</li>
--   <li>It ensures durability by executing an <tt>fsync()</tt> call before
--   closing the file handle</li>
--   </ul>
--   
--   <h3>Cross-Platform support</h3>
--   
--   This function behaves the same as <a>withBinaryFile</a> on Windows
--   platforms.
withBinaryFileDurable :: MonadUnliftIO m => FilePath -> IOMode -> (Handle -> m r) -> m r

-- | Similar to <a>writeBinaryFile</a>, but it also ensures that changes
--   executed to the file are guaranteed to be durable. It internally uses
--   <tt>fsync()</tt> and makes sure it synchronizes the file on disk.
--   
--   <h3>Cross-Platform support</h3>
--   
--   This function behaves the same as <a>writeBinaryFile</a> on Windows
--   platforms.
writeBinaryFileDurable :: MonadIO m => FilePath -> ByteString -> m ()

-- | After a file is closed, this function opens it again and executes
--   <tt>fsync()</tt> internally on both the file and the directory that
--   contains it. Note that this function is intended to work around the
--   non-durability of existing file APIs, as opposed to being necessary
--   for the API functions provided in this module.
--   
--   <a>The effectiveness of calling this function is debatable</a>, as it
--   relies on internal implementation details at the Kernel level that
--   might change. We argue that, despite this fact, calling this function
--   may bring benefits in terms of durability.
--   
--   This function does not provide the same guarantee as if you would open
--   and modify a file using <a>withBinaryFileDurable</a> or
--   <a>writeBinaryFileDurable</a>, since they ensure that the
--   <tt>fsync()</tt> is called before the file is closed, so if possible
--   use those instead.
--   
--   <h3>Cross-Platform support</h3>
--   
--   This function is a noop on Windows platforms.
ensureFileDurable :: MonadIO m => FilePath -> m ()

-- | Opens a file with the following guarantees:
--   
--   <ul>
--   <li>It successfully closes the file in case of an asynchronous
--   exception</li>
--   <li>It reliably saves the file in the correct directory; including
--   edge case situations like a different device being mounted to the
--   current directory, or the current directory being renamed to some
--   other name while the file is being used.</li>
--   <li>It ensures durability by executing an <tt>fsync()</tt> call before
--   closing the file handle</li>
--   <li>It keeps all changes in a temporary file, and after it is closed
--   it atomically moves the temporary file to the original filepath, in
--   case of catastrophic failure, the original file stays unaffected.</li>
--   </ul>
--   
--   If you do not need durability but only atomicity, use
--   <a>withBinaryFileAtomic</a> instead, which is faster as it does not
--   perform <tt>fsync()</tt>.
--   
--   <b>Important</b> - Make sure not to close the <a>Handle</a>, it will
--   be closed for you, otherwise it will result in <tt>invalid argument
--   (Bad file descriptor)</tt> exception.
--   
--   <h3>Performance Considerations</h3>
--   
--   When using a writable but non-truncating <a>IOMode</a> (i.e.
--   <a>ReadWriteMode</a> and <a>AppendMode</a>), this function performs a
--   copy operation of the specified input file to guarantee the original
--   file is intact in case of a catastrophic failure (no partial writes).
--   This approach may be prohibitive in scenarios where the input file is
--   expected to be large in size.
--   
--   <h3>Cross-Platform support</h3>
--   
--   This function behaves the same as <a>withBinaryFile</a> on Windows
--   platforms.
withBinaryFileDurableAtomic :: MonadUnliftIO m => FilePath -> IOMode -> (Handle -> m r) -> m r

-- | Similar to <a>writeBinaryFile</a>, but it also guarantes that changes
--   executed to the file are durable, also, in case of failure, the
--   modified file is never going to get corrupted. It internally uses
--   <tt>fsync()</tt> and makes sure it synchronizes the file on disk.
--   
--   <h3>Cross-Platform support</h3>
--   
--   This function behaves the same as <a>writeBinaryFile</a> on Windows
--   platforms.
writeBinaryFileDurableAtomic :: MonadIO m => FilePath -> ByteString -> m ()

module RIO.FilePath
type FilePath = String
(-<.>) :: FilePath -> String -> FilePath
(<.>) :: FilePath -> String -> FilePath
(</>) :: FilePath -> FilePath -> FilePath
addExtension :: FilePath -> String -> FilePath
addTrailingPathSeparator :: FilePath -> FilePath
combine :: FilePath -> FilePath -> FilePath
dropDrive :: FilePath -> FilePath
dropExtension :: FilePath -> FilePath
dropExtensions :: FilePath -> FilePath
dropFileName :: FilePath -> FilePath
dropTrailingPathSeparator :: FilePath -> FilePath
equalFilePath :: FilePath -> FilePath -> Bool
extSeparator :: Char
hasDrive :: FilePath -> Bool
hasExtension :: FilePath -> Bool
hasTrailingPathSeparator :: FilePath -> Bool
isAbsolute :: FilePath -> Bool
isDrive :: FilePath -> Bool
isExtSeparator :: Char -> Bool
isExtensionOf :: String -> FilePath -> Bool
isPathSeparator :: Char -> Bool
isRelative :: FilePath -> Bool
isSearchPathSeparator :: Char -> Bool
isValid :: FilePath -> Bool
joinDrive :: FilePath -> FilePath -> FilePath
joinPath :: [FilePath] -> FilePath
makeRelative :: FilePath -> FilePath -> FilePath
makeValid :: FilePath -> FilePath
normalise :: FilePath -> FilePath
pathSeparator :: Char
pathSeparators :: [Char]
replaceBaseName :: FilePath -> String -> FilePath
replaceDirectory :: FilePath -> String -> FilePath
replaceExtension :: FilePath -> String -> FilePath
replaceExtensions :: FilePath -> String -> FilePath
replaceFileName :: FilePath -> String -> FilePath
searchPathSeparator :: Char
splitDirectories :: FilePath -> [FilePath]
splitDrive :: FilePath -> (FilePath, FilePath)
splitExtension :: FilePath -> (String, String)
splitExtensions :: FilePath -> (FilePath, String)
splitFileName :: FilePath -> (String, String)
splitPath :: FilePath -> [FilePath]
splitSearchPath :: String -> [FilePath]
stripExtension :: String -> FilePath -> Maybe FilePath
takeBaseName :: FilePath -> String
takeDirectory :: FilePath -> FilePath
takeDrive :: FilePath -> FilePath
takeExtension :: FilePath -> String
takeExtensions :: FilePath -> String
takeFileName :: FilePath -> FilePath

-- | Lifted version of <a>getSearchPath</a>
getSearchPath :: MonadIO m => m [FilePath]


-- | Strict <tt>Map</tt> with hashed keys. Import as:
--   
--   <pre>
--   import qualified RIO.HashMap as HM
--   </pre>
--   
--   This module does not export any partial functions. For those, see
--   <a>RIO.HashMap.Partial</a>
module RIO.HashMap
data HashMap k v
empty :: HashMap k v
singleton :: Hashable k => k -> v -> HashMap k v
null :: HashMap k v -> Bool
size :: HashMap k v -> Int
member :: (Eq k, Hashable k) => k -> HashMap k a -> Bool
lookup :: (Eq k, Hashable k) => k -> HashMap k v -> Maybe v
lookupDefault :: (Eq k, Hashable k) => v -> k -> HashMap k v -> v
insert :: (Eq k, Hashable k) => k -> v -> HashMap k v -> HashMap k v
insertWith :: (Eq k, Hashable k) => (v -> v -> v) -> k -> v -> HashMap k v -> HashMap k v
delete :: (Eq k, Hashable k) => k -> HashMap k v -> HashMap k v
adjust :: (Eq k, Hashable k) => (v -> v) -> k -> HashMap k v -> HashMap k v
update :: (Eq k, Hashable k) => (a -> Maybe a) -> k -> HashMap k a -> HashMap k a
alter :: (Eq k, Hashable k) => (Maybe v -> Maybe v) -> k -> HashMap k v -> HashMap k v
union :: (Eq k, Hashable k) => HashMap k v -> HashMap k v -> HashMap k v
unionWith :: (Eq k, Hashable k) => (v -> v -> v) -> HashMap k v -> HashMap k v -> HashMap k v
unionWithKey :: (Eq k, Hashable k) => (k -> v -> v -> v) -> HashMap k v -> HashMap k v -> HashMap k v
unions :: (Eq k, Hashable k) => [HashMap k v] -> HashMap k v
map :: (v1 -> v2) -> HashMap k v1 -> HashMap k v2
mapWithKey :: (k -> v1 -> v2) -> HashMap k v1 -> HashMap k v2
traverseWithKey :: Applicative f => (k -> v1 -> f v2) -> HashMap k v1 -> f (HashMap k v2)
difference :: (Eq k, Hashable k) => HashMap k v -> HashMap k w -> HashMap k v
differenceWith :: (Eq k, Hashable k) => (v -> w -> Maybe v) -> HashMap k v -> HashMap k w -> HashMap k v
intersection :: (Eq k, Hashable k) => HashMap k v -> HashMap k w -> HashMap k v
intersectionWith :: (Eq k, Hashable k) => (v1 -> v2 -> v3) -> HashMap k v1 -> HashMap k v2 -> HashMap k v3
intersectionWithKey :: (Eq k, Hashable k) => (k -> v1 -> v2 -> v3) -> HashMap k v1 -> HashMap k v2 -> HashMap k v3
foldl' :: (a -> v -> a) -> a -> HashMap k v -> a
foldlWithKey' :: (a -> k -> v -> a) -> a -> HashMap k v -> a
foldr :: (v -> a -> a) -> a -> HashMap k v -> a
foldrWithKey :: (k -> v -> a -> a) -> a -> HashMap k v -> a
filter :: (v -> Bool) -> HashMap k v -> HashMap k v
filterWithKey :: (k -> v -> Bool) -> HashMap k v -> HashMap k v
mapMaybe :: (v1 -> Maybe v2) -> HashMap k v1 -> HashMap k v2
mapMaybeWithKey :: (k -> v1 -> Maybe v2) -> HashMap k v1 -> HashMap k v2
keys :: HashMap k v -> [k]
elems :: HashMap k v -> [v]
toList :: HashMap k v -> [(k, v)]
fromList :: (Eq k, Hashable k) => [(k, v)] -> HashMap k v
fromListWith :: (Eq k, Hashable k) => (v -> v -> v) -> [(k, v)] -> HashMap k v


-- | Strict <tt>HashMap</tt> partial functions. Import as:
--   
--   <pre>
--   import qualified RIO.HashMap.Partial as HM'
--   </pre>
module RIO.HashMap.Partial
(!) :: (Eq k, Hashable k) => HashMap k v -> k -> v


-- | <tt>Set</tt> with hashed members. Import as:
--   
--   <pre>
--   import qualified RIO.HashSet as HS
--   </pre>
module RIO.HashSet
data HashSet a
empty :: HashSet a
singleton :: Hashable a => a -> HashSet a
union :: (Eq a, Hashable a) => HashSet a -> HashSet a -> HashSet a
unions :: (Eq a, Hashable a) => [HashSet a] -> HashSet a
null :: HashSet a -> Bool
size :: HashSet a -> Int
member :: (Eq a, Hashable a) => a -> HashSet a -> Bool
insert :: (Eq a, Hashable a) => a -> HashSet a -> HashSet a
delete :: (Eq a, Hashable a) => a -> HashSet a -> HashSet a
map :: (Hashable b, Eq b) => (a -> b) -> HashSet a -> HashSet b
difference :: (Eq a, Hashable a) => HashSet a -> HashSet a -> HashSet a
intersection :: (Eq a, Hashable a) => HashSet a -> HashSet a -> HashSet a
foldl' :: (a -> b -> a) -> a -> HashSet b -> a
foldr :: (b -> a -> a) -> a -> HashSet b -> a
filter :: (a -> Bool) -> HashSet a -> HashSet a
toList :: HashSet a -> [a]
fromList :: (Eq a, Hashable a) => [a] -> HashSet a
toMap :: HashSet a -> HashMap a ()
fromMap :: HashMap a () -> HashSet a


-- | Extra utilities from <tt>microlens</tt>.
--   
--   @since: 0.1.16.0
module RIO.Lens

-- | A <tt>SimpleFold s a</tt> extracts several <tt>a</tt>s from
--   <tt>s</tt>; so, it's pretty much the same thing as <tt>(s -&gt;
--   [a])</tt>, but you can use it with lens operators.
--   
--   The actual <tt>Fold</tt> from lens is more general:
--   
--   <pre>
--   type Fold s a =
--     forall f. (Contravariant f, Applicative f) =&gt; (a -&gt; f a) -&gt; s -&gt; f s
--   </pre>
--   
--   There are several functions in lens that accept lens's <tt>Fold</tt>
--   but won't accept <a>SimpleFold</a>; I'm aware of
--   <tt><a>takingWhile</a></tt>, <tt><a>droppingWhile</a></tt>,
--   <tt><a>backwards</a></tt>, <tt><a>foldByOf</a></tt>,
--   <tt><a>foldMapByOf</a></tt>. For this reason, try not to export
--   <a>SimpleFold</a>s if at all possible. <a>microlens-contra</a>
--   provides a fully lens-compatible <tt>Fold</tt>.
--   
--   Lens users: you can convert a <a>SimpleFold</a> to <tt>Fold</tt> by
--   applying <tt>folded . toListOf</tt> to it.
type SimpleFold s a = forall r. Monoid r => Getting r s a

-- | <a>toListOf</a> is a synonym for (<a>^..</a>).
toListOf :: Getting (Endo [a]) s a -> s -> [a]

-- | <a>has</a> checks whether a getter (any getter, including lenses,
--   traversals, and folds) returns at least 1 value.
--   
--   Checking whether a list is non-empty:
--   
--   <pre>
--   &gt;&gt;&gt; has each []
--   False
--   </pre>
--   
--   You can also use it with e.g. <a>_Left</a> (and other 0-or-1
--   traversals) as a replacement for <a>isNothing</a>, <a>isJust</a> and
--   other <tt>isConstructorName</tt> functions:
--   
--   <pre>
--   &gt;&gt;&gt; has _Left (Left 1)
--   True
--   </pre>
has :: Getting Any s a -> s -> Bool

-- | Gives access to the 1st field of a tuple (up to 5-tuples).
--   
--   Getting the 1st component:
--   
--   <pre>
--   &gt;&gt;&gt; (1,2,3,4,5) ^. _1
--   1
--   </pre>
--   
--   Setting the 1st component:
--   
--   <pre>
--   &gt;&gt;&gt; (1,2,3) &amp; _1 .~ 10
--   (10,2,3)
--   </pre>
--   
--   Note that this lens is lazy, and can set fields even of
--   <a>undefined</a>:
--   
--   <pre>
--   &gt;&gt;&gt; set _1 10 undefined :: (Int, Int)
--   (10,*** Exception: Prelude.undefined
--   </pre>
--   
--   This is done to avoid violating a lens law stating that you can get
--   back what you put:
--   
--   <pre>
--   &gt;&gt;&gt; view _1 . set _1 10 $ (undefined :: (Int, Int))
--   10
--   </pre>
--   
--   The implementation (for 2-tuples) is:
--   
--   <pre>
--   <a>_1</a> f t = (,) <a>&lt;$&gt;</a> f    (<a>fst</a> t)
--                <a>&lt;*&gt;</a> <a>pure</a> (<a>snd</a> t)
--   </pre>
--   
--   or, alternatively,
--   
--   <pre>
--   <a>_1</a> f ~(a,b) = (\a' -&gt; (a',b)) <a>&lt;$&gt;</a> f a
--   </pre>
--   
--   (where <tt>~</tt> means a <a>lazy pattern</a>).
--   
--   <a>_2</a>, <a>_3</a>, <a>_4</a>, and <a>_5</a> are also available (see
--   below).
_1 :: Field1 s t a b => Lens s t a b
_2 :: Field2 s t a b => Lens s t a b
_3 :: Field3 s t a b => Lens s t a b
_4 :: Field4 s t a b => Lens s t a b
_5 :: Field5 s t a b => Lens s t a b

-- | This lens lets you read, write, or delete elements in
--   <tt>Map</tt>-like structures. It returns <a>Nothing</a> when the value
--   isn't found, just like <tt>lookup</tt>:
--   
--   <pre>
--   Data.Map.lookup k m = m <a>^.</a> at k
--   </pre>
--   
--   However, it also lets you insert and delete values by setting the
--   value to <tt><a>Just</a> value</tt> or <a>Nothing</a>:
--   
--   <pre>
--   Data.Map.insert k a m = m <a>&amp;</a> at k <a>.~</a> Just a
--   
--   Data.Map.delete k m = m <a>&amp;</a> at k <a>.~</a> Nothing
--   </pre>
--   
--   Or you could use (<a>?~</a>) instead of (<a>.~</a>):
--   
--   <pre>
--   Data.Map.insert k a m = m <a>&amp;</a> at k <a>?~</a> a
--   </pre>
--   
--   Note that <a>at</a> doesn't work for arrays or lists. You can't delete
--   an arbitrary element from an array (what would be left in its place?),
--   and you can't set an arbitrary element in a list because if the index
--   is out of list's bounds, you'd have to somehow fill the stretch
--   between the last element and the element you just inserted (i.e.
--   <tt>[1,2,3] &amp; at 10 .~ 5</tt> is undefined). If you want to modify
--   an already existing value in an array or list, you should use
--   <a>ix</a> instead.
--   
--   <a>at</a> is often used with <a>non</a>. See the documentation of
--   <a>non</a> for examples.
--   
--   Note that <a>at</a> isn't strict for <tt>Map</tt>, even if you're
--   using <tt>Data.Map.Strict</tt>:
--   
--   <pre>
--   &gt;&gt;&gt; Data.Map.Strict.size (Data.Map.Strict.empty &amp; at 1 .~ Just undefined)
--   1
--   </pre>
--   
--   The reason for such behavior is that there's actually no “strict
--   <tt>Map</tt>” type; <tt>Data.Map.Strict</tt> just provides some strict
--   functions for ordinary <tt>Map</tt>s.
--   
--   This package doesn't actually provide any instances for <a>at</a>, but
--   there are instances for <tt>Map</tt> and <tt>IntMap</tt> in
--   <a>microlens-ghc</a> and an instance for <tt>HashMap</tt> in
--   <a>microlens-platform</a>.
at :: At m => Index m -> Lens' m (Maybe (IxValue m))

-- | <a>lens</a> creates a <a>Lens</a> from a getter and a setter. The
--   resulting lens isn't the most effective one (because of having to
--   traverse the structure twice when modifying), but it shouldn't matter
--   much.
--   
--   A (partial) lens for list indexing:
--   
--   <pre>
--   ix :: Int -&gt; <a>Lens'</a> [a] a
--   ix i = <a>lens</a> (<a>!!</a> i)                                   -- getter
--               (\s b -&gt; take i s ++ b : drop (i+1) s)   -- setter
--   </pre>
--   
--   Usage:
--   
--   <pre>
--   &gt;&gt;&gt; [1..9] <a>^.</a> ix 3
--   4
--   
--   &gt;&gt;&gt; [1..9] &amp; ix 3 <a>%~</a> negate
--   [1,2,3,-4,5,6,7,8,9]
--   </pre>
--   
--   When getting, the setter is completely unused; when setting, the
--   getter is unused. Both are used only when the value is being modified.
--   For instance, here we define a lens for the 1st element of a list, but
--   instead of a legitimate getter we use <a>undefined</a>. Then we use
--   the resulting lens for <i>setting</i> and it works, which proves that
--   the getter wasn't used:
--   
--   <pre>
--   &gt;&gt;&gt; [1,2,3] &amp; lens undefined (\s b -&gt; b : tail s) .~ 10
--   [10,2,3]
--   </pre>
lens :: (s -> a) -> (s -> b -> t) -> Lens s t a b

-- | <a>non</a> lets you “relabel” a <a>Maybe</a> by equating
--   <a>Nothing</a> to an arbitrary value (which you can choose):
--   
--   <pre>
--   &gt;&gt;&gt; Just 1 ^. non 0
--   1
--   </pre>
--   
--   <pre>
--   &gt;&gt;&gt; Nothing ^. non 0
--   0
--   </pre>
--   
--   The most useful thing about <a>non</a> is that relabeling also works
--   in other direction. If you try to <a>set</a> the “forbidden” value,
--   it'll be turned to <a>Nothing</a>:
--   
--   <pre>
--   &gt;&gt;&gt; Just 1 &amp; non 0 .~ 0
--   Nothing
--   </pre>
--   
--   Setting anything else works just fine:
--   
--   <pre>
--   &gt;&gt;&gt; Just 1 &amp; non 0 .~ 5
--   Just 5
--   </pre>
--   
--   Same happens if you try to modify a value:
--   
--   <pre>
--   &gt;&gt;&gt; Just 1 &amp; non 0 %~ subtract 1
--   Nothing
--   </pre>
--   
--   <pre>
--   &gt;&gt;&gt; Just 1 &amp; non 0 %~ (+ 1)
--   Just 2
--   </pre>
--   
--   <a>non</a> is often useful when combined with <a>at</a>. For instance,
--   if you have a map of songs and their playcounts, it makes sense not to
--   store songs with 0 plays in the map; <a>non</a> can act as a filter
--   that wouldn't pass such entries.
--   
--   Decrease playcount of a song to 0, and it'll be gone:
--   
--   <pre>
--   &gt;&gt;&gt; fromList [("Soon",1),("Yesterday",3)] &amp; at "Soon" . non 0 %~ subtract 1
--   fromList [("Yesterday",3)]
--   </pre>
--   
--   Try to add a song with 0 plays, and it won't be added:
--   
--   <pre>
--   &gt;&gt;&gt; fromList [("Yesterday",3)] &amp; at "Soon" . non 0 .~ 0
--   fromList [("Yesterday",3)]
--   </pre>
--   
--   But it will be added if you set any other number:
--   
--   <pre>
--   &gt;&gt;&gt; fromList [("Yesterday",3)] &amp; at "Soon" . non 0 .~ 1
--   fromList [("Soon",1),("Yesterday",3)]
--   </pre>
--   
--   <a>non</a> is also useful when working with nested maps. Here a nested
--   map is created when it's missing:
--   
--   <pre>
--   &gt;&gt;&gt; Map.empty &amp; at "Dez Mona" . non Map.empty . at "Soon" .~ Just 1
--   fromList [("Dez Mona",fromList [("Soon",1)])]
--   </pre>
--   
--   and here it is deleted when its last entry is deleted (notice that
--   <a>non</a> is used twice here):
--   
--   <pre>
--   &gt;&gt;&gt; fromList [("Dez Mona",fromList [("Soon",1)])] &amp; at "Dez Mona" . non Map.empty . at "Soon" . non 0 %~ subtract 1
--   fromList []
--   </pre>
--   
--   To understand the last example better, observe the flow of values in
--   it:
--   
--   <ul>
--   <li>the map goes into <tt>at "Dez Mona"</tt></li>
--   <li>the nested map (wrapped into <tt>Just</tt>) goes into <tt>non
--   Map.empty</tt></li>
--   <li><tt>Just</tt> is unwrapped and the nested map goes into <tt>at
--   "Soon"</tt></li>
--   <li><tt>Just 1</tt> is unwrapped by <tt>non 0</tt></li>
--   </ul>
--   
--   Then the final value – i.e. 1 – is modified by <tt>subtract 1</tt> and
--   the result (which is 0) starts flowing backwards:
--   
--   <ul>
--   <li><tt>non 0</tt> sees the 0 and produces a <tt>Nothing</tt></li>
--   <li><tt>at "Soon"</tt> sees <tt>Nothing</tt> and deletes the
--   corresponding value from the map</li>
--   <li>the resulting empty map is passed to <tt>non Map.empty</tt>, which
--   sees that it's empty and thus produces <tt>Nothing</tt></li>
--   <li><tt>at "Dez Mona"</tt> sees <tt>Nothing</tt> and removes the key
--   from the map</li>
--   </ul>
non :: Eq a => a -> Lens' (Maybe a) a

-- | <a>singular</a> turns a traversal into a lens that behaves like a
--   single-element traversal:
--   
--   <pre>
--   &gt;&gt;&gt; [1,2,3] ^. singular each
--   1
--   </pre>
--   
--   <pre>
--   &gt;&gt;&gt; [1,2,3] &amp; singular each %~ negate
--   [-1,2,3]
--   </pre>
--   
--   If there is nothing to return, it'll throw an error:
--   
--   <pre>
--   &gt;&gt;&gt; [] ^. singular each
--   *** Exception: Lens.Micro.singular: empty traversal
--   </pre>
--   
--   However, it won't fail if you are merely setting the value:
--   
--   <pre>
--   &gt;&gt;&gt; [] &amp; singular each %~ negate
--   </pre>
singular :: HasCallStack => Traversal s t a a -> Lens s t a a

-- | <a>failing</a> lets you chain traversals together; if the 1st
--   traversal fails, the 2nd traversal will be used.
--   
--   <pre>
--   &gt;&gt;&gt; ([1,2],[3]) &amp; failing (_1.each) (_2.each) .~ 0
--   ([0,0],[3])
--   </pre>
--   
--   <pre>
--   &gt;&gt;&gt; ([],[3]) &amp; failing (_1.each) (_2.each) .~ 0
--   ([],[0])
--   </pre>
--   
--   Note that the resulting traversal won't be valid unless either both
--   traversals don't touch each others' elements, or both traversals
--   return exactly the same results. To see an example of how
--   <a>failing</a> can generate invalid traversals, see <a>this
--   Stackoverflow question</a>.
failing :: Traversal s t a b -> Traversal s t a b -> Traversal s t a b
infixl 5 `failing`

-- | <a>filtered</a> is a traversal that filters elements “passing” through
--   it:
--   
--   <pre>
--   &gt;&gt;&gt; (1,2,3,4) ^.. each
--   [1,2,3,4]
--   </pre>
--   
--   <pre>
--   &gt;&gt;&gt; (1,2,3,4) ^.. each . filtered even
--   [2,4]
--   </pre>
--   
--   It also can be used to modify elements selectively:
--   
--   <pre>
--   &gt;&gt;&gt; (1,2,3,4) &amp; each . filtered even %~ (*100)
--   (1,200,3,400)
--   </pre>
--   
--   The implementation of <a>filtered</a> is very simple. Consider this
--   traversal, which always “traverses” just the value it's given:
--   
--   <pre>
--   id :: <a>Traversal'</a> a a
--   id f s = f s
--   </pre>
--   
--   And this traversal, which traverses nothing (in other words,
--   <i>doesn't</i> traverse the value it's given):
--   
--   <pre>
--   ignored :: <a>Traversal'</a> a a
--   ignored f s = <a>pure</a> s
--   </pre>
--   
--   And now combine them into a traversal that conditionally traverses the
--   value it's given, and you get <a>filtered</a>:
--   
--   <pre>
--   filtered :: (a -&gt; Bool) -&gt; <a>Traversal'</a> a a
--   filtered p f s = if p s then f s else <a>pure</a> s
--   </pre>
--   
--   By the way, note that <a>filtered</a> can generate illegal traversals
--   – sometimes this can bite you. In particular, an optimisation that
--   should be safe becomes unsafe. (To the best of my knowledge, this
--   optimisation never happens automatically. If you just use
--   <a>filtered</a> to modify/view something, you're safe. If you don't
--   define any traversals that use <a>filtered</a>, you're safe too.)
--   
--   Let's use <tt>evens</tt> as an example:
--   
--   <pre>
--   evens = <a>filtered</a> <a>even</a>
--   </pre>
--   
--   If <tt>evens</tt> was a legal traversal, you'd be able to fuse several
--   applications of <tt>evens</tt> like this:
--   
--   <pre>
--   <a>over</a> evens f <a>.</a> <a>over</a> evens g = <a>over</a> evens (f <a>.</a> g)
--   </pre>
--   
--   Unfortunately, in case of <tt>evens</tt> this isn't a correct
--   optimisation:
--   
--   <ul>
--   <li>the left-side variant applies <tt>g</tt> to all even numbers, and
--   then applies <tt>f</tt> to all even numbers that are left after
--   <tt>f</tt> (because <tt>f</tt> might've turned some even numbers into
--   odd ones)</li>
--   <li>the right-side variant applies <tt>f</tt> and <tt>g</tt> to all
--   even numbers</li>
--   </ul>
--   
--   Of course, when you are careful and know what you're doing, you won't
--   try to make such an optimisation. However, if you export an illegal
--   traversal created with <a>filtered</a> and someone tries to use it,
--   they might mistakenly assume that it's legal, do the optimisation, and
--   silently get an incorrect result.
--   
--   If you are using <a>filtered</a> with some another traversal that
--   doesn't overlap with -whatever the predicate checks-, the resulting
--   traversal will be legal. For instance, here the predicate looks at the
--   1st element of a tuple, but the resulting traversal only gives you
--   access to the 2nd:
--   
--   <pre>
--   pairedWithEvens :: <a>Traversal</a> [(Int, a)] [(Int, b)] a b
--   pairedWithEvens = <a>each</a> <a>.</a> <a>filtered</a> (<a>even</a> <a>.</a> <a>fst</a>) <a>.</a> <a>_2</a>
--   </pre>
--   
--   Since you can't do anything with the 1st components through this
--   traversal, the following holds for any <tt>f</tt> and <tt>g</tt>:
--   
--   <pre>
--   <a>over</a> pairedWithEvens f <a>.</a> <a>over</a> pairedWithEvens g = <a>over</a> pairedWithEvens (f <a>.</a> g)
--   </pre>
filtered :: (a -> Bool) -> Traversal' a a

-- | <a>both</a> traverses both fields of a tuple. Unlike
--   <tt><a>both</a></tt> from lens, it only works for pairs – not for
--   triples or <a>Either</a>.
--   
--   <pre>
--   &gt;&gt;&gt; ("str","ing") ^. both
--   "string"
--   </pre>
--   
--   <pre>
--   &gt;&gt;&gt; ("str","ing") &amp; both %~ reverse
--   ("rts","gni")
--   </pre>
both :: Traversal (a, a) (b, b) a b

-- | <a>traversed</a> traverses any <a>Traversable</a> container (list,
--   vector, <tt>Map</tt>, <a>Maybe</a>, you name it):
--   
--   <pre>
--   &gt;&gt;&gt; Just 1 ^.. traversed
--   [1]
--   </pre>
--   
--   <a>traversed</a> is the same as <a>traverse</a>, but can be faster
--   thanks to magic rewrite rules.
traversed :: forall (f :: Type -> Type) a b. Traversable f => Traversal (f a) (f b) a b

-- | <a>each</a> tries to be a universal <a>Traversal</a> – it behaves like
--   <a>traversed</a> in most situations, but also adds support for e.g.
--   tuples with same-typed values:
--   
--   <pre>
--   &gt;&gt;&gt; (1,2) &amp; each %~ succ
--   (2,3)
--   </pre>
--   
--   <pre>
--   &gt;&gt;&gt; ["x", "y", "z"] ^. each
--   "xyz"
--   </pre>
--   
--   However, note that <a>each</a> doesn't work on <i>every</i> instance
--   of <a>Traversable</a>. If you have a <a>Traversable</a> which isn't
--   supported by <a>each</a>, you can use <a>traversed</a> instead.
--   Personally, I like using <a>each</a> instead of <a>traversed</a>
--   whenever possible – it's shorter and more descriptive.
--   
--   You can use <a>each</a> with these things:
--   
--   <pre>
--   <a>each</a> :: <a>Traversal</a> [a] [b] a b
--   
--   <a>each</a> :: <a>Traversal</a> (<a>Maybe</a> a) (<a>Maybe</a> b) a b
--   <a>each</a> :: <a>Traversal</a> (<a>Either</a> a a) (<a>Either</a> b b) a b  -- since 0.4.11
--   
--   <a>each</a> :: <a>Traversal</a> (a,a) (b,b) a b
--   <a>each</a> :: <a>Traversal</a> (a,a,a) (b,b,b) a b
--   <a>each</a> :: <a>Traversal</a> (a,a,a,a) (b,b,b,b) a b
--   <a>each</a> :: <a>Traversal</a> (a,a,a,a,a) (b,b,b,b,b) a b
--   
--   <a>each</a> :: (<a>RealFloat</a> a, <a>RealFloat</a> b) =&gt; <a>Traversal</a> (<a>Complex</a> a) (<a>Complex</a> b) a b
--   </pre>
--   
--   You can also use <a>each</a> with types from <a>array</a>,
--   <a>bytestring</a>, and <a>containers</a> by using
--   <a>microlens-ghc</a>, or additionally with types from <a>vector</a>,
--   <a>text</a>, and <a>unordered-containers</a> by using
--   <a>microlens-platform</a>.
each :: Each s t a b => Traversal s t a b

-- | This traversal lets you access (and update) an arbitrary element in a
--   list, array, <tt>Map</tt>, etc. (If you want to insert or delete
--   elements as well, look at <a>at</a>.)
--   
--   An example for lists:
--   
--   <pre>
--   &gt;&gt;&gt; [0..5] &amp; ix 3 .~ 10
--   [0,1,2,10,4,5]
--   </pre>
--   
--   You can use it for getting, too:
--   
--   <pre>
--   &gt;&gt;&gt; [0..5] ^? ix 3
--   Just 3
--   </pre>
--   
--   Of course, the element may not be present (which means that you can
--   use <a>ix</a> as a safe variant of (<a>!!</a>)):
--   
--   <pre>
--   &gt;&gt;&gt; [0..5] ^? ix 10
--   Nothing
--   </pre>
--   
--   Another useful instance is the one for functions – it lets you modify
--   their outputs for specific inputs. For instance, here's <a>maximum</a>
--   that returns 0 when the list is empty (instead of throwing an
--   exception):
--   
--   <pre>
--   maximum0 = <a>maximum</a> <a>&amp;</a> <a>ix</a> [] <a>.~</a> 0
--   </pre>
--   
--   The following instances are provided in this package:
--   
--   <pre>
--   <a>ix</a> :: <a>Int</a> -&gt; <a>Traversal'</a> [a] a
--   
--   <a>ix</a> :: (<a>Eq</a> e) =&gt; e -&gt; <a>Traversal'</a> (e -&gt; a) a
--   </pre>
--   
--   You can also use <a>ix</a> with types from <a>array</a>,
--   <a>bytestring</a>, and <a>containers</a> by using
--   <a>microlens-ghc</a>, or additionally with types from <a>vector</a>,
--   <a>text</a>, and <a>unordered-containers</a> by using
--   <a>microlens-platform</a>.
ix :: Ixed m => Index m -> Traversal' m (IxValue m)

-- | <a>_head</a> traverses the 1st element of something (usually a list,
--   but can also be a <tt>Seq</tt>, etc):
--   
--   <pre>
--   &gt;&gt;&gt; [1..5] ^? _head
--   Just 1
--   </pre>
--   
--   It can be used to modify too, as in this example where the 1st letter
--   of a sentence is capitalised:
--   
--   <pre>
--   &gt;&gt;&gt; "mary had a little lamb." &amp; _head %~ toTitle
--   "Mary had a little lamb."
--   </pre>
--   
--   The reason it's a traversal and not a lens is that there's nothing to
--   traverse when the list is empty:
--   
--   <pre>
--   &gt;&gt;&gt; [] ^? _head
--   Nothing
--   </pre>
--   
--   This package only lets you use <a>_head</a> on lists, but if you use
--   <a>microlens-ghc</a> you get instances for <tt>ByteString</tt> and
--   <tt>Seq</tt>, and if you use <a>microlens-platform</a> you
--   additionally get instances for <tt>Text</tt> and <tt>Vector</tt>.
_head :: Cons s s a a => Traversal' s a

-- | <a>_tail</a> gives you access to the tail of a list (or <tt>Seq</tt>,
--   etc):
--   
--   <pre>
--   &gt;&gt;&gt; [1..5] ^? _tail
--   Just [2,3,4,5]
--   </pre>
--   
--   You can modify the tail as well:
--   
--   <pre>
--   &gt;&gt;&gt; [4,1,2,3] &amp; _tail %~ reverse
--   [4,3,2,1]
--   </pre>
--   
--   Since lists are monoids, you can use <a>_tail</a> with plain
--   (<a>^.</a>) (and then it'll return an empty list if you give it an
--   empty list):
--   
--   <pre>
--   &gt;&gt;&gt; [1..5] ^. _tail
--   [2,3,4,5]
--   </pre>
--   
--   <pre>
--   &gt;&gt;&gt; [] ^. _tail
--   []
--   </pre>
--   
--   If you want to traverse each <i>element</i> of the tail, use
--   <a>_tail</a> with <a>each</a>:
--   
--   <pre>
--   &gt;&gt;&gt; "I HATE CAPS." &amp; _tail.each %~ toLower
--   "I hate caps."
--   </pre>
--   
--   This package only lets you use <a>_tail</a> on lists, but if you use
--   <a>microlens-ghc</a> you get instances for <tt>ByteString</tt> and
--   <tt>Seq</tt>, and if you use <a>microlens-platform</a> you
--   additionally get instances for <tt>Text</tt> and <tt>Vector</tt>.
_tail :: Cons s s a a => Traversal' s s

-- | <a>_init</a> gives you access to all-but-the-last elements of the
--   list:
--   
--   <pre>
--   &gt;&gt;&gt; "Hello." ^. _init
--   "Hello"
--   </pre>
--   
--   See documentation for <a>_tail</a>, as <a>_init</a> and <a>_tail</a>
--   are pretty similar.
_init :: Snoc s s a a => Traversal' s s

-- | <a>_last</a> gives you access to the last element of the list:
--   
--   <pre>
--   &gt;&gt;&gt; "Hello." ^? _last
--   '.'
--   </pre>
--   
--   See documentation for <a>_head</a>, as <a>_last</a> and <a>_head</a>
--   are pretty similar.
_last :: Snoc s s a a => Traversal' s a

-- | <a>_Left</a> targets the value contained in an <a>Either</a>, provided
--   it's a <a>Left</a>.
--   
--   Gathering all <tt>Left</tt>s in a structure (like the <a>lefts</a>
--   function, but not necessarily just for lists):
--   
--   <pre>
--   &gt;&gt;&gt; [Left 1, Right 'c', Left 3] ^.. each._Left
--   [1,3]
--   </pre>
--   
--   Checking whether an <a>Either</a> is a <a>Left</a> (like
--   <a>isLeft</a>):
--   
--   <pre>
--   &gt;&gt;&gt; has _Left (Left 1)
--   True
--   </pre>
--   
--   <pre>
--   &gt;&gt;&gt; has _Left (Right 1)
--   False
--   </pre>
--   
--   Extracting a value (if you're sure it's a <a>Left</a>):
--   
--   <pre>
--   &gt;&gt;&gt; Left 1 ^?! _Left
--   1
--   </pre>
--   
--   Mapping over all <a>Left</a>s:
--   
--   <pre>
--   &gt;&gt;&gt; (each._Left %~ map toUpper) [Left "foo", Right "bar"]
--   [Left "FOO",Right "bar"]
--   </pre>
--   
--   Implementation:
--   
--   <pre>
--   <a>_Left</a> f (Left a)  = <a>Left</a> <a>&lt;$&gt;</a> f a
--   <a>_Left</a> _ (Right b) = <a>pure</a> (<a>Right</a> b)
--   </pre>
_Left :: Traversal (Either a b) (Either a' b) a a'

-- | <a>_Right</a> targets the value contained in an <a>Either</a>,
--   provided it's a <a>Right</a>.
--   
--   See documentation for <a>_Left</a>.
_Right :: Traversal (Either a b) (Either a b') b b'

-- | <a>_Just</a> targets the value contained in a <a>Maybe</a>, provided
--   it's a <a>Just</a>.
--   
--   See documentation for <a>_Left</a> (as these 2 are pretty similar). In
--   particular, it can be used to write these:
--   
--   <ul>
--   <li>Unsafely extracting a value from a <a>Just</a>:</li>
--   </ul>
--   
--   <pre>
--   <a>fromJust</a> = (<a>^?!</a> <a>_Just</a>)
--   
--   </pre>
--   
--   <ul>
--   <li>Checking whether a value is a <a>Just</a>:</li>
--   </ul>
--   
--   <pre>
--   <a>isJust</a> = <a>has</a> <a>_Just</a>
--   
--   </pre>
--   
--   <ul>
--   <li>Converting a <a>Maybe</a> to a list (empty or consisting of a
--   single element):</li>
--   </ul>
--   
--   <pre>
--   <a>maybeToList</a> = (<a>^..</a> <a>_Just</a>)
--   
--   </pre>
--   
--   <ul>
--   <li>Gathering all <a>Just</a>s in a list:</li>
--   </ul>
--   
--   <pre>
--   <a>catMaybes</a> = (<a>^..</a> <a>each</a> <a>.</a> <a>_Just</a>)
--   
--   </pre>
_Just :: Traversal (Maybe a) (Maybe a') a a'

-- | <a>_Nothing</a> targets a <tt>()</tt> if the <a>Maybe</a> is a
--   <a>Nothing</a>, and doesn't target anything otherwise:
--   
--   <pre>
--   &gt;&gt;&gt; Just 1 ^.. _Nothing
--   []
--   </pre>
--   
--   <pre>
--   &gt;&gt;&gt; Nothing ^.. _Nothing
--   [()]
--   </pre>
--   
--   It's not particularly useful (unless you want to use <tt><a>has</a>
--   <a>_Nothing</a></tt> as a replacement for <a>isNothing</a>), and
--   provided mainly for consistency.
--   
--   Implementation:
--   
--   <pre>
--   <a>_Nothing</a> f Nothing = <a>const</a> <a>Nothing</a> <a>&lt;$&gt;</a> f ()
--   <a>_Nothing</a> _ j       = <a>pure</a> j
--   </pre>
_Nothing :: Traversal' (Maybe a) ()


-- | <tt>List</tt>. Import as:
--   
--   <pre>
--   import qualified RIO.List as L
--   </pre>
--   
--   This module does not export any partial functions. For those, see
--   <a>RIO.List.Partial</a>
module RIO.List
(++) :: [a] -> [a] -> [a]
uncons :: [a] -> Maybe (a, [a])
null :: Foldable t => t a -> Bool
length :: Foldable t => t a -> Int

headMaybe :: [a] -> Maybe a

lastMaybe :: [a] -> Maybe a

tailMaybe :: [a] -> Maybe [a]

initMaybe :: [a] -> Maybe [a]
map :: (a -> b) -> [a] -> [b]
reverse :: [a] -> [a]
intersperse :: a -> [a] -> [a]
intercalate :: [a] -> [[a]] -> [a]
transpose :: [[a]] -> [[a]]
subsequences :: [a] -> [[a]]
permutations :: [a] -> [[a]]
foldl :: Foldable t => (b -> a -> b) -> b -> t a -> b
foldl' :: Foldable t => (b -> a -> b) -> b -> t a -> b
foldr :: Foldable t => (a -> b -> b) -> b -> t a -> b
concat :: Foldable t => t [a] -> [a]
concatMap :: Foldable t => (a -> [b]) -> t a -> [b]
and :: Foldable t => t Bool -> Bool
or :: Foldable t => t Bool -> Bool
any :: Foldable t => (a -> Bool) -> t a -> Bool
all :: Foldable t => (a -> Bool) -> t a -> Bool
sum :: (Foldable t, Num a) => t a -> a
product :: (Foldable t, Num a) => t a -> a

maximumMaybe :: (Ord a, Foldable t) => t a -> Maybe a

minimumMaybe :: (Ord a, Foldable t) => t a -> Maybe a

maximumByMaybe :: Foldable t => (a -> a -> Ordering) -> t a -> Maybe a

minimumByMaybe :: Foldable t => (a -> a -> Ordering) -> t a -> Maybe a
scanl :: (b -> a -> b) -> b -> [a] -> [b]
scanl' :: (b -> a -> b) -> b -> [a] -> [b]
scanr :: (a -> b -> b) -> b -> [a] -> [b]
scanl1 :: (a -> a -> a) -> [a] -> [a]
scanr1 :: (a -> a -> a) -> [a] -> [a]
mapAccumL :: Traversable t => (a -> b -> (a, c)) -> a -> t b -> (a, t c)
mapAccumR :: Traversable t => (a -> b -> (a, c)) -> a -> t b -> (a, t c)
iterate :: (a -> a) -> a -> [a]
repeat :: a -> [a]
replicate :: Int -> a -> [a]
cycle :: [a] -> [a]
unfoldr :: (b -> Maybe (a, b)) -> b -> [a]
take :: Int -> [a] -> [a]
drop :: Int -> [a] -> [a]
splitAt :: Int -> [a] -> ([a], [a])
takeWhile :: (a -> Bool) -> [a] -> [a]
dropWhile :: (a -> Bool) -> [a] -> [a]
dropWhileEnd :: (a -> Bool) -> [a] -> [a]
span :: (a -> Bool) -> [a] -> ([a], [a])
break :: (a -> Bool) -> [a] -> ([a], [a])
stripPrefix :: Eq a => [a] -> [a] -> Maybe [a]

-- | Remove the suffix from the given list, if present
stripSuffix :: Eq a => [a] -> [a] -> Maybe [a]

-- | Drop prefix if present, otherwise return original list.
dropPrefix :: Eq a => [a] -> [a] -> [a]

-- | Drop prefix if present, otherwise return original list.
dropSuffix :: Eq a => [a] -> [a] -> [a]
group :: Eq a => [a] -> [[a]]
inits :: [a] -> [[a]]
tails :: [a] -> [[a]]
isPrefixOf :: Eq a => [a] -> [a] -> Bool
isSuffixOf :: Eq a => [a] -> [a] -> Bool
isInfixOf :: Eq a => [a] -> [a] -> Bool
isSubsequenceOf :: Eq a => [a] -> [a] -> Bool
elem :: (Foldable t, Eq a) => a -> t a -> Bool
notElem :: (Foldable t, Eq a) => a -> t a -> Bool
lookup :: Eq a => a -> [(a, b)] -> Maybe b
find :: Foldable t => (a -> Bool) -> t a -> Maybe a
filter :: (a -> Bool) -> [a] -> [a]
partition :: (a -> Bool) -> [a] -> ([a], [a])
elemIndex :: Eq a => a -> [a] -> Maybe Int
elemIndices :: Eq a => a -> [a] -> [Int]
findIndex :: (a -> Bool) -> [a] -> Maybe Int
findIndices :: (a -> Bool) -> [a] -> [Int]
zip :: [a] -> [b] -> [(a, b)]
zip3 :: [a] -> [b] -> [c] -> [(a, b, c)]
zip4 :: [a] -> [b] -> [c] -> [d] -> [(a, b, c, d)]
zip5 :: [a] -> [b] -> [c] -> [d] -> [e] -> [(a, b, c, d, e)]
zip6 :: [a] -> [b] -> [c] -> [d] -> [e] -> [f] -> [(a, b, c, d, e, f)]
zip7 :: [a] -> [b] -> [c] -> [d] -> [e] -> [f] -> [g] -> [(a, b, c, d, e, f, g)]
zipWith :: (a -> b -> c) -> [a] -> [b] -> [c]
zipWith3 :: (a -> b -> c -> d) -> [a] -> [b] -> [c] -> [d]
zipWith4 :: (a -> b -> c -> d -> e) -> [a] -> [b] -> [c] -> [d] -> [e]
zipWith5 :: (a -> b -> c -> d -> e -> f) -> [a] -> [b] -> [c] -> [d] -> [e] -> [f]
zipWith6 :: (a -> b -> c -> d -> e -> f -> g) -> [a] -> [b] -> [c] -> [d] -> [e] -> [f] -> [g]
zipWith7 :: (a -> b -> c -> d -> e -> f -> g -> h) -> [a] -> [b] -> [c] -> [d] -> [e] -> [f] -> [g] -> [h]
unzip :: [(a, b)] -> ([a], [b])
unzip3 :: [(a, b, c)] -> ([a], [b], [c])
unzip4 :: [(a, b, c, d)] -> ([a], [b], [c], [d])
unzip5 :: [(a, b, c, d, e)] -> ([a], [b], [c], [d], [e])
unzip6 :: [(a, b, c, d, e, f)] -> ([a], [b], [c], [d], [e], [f])
unzip7 :: [(a, b, c, d, e, f, g)] -> ([a], [b], [c], [d], [e], [f], [g])
lines :: String -> [String]

-- | <a>linesCR</a> breaks a <a>String</a> up into a list of <a>String</a>s
--   at newline <a>Char</a>s. It is very similar to <a>lines</a>, but it
--   also removes any trailing <tt>'r'</tt> <a>Char</a>s. The resulting
--   <a>String</a> values do not contain newlines or trailing <tt>'r'</tt>
--   characters.
linesCR :: String -> [String]
words :: String -> [String]
unlines :: [String] -> String
unwords :: [String] -> String
nub :: Eq a => [a] -> [a]
delete :: Eq a => a -> [a] -> [a]
(\\) :: Eq a => [a] -> [a] -> [a]
union :: Eq a => [a] -> [a] -> [a]
intersect :: Eq a => [a] -> [a] -> [a]
sort :: Ord a => [a] -> [a]
sortOn :: Ord b => (a -> b) -> [a] -> [a]
insert :: Ord a => a -> [a] -> [a]
nubBy :: (a -> a -> Bool) -> [a] -> [a]
deleteBy :: (a -> a -> Bool) -> a -> [a] -> [a]
deleteFirstsBy :: (a -> a -> Bool) -> [a] -> [a] -> [a]
unionBy :: (a -> a -> Bool) -> [a] -> [a] -> [a]
intersectBy :: (a -> a -> Bool) -> [a] -> [a] -> [a]
groupBy :: (a -> a -> Bool) -> [a] -> [[a]]
sortBy :: (a -> a -> Ordering) -> [a] -> [a]
insertBy :: (a -> a -> Ordering) -> a -> [a] -> [a]
genericLength :: Num i => [a] -> i
genericTake :: Integral i => i -> [a] -> [a]
genericDrop :: Integral i => i -> [a] -> [a]
genericSplitAt :: Integral i => i -> [a] -> ([a], [a])
genericIndex :: Integral i => [a] -> i -> a
genericReplicate :: Integral i => i -> a -> [a]


-- | <tt>List</tt> partial functions. Import as:
--   
--   <pre>
--   import qualified RIO.List.Partial as L'
--   </pre>
module RIO.List.Partial
head :: [a] -> a
last :: [a] -> a
tail :: [a] -> [a]
init :: [a] -> [a]
foldl1 :: Foldable t => (a -> a -> a) -> t a -> a
foldl1' :: (a -> a -> a) -> [a] -> a
foldr1 :: Foldable t => (a -> a -> a) -> t a -> a
maximum :: (Foldable t, Ord a) => t a -> a
minimum :: (Foldable t, Ord a) => t a -> a
maximumBy :: Foldable t => (a -> a -> Ordering) -> t a -> a
minimumBy :: Foldable t => (a -> a -> Ordering) -> t a -> a
scanl1 :: (a -> a -> a) -> [a] -> [a]
scanr1 :: (a -> a -> a) -> [a] -> [a]
(!!) :: [a] -> Int -> a


-- | Strict <tt>Map</tt>. Import as:
--   
--   <pre>
--   import qualified RIO.Map as Map
--   </pre>
--   
--   This module does not export any partial or unchecked functions. For
--   those, see <a>RIO.Map.Partial</a> and <a>RIO.Map.Unchecked</a>
module RIO.Map
data Map k a
(!?) :: Ord k => Map k a -> k -> Maybe a
(\\) :: Ord k => Map k a -> Map k b -> Map k a
null :: Map k a -> Bool
size :: Map k a -> Int
member :: Ord k => k -> Map k a -> Bool
notMember :: Ord k => k -> Map k a -> Bool
lookup :: Ord k => k -> Map k a -> Maybe a
findWithDefault :: Ord k => a -> k -> Map k a -> a
lookupLT :: Ord k => k -> Map k v -> Maybe (k, v)
lookupGT :: Ord k => k -> Map k v -> Maybe (k, v)
lookupLE :: Ord k => k -> Map k v -> Maybe (k, v)
lookupGE :: Ord k => k -> Map k v -> Maybe (k, v)
empty :: Map k a
singleton :: k -> a -> Map k a
insert :: Ord k => k -> a -> Map k a -> Map k a
insertWith :: Ord k => (a -> a -> a) -> k -> a -> Map k a -> Map k a
insertWithKey :: Ord k => (k -> a -> a -> a) -> k -> a -> Map k a -> Map k a
insertLookupWithKey :: Ord k => (k -> a -> a -> a) -> k -> a -> Map k a -> (Maybe a, Map k a)
delete :: Ord k => k -> Map k a -> Map k a
adjust :: Ord k => (a -> a) -> k -> Map k a -> Map k a
adjustWithKey :: Ord k => (k -> a -> a) -> k -> Map k a -> Map k a
update :: Ord k => (a -> Maybe a) -> k -> Map k a -> Map k a
updateWithKey :: Ord k => (k -> a -> Maybe a) -> k -> Map k a -> Map k a
updateLookupWithKey :: Ord k => (k -> a -> Maybe a) -> k -> Map k a -> (Maybe a, Map k a)
alter :: Ord k => (Maybe a -> Maybe a) -> k -> Map k a -> Map k a
alterF :: (Functor f, Ord k) => (Maybe a -> f (Maybe a)) -> k -> Map k a -> f (Map k a)
union :: Ord k => Map k a -> Map k a -> Map k a
unionWith :: Ord k => (a -> a -> a) -> Map k a -> Map k a -> Map k a
unionWithKey :: Ord k => (k -> a -> a -> a) -> Map k a -> Map k a -> Map k a
unions :: (Foldable f, Ord k) => f (Map k a) -> Map k a
unionsWith :: (Foldable f, Ord k) => (a -> a -> a) -> f (Map k a) -> Map k a
difference :: Ord k => Map k a -> Map k b -> Map k a
differenceWith :: Ord k => (a -> b -> Maybe a) -> Map k a -> Map k b -> Map k a
differenceWithKey :: Ord k => (k -> a -> b -> Maybe a) -> Map k a -> Map k b -> Map k a
intersection :: Ord k => Map k a -> Map k b -> Map k a
intersectionWith :: Ord k => (a -> b -> c) -> Map k a -> Map k b -> Map k c
intersectionWithKey :: Ord k => (k -> a -> b -> c) -> Map k a -> Map k b -> Map k c
mergeWithKey :: Ord k => (k -> a -> b -> Maybe c) -> (Map k a -> Map k c) -> (Map k b -> Map k c) -> Map k a -> Map k b -> Map k c
map :: (a -> b) -> Map k a -> Map k b
mapWithKey :: (k -> a -> b) -> Map k a -> Map k b
traverseWithKey :: Applicative t => (k -> a -> t b) -> Map k a -> t (Map k b)
traverseMaybeWithKey :: Applicative f => (k -> a -> f (Maybe b)) -> Map k a -> f (Map k b)
mapAccum :: (a -> b -> (a, c)) -> a -> Map k b -> (a, Map k c)
mapAccumWithKey :: (a -> k -> b -> (a, c)) -> a -> Map k b -> (a, Map k c)
mapAccumRWithKey :: (a -> k -> b -> (a, c)) -> a -> Map k b -> (a, Map k c)
mapKeys :: Ord k2 => (k1 -> k2) -> Map k1 a -> Map k2 a
mapKeysWith :: Ord k2 => (a -> a -> a) -> (k1 -> k2) -> Map k1 a -> Map k2 a
foldr :: (a -> b -> b) -> b -> Map k a -> b
foldl :: (a -> b -> a) -> a -> Map k b -> a
foldrWithKey :: (k -> a -> b -> b) -> b -> Map k a -> b
foldlWithKey :: (a -> k -> b -> a) -> a -> Map k b -> a
foldMapWithKey :: Monoid m => (k -> a -> m) -> Map k a -> m
foldr' :: (a -> b -> b) -> b -> Map k a -> b
foldl' :: (a -> b -> a) -> a -> Map k b -> a
foldrWithKey' :: (k -> a -> b -> b) -> b -> Map k a -> b
foldlWithKey' :: (a -> k -> b -> a) -> a -> Map k b -> a
elems :: Map k a -> [a]
keys :: Map k a -> [k]
assocs :: Map k a -> [(k, a)]
keysSet :: Map k a -> Set k
fromSet :: (k -> a) -> Set k -> Map k a
toList :: Map k a -> [(k, a)]
fromList :: Ord k => [(k, a)] -> Map k a
fromListWith :: Ord k => (a -> a -> a) -> [(k, a)] -> Map k a
fromListWithKey :: Ord k => (k -> a -> a -> a) -> [(k, a)] -> Map k a
toAscList :: Map k a -> [(k, a)]
toDescList :: Map k a -> [(k, a)]
filter :: (a -> Bool) -> Map k a -> Map k a
filterWithKey :: (k -> a -> Bool) -> Map k a -> Map k a
restrictKeys :: Ord k => Map k a -> Set k -> Map k a
withoutKeys :: Ord k => Map k a -> Set k -> Map k a
partition :: (a -> Bool) -> Map k a -> (Map k a, Map k a)
partitionWithKey :: (k -> a -> Bool) -> Map k a -> (Map k a, Map k a)
takeWhileAntitone :: (k -> Bool) -> Map k a -> Map k a
dropWhileAntitone :: (k -> Bool) -> Map k a -> Map k a
spanAntitone :: (k -> Bool) -> Map k a -> (Map k a, Map k a)
mapMaybe :: (a -> Maybe b) -> Map k a -> Map k b
mapMaybeWithKey :: (k -> a -> Maybe b) -> Map k a -> Map k b
mapEither :: (a -> Either b c) -> Map k a -> (Map k b, Map k c)
mapEitherWithKey :: (k -> a -> Either b c) -> Map k a -> (Map k b, Map k c)
split :: Ord k => k -> Map k a -> (Map k a, Map k a)
splitLookup :: Ord k => k -> Map k a -> (Map k a, Maybe a, Map k a)
splitRoot :: Map k b -> [Map k b]
isSubmapOf :: (Ord k, Eq a) => Map k a -> Map k a -> Bool
isSubmapOfBy :: Ord k => (a -> b -> Bool) -> Map k a -> Map k b -> Bool
isProperSubmapOf :: (Ord k, Eq a) => Map k a -> Map k a -> Bool
isProperSubmapOfBy :: Ord k => (a -> b -> Bool) -> Map k a -> Map k b -> Bool
lookupIndex :: Ord k => k -> Map k a -> Maybe Int
elemAt :: Int -> Map k a -> (k, a)
deleteAt :: Int -> Map k a -> Map k a
take :: Int -> Map k a -> Map k a
drop :: Int -> Map k a -> Map k a
splitAt :: Int -> Map k a -> (Map k a, Map k a)
lookupMin :: Map k a -> Maybe (k, a)
lookupMax :: Map k a -> Maybe (k, a)
deleteMin :: Map k a -> Map k a
deleteMax :: Map k a -> Map k a
updateMin :: (a -> Maybe a) -> Map k a -> Map k a
updateMax :: (a -> Maybe a) -> Map k a -> Map k a
updateMinWithKey :: (k -> a -> Maybe a) -> Map k a -> Map k a
updateMaxWithKey :: (k -> a -> Maybe a) -> Map k a -> Map k a
minView :: Map k a -> Maybe (a, Map k a)
maxView :: Map k a -> Maybe (a, Map k a)
minViewWithKey :: Map k a -> Maybe ((k, a), Map k a)
maxViewWithKey :: Map k a -> Maybe ((k, a), Map k a)
showTree :: Whoops "showTree has moved to Data.Map.Internal.Debug.showTree." => Map k a -> String
showTreeWith :: Whoops "showTreeWith has moved to Data.Map.Internal.Debug.showTreeWith." => (k -> a -> String) -> Bool -> Bool -> Map k a -> String
valid :: Ord k => Map k a -> Bool


-- | Strict <tt>Map</tt> partial functions. Import as:
--   
--   <pre>
--   import qualified RIO.Map.Partial as Map'
--   </pre>
module RIO.Map.Partial
(!) :: Ord k => Map k a -> k -> a
elemAt :: Int -> Map k a -> (k, a)
deleteAt :: Int -> Map k a -> Map k a
findIndex :: Ord k => k -> Map k a -> Int
updateAt :: (k -> a -> Maybe a) -> Int -> Map k a -> Map k a
findMin :: Map k a -> (k, a)
findMax :: Map k a -> (k, a)
deleteFindMin :: Map k a -> ((k, a), Map k a)
deleteFindMax :: Map k a -> ((k, a), Map k a)


-- | This module contains functions from <a>Data.Map.Strict</a> that have
--   unchecked preconditions on their input. If these preconditions are not
--   satisfied, the data structure may end up in an invalid state and other
--   operations may misbehave. Import as:
--   
--   <pre>
--   import qualified RIO.Map.Unchecked as Map'
--   </pre>
module RIO.Map.Unchecked
mapKeysMonotonic :: (k1 -> k2) -> Map k1 a -> Map k2 a
toAscList :: Map k a -> [(k, a)]
fromAscList :: Eq k => [(k, a)] -> Map k a
fromAscListWith :: Eq k => (a -> a -> a) -> [(k, a)] -> Map k a
fromAscListWithKey :: Eq k => (k -> a -> a -> a) -> [(k, a)] -> Map k a
fromDistinctAscList :: [(k, a)] -> Map k a
toDescList :: Map k a -> [(k, a)]
fromDescList :: Eq k => [(k, a)] -> Map k a
fromDescListWith :: Eq k => (a -> a -> a) -> [(k, a)] -> Map k a
fromDescListWithKey :: Eq k => (k -> a -> a -> a) -> [(k, a)] -> Map k a
fromDistinctDescList :: [(k, a)] -> Map k a


-- | <tt>NonEmpty</tt> list. Import as:
--   
--   <pre>
--   import qualified RIO.NonEmpty as NE
--   </pre>
--   
--   This module does not export any partial functions. For those, see
--   <a>RIO.NonEmpty.Partial</a>
module RIO.NonEmpty
data NonEmpty a
(:|) :: a -> [a] -> NonEmpty a
map :: (a -> b) -> NonEmpty a -> NonEmpty b
intersperse :: a -> NonEmpty a -> NonEmpty a
scanl :: Foldable f => (b -> a -> b) -> b -> f a -> NonEmpty b
scanr :: Foldable f => (a -> b -> b) -> b -> f a -> NonEmpty b
scanl1 :: (a -> a -> a) -> NonEmpty a -> NonEmpty a
scanr1 :: (a -> a -> a) -> NonEmpty a -> NonEmpty a
transpose :: NonEmpty (NonEmpty a) -> NonEmpty (NonEmpty a)
sortBy :: (a -> a -> Ordering) -> NonEmpty a -> NonEmpty a
sortWith :: Ord o => (a -> o) -> NonEmpty a -> NonEmpty a
length :: NonEmpty a -> Int
head :: NonEmpty a -> a
tail :: NonEmpty a -> [a]
last :: NonEmpty a -> a
init :: NonEmpty a -> [a]
(<|) :: a -> NonEmpty a -> NonEmpty a
cons :: a -> NonEmpty a -> NonEmpty a
uncons :: NonEmpty a -> (a, Maybe (NonEmpty a))
unfoldr :: (a -> (b, Maybe a)) -> a -> NonEmpty b
sort :: Ord a => NonEmpty a -> NonEmpty a
reverse :: NonEmpty a -> NonEmpty a
inits :: Foldable f => f a -> NonEmpty [a]
tails :: Foldable f => f a -> NonEmpty [a]
iterate :: (a -> a) -> a -> NonEmpty a
repeat :: a -> NonEmpty a
cycle :: NonEmpty a -> NonEmpty a
insert :: (Foldable f, Ord a) => a -> f a -> NonEmpty a
some1 :: Alternative f => f a -> f (NonEmpty a)
take :: Int -> NonEmpty a -> [a]
drop :: Int -> NonEmpty a -> [a]
splitAt :: Int -> NonEmpty a -> ([a], [a])
takeWhile :: (a -> Bool) -> NonEmpty a -> [a]
dropWhile :: (a -> Bool) -> NonEmpty a -> [a]
span :: (a -> Bool) -> NonEmpty a -> ([a], [a])
break :: (a -> Bool) -> NonEmpty a -> ([a], [a])
filter :: (a -> Bool) -> NonEmpty a -> [a]
partition :: (a -> Bool) -> NonEmpty a -> ([a], [a])
group :: (Foldable f, Eq a) => f a -> [NonEmpty a]
groupBy :: Foldable f => (a -> a -> Bool) -> f a -> [NonEmpty a]
groupWith :: (Foldable f, Eq b) => (a -> b) -> f a -> [NonEmpty a]
groupAllWith :: Ord b => (a -> b) -> [a] -> [NonEmpty a]
group1 :: Eq a => NonEmpty a -> NonEmpty (NonEmpty a)
groupBy1 :: (a -> a -> Bool) -> NonEmpty a -> NonEmpty (NonEmpty a)
groupWith1 :: Eq b => (a -> b) -> NonEmpty a -> NonEmpty (NonEmpty a)
groupAllWith1 :: Ord b => (a -> b) -> NonEmpty a -> NonEmpty (NonEmpty a)
isPrefixOf :: Eq a => [a] -> NonEmpty a -> Bool
nub :: Eq a => NonEmpty a -> NonEmpty a
nubBy :: (a -> a -> Bool) -> NonEmpty a -> NonEmpty a
zip :: NonEmpty a -> NonEmpty b -> NonEmpty (a, b)
zipWith :: (a -> b -> c) -> NonEmpty a -> NonEmpty b -> NonEmpty c
unzip :: Functor f => f (a, b) -> (f a, f b)
nonEmpty :: [a] -> Maybe (NonEmpty a)
toList :: NonEmpty a -> [a]
xor :: NonEmpty Bool -> Bool


-- | <tt>NonEmpty</tt> list partial functions. Import as:
--   
--   <pre>
--   import qualified RIO.NonEmpty.Partial as NE'
--   </pre>
module RIO.NonEmpty.Partial
(!!) :: NonEmpty a -> Int -> a
fromList :: [a] -> NonEmpty a


-- | Partial functions. Import as:
--   
--   <pre>
--   import qualified RIO.Partial as RIO'
--   </pre>
module RIO.Partial
fromJust :: HasCallStack => Maybe a -> a
read :: Read a => String -> a
toEnum :: Enum a => Int -> a
pred :: Enum a => a -> a
succ :: Enum a => a -> a

module RIO.Prelude.Types
data Bool
False :: Bool
True :: Bool
data Char
type String = [Char]
type FilePath = String
data Ordering
LT :: Ordering
EQ :: Ordering
GT :: Ordering
data Int
data Int8
data Int16
data Int32
data Int64
data Word
data Word8
data Word16
data Word32
data Word64
data Integer
data Natural
type Rational = Ratio Integer
data Float
data Double
data Maybe a
Nothing :: Maybe a
Just :: a -> Maybe a
data Either a b
Left :: a -> Either a b
Right :: b -> Either a b
data NonEmpty a
(:|) :: a -> [a] -> NonEmpty a
data Proxy (t :: k)
Proxy :: Proxy (t :: k)
data Void
newtype Const a (b :: k)
Const :: a -> Const a (b :: k)
[getConst] :: Const a (b :: k) -> a
newtype Identity a
Identity :: a -> Identity a
[runIdentity] :: Identity a -> a
data IO a
data ST s a
class Eq a
class Eq a => Ord a
class Bounded a
class Enum a
class Show a
class Read a
class IsString a
class Num a
class Num a => Fractional a
class Fractional a => Floating a
class (Num a, Ord a) => Real a
class (Real a, Enum a) => Integral a
class (Real a, Fractional a) => RealFrac a
class (RealFrac a, Floating a) => RealFloat a
class Functor (f :: Type -> Type)
class Bifunctor (p :: Type -> Type -> Type)
class Foldable (t :: Type -> Type)
class Bifoldable (p :: Type -> Type -> Type)
class Semigroup a
class Semigroup a => Monoid a
class Functor f => Applicative (f :: Type -> Type)
class Applicative f => Alternative (f :: Type -> Type)
class (Functor t, Foldable t) => Traversable (t :: Type -> Type)
class (Bifunctor t, Bifoldable t) => Bitraversable (t :: Type -> Type -> Type)
class Applicative m => Monad (m :: Type -> Type)
class (Alternative m, Monad m) => MonadPlus (m :: Type -> Type)
class Category (cat :: k -> k -> Type)
class Category a => Arrow (a :: Type -> Type -> Type)
class Monad m => MonadFail (m :: Type -> Type)
class Typeable (a :: k)
class Typeable a => Data a
gfoldl :: Data a => (forall d b. Data d => c (d -> b) -> d -> c b) -> (forall g. () => g -> c g) -> a -> c a
gunfold :: Data a => (forall b r. Data b => c (b -> r) -> c r) -> (forall r. () => r -> c r) -> Constr -> c a
toConstr :: Data a => a -> Constr
dataTypeOf :: Data a => a -> DataType
dataCast1 :: (Data a, Typeable t) => (forall d. Data d => c (t d)) -> Maybe (c a)
dataCast2 :: (Data a, Typeable t) => (forall d e. (Data d, Data e) => c (t d e)) -> Maybe (c a)
gmapT :: Data a => (forall b. Data b => b -> b) -> a -> a
gmapQl :: Data a => (r -> r' -> r) -> r -> (forall d. Data d => d -> r') -> a -> r
gmapQr :: forall r r'. Data a => (r' -> r -> r) -> r -> (forall d. Data d => d -> r') -> a -> r
gmapQ :: Data a => (forall d. Data d => d -> u) -> a -> [u]
gmapQi :: Data a => Int -> (forall d. Data d => d -> u) -> a -> u
gmapM :: (Data a, Monad m) => (forall d. Data d => d -> m d) -> a -> m a
gmapMp :: (Data a, MonadPlus m) => (forall d. Data d => d -> m d) -> a -> m a
gmapMo :: (Data a, MonadPlus m) => (forall d. Data d => d -> m d) -> a -> m a
class Generic a
class Storable a
class (Typeable e, Show e) => Exception e
type HasCallStack = ?callStack :: CallStack
class NFData a
class MonadTrans (t :: Type -> Type -> Type -> Type)
class Monad m => MonadReader r (m :: Type -> Type) | m -> r
type Reader r = ReaderT r Identity
newtype ReaderT r (m :: Type -> Type) a
ReaderT :: (r -> m a) -> ReaderT r (m :: Type -> Type) a
class Monad m => MonadThrow (m :: Type -> Type)
data ByteString
type LByteString = ByteString
data Builder
data ShortByteString
data Text
type LText = Text
data UnicodeException
DecodeError :: String -> Maybe Word8 -> UnicodeException
EncodeError :: String -> Maybe Char -> UnicodeException

-- | Boxed vectors, supporting efficient slicing.
data Vector a
type UVector = Vector
class (Vector Vector a, MVector MVector a) => Unbox a
type SVector = Vector
type GVector = Vector
data IntMap a
data Map k a
data IntSet
data Set a
data Seq a
class Hashable a
data HashMap k v
data HashSet a

-- | Class of monads which can perform primitive state-transformer actions
class Monad m => PrimMonad (m :: Type -> Type) where {
    
    -- | State token type
    type family PrimState (m :: Type -> Type);
}

module RIO.Prelude
(||) :: Bool -> Bool -> Bool
(&&) :: Bool -> Bool -> Bool
not :: Bool -> Bool
otherwise :: Bool
bool :: a -> a -> Bool -> a
maybe :: b -> (a -> b) -> Maybe a -> b
fromMaybe :: a -> Maybe a -> a

-- | Get a <a>First</a> value with a default fallback
fromFirst :: a -> First a -> a
isJust :: Maybe a -> Bool
isNothing :: Maybe a -> Bool
listToMaybe :: [a] -> Maybe a
maybeToList :: Maybe a -> [a]
catMaybes :: [Maybe a] -> [a]
mapMaybe :: (a -> Maybe b) -> [a] -> [b]

-- | Applicative <a>mapMaybe</a>.
mapMaybeA :: Applicative f => (a -> f (Maybe b)) -> [a] -> f [b]

-- | Monadic <a>mapMaybe</a>.
mapMaybeM :: Monad m => (a -> m (Maybe b)) -> [a] -> m [b]

-- | <pre>
--   <a>forMaybeA</a> <a>==</a> <a>flip</a> <a>mapMaybeA</a>
--   </pre>
forMaybeA :: Applicative f => [a] -> (a -> f (Maybe b)) -> f [b]

-- | <pre>
--   <a>forMaybeM</a> <a>==</a> <a>flip</a> <a>mapMaybeM</a>
--   </pre>
forMaybeM :: Monad m => [a] -> (a -> m (Maybe b)) -> m [b]
either :: (a -> c) -> (b -> c) -> Either a b -> c
isLeft :: Either a b -> Bool
isRight :: Either a b -> Bool

-- | Apply a function to a <a>Left</a> constructor
mapLeft :: (a1 -> a2) -> Either a1 b -> Either a2 b
lefts :: [Either a b] -> [a]
partitionEithers :: [Either a b] -> ([a], [b])
rights :: [Either a b] -> [b]
fst :: (a, b) -> a
snd :: (a, b) -> b
curry :: ((a, b) -> c) -> a -> b -> c
uncurry :: (a -> b -> c) -> (a, b) -> c
(==) :: Eq a => a -> a -> Bool
(/=) :: Eq a => a -> a -> Bool
(<) :: 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
compare :: Ord a => a -> a -> Ordering
comparing :: Ord a => (b -> a) -> b -> b -> Ordering
newtype Down a
Down :: a -> Down a
fromEnum :: Enum a => a -> Int
minBound :: Bounded a => a
maxBound :: Bounded a => a
(+) :: Num a => a -> a -> a
(-) :: Num a => a -> a -> a
(*) :: Num a => a -> a -> a
(^) :: (Num a, Integral b) => a -> b -> a
negate :: Num a => a -> a
abs :: Num a => a -> a
signum :: Num a => a -> a
fromInteger :: Num a => Integer -> a
subtract :: Num a => a -> a -> a
toRational :: Real a => a -> Rational
quot :: Integral a => a -> a -> a
rem :: Integral a => a -> a -> a
div :: Integral a => a -> a -> a
mod :: Integral a => a -> a -> a
quotRem :: Integral a => a -> a -> (a, a)
divMod :: Integral a => a -> a -> (a, a)
toInteger :: Integral a => a -> Integer
even :: Integral a => a -> Bool
odd :: Integral a => a -> Bool
gcd :: Integral a => a -> a -> a
lcm :: Integral a => a -> a -> a
fromIntegral :: (Integral a, Num b) => a -> b
(/) :: Fractional a => a -> a -> a
(^^) :: (Fractional a, Integral b) => a -> b -> a
recip :: Fractional a => a -> a
fromRational :: Fractional a => Rational -> a
realToFrac :: (Real a, Fractional b) => a -> b
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
properFraction :: (RealFrac a, Integral b) => a -> (b, a)
truncate :: (RealFrac a, Integral b) => a -> b
round :: (RealFrac a, Integral b) => a -> b
ceiling :: (RealFrac a, Integral b) => a -> b
floor :: (RealFrac a, Integral b) => a -> b
floatRadix :: RealFloat a => a -> Integer
floatDigits :: RealFloat a => a -> Int
floatRange :: RealFloat a => a -> (Int, Int)
decodeFloat :: RealFloat a => a -> (Integer, Int)
encodeFloat :: RealFloat a => Integer -> Int -> a
exponent :: RealFloat a => a -> Int
significand :: RealFloat a => a -> a
scaleFloat :: RealFloat a => Int -> a -> a
isNaN :: RealFloat a => a -> Bool
isInfinite :: RealFloat a => a -> Bool
isDenormalized :: RealFloat a => a -> Bool
isNegativeZero :: RealFloat a => a -> Bool
isIEEE :: RealFloat a => a -> Bool
atan2 :: RealFloat a => a -> a -> a
byteSwap16 :: Word16 -> Word16
byteSwap32 :: Word32 -> Word32
byteSwap64 :: Word64 -> Word64
(<>) :: Semigroup a => a -> a -> a
sappend :: Semigroup s => s -> s -> s
mempty :: Monoid a => a
mappend :: Monoid a => a -> a -> a
mconcat :: Monoid a => [a] -> a
fmap :: Functor f => (a -> b) -> f a -> f b
(<$>) :: Functor f => (a -> b) -> f a -> f b
(<$) :: Functor f => a -> f b -> f a
($>) :: Functor f => f a -> b -> f b
void :: Functor f => f a -> f ()
(<&>) :: Functor f => f a -> (a -> b) -> f b
pure :: Applicative f => a -> f a
(<*>) :: Applicative f => f (a -> b) -> f a -> f b
(<*) :: Applicative f => f a -> f b -> f a
(*>) :: Applicative f => f a -> f b -> f b
liftA :: Applicative f => (a -> b) -> f a -> f b
liftA2 :: Applicative f => (a -> b -> c) -> f a -> f b -> f c
liftA3 :: Applicative f => (a -> b -> c -> d) -> f a -> f b -> f c -> f d
forever :: Applicative f => f a -> f b
traverse_ :: (Foldable t, Applicative f) => (a -> f b) -> t a -> f ()
for_ :: (Foldable t, Applicative f) => t a -> (a -> f b) -> f ()
sequenceA_ :: (Foldable t, Applicative f) => t (f a) -> f ()
filterM :: Applicative m => (a -> m Bool) -> [a] -> m [a]
replicateM_ :: Applicative m => Int -> m a -> m ()
zipWithM :: Applicative m => (a -> b -> m c) -> [a] -> [b] -> m [c]
zipWithM_ :: Applicative m => (a -> b -> m c) -> [a] -> [b] -> m ()
return :: Monad m => a -> m a
join :: Monad m => m (m a) -> m a
fail :: MonadFail m => String -> m a
(>>=) :: Monad m => m a -> (a -> m b) -> m b
(>>) :: Monad m => m a -> m b -> m b
(=<<) :: Monad m => (a -> m b) -> m a -> m b
(>=>) :: Monad m => (a -> m b) -> (b -> m c) -> a -> m c
(<=<) :: Monad m => (b -> m c) -> (a -> m b) -> a -> m c
(<$!>) :: Monad m => (a -> b) -> m a -> m b
liftM :: Monad m => (a1 -> r) -> m a1 -> m r
liftM2 :: Monad m => (a1 -> a2 -> r) -> m a1 -> m a2 -> m r

-- | Run the second value if the first value returns <a>True</a>
whenM :: Monad m => m Bool -> m () -> m ()

-- | Run the second value if the first value returns <a>False</a>
unlessM :: Monad m => m Bool -> m () -> m ()
mapM_ :: (Foldable t, Monad m) => (a -> m b) -> t a -> m ()
forM_ :: (Foldable t, Monad m) => t a -> (a -> m b) -> m ()
sequence_ :: (Foldable t, Monad m) => t (m a) -> m ()
foldM :: (Foldable t, Monad m) => (b -> a -> m b) -> b -> t a -> m b
foldM_ :: (Foldable t, Monad m) => (b -> a -> m b) -> b -> t a -> m ()
foldr :: Foldable t => (a -> b -> b) -> b -> t a -> b
foldl' :: Foldable t => (b -> a -> b) -> b -> t a -> b
fold :: (Foldable t, Monoid m) => t m -> m
foldMap :: (Foldable t, Monoid m) => (a -> m) -> t a -> m

-- | Extend <a>foldMap</a> to allow side effects.
--   
--   Internally, this is implemented using a strict left fold. This is used
--   for performance reasons. It also necessitates that this function has a
--   <tt>Monad</tt> constraint and not just an <tt>Applicative</tt>
--   constraint. For more information, see
--   <a>https://github.com/commercialhaskell/rio/pull/99#issuecomment-394179757</a>.
foldMapM :: (Monad m, Monoid w, Foldable t) => (a -> m w) -> t a -> m w
elem :: (Foldable t, Eq a) => a -> t a -> Bool
notElem :: (Foldable t, Eq a) => a -> t a -> Bool
null :: Foldable t => t a -> Bool
length :: Foldable t => t a -> Int
sum :: (Foldable t, Num a) => t a -> a
product :: (Foldable t, Num a) => t a -> a
all :: Foldable t => (a -> Bool) -> t a -> Bool
any :: Foldable t => (a -> Bool) -> t a -> Bool
and :: Foldable t => t Bool -> Bool
or :: Foldable t => t Bool -> Bool
toList :: Foldable t => t a -> [a]
concat :: Foldable t => t [a] -> [a]
concatMap :: Foldable t => (a -> [b]) -> t a -> [b]
traverse :: (Traversable t, Applicative f) => (a -> f b) -> t a -> f (t b)
for :: (Traversable t, Applicative f) => t a -> (a -> f b) -> f (t b)
sequenceA :: (Traversable t, Applicative f) => t (f a) -> f (t a)
mapM :: (Traversable t, Monad m) => (a -> m b) -> t a -> m (t b)
forM :: (Traversable t, Monad m) => t a -> (a -> m b) -> m (t b)
sequence :: (Traversable t, Monad m) => t (m a) -> m (t a)
(<|>) :: Alternative f => f a -> f a -> f a
some :: Alternative f => f a -> f [a]
many :: Alternative f => f a -> f [a]
optional :: Alternative f => f a -> f (Maybe a)
asum :: (Foldable t, Alternative f) => t (f a) -> f a
guard :: Alternative f => Bool -> f ()
when :: Applicative f => Bool -> f () -> f ()
unless :: Applicative f => Bool -> f () -> f ()
bimap :: Bifunctor p => (a -> b) -> (c -> d) -> p a c -> p b d
first :: Bifunctor p => (a -> b) -> p a c -> p b c
second :: Bifunctor p => (b -> c) -> p a b -> p a c
bifold :: (Bifoldable p, Monoid m) => p m m -> m
bifoldMap :: (Bifoldable p, Monoid m) => (a -> m) -> (b -> m) -> p a b -> m
bifoldr :: Bifoldable p => (a -> c -> c) -> (b -> c -> c) -> c -> p a b -> c
bifoldl :: Bifoldable p => (c -> a -> c) -> (c -> b -> c) -> c -> p a b -> c
bifoldr' :: Bifoldable t => (a -> c -> c) -> (b -> c -> c) -> c -> t a b -> c
bifoldr1 :: Bifoldable t => (a -> a -> a) -> t a a -> a
bifoldrM :: (Bifoldable t, Monad m) => (a -> c -> m c) -> (b -> c -> m c) -> c -> t a b -> m c
bifoldl' :: Bifoldable t => (a -> b -> a) -> (a -> c -> a) -> a -> t b c -> a
bifoldl1 :: Bifoldable t => (a -> a -> a) -> t a a -> a
bifoldlM :: (Bifoldable t, Monad m) => (a -> b -> m a) -> (a -> c -> m a) -> a -> t b c -> m a
bitraverse_ :: (Bifoldable t, Applicative f) => (a -> f c) -> (b -> f d) -> t a b -> f ()
bifor_ :: (Bifoldable t, Applicative f) => t a b -> (a -> f c) -> (b -> f d) -> f ()
bisequence_ :: (Bifoldable t, Applicative f) => t (f a) (f b) -> f ()
biasum :: (Bifoldable t, Alternative f) => t (f a) (f a) -> f a
biList :: Bifoldable t => t a a -> [a]
binull :: Bifoldable t => t a b -> Bool
bilength :: Bifoldable t => t a b -> Int
bielem :: (Bifoldable t, Eq a) => a -> t a a -> Bool
bimaximum :: (Bifoldable t, Ord a) => t a a -> a
biminimum :: (Bifoldable t, Ord a) => t a a -> a
bisum :: (Bifoldable t, Num a) => t a a -> a
biproduct :: (Bifoldable t, Num a) => t a a -> a
biconcat :: Bifoldable t => t [a] [a] -> [a]
biconcatMap :: Bifoldable t => (a -> [c]) -> (b -> [c]) -> t a b -> [c]
biand :: Bifoldable t => t Bool Bool -> Bool
bior :: Bifoldable t => t Bool Bool -> Bool
biany :: Bifoldable t => (a -> Bool) -> (b -> Bool) -> t a b -> Bool
biall :: Bifoldable t => (a -> Bool) -> (b -> Bool) -> t a b -> Bool
bimaximumBy :: Bifoldable t => (a -> a -> Ordering) -> t a a -> a
biminimumBy :: Bifoldable t => (a -> a -> Ordering) -> t a a -> a
binotElem :: (Bifoldable t, Eq a) => a -> t a a -> Bool
bifind :: Bifoldable t => (a -> Bool) -> t a a -> Maybe a
bitraverse :: (Bitraversable t, Applicative f) => (a -> f c) -> (b -> f d) -> t a b -> f (t c d)
bisequence :: (Bitraversable t, Applicative f) => t (f a) (f b) -> f (t a b)
bifor :: (Bitraversable t, Applicative f) => t a b -> (a -> f c) -> (b -> f d) -> f (t c d)
bimapAccumL :: Bitraversable t => (a -> b -> (a, c)) -> (a -> d -> (a, e)) -> a -> t b d -> (a, t c e)
bimapAccumR :: Bitraversable t => (a -> b -> (a, c)) -> (a -> d -> (a, e)) -> a -> t b d -> (a, t c e)
mzero :: MonadPlus m => m a
mplus :: MonadPlus m => m a -> m a -> m a
msum :: (Foldable t, MonadPlus m) => t (m a) -> m a
mfilter :: MonadPlus m => (a -> Bool) -> m a -> m a
(&&&) :: Arrow a => a b c -> a b c' -> a b (c, c')
(***) :: Arrow a => a b c -> a b' c' -> a (b, b') (c, c')
(>>>) :: forall k cat (a :: k) (b :: k) (c :: k). Category cat => cat a b -> cat b c -> cat a c
id :: a -> a
const :: a -> b -> a
(.) :: (b -> c) -> (a -> b) -> a -> c
($) :: forall (r :: RuntimeRep) a (b :: TYPE r). (a -> b) -> a -> b
(&) :: a -> (a -> b) -> b
flip :: (a -> b -> c) -> b -> a -> c
fix :: (a -> a) -> a
on :: (b -> b -> c) -> (a -> b) -> a -> a -> c
($!) :: forall (r :: RuntimeRep) a (b :: TYPE r). (a -> b) -> a -> b
seq :: a -> b -> b
error :: forall (r :: RuntimeRep) (a :: TYPE r). HasCallStack => [Char] -> a
undefined :: forall (r :: RuntimeRep) (a :: TYPE r). HasCallStack => a
asTypeOf :: a -> a -> a

-- | Helper function to force an action to run in <a>IO</a>. Especially
--   useful for overly general contexts, like hspec tests.
asIO :: IO a -> IO a
(++) :: [a] -> [a] -> [a]
break :: (a -> Bool) -> [a] -> ([a], [a])
drop :: Int -> [a] -> [a]
dropWhile :: (a -> Bool) -> [a] -> [a]
filter :: (a -> Bool) -> [a] -> [a]
lookup :: Eq a => a -> [(a, b)] -> Maybe b
map :: (a -> b) -> [a] -> [b]
replicate :: Int -> a -> [a]
reverse :: [a] -> [a]
span :: (a -> Bool) -> [a] -> ([a], [a])
take :: Int -> [a] -> [a]
takeWhile :: (a -> Bool) -> [a] -> [a]
zip :: [a] -> [b] -> [(a, b)]
zipWith :: (a -> b -> c) -> [a] -> [b] -> [c]

-- | Strip out duplicates
nubOrd :: Ord a => [a] -> [a]
fromString :: IsString a => String -> a
lines :: String -> [String]
unlines :: [String] -> String
unwords :: [String] -> String
words :: String -> [String]
show :: Show a => a -> String
readMaybe :: Read a => String -> Maybe a
($!!) :: NFData a => (a -> b) -> a -> b
rnf :: NFData a => a -> ()
deepseq :: NFData a => a -> b -> b
force :: NFData a => a -> a
absurd :: Void -> a
lift :: (MonadTrans t, Monad m) => m a -> t m a
ask :: MonadReader r m => m r
asks :: MonadReader r m => (r -> a) -> m a
local :: MonadReader r m => (r -> r) -> m a -> m a
runReader :: Reader r a -> r -> a
runReaderT :: ReaderT r m a -> r -> m a
toStrictBytes :: LByteString -> ByteString
fromStrictBytes :: ByteString -> LByteString
toShort :: ByteString -> ShortByteString
fromShort :: ShortByteString -> ByteString
tshow :: Show a => a -> Text
decodeUtf8Lenient :: ByteString -> Text
decodeUtf8' :: ByteString -> Either UnicodeException Text
decodeUtf8With :: OnDecodeError -> ByteString -> Text
encodeUtf8 :: Text -> ByteString
encodeUtf8Builder :: Text -> Builder
lenientDecode :: OnDecodeError

-- | Execute a primitive operation
primitive :: PrimMonad m => (State# (PrimState m) -> (# State# (PrimState m), a #)) -> m a
runST :: (forall s. () => ST s a) -> a

module RIO.Deque

-- | A double-ended queue supporting any underlying vector type and any
--   monad.
--   
--   This implements a circular double-ended queue with exponential growth.
data Deque v s a

-- | A <a>Deque</a> specialized to unboxed vectors.
type UDeque = Deque MVector

-- | A <a>Deque</a> specialized to storable vectors.
type SDeque = Deque MVector

-- | A <a>Deque</a> specialized to boxed vectors.
type BDeque = Deque MVector

-- | Create a new, empty <a>Deque</a>
newDeque :: (MVector v a, PrimMonad m) => m (Deque v (PrimState m) a)

-- | <i>O(1)</i> - Get the number of elements that is currently in the
--   <a>Deque</a>
getDequeSize :: PrimMonad m => Deque v (PrimState m) a -> m Int

-- | Pop the first value from the beginning of the <a>Deque</a>
popFrontDeque :: (MVector v a, PrimMonad m) => Deque v (PrimState m) a -> m (Maybe a)

-- | Pop the first value from the end of the <a>Deque</a>
popBackDeque :: (MVector v a, PrimMonad m) => Deque v (PrimState m) a -> m (Maybe a)

-- | Push a new value to the beginning of the <a>Deque</a>
pushFrontDeque :: (MVector v a, PrimMonad m) => Deque v (PrimState m) a -> a -> m ()

-- | Push a new value to the end of the <a>Deque</a>
pushBackDeque :: (MVector v a, PrimMonad m) => Deque v (PrimState m) a -> a -> m ()

-- | Fold over a <a>Deque</a>, starting at the beginning. Does not modify
--   the <a>Deque</a>.
foldlDeque :: (MVector v a, PrimMonad m) => (acc -> a -> m acc) -> acc -> Deque v (PrimState m) a -> m acc

-- | Fold over a <a>Deque</a>, starting at the end. Does not modify the
--   <a>Deque</a>.
foldrDeque :: (MVector v a, PrimMonad m) => (a -> acc -> m acc) -> acc -> Deque v (PrimState m) a -> m acc

-- | Convert a <a>Deque</a> into a list. Does not modify the <a>Deque</a>.
dequeToList :: (MVector v a, PrimMonad m) => Deque v (PrimState m) a -> m [a]

-- | Convert to an immutable vector of any type. If resulting pure vector
--   corresponds to the mutable one used by the <a>Deque</a>, it will be
--   more efficient to use <a>freezeDeque</a> instead.
--   
--   <h4><b>Example</b></h4>
--   
--   <pre>
--   &gt;&gt;&gt; :set -XTypeApplications
--   
--   &gt;&gt;&gt; import qualified RIO.Vector.Unboxed as U
--   
--   &gt;&gt;&gt; import qualified RIO.Vector.Storable as S
--   
--   &gt;&gt;&gt; d &lt;- newDeque @U.MVector @Int
--   
--   &gt;&gt;&gt; mapM_ (pushFrontDeque d) [0..10]
--   
--   &gt;&gt;&gt; dequeToVector @S.Vector d
--   [10,9,8,7,6,5,4,3,2,1,0]
--   </pre>
dequeToVector :: (Vector v' a, MVector v a, PrimMonad m) => Deque v (PrimState m) a -> m (v' a)

-- | Yield an immutable copy of the underlying mutable vector. The
--   difference from <a>dequeToVector</a> is that the the copy will be
--   performed with a more efficient <tt>memcpy</tt>, rather than element
--   by element. The downside is that the resulting vector type must be the
--   one that corresponds to the mutable one that is used in the
--   <a>Deque</a>.
--   
--   <h4><b>Example</b></h4>
--   
--   <pre>
--   &gt;&gt;&gt; :set -XTypeApplications
--   
--   &gt;&gt;&gt; import qualified RIO.Vector.Unboxed as U
--   
--   &gt;&gt;&gt; d &lt;- newDeque @U.MVector @Int
--   
--   &gt;&gt;&gt; mapM_ (pushFrontDeque d) [0..10]
--   
--   &gt;&gt;&gt; freezeDeque @U.Vector d
--   [10,9,8,7,6,5,4,3,2,1,0]
--   </pre>
freezeDeque :: (Vector v a, PrimMonad m) => Deque (Mutable v) (PrimState m) a -> m (v a)

-- | Helper function to assist with type inference, forcing usage of an
--   unboxed vector.
asUDeque :: UDeque s a -> UDeque s a

-- | Helper function to assist with type inference, forcing usage of a
--   storable vector.
asSDeque :: SDeque s a -> SDeque s a

-- | Helper function to assist with type inference, forcing usage of a
--   boxed vector.
asBDeque :: BDeque s a -> BDeque s a


-- | Interacting with external processes.
--   
--   This module provides a layer on top of <a>System.Process.Typed</a>,
--   with the following additions:
--   
--   <ul>
--   <li>For efficiency, it will cache <tt>PATH</tt> lookups.</li>
--   <li>For convenience, you can set the working directory and env vars
--   overrides in a <a>RIO</a> environment instead of on the individual
--   calls to the process.</li>
--   <li>Built-in support for logging at the debug level.</li>
--   </ul>
--   
--   In order to switch over to this API, the main idea is:
--   
--   <ul>
--   <li>Like most of the rio library, you need to create an environment
--   value (this time <a>ProcessContext</a>), and include it in your
--   <a>RIO</a> environment. See <a>mkProcessContext</a>.</li>
--   <li>Instead of using the <a>proc</a> function from
--   <a>System.Process.Typed</a> for creating a <a>ProcessConfig</a>, use
--   the locally defined <a>proc</a> function, which will handle overriding
--   environment variables, looking up paths, performing logging, etc.</li>
--   </ul>
--   
--   Once you have your <a>ProcessConfig</a>, use the standard functions
--   from <a>Typed</a> (reexported here for convenient) for running the
--   <a>ProcessConfig</a>.
module RIO.Process

-- | Context in which to run processes.
data ProcessContext

-- | Get the <a>ProcessContext</a> from the environment.
class HasProcessContext env
processContextL :: HasProcessContext env => Lens' env ProcessContext

-- | The environment variable map
type EnvVars = Map Text Text

-- | Create a new <a>ProcessContext</a> from the given environment variable
--   map.
mkProcessContext :: MonadIO m => EnvVars -> m ProcessContext

-- | Same as <a>mkProcessContext</a> but uses the system environment (from
--   <a>getEnvironment</a>).
mkDefaultProcessContext :: MonadIO m => m ProcessContext

-- | Modify the environment variables of a <a>ProcessContext</a>. This will
--   not change the working directory.
--   
--   Note that this requires <a>MonadIO</a>, as it will create a new
--   <a>IORef</a> for the cache.
modifyEnvVars :: MonadIO m => ProcessContext -> (EnvVars -> EnvVars) -> m ProcessContext

-- | Use <a>modifyEnvVars</a> to create a new <a>ProcessContext</a>, and
--   then use it in the provided action.
withModifyEnvVars :: (HasProcessContext env, MonadReader env m, MonadIO m) => (EnvVars -> EnvVars) -> m a -> m a

-- | Look into the <a>ProcessContext</a> and return the specified
--   environmet variable if one is available.
lookupEnvFromContext :: (MonadReader env m, HasProcessContext env) => Text -> m (Maybe Text)

-- | Set the working directory to be used by child processes.
withWorkingDir :: (HasProcessContext env, MonadReader env m, MonadIO m) => FilePath -> m a -> m a

-- | Override the working directory processes run in. <tt>Nothing</tt>
--   means the current process's working directory.
workingDirL :: HasProcessContext env => Lens' env (Maybe FilePath)

-- | Get the environment variables. We cannot provide a <tt>Lens</tt> here,
--   since updating the environment variables requires an <tt>IO</tt>
--   action to allocate a new <tt>IORef</tt> for holding the executable
--   path cache.
envVarsL :: HasProcessContext env => SimpleGetter env EnvVars

-- | Get the <a>EnvVars</a> as an associated list of <a>String</a>s.
--   
--   Useful for interacting with other libraries.
envVarsStringsL :: HasProcessContext env => SimpleGetter env [(String, String)]

-- | Get the list of directories searched for executables (the
--   <tt>PATH</tt>).
--   
--   Similar to <tt>envVarMapL</tt>, this cannot be a full <tt>Lens</tt>.
exeSearchPathL :: HasProcessContext env => SimpleGetter env [FilePath]

-- | Reset the executable cache.
resetExeCache :: (MonadIO m, MonadReader env m, HasProcessContext env) => m ()

-- | Provide a <a>ProcessConfig</a> based on the <a>ProcessContext</a> in
--   scope. Deals with resolving the full path, setting the child process's
--   environment variables, setting the working directory, and wrapping the
--   call with <a>withProcessTimeLog</a> for debugging output.
--   
--   This is intended to be analogous to the <tt>proc</tt> function
--   provided by the <tt>System.Process.Typed</tt> module, but has a
--   different type signature to (1) allow it to perform <tt>IO</tt>
--   actions for looking up paths, and (2) allow logging and timing of the
--   running action.
proc :: (HasProcessContext env, HasLogFunc env, MonadReader env m, MonadIO m, HasCallStack) => FilePath -> [String] -> (ProcessConfig () () () -> m a) -> m a

-- | Same as <a>withProcess</a>, but generalized to <a>MonadUnliftIO</a>.

-- | <i>Deprecated: Please consider using withProcessWait, or instead use
--   withProcessTerm</i>
withProcess :: MonadUnliftIO m => ProcessConfig stdin stdout stderr -> (Process stdin stdout stderr -> m a) -> m a

-- | Same as <a>withProcess_</a>, but generalized to <a>MonadUnliftIO</a>.

-- | <i>Deprecated: Please consider using withProcessWait, or instead use
--   withProcessTerm</i>
withProcess_ :: MonadUnliftIO m => ProcessConfig stdin stdout stderr -> (Process stdin stdout stderr -> m a) -> m a

-- | Same as <a>withProcessWait</a>, but generalized to
--   <a>MonadUnliftIO</a>.
withProcessWait :: MonadUnliftIO m => ProcessConfig stdin stdout stderr -> (Process stdin stdout stderr -> m a) -> m a

-- | Same as <a>withProcessWait_</a>, but generalized to
--   <a>MonadUnliftIO</a>.
withProcessWait_ :: MonadUnliftIO m => ProcessConfig stdin stdout stderr -> (Process stdin stdout stderr -> m a) -> m a

-- | Same as <a>withProcessTerm</a>, but generalized to
--   <a>MonadUnliftIO</a>.
withProcessTerm :: MonadUnliftIO m => ProcessConfig stdin stdout stderr -> (Process stdin stdout stderr -> m a) -> m a

-- | Same as <a>withProcessTerm_</a>, but generalized to
--   <a>MonadUnliftIO</a>.
withProcessTerm_ :: MonadUnliftIO m => ProcessConfig stdin stdout stderr -> (Process stdin stdout stderr -> m a) -> m a

-- | Execute a process within the configured environment.
--   
--   Execution will not return, because either:
--   
--   1) On non-windows, execution is taken over by execv of the
--   sub-process. This allows signals to be propagated (#527)
--   
--   2) On windows, an <tt>ExitCode</tt> exception will be thrown.
exec :: (HasProcessContext env, HasLogFunc env) => String -> [String] -> RIO env b

-- | Like <a>exec</a>, but does not use <tt>execv</tt> on non-windows. This
--   way, there is a sub-process, which is helpful in some cases
--   (<a>https://github.com/commercialhaskell/stack/issues/1306</a>).
--   
--   This function only exits by throwing <tt>ExitCode</tt>.
execSpawn :: (HasProcessContext env, HasLogFunc env) => String -> [String] -> RIO env a

-- | A convenience environment combining a <a>LogFunc</a> and a
--   <a>ProcessContext</a>
data LoggedProcessContext
LoggedProcessContext :: ProcessContext -> LogFunc -> LoggedProcessContext

-- | Run an action using a <a>LoggedProcessContext</a> with default
--   settings and no logging.
withProcessContextNoLogging :: MonadIO m => RIO LoggedProcessContext a -> m a

-- | Exception type which may be generated in this module.
--   
--   <i>NOTE</i> Other exceptions may be thrown by underlying libraries!
data ProcessException
NoPathFound :: ProcessException
ExecutableNotFound :: String -> [FilePath] -> ProcessException
ExecutableNotFoundAt :: FilePath -> ProcessException
PathsInvalidInPath :: [FilePath] -> ProcessException

-- | Check if the given executable exists on the given PATH.
doesExecutableExist :: (MonadIO m, MonadReader env m, HasProcessContext env) => String -> m Bool

-- | Find the complete path for the given executable name.
--   
--   On POSIX systems, filenames that match but are not exectuables are
--   excluded.
--   
--   On Windows systems, the executable names tried, in turn, are the
--   supplied name (only if it has an extension) and that name extended by
--   each of the <a>exeExtensions</a>. Also, this function may behave
--   differently from <a>findExecutable</a>. The latter excludes as
--   executables filenames without a <tt>.bat</tt>, <tt>.cmd</tt>,
--   <tt>.com</tt> or <tt>.exe</tt> extension (case-insensitive).
findExecutable :: (MonadIO m, MonadReader env m, HasProcessContext env) => String -> m (Either ProcessException FilePath)

-- | Get the filename extensions for executable files, including the dot
--   (if any).
--   
--   On POSIX systems, this is <tt>[""]</tt>.
--   
--   On Windows systems, the list is determined by the value of the
--   <tt>PATHEXT</tt> environment variable, if it present in the
--   environment. If the variable is absent, this is its default value on a
--   Windows system. This function may, therefore, behave differently from
--   <a>exeExtension</a>, which returns only <tt>".exe"</tt>.
exeExtensions :: (MonadIO m, MonadReader env m, HasProcessContext env) => m [String]

-- | Augment the PATH environment variable with the given extra paths.
augmentPath :: [FilePath] -> Maybe Text -> Either ProcessException Text

-- | Apply <a>augmentPath</a> on the PATH value in the given
--   <a>EnvVars</a>.
augmentPathMap :: [FilePath] -> EnvVars -> Either ProcessException EnvVars

-- | Show a process arg including speechmarks when necessary. Just for
--   debugging purposes, not functionally important.
showProcessArgDebug :: String -> Text
data ProcessConfig stdin stdout stderr
data StreamSpec (streamType :: StreamType) a
data StreamType
STInput :: StreamType
STOutput :: StreamType
data Process stdin stdout stderr
setStdin :: StreamSpec 'STInput stdin -> ProcessConfig stdin0 stdout stderr -> ProcessConfig stdin stdout stderr
setStdout :: StreamSpec 'STOutput stdout -> ProcessConfig stdin stdout0 stderr -> ProcessConfig stdin stdout stderr
setStderr :: StreamSpec 'STOutput stderr -> ProcessConfig stdin stdout stderr0 -> ProcessConfig stdin stdout stderr
setCloseFds :: Bool -> ProcessConfig stdin stdout stderr -> ProcessConfig stdin stdout stderr
setCreateGroup :: Bool -> ProcessConfig stdin stdout stderr -> ProcessConfig stdin stdout stderr
setDelegateCtlc :: Bool -> ProcessConfig stdin stdout stderr -> ProcessConfig stdin stdout stderr
setDetachConsole :: Bool -> ProcessConfig stdin stdout stderr -> ProcessConfig stdin stdout stderr
setCreateNewConsole :: Bool -> ProcessConfig stdin stdout stderr -> ProcessConfig stdin stdout stderr
setNewSession :: Bool -> ProcessConfig stdin stdout stderr -> ProcessConfig stdin stdout stderr
setChildGroup :: GroupID -> ProcessConfig stdin stdout stderr -> ProcessConfig stdin stdout stderr
setChildUser :: UserID -> ProcessConfig stdin stdout stderr -> ProcessConfig stdin stdout stderr
mkStreamSpec :: forall a (streamType :: StreamType). StdStream -> (ProcessConfig () () () -> Maybe Handle -> IO (a, IO ())) -> StreamSpec streamType a
inherit :: forall (anyStreamType :: StreamType). StreamSpec anyStreamType ()
closed :: forall (anyStreamType :: StreamType). StreamSpec anyStreamType ()
byteStringInput :: ByteString -> StreamSpec 'STInput ()
byteStringOutput :: StreamSpec 'STOutput (STM ByteString)
createPipe :: forall (anyStreamType :: StreamType). StreamSpec anyStreamType Handle
useHandleOpen :: forall (anyStreamType :: StreamType). Handle -> StreamSpec anyStreamType ()
useHandleClose :: forall (anyStreamType :: StreamType). Handle -> StreamSpec anyStreamType ()
startProcess :: MonadIO m => ProcessConfig stdin stdout stderr -> m (Process stdin stdout stderr)
stopProcess :: MonadIO m => Process stdin stdout stderr -> m ()
readProcess :: MonadIO m => ProcessConfig stdin stdoutIgnored stderrIgnored -> m (ExitCode, ByteString, ByteString)
readProcess_ :: MonadIO m => ProcessConfig stdin stdoutIgnored stderrIgnored -> m (ByteString, ByteString)
runProcess :: MonadIO m => ProcessConfig stdin stdout stderr -> m ExitCode
runProcess_ :: MonadIO m => ProcessConfig stdin stdout stderr -> m ()
readProcessStdout :: MonadIO m => ProcessConfig stdin stdoutIgnored stderr -> m (ExitCode, ByteString)
readProcessStdout_ :: MonadIO m => ProcessConfig stdin stdoutIgnored stderr -> m ByteString
readProcessStderr :: MonadIO m => ProcessConfig stdin stdout stderrIgnored -> m (ExitCode, ByteString)
readProcessStderr_ :: MonadIO m => ProcessConfig stdin stdout stderrIgnored -> m ByteString
waitExitCode :: MonadIO m => Process stdin stdout stderr -> m ExitCode
waitExitCodeSTM :: Process stdin stdout stderr -> STM ExitCode
getExitCode :: MonadIO m => Process stdin stdout stderr -> m (Maybe ExitCode)
getExitCodeSTM :: Process stdin stdout stderr -> STM (Maybe ExitCode)
checkExitCode :: MonadIO m => Process stdin stdout stderr -> m ()
checkExitCodeSTM :: Process stdin stdout stderr -> STM ()
getStdin :: Process stdin stdout stderr -> stdin
getStdout :: Process stdin stdout stderr -> stdout
getStderr :: Process stdin stdout stderr -> stderr
data ExitCodeException
ExitCodeException :: ExitCode -> ProcessConfig () () () -> ByteString -> ByteString -> ExitCodeException
[eceExitCode] :: ExitCodeException -> ExitCode
[eceProcessConfig] :: ExitCodeException -> ProcessConfig () () ()
[eceStdout] :: ExitCodeException -> ByteString
[eceStderr] :: ExitCodeException -> ByteString
data ByteStringOutputException
ByteStringOutputException :: SomeException -> ProcessConfig () () () -> ByteStringOutputException
unsafeProcessHandle :: Process stdin stdout stderr -> ProcessHandle
instance RIO.Prelude.Logger.HasLogFunc RIO.Process.LoggedProcessContext
instance RIO.Process.HasProcessContext RIO.Process.LoggedProcessContext
instance RIO.Process.HasProcessContext RIO.Process.ProcessContext
instance GHC.Show.Show RIO.Process.ProcessException
instance GHC.Exception.Type.Exception RIO.Process.ProcessException


-- | Provide a <tt><a>SimpleApp</a></tt> datatype, for providing a basic
--   <tt>App</tt>-like environment with common functionality built in. This
--   is intended to make it easier to, e.g., use rio's logging and process
--   code from within short scripts.
module RIO.Prelude.Simple

-- | A simple, non-customizable environment type for <tt>RIO</tt>, which
--   provides common functionality. If it's insufficient for your needs,
--   define your own, custom <tt>App</tt> data type.
data SimpleApp

-- | Constructor for <a>SimpleApp</a>. In case when <a>ProcessContext</a>
--   is not supplied <a>mkDefaultProcessContext</a> will be used to create
--   it.
mkSimpleApp :: MonadIO m => LogFunc -> Maybe ProcessContext -> m SimpleApp

-- | Run with a default configured <tt>SimpleApp</tt>, consisting of:
--   
--   <ul>
--   <li>Logging to stderr</li>
--   <li>If the <tt>RIO_VERBOSE</tt> environment variable is set, turns on
--   verbose logging</li>
--   <li>Default process context</li>
--   </ul>
runSimpleApp :: MonadIO m => RIO SimpleApp a -> m a
instance RIO.Prelude.Logger.HasLogFunc RIO.Prelude.Simple.SimpleApp
instance RIO.Process.HasProcessContext RIO.Prelude.Simple.SimpleApp


-- | <tt>Seq</tt>. Import as:
--   
--   <pre>
--   import qualified RIO.Seq as Seq
--   </pre>
module RIO.Seq
data Seq a
pattern Empty :: Seq a
pattern (:<|) :: a -> Seq a -> Seq a
pattern (:|>) :: Seq a -> a -> Seq a
empty :: Seq a
singleton :: a -> Seq a
(<|) :: a -> Seq a -> Seq a
(|>) :: Seq a -> a -> Seq a
(><) :: Seq a -> Seq a -> Seq a
fromList :: [a] -> Seq a
fromFunction :: Int -> (Int -> a) -> Seq a
fromArray :: Ix i => Array i a -> Seq a
replicate :: Int -> a -> Seq a
replicateA :: Applicative f => Int -> f a -> f (Seq a)
replicateM :: Applicative m => Int -> m a -> m (Seq a)
cycleTaking :: Int -> Seq a -> Seq a
iterateN :: Int -> (a -> a) -> a -> Seq a
unfoldr :: (b -> Maybe (a, b)) -> b -> Seq a
unfoldl :: (b -> Maybe (b, a)) -> b -> Seq a
null :: Seq a -> Bool
length :: Seq a -> Int
data ViewL a
EmptyL :: ViewL a
(:<) :: a -> Seq a -> ViewL a
viewl :: Seq a -> ViewL a
data ViewR a
EmptyR :: ViewR a
(:>) :: Seq a -> a -> ViewR a
viewr :: Seq a -> ViewR a
scanl :: (a -> b -> a) -> a -> Seq b -> Seq a
scanl1 :: (a -> a -> a) -> Seq a -> Seq a
scanr :: (a -> b -> b) -> b -> Seq a -> Seq b
scanr1 :: (a -> a -> a) -> Seq a -> Seq a
tails :: Seq a -> Seq (Seq a)
inits :: Seq a -> Seq (Seq a)
chunksOf :: Int -> Seq a -> Seq (Seq a)
takeWhileL :: (a -> Bool) -> Seq a -> Seq a
takeWhileR :: (a -> Bool) -> Seq a -> Seq a
dropWhileL :: (a -> Bool) -> Seq a -> Seq a
dropWhileR :: (a -> Bool) -> Seq a -> Seq a
spanl :: (a -> Bool) -> Seq a -> (Seq a, Seq a)
spanr :: (a -> Bool) -> Seq a -> (Seq a, Seq a)
breakl :: (a -> Bool) -> Seq a -> (Seq a, Seq a)
breakr :: (a -> Bool) -> Seq a -> (Seq a, Seq a)
partition :: (a -> Bool) -> Seq a -> (Seq a, Seq a)
filter :: (a -> Bool) -> Seq a -> Seq a
sort :: Ord a => Seq a -> Seq a
sortBy :: (a -> a -> Ordering) -> Seq a -> Seq a
unstableSort :: Ord a => Seq a -> Seq a
unstableSortBy :: (a -> a -> Ordering) -> Seq a -> Seq a
lookup :: Int -> Seq a -> Maybe a
(!?) :: Seq a -> Int -> Maybe a
index :: Seq a -> Int -> a
adjust :: (a -> a) -> Int -> Seq a -> Seq a
adjust' :: (a -> a) -> Int -> Seq a -> Seq a
update :: Int -> a -> Seq a -> Seq a
take :: Int -> Seq a -> Seq a
drop :: Int -> Seq a -> Seq a
insertAt :: Int -> a -> Seq a -> Seq a
deleteAt :: Int -> Seq a -> Seq a
splitAt :: Int -> Seq a -> (Seq a, Seq a)
elemIndexL :: Eq a => a -> Seq a -> Maybe Int
elemIndicesL :: Eq a => a -> Seq a -> [Int]
elemIndexR :: Eq a => a -> Seq a -> Maybe Int
elemIndicesR :: Eq a => a -> Seq a -> [Int]
findIndexL :: (a -> Bool) -> Seq a -> Maybe Int
findIndicesL :: (a -> Bool) -> Seq a -> [Int]
findIndexR :: (a -> Bool) -> Seq a -> Maybe Int
findIndicesR :: (a -> Bool) -> Seq a -> [Int]
foldMapWithIndex :: Monoid m => (Int -> a -> m) -> Seq a -> m
foldlWithIndex :: (b -> Int -> a -> b) -> b -> Seq a -> b
foldrWithIndex :: (Int -> a -> b -> b) -> b -> Seq a -> b
mapWithIndex :: (Int -> a -> b) -> Seq a -> Seq b
traverseWithIndex :: Applicative f => (Int -> a -> f b) -> Seq a -> f (Seq b)
reverse :: Seq a -> Seq a
intersperse :: a -> Seq a -> Seq a
zip :: Seq a -> Seq b -> Seq (a, b)
zipWith :: (a -> b -> c) -> Seq a -> Seq b -> Seq c
zip3 :: Seq a -> Seq b -> Seq c -> Seq (a, b, c)
zipWith3 :: (a -> b -> c -> d) -> Seq a -> Seq b -> Seq c -> Seq d
zip4 :: Seq a -> Seq b -> Seq c -> Seq d -> Seq (a, b, c, d)
zipWith4 :: (a -> b -> c -> d -> e) -> Seq a -> Seq b -> Seq c -> Seq d -> Seq e


-- | <tt>Set</tt>. Import as:
--   
--   <pre>
--   import qualified RIO.Set as Set
--   </pre>
--   
--   This module does not export any partial or unchecked functions. For
--   those, see <a>RIO.Set.Partial</a> and <a>RIO.Set.Unchecked</a>
module RIO.Set
data Set a
(\\) :: Ord a => Set a -> Set a -> Set a
null :: Set a -> Bool
size :: Set a -> Int
member :: Ord a => a -> Set a -> Bool
notMember :: Ord a => a -> Set a -> Bool
lookupLT :: Ord a => a -> Set a -> Maybe a
lookupGT :: Ord a => a -> Set a -> Maybe a
lookupLE :: Ord a => a -> Set a -> Maybe a
lookupGE :: Ord a => a -> Set a -> Maybe a
isSubsetOf :: Ord a => Set a -> Set a -> Bool
isProperSubsetOf :: Ord a => Set a -> Set a -> Bool
empty :: Set a
singleton :: a -> Set a
insert :: Ord a => a -> Set a -> Set a
delete :: Ord a => a -> Set a -> Set a
union :: Ord a => Set a -> Set a -> Set a
unions :: (Foldable f, Ord a) => f (Set a) -> Set a
difference :: Ord a => Set a -> Set a -> Set a
intersection :: Ord a => Set a -> Set a -> Set a
filter :: (a -> Bool) -> Set a -> Set a
takeWhileAntitone :: (a -> Bool) -> Set a -> Set a
dropWhileAntitone :: (a -> Bool) -> Set a -> Set a
spanAntitone :: (a -> Bool) -> Set a -> (Set a, Set a)
partition :: (a -> Bool) -> Set a -> (Set a, Set a)
split :: Ord a => a -> Set a -> (Set a, Set a)
splitMember :: Ord a => a -> Set a -> (Set a, Bool, Set a)
splitRoot :: Set a -> [Set a]
lookupIndex :: Ord a => a -> Set a -> Maybe Int
take :: Int -> Set a -> Set a
drop :: Int -> Set a -> Set a
splitAt :: Int -> Set a -> (Set a, Set a)
map :: Ord b => (a -> b) -> Set a -> Set b
foldr :: (a -> b -> b) -> b -> Set a -> b
foldl :: (a -> b -> a) -> a -> Set b -> a
foldr' :: (a -> b -> b) -> b -> Set a -> b
foldl' :: (a -> b -> a) -> a -> Set b -> a
lookupMin :: Set a -> Maybe a
lookupMax :: Set a -> Maybe a
deleteMin :: Set a -> Set a
deleteMax :: Set a -> Set a
maxView :: Set a -> Maybe (a, Set a)
minView :: Set a -> Maybe (a, Set a)
elems :: Set a -> [a]
toList :: Set a -> [a]
fromList :: Ord a => [a] -> Set a
toAscList :: Set a -> [a]
toDescList :: Set a -> [a]
showTree :: Show a => Set a -> String
showTreeWith :: Show a => Bool -> Bool -> Set a -> String
valid :: Ord a => Set a -> Bool


-- | <tt>Set</tt> partial functions. Import as:
--   
--   <pre>
--   import qualified RIO.Set.Partial as Set'
--   </pre>
module RIO.Set.Partial
findIndex :: Ord a => a -> Set a -> Int
elemAt :: Int -> Set a -> a
deleteAt :: Int -> Set a -> Set a
findMin :: Set a -> a
findMax :: Set a -> a
deleteFindMin :: Set a -> (a, Set a)
deleteFindMax :: Set a -> (a, Set a)


-- | This module contains functions from <a>Data.Set</a> that have
--   unchecked preconditions on their input. If these preconditions are not
--   satisfied, the data structure may end up in an invalid state and other
--   operations may misbehave. Import as:
--   
--   <pre>
--   import qualified RIO.Set.Unchecked as Set'
--   </pre>
module RIO.Set.Unchecked
mapMonotonic :: (a -> b) -> Set a -> Set b
fromAscList :: Eq a => [a] -> Set a
fromDescList :: Eq a => [a] -> Set a
fromDistinctAscList :: [a] -> Set a
fromDistinctDescList :: [a] -> Set a


-- | Provides reexports of <tt>MonadState</tt> and related helpers.
module RIO.State
class Monad m => MonadState s (m :: Type -> Type) | m -> s
get :: MonadState s m => m s
put :: MonadState s m => s -> m ()
state :: MonadState s m => (s -> (a, s)) -> m a
gets :: MonadState s m => (s -> a) -> m a
modify :: MonadState s m => (s -> s) -> m ()
modify' :: MonadState s m => (s -> s) -> m ()
type State s = StateT s Identity
runState :: State s a -> s -> (a, s)
evalState :: State s a -> s -> a
execState :: State s a -> s -> s
mapState :: ((a, s) -> (b, s)) -> State s a -> State s b
withState :: (s -> s) -> State s a -> State s a
newtype StateT s (m :: Type -> Type) a
StateT :: (s -> m (a, s)) -> StateT s (m :: Type -> Type) a
[runStateT] :: StateT s (m :: Type -> Type) a -> s -> m (a, s)
evalStateT :: Monad m => StateT s m a -> s -> m a
execStateT :: Monad m => StateT s m a -> s -> m s
mapStateT :: (m (a, s) -> n (b, s)) -> StateT s m a -> StateT s n b
withStateT :: forall s (m :: Type -> Type) a. (s -> s) -> StateT s m a -> StateT s m a


-- | Strict <tt>Text</tt>. Import as:
--   
--   <pre>
--   import qualified RIO.Text as T
--   </pre>
--   
--   This module does not export any partial functions. For those, see
--   <a>RIO.Text.Partial</a>
module RIO.Text
data Text
pack :: String -> Text
unpack :: Text -> String
singleton :: Char -> Text
empty :: Text
cons :: Char -> Text -> Text
snoc :: Text -> Char -> Text
append :: Text -> Text -> Text
uncons :: Text -> Maybe (Char, Text)
null :: Text -> Bool
length :: Text -> Int
compareLength :: Text -> Int -> Ordering
map :: (Char -> Char) -> Text -> Text
intercalate :: Text -> [Text] -> Text
intersperse :: Char -> Text -> Text
transpose :: [Text] -> [Text]
reverse :: Text -> Text
toCaseFold :: Text -> Text
toLower :: Text -> Text
toUpper :: Text -> Text
toTitle :: Text -> Text
justifyLeft :: Int -> Char -> Text -> Text
justifyRight :: Int -> Char -> Text -> Text
center :: Int -> Char -> Text -> Text
foldl :: (a -> Char -> a) -> a -> Text -> a
foldl' :: (a -> Char -> a) -> a -> Text -> a
foldr :: (Char -> a -> a) -> a -> Text -> a
concat :: [Text] -> Text
concatMap :: (Char -> Text) -> Text -> Text
any :: (Char -> Bool) -> Text -> Bool
all :: (Char -> Bool) -> Text -> Bool
scanl :: (Char -> Char -> Char) -> Char -> Text -> Text
scanl1 :: (Char -> Char -> Char) -> Text -> Text
scanr :: (Char -> Char -> Char) -> Char -> Text -> Text
scanr1 :: (Char -> Char -> Char) -> Text -> Text
mapAccumL :: (a -> Char -> (a, Char)) -> a -> Text -> (a, Text)
mapAccumR :: (a -> Char -> (a, Char)) -> a -> Text -> (a, Text)
replicate :: Int -> Text -> Text
unfoldr :: (a -> Maybe (Char, a)) -> a -> Text
unfoldrN :: Int -> (a -> Maybe (Char, a)) -> a -> Text
take :: Int -> Text -> Text
takeEnd :: Int -> Text -> Text
drop :: Int -> Text -> Text
dropEnd :: Int -> Text -> Text
takeWhile :: (Char -> Bool) -> Text -> Text
takeWhileEnd :: (Char -> Bool) -> Text -> Text
dropWhile :: (Char -> Bool) -> Text -> Text
dropWhileEnd :: (Char -> Bool) -> Text -> Text
dropAround :: (Char -> Bool) -> Text -> Text
strip :: Text -> Text
stripStart :: Text -> Text
stripEnd :: Text -> Text
splitAt :: Int -> Text -> (Text, Text)
break :: (Char -> Bool) -> Text -> (Text, Text)
span :: (Char -> Bool) -> Text -> (Text, Text)
group :: Text -> [Text]
groupBy :: (Char -> Char -> Bool) -> Text -> [Text]
inits :: Text -> [Text]
tails :: Text -> [Text]
split :: (Char -> Bool) -> Text -> [Text]
chunksOf :: Int -> Text -> [Text]
lines :: Text -> [Text]

-- | <a>linesCR</a> breaks a <a>Text</a> up into a list of <a>Text</a>s at
--   newline <a>Char</a>s. It is very similar to <a>lines</a>, but it also
--   removes any trailing <tt>'r'</tt> characters. The resulting
--   <a>Text</a> values do not contain newlines or trailing <tt>'r'</tt>
--   characters.
linesCR :: Text -> [Text]
words :: Text -> [Text]
unlines :: [Text] -> Text
unwords :: [Text] -> Text
isPrefixOf :: Text -> Text -> Bool
isSuffixOf :: Text -> Text -> Bool
isInfixOf :: Text -> Text -> Bool
stripPrefix :: Text -> Text -> Maybe Text
stripSuffix :: Text -> Text -> Maybe Text

-- | Drop prefix if present, otherwise return original <a>Text</a>.
dropPrefix :: Text -> Text -> Text

-- | Drop prefix if present, otherwise return original <a>Text</a>.
dropSuffix :: Text -> Text -> Text
commonPrefixes :: Text -> Text -> Maybe (Text, Text, Text)
filter :: (Char -> Bool) -> Text -> Text
find :: (Char -> Bool) -> Text -> Maybe Char
partition :: (Char -> Bool) -> Text -> (Text, Text)
index :: Text -> Int -> Char
findIndex :: (Char -> Bool) -> Text -> Maybe Int
zip :: Text -> Text -> [(Char, Char)]
zipWith :: (Char -> Char -> Char) -> Text -> Text -> Text
copy :: Text -> Text
unpackCString# :: Addr# -> Text
encodeUtf8 :: Text -> ByteString
decodeUtf8With :: OnDecodeError -> ByteString -> Text
decodeUtf8' :: ByteString -> Either UnicodeException Text
lenientDecode :: OnDecodeError

module RIO

-- | The Reader+IO monad. This is different from a <a>ReaderT</a> because:
--   
--   <ul>
--   <li>It's not a transformer, it hardcodes IO for simpler usage and
--   error messages.</li>
--   <li>Instances of typeclasses like <tt>MonadLogger</tt> are implemented
--   using classes defined on the environment, instead of using an
--   underlying monad.</li>
--   </ul>
newtype RIO env a
RIO :: ReaderT env IO a -> RIO env a
[unRIO] :: RIO env a -> ReaderT env IO a

-- | Using the environment run in IO the action that requires that
--   environment.
runRIO :: MonadIO m => env -> RIO env a -> m a

-- | Abstract <a>RIO</a> to an arbitrary <a>MonadReader</a> instance, which
--   can handle IO.
liftRIO :: (MonadIO m, MonadReader env m) => RIO env a -> m a

-- | Given a <a>LogOptions</a> value, run the given function with the
--   specified <a>LogFunc</a>. A common way to use this function is:
--   
--   <pre>
--   let isVerbose = False -- get from the command line instead
--   logOptions' &lt;- logOptionsHandle stderr isVerbose
--   let logOptions = setLogUseTime True logOptions'
--   withLogFunc logOptions $ \lf -&gt; do
--     let app = App -- application specific environment
--           { appLogFunc = lf
--           , appOtherStuff = ...
--           }
--     runRIO app $ do
--       logInfo "Starting app"
--       myApp
--   </pre>
withLogFunc :: MonadUnliftIO m => LogOptions -> (LogFunc -> m a) -> m a

-- | Given a <a>LogOptions</a> value, returns both a new <a>LogFunc</a> and
--   a sub-routine that disposes it.
--   
--   Intended for use if you want to deal with the teardown of
--   <a>LogFunc</a> yourself, otherwise prefer the <a>withLogFunc</a>
--   function instead.
newLogFunc :: (MonadIO n, MonadIO m) => LogOptions -> n (LogFunc, m ())

-- | A logging function, wrapped in a newtype for better error messages.
--   
--   An implementation may choose any behavior of this value it wishes,
--   including printing to standard output or no action at all.
data LogFunc

-- | Environment values with a logging function.
class HasLogFunc env
logFuncL :: HasLogFunc env => Lens' env LogFunc

-- | Create a <a>LogOptions</a> value from the given <a>Handle</a> and
--   whether to perform verbose logging or not. Individiual settings can be
--   overridden using appropriate <tt>set</tt> functions.
--   
--   When Verbose Flag is <tt>True</tt>, the following happens:
--   
--   <ul>
--   <li><tt>setLogVerboseFormat</tt> is called with <tt>True</tt></li>
--   <li><tt>setLogUseColor</tt> is called with <tt>True</tt> (except on
--   Windows)</li>
--   <li><tt>setLogUseLoc</tt> is called with <tt>True</tt></li>
--   <li><tt>setLogUseTime</tt> is called with <tt>True</tt></li>
--   <li><tt>setLogMinLevel</tt> is called with <tt>Debug</tt> log
--   level</li>
--   </ul>
logOptionsHandle :: MonadIO m => Handle -> Bool -> m LogOptions

-- | Configuration for how to create a <a>LogFunc</a>. Intended to be used
--   with the <a>withLogFunc</a> function.
data LogOptions

-- | Set the minimum log level. Messages below this level will not be
--   printed.
--   
--   Default: in verbose mode, <a>LevelDebug</a>. Otherwise,
--   <a>LevelInfo</a>.
setLogMinLevel :: LogLevel -> LogOptions -> LogOptions

-- | Refer to <a>setLogMinLevel</a>. This modifier allows to alter the
--   verbose format value dynamically at runtime.
--   
--   Default: in verbose mode, <a>LevelDebug</a>. Otherwise,
--   <a>LevelInfo</a>.
setLogMinLevelIO :: IO LogLevel -> LogOptions -> LogOptions

-- | Use the verbose format for printing log messages.
--   
--   Default: follows the value of the verbose flag.
setLogVerboseFormat :: Bool -> LogOptions -> LogOptions

-- | Refer to <a>setLogVerboseFormat</a>. This modifier allows to alter the
--   verbose format value dynamically at runtime.
--   
--   Default: follows the value of the verbose flag.
setLogVerboseFormatIO :: IO Bool -> LogOptions -> LogOptions

-- | Do we treat output as a terminal. If <tt>True</tt>, we will enabled
--   sticky logging functionality.
--   
--   Default: checks if the <tt>Handle</tt> provided to
--   <a>logOptionsHandle</a> is a terminal with <a>hIsTerminalDevice</a>.
setLogTerminal :: Bool -> LogOptions -> LogOptions

-- | Include the time when printing log messages.
--   
--   Default: <a>True</a> in debug mode, <a>False</a> otherwise.
setLogUseTime :: Bool -> LogOptions -> LogOptions

-- | Use ANSI color codes in the log output.
--   
--   Default: <a>True</a> if in verbose mode <i>and</i> the <a>Handle</a>
--   is a terminal device.
setLogUseColor :: Bool -> LogOptions -> LogOptions

-- | Use code location in the log output.
--   
--   Default: <a>True</a> if in verbose mode, <a>False</a> otherwise.
setLogUseLoc :: Bool -> LogOptions -> LogOptions

-- | Set format method for messages
--   
--   Default: <a>id</a>
setLogFormat :: (Utf8Builder -> Utf8Builder) -> LogOptions -> LogOptions

-- | ANSI color codes for <a>LogLevel</a> in the log output.
--   
--   Default: <a>LevelDebug</a> = "\ESC[32m" -- Green <a>LevelInfo</a> =
--   "\ESC[34m" -- Blue <a>LevelWarn</a> = "\ESC[33m" -- Yellow
--   <a>LevelError</a> = "\ESC[31m" -- Red <a>LevelOther</a> _ = "\ESC[35m"
--   -- Magenta
setLogLevelColors :: (LogLevel -> Utf8Builder) -> LogOptions -> LogOptions

-- | ANSI color codes for secondary content in the log output.
--   
--   Default: "\ESC[90m" -- Bright black (gray)
setLogSecondaryColor :: Utf8Builder -> LogOptions -> LogOptions

-- | ANSI color codes for accents in the log output. Accent colors are
--   indexed by <a>Int</a>.
--   
--   Default: <a>const</a> "\ESC[92m" -- Bright green, for all indicies
setLogAccentColors :: (Int -> Utf8Builder) -> LogOptions -> LogOptions

-- | Log a debug level message with no source.
logDebug :: (MonadIO m, MonadReader env m, HasLogFunc env, HasCallStack) => Utf8Builder -> m ()

-- | Log an info level message with no source.
logInfo :: (MonadIO m, MonadReader env m, HasLogFunc env, HasCallStack) => Utf8Builder -> m ()

-- | Log a warn level message with no source.
logWarn :: (MonadIO m, MonadReader env m, HasLogFunc env, HasCallStack) => Utf8Builder -> m ()

-- | Log an error level message with no source.
logError :: (MonadIO m, MonadReader env m, HasLogFunc env, HasCallStack) => Utf8Builder -> m ()

-- | Log a message with the specified textual level and no source.
logOther :: (MonadIO m, MonadReader env m, HasLogFunc env, HasCallStack) => Text -> Utf8Builder -> m ()

-- | Write a "sticky" line to the terminal. Any subsequent lines will
--   overwrite this one, and that same line will be repeated below again.
--   In other words, the line sticks at the bottom of the output forever.
--   Running this function again will replace the sticky line with a new
--   sticky line. When you want to get rid of the sticky line, run
--   <a>logStickyDone</a>.
--   
--   Note that not all <a>LogFunc</a> implementations will support sticky
--   messages as described. However, the <a>withLogFunc</a> implementation
--   provided by this module does.
logSticky :: (MonadIO m, HasCallStack, MonadReader env m, HasLogFunc env) => Utf8Builder -> m ()

-- | This will print out the given message with a newline and disable any
--   further stickiness of the line until a new call to <a>logSticky</a>
--   happens.
logStickyDone :: (MonadIO m, HasCallStack, MonadReader env m, HasLogFunc env) => Utf8Builder -> m ()

-- | Log a debug level message with the given source.
logDebugS :: (MonadIO m, MonadReader env m, HasLogFunc env, HasCallStack) => LogSource -> Utf8Builder -> m ()

-- | Log an info level message with the given source.
logInfoS :: (MonadIO m, MonadReader env m, HasLogFunc env, HasCallStack) => LogSource -> Utf8Builder -> m ()

-- | Log a warn level message with the given source.
logWarnS :: (MonadIO m, MonadReader env m, HasLogFunc env, HasCallStack) => LogSource -> Utf8Builder -> m ()

-- | Log an error level message with the given source.
logErrorS :: (MonadIO m, MonadReader env m, HasLogFunc env, HasCallStack) => LogSource -> Utf8Builder -> m ()

-- | Log a message with the specified textual level and the given source.
logOtherS :: (MonadIO m, MonadReader env m, HasLogFunc env, HasCallStack) => Text -> LogSource -> Utf8Builder -> m ()

-- | Generic, basic function for creating other logging functions.
logGeneric :: (MonadIO m, MonadReader env m, HasLogFunc env, HasCallStack) => LogSource -> LogLevel -> Utf8Builder -> m ()

-- | Create a <a>LogFunc</a> from the given function.
mkLogFunc :: (CallStack -> LogSource -> LogLevel -> Utf8Builder -> IO ()) -> LogFunc

-- | Create a <a>LogOptions</a> value which will store its data in memory.
--   This is primarily intended for testing purposes. This will return both
--   a <a>LogOptions</a> value and an <a>IORef</a> containing the resulting
--   <a>Builder</a> value.
--   
--   This will default to non-verbose settings and assume there is a
--   terminal attached. These assumptions can be overridden using the
--   appropriate <tt>set</tt> functions.
logOptionsMemory :: MonadIO m => m (IORef Builder, LogOptions)

-- | The log level of a message.
data LogLevel
LevelDebug :: LogLevel
LevelInfo :: LogLevel
LevelWarn :: LogLevel
LevelError :: LogLevel
LevelOther :: !Text -> LogLevel

-- | Where in the application a log message came from. Used for display
--   purposes only.
type LogSource = Text
data CallStack

-- | Convert a <a>CallStack</a> value into a <a>Utf8Builder</a> indicating
--   the first source location.
--   
--   TODO Consider showing the entire call stack instead.
displayCallStack :: CallStack -> Utf8Builder

-- | Disable logging capabilities in a given sub-routine
--   
--   Intended to skip logging in general purpose implementations, where
--   secrets might be logged accidently.
noLogging :: (HasLogFunc env, MonadReader env m) => m a -> m a

-- | Is the log func configured to use color output?
--   
--   Intended for use by code which wants to optionally add additional
--   color to its log messages.
logFuncUseColorL :: HasLogFunc env => SimpleGetter env Bool

-- | What color is the log func configured to use for each <a>LogLevel</a>?
--   
--   Intended for use by code which wants to optionally add additional
--   color to its log messages.
logFuncLogLevelColorsL :: HasLogFunc env => SimpleGetter env (LogLevel -> Utf8Builder)

-- | What color is the log func configured to use for secondary content?
--   
--   Intended for use by code which wants to optionally add additional
--   color to its log messages.
logFuncSecondaryColorL :: HasLogFunc env => SimpleGetter env Utf8Builder

-- | What accent colors, indexed by <a>Int</a>, is the log func configured
--   to use?
--   
--   Intended for use by code which wants to optionally add additional
--   color to its log messages.
logFuncAccentColorsL :: HasLogFunc env => SimpleGetter env (Int -> Utf8Builder)

-- | Log a value generically.
glog :: (MonadIO m, HasCallStack, HasGLogFunc env, MonadReader env m) => GMsg env -> m ()

-- | A generic logger of some type <tt>msg</tt>.
--   
--   Your <tt>GLocFunc</tt> can re-use the existing classical logging
--   framework of RIO, and/or implement additional transforms, filters.
--   Alternatively, you may log to a JSON source in a database, or anywhere
--   else as needed. You can decide how to log levels or severities based
--   on the constructors in your type. You will normally determine this in
--   your main app entry point.
data GLogFunc msg

-- | Make a <a>GLogFunc</a> via classic <a>LogFunc</a>. Use this if you'd
--   like to log your generic data type via the classic RIO terminal
--   logger.
gLogFuncClassic :: (HasLogLevel msg, HasLogSource msg, Display msg) => LogFunc -> GLogFunc msg

-- | Make a custom generic logger. With this you could, for example, write
--   to a database or a log digestion service. For example:
--   
--   <pre>
--   mkGLogFunc (\stack msg -&gt; send (Data.Aeson.encode (JsonLog stack msg)))
--   </pre>
mkGLogFunc :: (CallStack -> msg -> IO ()) -> GLogFunc msg

-- | A vesion of <a>contramapMaybeGLogFunc</a> which supports filering.
contramapMaybeGLogFunc :: (a -> Maybe b) -> GLogFunc b -> GLogFunc a

-- | A contramap. Use this to wrap sub-loggers via <a>mapRIO</a>.
--   
--   If you are on base &gt; 4.12.0, you can just use <a>contramap</a>.
contramapGLogFunc :: (a -> b) -> GLogFunc b -> GLogFunc a

-- | An app is capable of generic logging if it implements this.
class HasGLogFunc env where {
    type family GMsg env;
}
gLogFuncL :: HasGLogFunc env => Lens' env (GLogFunc (GMsg env))

-- | Level, if any, of your logs. If unknown, use <tt>LogOther</tt>. Use
--   for your generic log data types that want to sit inside the classic
--   log framework.
class HasLogLevel msg
getLogLevel :: HasLogLevel msg => msg -> LogLevel

-- | Source of a log. This can be whatever you want. Use for your generic
--   log data types that want to sit inside the classic log framework.
class HasLogSource msg
getLogSource :: HasLogSource msg => msg -> LogSource

-- | A builder of binary data, with the invariant that the underlying data
--   is supposed to be UTF-8 encoded.
newtype Utf8Builder
Utf8Builder :: Builder -> Utf8Builder
[getUtf8Builder] :: Utf8Builder -> Builder

-- | A typeclass for values which can be converted to a <a>Utf8Builder</a>.
--   The intention of this typeclass is to provide a human-friendly display
--   of the data.
class Display a
display :: Display a => a -> Utf8Builder

-- | Display data as <a>Text</a>, which will also be used for
--   <a>display</a> if it is not overriden.
textDisplay :: Display a => a -> Text

-- | Use the <a>Show</a> instance for a value to convert it to a
--   <a>Utf8Builder</a>.
displayShow :: Show a => a -> Utf8Builder

-- | Convert a <a>Utf8Builder</a> value into a strict <a>Text</a>.
utf8BuilderToText :: Utf8Builder -> Text

-- | Convert a <a>Utf8Builder</a> value into a lazy <a>Text</a>.
utf8BuilderToLazyText :: Utf8Builder -> Text

-- | Convert a <a>ByteString</a> into a <a>Utf8Builder</a>.
--   
--   <i>NOTE</i> This function performs no checks to ensure that the data
--   is, in fact, UTF8 encoded. If you provide non-UTF8 data, later
--   functions may fail.
displayBytesUtf8 :: ByteString -> Utf8Builder

-- | Write the given <a>Utf8Builder</a> value to a file.
writeFileUtf8Builder :: MonadIO m => FilePath -> Utf8Builder -> m ()

-- | <a>view</a> is a synonym for (<a>^.</a>), generalised for
--   <a>MonadReader</a> (we are able to use it instead of (<a>^.</a>) since
--   functions are instances of the <a>MonadReader</a> class):
--   
--   <pre>
--   &gt;&gt;&gt; view _1 (1, 2)
--   1
--   </pre>
--   
--   When you're using <a>Reader</a> for config and your config type has
--   lenses generated for it, most of the time you'll be using <a>view</a>
--   instead of <a>asks</a>:
--   
--   <pre>
--   doSomething :: (<a>MonadReader</a> Config m) =&gt; m Int
--   doSomething = do
--     thingy        &lt;- <a>view</a> setting1  -- same as “<a>asks</a> (<a>^.</a> setting1)”
--     anotherThingy &lt;- <a>view</a> setting2
--     ...
--   </pre>
view :: MonadReader s m => Getting a s a -> m a

-- | <a>preview</a> is a synonym for (<a>^?</a>), generalised for
--   <a>MonadReader</a> (just like <a>view</a>, which is a synonym for
--   (<a>^.</a>)).
--   
--   <pre>
--   &gt;&gt;&gt; preview each [1..5]
--   Just 1
--   </pre>
preview :: MonadReader s m => Getting (First a) s a -> m (Maybe a)

-- | <tt>ASetter s t a b</tt> is something that turns a function modifying
--   a value into a function modifying a <i>structure</i>. If you ignore
--   <a>Identity</a> (as <tt>Identity a</tt> is the same thing as
--   <tt>a</tt>), the type is:
--   
--   <pre>
--   type ASetter s t a b = (a -&gt; b) -&gt; s -&gt; t
--   </pre>
--   
--   The reason <a>Identity</a> is used here is for <a>ASetter</a> to be
--   composable with other types, such as <a>Lens</a>.
--   
--                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                             