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


-- | A framework for packaging Haskell software
°5u
°5uThe Haskell Common Architecture for Building Applications and
°5uLibraries: a framework defining a common interface for authors to more
°5ueasily build their Haskell applications in a portable way.
°5u
°5uThe Haskell Cabal is part of a larger infrastructure for distributing,
°5uorganizing, and cataloging Haskell libraries and tools.
@package Cabal
@version 2.1.0.0

module Distribution.Compat.Binary
decodeOrFailIO :: Binary a => ByteString -> IO (Either String a)

-- | Lazily reconstruct a value previously written to a file.
decodeFileOrFail' :: Binary a => FilePath -> IO (Either String a)

module Distribution.Compat.Exception
catchIO :: IO a -> (IOException -> IO a) -> IO a
catchExit :: IO a -> (ExitCode -> IO a) -> IO a
tryIO :: IO a -> IO (Either IOException a)

-- | Render this exception value in a human-friendly manner.
°5u
°5uDefault implementation: <tt><a>show</a></tt>.
displayException :: Exception e => e -> String

module Distribution.Compat.Map.Strict


-- | Per Conor McBride, the <a>Newtype</a> typeclass represents the packing
°5uand unpacking of a newtype, and allows you to operatate under that
°5unewtype with functions such as <a>ala</a>.
module Distribution.Compat.Newtype

-- | The <tt>FunctionalDependencies</tt> version of <a>Newtype</a>
°5utype-class.
°5u
°5u<i>Note:</i> for actual newtypes the implementation can be <tt>pack =
°5ucoerce; unpack = coerce</tt>. We don't have default implementation,
°5ubecause <tt>Cabal</tt> have to support older than <tt>base &gt;=
°5u4.7</tt> compilers. Also, <a>Newtype</a> could witness a
°5unon-structural isomorphism.
class Newtype n o | n -> o
pack :: Newtype n o => o -> n
unpack :: Newtype n o => n -> o

-- | <pre>
°5u&gt;&gt;&gt; ala Sum foldMap [1, 2, 3, 4 :: Int]
°5u10
°5u</pre>
°5u
°5u<i>Note:</i> the user supplied function for the newtype is
°5u<i>ignored</i>.
°5u
°5u<pre>
°5u&gt;&gt;&gt; ala (Sum . (+1)) foldMap [1, 2, 3, 4 :: Int]
°5u10
°5u</pre>
ala :: (Newtype n o, Newtype n' o') => (o -> n) -> ((o -> n) -> b -> n') -> (b -> o')

-- | <pre>
°5u&gt;&gt;&gt; alaf Sum foldMap length ["cabal", "install"]
°5u12
°5u</pre>
°5u
°5u<i>Note:</i> as with <a>ala</a>, the user supplied function for the
°5unewtype is <i>ignored</i>.
alaf :: (Newtype n o, Newtype n' o') => (o -> n) -> ((a -> n) -> b -> n') -> (a -> o) -> (b -> o')

-- | Variant of <a>pack</a>, which takes a phantom type.
pack' :: Newtype n o => (o -> n) -> o -> n

-- | Variant of <a>pack</a>, which takes a phantom type.
unpack' :: Newtype n o => (o -> n) -> n -> o
instance Distribution.Compat.Newtype.Newtype (Data.Functor.Identity.Identity a) a
instance Distribution.Compat.Newtype.Newtype (Data.Semigroup.Internal.Sum a) a
instance Distribution.Compat.Newtype.Newtype (Data.Semigroup.Internal.Product a) a
instance Distribution.Compat.Newtype.Newtype (Data.Semigroup.Internal.Endo a) (a -> a)


-- | Compatibility layer for <a>Data.Semigroup</a>
module Distribution.Compat.Semigroup

-- | The class of semigroups (types with an associative binary operation).
°5u
°5uInstances should satisfy the associativity law:
°5u
°5u<ul>
°5u<li><pre>x <a>&lt;&gt;</a> (y <a>&lt;&gt;</a> z) = (x <a>&lt;&gt;</a>
°5uy) <a>&lt;&gt;</a> z</pre></li>
°5u</ul>
class Semigroup a

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

-- | The class of monoids (types with an associative binary operation that
°5uhas an identity). Instances should satisfy the following laws:
°5u
°5u<ul>
°5u<li><pre>x <a>&lt;&gt;</a> <a>mempty</a> = x</pre></li>
°5u<li><pre><a>mempty</a> <a>&lt;&gt;</a> x = x</pre></li>
°5u<li><tt>x <a>&lt;&gt;</a> (y <a>&lt;&gt;</a> z) = (x <a>&lt;&gt;</a>
°5uy) <a>&lt;&gt;</a> z</tt> (<a>Semigroup</a> law)</li>
°5u<li><pre><a>mconcat</a> = <a>foldr</a> '(&lt;&gt;)'
°5u<a>mempty</a></pre></li>
°5u</ul>
°5u
°5uThe method names refer to the monoid of lists under concatenation, but
°5uthere are many other instances.
°5u
°5uSome types can be viewed as a monoid in more than one way, e.g. both
°5uaddition and multiplication on numbers. In such cases we often define
°5u<tt>newtype</tt>s and make those instances of <a>Monoid</a>, e.g.
°5u<tt>Sum</tt> and <tt>Product</tt>.
°5u
°5u<b>NOTE</b>: <a>Semigroup</a> is a superclass of <a>Monoid</a> since
°5u<i>base-4.11.0.0</i>.
class Semigroup a => Monoid a

-- | Identity of <a>mappend</a>
mempty :: Monoid a => a

-- | An associative operation
°5u
°5u<b>NOTE</b>: This method is redundant and has the default
°5uimplementation <tt><a>mappend</a> = '(&lt;&gt;)'</tt> since
°5u<i>base-4.11.0.0</i>.
mappend :: Monoid a => a -> a -> a

-- | Fold a list using the monoid.
°5u
°5uFor most types, the default definition for <a>mconcat</a> will be
°5uused, but the function is included in the class definition so that an
°5uoptimized version can be provided for specific types.
mconcat :: Monoid a => [a] -> a

-- | Boolean monoid under conjunction (<a>&amp;&amp;</a>).
°5u
°5u<pre>
°5u&gt;&gt;&gt; getAll (All True &lt;&gt; mempty &lt;&gt; All False)
°5uFalse
°5u</pre>
°5u
°5u<pre>
°5u&gt;&gt;&gt; getAll (mconcat (map (\x -&gt; All (even x)) [2,4,6,7,8]))
°5uFalse
°5u</pre>
newtype All
All :: Bool -> All
[getAll] :: All -> Bool

-- | Boolean monoid under disjunction (<a>||</a>).
°5u
°5u<pre>
°5u&gt;&gt;&gt; getAny (Any True &lt;&gt; mempty &lt;&gt; Any False)
°5uTrue
°5u</pre>
°5u
°5u<pre>
°5u&gt;&gt;&gt; getAny (mconcat (map (\x -&gt; Any (even x)) [2,4,6,7,8]))
°5uTrue
°5u</pre>
newtype Any
Any :: Bool -> Any
[getAny] :: Any -> Bool

-- | Cabal's own <a>Last</a> copy to avoid requiring an orphan
°5u<a>Binary</a> instance.
°5u
°5uOnce the oldest <tt>binary</tt> version we support provides a
°5u<a>Binary</a> instance for <a>Last</a> we can remove this one here.
°5u
°5uNB: <a>Last</a> is defined differently and not a <a>Monoid</a>
newtype Last' a
Last' :: Maybe a -> Last' a
[getLast'] :: Last' a -> Maybe a

-- | Generically generate a <a>Semigroup</a> (<a>&lt;&gt;</a>) operation
°5ufor any type implementing <a>Generic</a>. This operation will append
°5utwo values by point-wise appending their component fields. It is only
°5udefined for product types.
°5u
°5u<pre>
°5u<a>gmappend</a> a (<a>gmappend</a> b c) = <a>gmappend</a> (<a>gmappend</a> a b) c
°5u</pre>
gmappend :: (Generic a, GSemigroup (Rep a)) => a -> a -> a

-- | Generically generate a <a>Monoid</a> <a>mempty</a> for any
°5uproduct-like type implementing <a>Generic</a>.
°5u
°5uIt is only defined for product types.
°5u
°5u<pre>
°5u<a>gmappend</a> <a>gmempty</a> a = a = <a>gmappend</a> a <a>gmempty</a>
°5u</pre>
gmempty :: (Generic a, GMonoid (Rep a)) => a
instance GHC.Generics.Generic (Distribution.Compat.Semigroup.Last' a)
instance GHC.Base.Applicative Distribution.Compat.Semigroup.Last'
instance GHC.Base.Functor Distribution.Compat.Semigroup.Last'
instance Data.Binary.Class.Binary a => Data.Binary.Class.Binary (Distribution.Compat.Semigroup.Last' a)
instance GHC.Show.Show a => GHC.Show.Show (Distribution.Compat.Semigroup.Last' a)
instance GHC.Read.Read a => GHC.Read.Read (Distribution.Compat.Semigroup.Last' a)
instance GHC.Classes.Ord a => GHC.Classes.Ord (Distribution.Compat.Semigroup.Last' a)
instance GHC.Classes.Eq a => GHC.Classes.Eq (Distribution.Compat.Semigroup.Last' a)
instance (GHC.Base.Semigroup a, GHC.Base.Monoid a) => Distribution.Compat.Semigroup.GMonoid (GHC.Generics.K1 i a)
instance Distribution.Compat.Semigroup.GMonoid f => Distribution.Compat.Semigroup.GMonoid (GHC.Generics.M1 i c f)
instance (Distribution.Compat.Semigroup.GMonoid f, Distribution.Compat.Semigroup.GMonoid g) => Distribution.Compat.Semigroup.GMonoid (f GHC.Generics.:*: g)
instance GHC.Base.Semigroup a => Distribution.Compat.Semigroup.GSemigroup (GHC.Generics.K1 i a)
instance Distribution.Compat.Semigroup.GSemigroup f => Distribution.Compat.Semigroup.GSemigroup (GHC.Generics.M1 i c f)
instance (Distribution.Compat.Semigroup.GSemigroup f, Distribution.Compat.Semigroup.GSemigroup g) => Distribution.Compat.Semigroup.GSemigroup (f GHC.Generics.:*: g)
instance GHC.Base.Semigroup (Distribution.Compat.Semigroup.Last' a)
instance GHC.Base.Monoid (Distribution.Compat.Semigroup.Last' a)

module Distribution.Compat.Stack
type WithCallStack a = HasCallStack => a

-- | <a>CallStack</a>s are a lightweight method of obtaining a partial
°5ucall-stack at any point in the program.
°5u
°5uA function can request its call-site with the <a>HasCallStack</a>
°5uconstraint. For example, we can define
°5u
°5u<pre>
°5uputStrLnWithCallStack :: HasCallStack =&gt; String -&gt; IO ()
°5u</pre>
°5u
°5uas a variant of <tt>putStrLn</tt> that will get its call-site and
°5uprint it, along with the string given as argument. We can access the
°5ucall-stack inside <tt>putStrLnWithCallStack</tt> with
°5u<a>callStack</a>.
°5u
°5u<pre>
°5uputStrLnWithCallStack :: HasCallStack =&gt; String -&gt; IO ()
°5uputStrLnWithCallStack msg = do
°5u  putStrLn msg
°5u  putStrLn (prettyCallStack callStack)
°5u</pre>
°5u
°5uThus, if we call <tt>putStrLnWithCallStack</tt> we will get a
°5uformatted call-stack alongside our string.
°5u
°5u<pre>
°5u&gt;&gt;&gt; putStrLnWithCallStack "hello"
°5uhello
°5uCallStack (from HasCallStack):
°5u  putStrLnWithCallStack, called at &lt;interactive&gt;:2:1 in interactive:Ghci1
°5u</pre>
°5u
°5uGHC solves <a>HasCallStack</a> constraints in three steps:
°5u
°5u<ol>
°5u<li>If there is a <a>CallStack</a> in scope -- i.e. the enclosing
°5ufunction has a <a>HasCallStack</a> constraint -- GHC will append the
°5unew call-site to the existing <a>CallStack</a>.</li>
°5u<li>If there is no <a>CallStack</a> in scope -- e.g. in the GHCi
°5usession above -- and the enclosing definition does not have an
°5uexplicit type signature, GHC will infer a <a>HasCallStack</a>
°5uconstraint for the enclosing definition (subject to the monomorphism
°5urestriction).</li>
°5u<li>If there is no <a>CallStack</a> in scope and the enclosing
°5udefinition has an explicit type signature, GHC will solve the
°5u<a>HasCallStack</a> constraint for the singleton <a>CallStack</a>
°5ucontaining just the current call-site.</li>
°5u</ol>
°5u
°5u<a>CallStack</a>s do not interact with the RTS and do not require
°5ucompilation with <tt>-prof</tt>. On the other hand, as they are built
°5uup explicitly via the <a>HasCallStack</a> constraints, they will
°5ugenerally not contain as much information as the simulated call-stacks
°5umaintained by the RTS.
°5u
°5uA <a>CallStack</a> is a <tt>[(String, SrcLoc)]</tt>. The
°5u<tt>String</tt> is the name of function that was called, the
°5u<a>SrcLoc</a> is the call-site. The list is ordered with the most
°5urecently called function at the head.
°5u
°5uNOTE: The intrepid user may notice that <a>HasCallStack</a> is just an
°5ualias for an implicit parameter <tt>?callStack :: CallStack</tt>. This
°5uis an implementation detail and <b>should not</b> be considered part
°5uof the <a>CallStack</a> API, we may decide to change the
°5uimplementation in the future.
data CallStack

-- | This function is for when you *really* want to add a call stack to
°5uraised IO, but you don't have a <a>Verbosity</a> so you can't use
°5u<a>annotateIO</a>. If you have a <tt>Verbosity</tt>, please use that
°5ufunction instead.
annotateCallStackIO :: WithCallStack (IO a -> IO a)

-- | Perform some computation without adding new entries to the
°5u<a>CallStack</a>.
withFrozenCallStack :: HasCallStack => HasCallStack -> a -> a
withLexicalCallStack :: (a -> WithCallStack (IO b)) -> WithCallStack (a -> IO b)

-- | Return the current <a>CallStack</a>.
°5u
°5uDoes *not* include the call-site of <a>callStack</a>.
callStack :: HasCallStack -> CallStack

-- | Pretty print a <a>CallStack</a>.
prettyCallStack :: CallStack -> String

-- | Give the *parent* of the person who invoked this; so it's most
°5usuitable for being called from a utility function. You probably want
°5uto call this using <a>withFrozenCallStack</a>; otherwise it's not very
°5uuseful. We didn't implement this for base-4.8.1 because we cannot rely
°5uon freezing to have taken place.
parentSrcLocPrefix :: WithCallStack String


-- | This is a library of parser combinators, originally written by Koen
°5uClaessen. It parses all alternatives in parallel, so it never keeps
°5uhold of the beginning of the input string, a common source of space
°5uleaks with other parsers. The '(+++)' choice combinator is genuinely
°5ucommutative; it makes no difference which branch is "shorter".
°5u
°5uSee also Koen's paper <i>Parallel Parsing Processes</i>
°5u(<a>http://citeseerx.ist.psu.edu/viewdoc/summary?doi=10.1.1.19.9217</a>).
°5u
°5uThis version of ReadP has been locally hacked to make it H98, by
°5uMartin Sjögren <a>mailto:msjogren@gmail.com</a>
°5u
°5uThe unit tests have been moved to UnitTest.Distribution.Compat.ReadP,
°5uby Mark Lentczner <a>mailto:mark@glyphic.com</a>
module Distribution.Compat.ReadP
type ReadP r a = Parser r Char a

-- | Consumes and returns the next character. Fails if there is no input
°5uleft.
get :: ReadP r Char

-- | Look-ahead: returns the part of the input that is left, without
°5uconsuming it.
look :: ReadP r String

-- | Symmetric choice.
(+++) :: ReadP r a -> ReadP r a -> ReadP r a
infixr 5 +++

-- | Local, exclusive, left-biased choice: If left parser locally produces
°5uany result at all, then right parser is not used.
(<++) :: ReadP a a -> ReadP r a -> ReadP r a
infixr 5 <++

-- | Transforms a parser into one that does the same, but in addition
°5ureturns the exact characters read. IMPORTANT NOTE: <a>gather</a> gives
°5ua runtime error if its first argument is built using any occurrences
°5uof readS_to_P.
gather :: ReadP (String -> P Char r) a -> ReadP r (String, a)

-- | Always fails.
pfail :: ReadP r a

-- | Succeeds iff we are at the end of input
eof :: ReadP r ()

-- | Consumes and returns the next character, if it satisfies the specified
°5upredicate.
satisfy :: (Char -> Bool) -> ReadP r Char

-- | Parses and returns the specified character.
char :: Char -> ReadP r Char

-- | Parses and returns the specified string.
string :: String -> ReadP r String

-- | Parses the first zero or more characters satisfying the predicate.
munch :: (Char -> Bool) -> ReadP r String

-- | Parses the first one or more characters satisfying the predicate.
munch1 :: (Char -> Bool) -> ReadP r String

-- | Skips all whitespace.
skipSpaces :: ReadP r ()

-- | Like <a>skipSpaces</a> but succeeds only if there is at least one
°5uwhitespace character to skip.
skipSpaces1 :: ReadP r ()

-- | Combines all parsers in the specified list.
choice :: [ReadP r a] -> ReadP r a

-- | <tt> count n p </tt> parses <tt>n</tt> occurrences of <tt>p</tt> in
°5usequence. A list of results is returned.
count :: Int -> ReadP r a -> ReadP r [a]

-- | <tt> between open close p </tt> parses <tt>open</tt>, followed by
°5u<tt>p</tt> and finally <tt>close</tt>. Only the value of <tt>p</tt> is
°5ureturned.
between :: ReadP r open -> ReadP r close -> ReadP r a -> ReadP r a

-- | <tt>option x p</tt> will either parse <tt>p</tt> or return <tt>x</tt>
°5uwithout consuming any input.
option :: a -> ReadP r a -> ReadP r a

-- | <tt>optional p</tt> optionally parses <tt>p</tt> and always returns
°5u<tt>()</tt>.
optional :: ReadP r a -> ReadP r ()

-- | Parses zero or more occurrences of the given parser.
many :: ReadP r a -> ReadP r [a]

-- | Parses one or more occurrences of the given parser.
many1 :: ReadP r a -> ReadP r [a]

-- | Like <a>many</a>, but discards the result.
skipMany :: ReadP r a -> ReadP r ()

-- | Like <a>many1</a>, but discards the result.
skipMany1 :: ReadP r a -> ReadP r ()

-- | <tt>sepBy p sep</tt> parses zero or more occurrences of <tt>p</tt>,
°5useparated by <tt>sep</tt>. Returns a list of values returned by
°5u<tt>p</tt>.
sepBy :: ReadP r a -> ReadP r sep -> ReadP r [a]

-- | <tt>sepBy1 p sep</tt> parses one or more occurrences of <tt>p</tt>,
°5useparated by <tt>sep</tt>. Returns a list of values returned by
°5u<tt>p</tt>.
sepBy1 :: ReadP r a -> ReadP r sep -> ReadP r [a]

-- | <tt>endBy p sep</tt> parses zero or more occurrences of <tt>p</tt>,
°5useparated and ended by <tt>sep</tt>.
endBy :: ReadP r a -> ReadP r sep -> ReadP r [a]

-- | <tt>endBy p sep</tt> parses one or more occurrences of <tt>p</tt>,
°5useparated and ended by <tt>sep</tt>.
endBy1 :: ReadP r a -> ReadP r sep -> ReadP r [a]

-- | <tt>chainr p op x</tt> parses zero or more occurrences of <tt>p</tt>,
°5useparated by <tt>op</tt>. Returns a value produced by a <i>right</i>
°5uassociative application of all functions returned by <tt>op</tt>. If
°5uthere are no occurrences of <tt>p</tt>, <tt>x</tt> is returned.
chainr :: ReadP r a -> ReadP r (a -> a -> a) -> a -> ReadP r a

-- | <tt>chainl p op x</tt> parses zero or more occurrences of <tt>p</tt>,
°5useparated by <tt>op</tt>. Returns a value produced by a <i>left</i>
°5uassociative application of all functions returned by <tt>op</tt>. If
°5uthere are no occurrences of <tt>p</tt>, <tt>x</tt> is returned.
chainl :: ReadP r a -> ReadP r (a -> a -> a) -> a -> ReadP r a

-- | Like <a>chainl</a>, but parses one or more occurrences of <tt>p</tt>.
chainl1 :: ReadP r a -> ReadP r (a -> a -> a) -> ReadP r a

-- | Like <a>chainr</a>, but parses one or more occurrences of <tt>p</tt>.
chainr1 :: ReadP r a -> ReadP r (a -> a -> a) -> ReadP r a

-- | <tt>manyTill p end</tt> parses zero or more occurrences of <tt>p</tt>,
°5uuntil <tt>end</tt> succeeds. Returns a list of values returned by
°5u<tt>p</tt>.
manyTill :: ReadP r a -> ReadP [a] end -> ReadP r [a]

-- | A parser for a type <tt>a</tt>, represented as a function that takes a
°5u<a>String</a> and returns a list of possible parses as
°5u<tt>(a,<a>String</a>)</tt> pairs.
°5u
°5uNote that this kind of backtracking parser is very inefficient;
°5ureading a large structure may be quite slow (cf <a>ReadP</a>).
type ReadS a = String -> [(a, String)]

-- | Converts a parser into a Haskell ReadS-style function. This is the
°5umain way in which you can "run" a <a>ReadP</a> parser: the expanded
°5utype is <tt> readP_to_S :: ReadP a -&gt; String -&gt; [(a,String)]
°5u</tt>
readP_to_S :: ReadP a a -> ReadS a

-- | Converts a Haskell ReadS-style function into a parser. Warning: This
°5uintroduces local backtracking in the resulting parser, and therefore a
°5upossible inefficiency.
readS_to_P :: ReadS a -> ReadP r a
data Parser r s a
instance GHC.Base.Functor (Distribution.Compat.ReadP.Parser r s)
instance GHC.Base.Applicative (Distribution.Compat.ReadP.Parser r s)
instance (s ~ GHC.Types.Char) => GHC.Base.Alternative (Distribution.Compat.ReadP.Parser r s)
instance GHC.Base.Monad (Distribution.Compat.ReadP.Parser r s)
instance Control.Monad.Fail.MonadFail (Distribution.Compat.ReadP.Parser r s)
instance (s ~ GHC.Types.Char) => GHC.Base.MonadPlus (Distribution.Compat.ReadP.Parser r s)
instance GHC.Base.Functor (Distribution.Compat.ReadP.P s)
instance GHC.Base.Applicative (Distribution.Compat.ReadP.P s)
instance GHC.Base.Monad (Distribution.Compat.ReadP.P s)
instance Control.Monad.Fail.MonadFail (Distribution.Compat.ReadP.P s)
instance GHC.Base.Alternative (Distribution.Compat.ReadP.P s)
instance GHC.Base.MonadPlus (Distribution.Compat.ReadP.P s)


-- | This module re-exports the non-exposed
°5u<a>Distribution.Compat.Prelude</a> module for reuse by
°5u<tt>cabal-install</tt>'s <a>Distribution.Client.Compat.Prelude</a>
°5umodule.
°5u
°5uIt is highly discouraged to rely on this module for <tt>Setup.hs</tt>
°5uscripts since its API is <i>not</i> stable.

-- | <i>Warning: This modules' API is not stable. Use at your own risk, or
°5ubetter yet, use <tt>base-compat</tt>!</i>
module Distribution.Compat.Prelude.Internal

-- | Append two lists, i.e.,
°5u
°5u<pre>
°5u[x1, ..., xm] ++ [y1, ..., yn] == [x1, ..., xm, y1, ..., yn]
°5u[x1, ..., xm] ++ [y1, ...] == [x1, ..., xm, y1, ...]
°5u</pre>
°5u
°5uIf the first list is not finite, the result is the first list.
(++) :: () => [a] -> [a] -> [a]
infixr 5 ++
seq :: () => a -> b -> b

-- | <a>filter</a>, applied to a predicate and a list, returns the list of
°5uthose elements that satisfy the predicate; i.e.,
°5u
°5u<pre>
°5ufilter p xs = [ x | x &lt;- xs, p x]
°5u</pre>
filter :: () => a -> Bool -> [a] -> [a]

-- | <a>zip</a> takes two lists and returns a list of corresponding pairs.
°5uIf one input list is short, excess elements of the longer list are
°5udiscarded.
°5u
°5u<a>zip</a> is right-lazy:
°5u
°5u<pre>
°5uzip [] _|_ = []
°5u</pre>
zip :: () => [a] -> [b] -> [(a, b)]

-- | The <a>print</a> function outputs a value of any printable type to the
°5ustandard output device. Printable types are those that are instances
°5uof class <a>Show</a>; <a>print</a> converts values to strings for
°5uoutput using the <a>show</a> operation and adds a newline.
°5u
°5uFor example, a program to print the first 20 integers and their powers
°5uof 2 could be written as:
°5u
°5u<pre>
°5umain = print ([(n, 2^n) | n &lt;- [0..19]])
°5u</pre>
print :: Show a => a -> IO ()

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

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

-- | <a>otherwise</a> is defined as the value <a>True</a>. It helps to make
°5uguards more readable. eg.
°5u
°5u<pre>
°5uf x | x &lt; 0     = ...
°5u    | otherwise = ...
°5u</pre>
otherwise :: Bool

-- | <a>map</a> <tt>f xs</tt> is the list obtained by applying <tt>f</tt>
°5uto each element of <tt>xs</tt>, i.e.,
°5u
°5u<pre>
°5umap f [x1, x2, ..., xn] == [f x1, f x2, ..., f xn]
°5umap f [x1, x2, ...] == [f x1, f x2, ...]
°5u</pre>
map :: () => a -> b -> [a] -> [b]

-- | Application operator. This operator is redundant, since ordinary
°5uapplication <tt>(f x)</tt> means the same as <tt>(f <a>$</a> x)</tt>.
°5uHowever, <a>$</a> has low, right-associative binding precedence, so it
°5usometimes allows parentheses to be omitted; for example:
°5u
°5u<pre>
°5uf $ g $ h x  =  f (g (h x))
°5u</pre>
°5u
°5uIt is also useful in higher-order situations, such as <tt><a>map</a>
°5u(<a>$</a> 0) xs</tt>, or <tt><a>zipWith</a> (<a>$</a>) fs xs</tt>.
($) :: () => a -> b -> a -> b
infixr 0 $

-- | general coercion from integral types
fromIntegral :: (Integral a, Num b) => a -> b

-- | general coercion to fractional types
realToFrac :: (Real a, Fractional b) => a -> b

-- | The <a>Bounded</a> class is used to name the upper and lower limits of
°5ua type. <a>Ord</a> is not a superclass of <a>Bounded</a> since types
°5uthat are not totally ordered may also have upper and lower bounds.
°5u
°5uThe <a>Bounded</a> class may be derived for any enumeration type;
°5u<a>minBound</a> is the first constructor listed in the <tt>data</tt>
°5udeclaration and <a>maxBound</a> is the last. <a>Bounded</a> may also
°5ube derived for single-constructor datatypes whose constituent types
°5uare in <a>Bounded</a>.
class Bounded a
minBound :: Bounded a => a
maxBound :: Bounded a => a

-- | Class <a>Enum</a> defines operations on sequentially ordered types.
°5u
°5uThe <tt>enumFrom</tt>... methods are used in Haskell's translation of
°5uarithmetic sequences.
°5u
°5uInstances of <a>Enum</a> may be derived for any enumeration type
°5u(types whose constructors have no fields). The nullary constructors
°5uare assumed to be numbered left-to-right by <a>fromEnum</a> from
°5u<tt>0</tt> through <tt>n-1</tt>. See Chapter 10 of the <i>Haskell
°5uReport</i> for more details.
°5u
°5uFor any type that is an instance of class <a>Bounded</a> as well as
°5u<a>Enum</a>, the following should hold:
°5u
°5u<ul>
°5u<li>The calls <tt><a>succ</a> <a>maxBound</a></tt> and <tt><a>pred</a>
°5u<a>minBound</a></tt> should result in a runtime error.</li>
°5u<li><a>fromEnum</a> and <a>toEnum</a> should give a runtime error if
°5uthe result value is not representable in the result type. For example,
°5u<tt><a>toEnum</a> 7 :: <a>Bool</a></tt> is an error.</li>
°5u<li><a>enumFrom</a> and <a>enumFromThen</a> should be defined with an
°5uimplicit bound, thus:</li>
°5u</ul>
°5u
°5u<pre>
°5uenumFrom     x   = enumFromTo     x maxBound
°5uenumFromThen x y = enumFromThenTo x y bound
°5u  where
°5u    bound | fromEnum y &gt;= fromEnum x = maxBound
°5u          | otherwise                = minBound
°5u</pre>
class Enum a

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

-- | the predecessor of a value. For numeric types, <a>pred</a> subtracts
°5u1.
pred :: Enum a => a -> a

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

-- | Convert to an <a>Int</a>. It is implementation-dependent what
°5u<a>fromEnum</a> returns when applied to a value that is too large to
°5ufit in an <a>Int</a>.
fromEnum :: Enum a => a -> Int

-- | Used in Haskell's translation of <tt>[n..]</tt>.
enumFrom :: Enum a => a -> [a]

-- | Used in Haskell's translation of <tt>[n,n'..]</tt>.
enumFromThen :: Enum a => a -> a -> [a]

-- | Used in Haskell's translation of <tt>[n..m]</tt>.
enumFromTo :: Enum a => a -> a -> [a]

-- | Used in Haskell's translation of <tt>[n,n'..m]</tt>.
enumFromThenTo :: Enum a => a -> a -> a -> [a]
class Eq a
(==) :: Eq a => a -> a -> Bool
(/=) :: Eq a => a -> a -> Bool

-- | Trigonometric and hyperbolic functions and related functions.
class Fractional a => Floating a
pi :: Floating a => a
exp :: Floating a => a -> a
log :: Floating a => a -> a
sqrt :: Floating a => a -> a
(**) :: Floating a => a -> a -> a
logBase :: Floating a => a -> a -> a
sin :: Floating a => a -> a
cos :: Floating a => a -> a
tan :: Floating a => a -> a
asin :: Floating a => a -> a
acos :: Floating a => a -> a
atan :: Floating a => a -> a
sinh :: Floating a => a -> a
cosh :: Floating a => a -> a
tanh :: Floating a => a -> a
asinh :: Floating a => a -> a
acosh :: Floating a => a -> a
atanh :: Floating a => a -> a

-- | Fractional numbers, supporting real division.
class Num a => Fractional a

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

-- | reciprocal fraction
recip :: Fractional a => a -> a

-- | Conversion from a <a>Rational</a> (that is <tt><a>Ratio</a>
°5u<a>Integer</a></tt>). A floating literal stands for an application of
°5u<a>fromRational</a> to a value of type <a>Rational</a>, so such
°5uliterals have type <tt>(<a>Fractional</a> a) =&gt; a</tt>.
fromRational :: Fractional a => Rational -> a

-- | Integral numbers, supporting integer division.
class (Real a, Enum a) => Integral a

-- | integer division truncated toward zero
quot :: Integral a => a -> a -> a

-- | integer remainder, satisfying
°5u
°5u<pre>
°5u(x `quot` y)*y + (x `rem` y) == x
°5u</pre>
rem :: Integral a => a -> a -> a

-- | integer division truncated toward negative infinity
div :: Integral a => a -> a -> a

-- | integer modulus, satisfying
°5u
°5u<pre>
°5u(x `div` y)*y + (x `mod` y) == x
°5u</pre>
mod :: Integral a => a -> a -> a

-- | simultaneous <a>quot</a> and <a>rem</a>
quotRem :: Integral a => a -> a -> (a, a)

-- | simultaneous <a>div</a> and <a>mod</a>
divMod :: Integral a => a -> a -> (a, a)

-- | conversion to <a>Integer</a>
toInteger :: Integral a => a -> Integer

-- | The <a>Monad</a> class defines the basic operations over a
°5u<i>monad</i>, a concept from a branch of mathematics known as
°5u<i>category theory</i>. From the perspective of a Haskell programmer,
°5uhowever, it is best to think of a monad as an <i>abstract datatype</i>
°5uof actions. Haskell's <tt>do</tt> expressions provide a convenient
°5usyntax for writing monadic expressions.
°5u
°5uInstances of <a>Monad</a> should satisfy the following laws:
°5u
°5u<ul>
°5u<li><pre><a>return</a> a <a>&gt;&gt;=</a> k = k a</pre></li>
°5u<li><pre>m <a>&gt;&gt;=</a> <a>return</a> = m</pre></li>
°5u<li><pre>m <a>&gt;&gt;=</a> (\x -&gt; k x <a>&gt;&gt;=</a> h) = (m
°5u<a>&gt;&gt;=</a> k) <a>&gt;&gt;=</a> h</pre></li>
°5u</ul>
°5u
°5uFurthermore, the <a>Monad</a> and <a>Applicative</a> operations should
°5urelate as follows:
°5u
°5u<ul>
°5u<li><pre><a>pure</a> = <a>return</a></pre></li>
°5u<li><pre>(<a>&lt;*&gt;</a>) = <a>ap</a></pre></li>
°5u</ul>
°5u
°5uThe above laws imply:
°5u
°5u<ul>
°5u<li><pre><a>fmap</a> f xs = xs <a>&gt;&gt;=</a> <a>return</a> .
°5uf</pre></li>
°5u<li><pre>(<a>&gt;&gt;</a>) = (<a>*&gt;</a>)</pre></li>
°5u</ul>
°5u
°5uand that <a>pure</a> and (<a>&lt;*&gt;</a>) satisfy the applicative
°5ufunctor laws.
°5u
°5uThe instances of <a>Monad</a> for lists, <a>Maybe</a> and <a>IO</a>
°5udefined in the <a>Prelude</a> satisfy these laws.
class Applicative m => Monad (m :: * -> *)

-- | Sequentially compose two actions, passing any value produced by the
°5ufirst as an argument to the second.
(>>=) :: Monad m => m a -> a -> m b -> m b

-- | Sequentially compose two actions, discarding any value produced by the
°5ufirst, like sequencing operators (such as the semicolon) in imperative
°5ulanguages.
(>>) :: Monad m => m a -> m b -> m b

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

-- | Fail with a message. This operation is not part of the mathematical
°5udefinition of a monad, but is invoked on pattern-match failure in a
°5u<tt>do</tt> expression.
°5u
°5uAs part of the MonadFail proposal (MFP), this function is moved to its
°5uown class <tt>MonadFail</tt> (see <a>Control.Monad.Fail</a> for more
°5udetails). The definition here will be removed in a future release.
fail :: Monad m => String -> m a

-- | The <a>Functor</a> class is used for types that can be mapped over.
°5uInstances of <a>Functor</a> should satisfy the following laws:
°5u
°5u<pre>
°5ufmap id  ==  id
°5ufmap (f . g)  ==  fmap f . fmap g
°5u</pre>
°5u
°5uThe instances of <a>Functor</a> for lists, <a>Maybe</a> and <a>IO</a>
°5usatisfy these laws.
class Functor (f :: * -> *)
fmap :: Functor f => a -> b -> f a -> f b

-- | Replace all locations in the input with the same value. The default
°5udefinition is <tt><a>fmap</a> . <a>const</a></tt>, but this may be
°5uoverridden with a more efficient version.
(<$) :: Functor f => a -> f b -> f a

-- | Basic numeric class.
class Num a
(+) :: Num a => a -> a -> a
(-) :: Num a => a -> a -> a
(*) :: Num a => a -> a -> a

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

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

-- | Sign of a number. The functions <a>abs</a> and <a>signum</a> should
°5usatisfy the law:
°5u
°5u<pre>
°5uabs x * signum x == x
°5u</pre>
°5u
°5uFor real numbers, the <a>signum</a> is either <tt>-1</tt> (negative),
°5u<tt>0</tt> (zero) or <tt>1</tt> (positive).
signum :: Num a => a -> a

-- | Conversion from an <a>Integer</a>. An integer literal represents the
°5uapplication of the function <a>fromInteger</a> to the appropriate
°5uvalue of type <a>Integer</a>, so such literals have type
°5u<tt>(<a>Num</a> a) =&gt; a</tt>.
fromInteger :: Num a => Integer -> a
class Eq a => Ord a
compare :: Ord a => a -> a -> Ordering
(<) :: Ord a => a -> a -> Bool
(<=) :: Ord a => a -> a -> Bool
(>) :: Ord a => a -> a -> Bool
(>=) :: Ord a => a -> a -> Bool
max :: Ord a => a -> a -> a
min :: Ord a => a -> a -> a

-- | Parsing of <a>String</a>s, producing values.
°5u
°5uDerived instances of <a>Read</a> make the following assumptions, which
°5uderived instances of <a>Show</a> obey:
°5u
°5u<ul>
°5u<li>If the constructor is defined to be an infix operator, then the
°5uderived <a>Read</a> instance will parse only infix applications of the
°5uconstructor (not the prefix form).</li>
°5u<li>Associativity is not used to reduce the occurrence of parentheses,
°5ualthough precedence may be.</li>
°5u<li>If the constructor is defined using record syntax, the derived
°5u<a>Read</a> will parse only the record-syntax form, and furthermore,
°5uthe fields must be given in the same order as the original
°5udeclaration.</li>
°5u<li>The derived <a>Read</a> instance allows arbitrary Haskell
°5uwhitespace between tokens of the input string. Extra parentheses are
°5ualso allowed.</li>
°5u</ul>
°5u
°5uFor example, given the declarations
°5u
°5u<pre>
°5uinfixr 5 :^:
°5udata Tree a =  Leaf a  |  Tree a :^: Tree a
°5u</pre>
°5u
°5uthe derived instance of <a>Read</a> in Haskell 2010 is equivalent to
°5u
°5u<pre>
°5uinstance (Read a) =&gt; Read (Tree a) where
°5u
°5u        readsPrec d r =  readParen (d &gt; app_prec)
°5u                         (\r -&gt; [(Leaf m,t) |
°5u                                 ("Leaf",s) &lt;- lex r,
°5u                                 (m,t) &lt;- readsPrec (app_prec+1) s]) r
°5u
°5u                      ++ readParen (d &gt; up_prec)
°5u                         (\r -&gt; [(u:^:v,w) |
°5u                                 (u,s) &lt;- readsPrec (up_prec+1) r,
°5u                                 (":^:",t) &lt;- lex s,
°5u                                 (v,w) &lt;- readsPrec (up_prec+1) t]) r
°5u
°5u          where app_prec = 10
°5u                up_prec = 5
°5u</pre>
°5u
°5uNote that right-associativity of <tt>:^:</tt> is unused.
°5u
°5uThe derived instance in GHC is equivalent to
°5u
°5u<pre>
°5uinstance (Read a) =&gt; Read (Tree a) where
°5u
°5u        readPrec = parens $ (prec app_prec $ do
°5u                                 Ident "Leaf" &lt;- lexP
°5u                                 m &lt;- step readPrec
°5u                                 return (Leaf m))
°5u
°5u                     +++ (prec up_prec $ do
°5u                                 u &lt;- step readPrec
°5u                                 Symbol ":^:" &lt;- lexP
°5u                                 v &lt;- step readPrec
°5u                                 return (u :^: v))
°5u
°5u          where app_prec = 10
°5u                up_prec = 5
°5u
°5u        readListPrec = readListPrecDefault
°5u</pre>
°5u
°5uWhy do both <a>readsPrec</a> and <a>readPrec</a> exist, and why does
°5uGHC opt to implement <a>readPrec</a> in derived <a>Read</a> instances
°5uinstead of <a>readsPrec</a>? The reason is that <a>readsPrec</a> is
°5ubased on the <a>ReadS</a> type, and although <a>ReadS</a> is mentioned
°5uin the Haskell 2010 Report, it is not a very efficient parser data
°5ustructure.
°5u
°5u<a>readPrec</a>, on the other hand, is based on a much more efficient
°5u<a>ReadPrec</a> datatype (a.k.a "new-style parsers"), but its
°5udefinition relies on the use of the <tt>RankNTypes</tt> language
°5uextension. Therefore, <a>readPrec</a> (and its cousin,
°5u<a>readListPrec</a>) are marked as GHC-only. Nevertheless, it is
°5urecommended to use <a>readPrec</a> instead of <a>readsPrec</a>
°5uwhenever possible for the efficiency improvements it brings.
°5u
°5uAs mentioned above, derived <a>Read</a> instances in GHC will
°5uimplement <a>readPrec</a> instead of <a>readsPrec</a>. The default
°5uimplementations of <a>readsPrec</a> (and its cousin, <a>readList</a>)
°5uwill simply use <a>readPrec</a> under the hood. If you are writing a
°5u<a>Read</a> instance by hand, it is recommended to write it like so:
°5u
°5u<pre>
°5uinstance <a>Read</a> T where
°5u  <a>readPrec</a>     = ...
°5u  <a>readListPrec</a> = <a>readListPrecDefault</a>
°5u</pre>
class Read a

-- | attempts to parse a value from the front of the string, returning a
°5ulist of (parsed value, remaining string) pairs. If there is no
°5usuccessful parse, the returned list is empty.
°5u
°5uDerived instances of <a>Read</a> and <a>Show</a> satisfy the
°5ufollowing:
°5u
°5u<ul>
°5u<li><tt>(x,"")</tt> is an element of <tt>(<a>readsPrec</a> d
°5u(<a>showsPrec</a> d x ""))</tt>.</li>
°5u</ul>
°5u
°5uThat is, <a>readsPrec</a> parses the string produced by
°5u<a>showsPrec</a>, and delivers the value that <a>showsPrec</a> started
°5uwith.
readsPrec :: Read a => Int -> ReadS a

-- | The method <a>readList</a> is provided to allow the programmer to give
°5ua specialised way of parsing lists of values. For example, this is
°5uused by the predefined <a>Read</a> instance of the <a>Char</a> type,
°5uwhere values of type <a>String</a> should be are expected to use
°5udouble quotes, rather than square brackets.
readList :: Read a => ReadS [a]
class (Num a, Ord a) => Real a

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

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

-- | a constant function, returning the radix of the representation (often
°5u<tt>2</tt>)
floatRadix :: RealFloat a => a -> Integer

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

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

-- | The function <a>decodeFloat</a> applied to a real floating-point
°5unumber returns the significand expressed as an <a>Integer</a> and an
°5uappropriately scaled exponent (an <a>Int</a>). If
°5u<tt><a>decodeFloat</a> x</tt> yields <tt>(m,n)</tt>, then <tt>x</tt>
°5uis equal in value to <tt>m*b^^n</tt>, where <tt>b</tt> is the
°5ufloating-point radix, and furthermore, either <tt>m</tt> and
°5u<tt>n</tt> are both zero or else <tt>b^(d-1) &lt;= <a>abs</a> m &lt;
°5ub^d</tt>, where <tt>d</tt> is the value of <tt><a>floatDigits</a>
°5ux</tt>. In particular, <tt><a>decodeFloat</a> 0 = (0,0)</tt>. If the
°5utype contains a negative zero, also <tt><a>decodeFloat</a> (-0.0) =
°5u(0,0)</tt>. <i>The result of</i> <tt><a>decodeFloat</a> x</tt> <i>is
°5uunspecified if either of</i> <tt><a>isNaN</a> x</tt> <i>or</i>
°5u<tt><a>isInfinite</a> x</tt> <i>is</i> <a>True</a>.
decodeFloat :: RealFloat a => a -> (Integer, Int)

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

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

-- | The first component of <a>decodeFloat</a>, scaled to lie in the open
°5uinterval (<tt>-1</tt>,<tt>1</tt>), either <tt>0.0</tt> or of absolute
°5uvalue <tt>&gt;= 1/b</tt>, where <tt>b</tt> is the floating-point
°5uradix. The behaviour is unspecified on infinite or <tt>NaN</tt>
°5uvalues.
significand :: RealFloat a => a -> a

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

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

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

-- | <a>True</a> if the argument is too small to be represented in
°5unormalized format
isDenormalized :: RealFloat a => a -> Bool

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

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

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

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

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

-- | <tt><a>truncate</a> x</tt> returns the integer nearest <tt>x</tt>
°5ubetween zero and <tt>x</tt>
truncate :: (RealFrac a, Integral b) => a -> b

-- | <tt><a>round</a> x</tt> returns the nearest integer to <tt>x</tt>; the
°5ueven integer if <tt>x</tt> is equidistant between two integers
round :: (RealFrac a, Integral b) => a -> b

-- | <tt><a>ceiling</a> x</tt> returns the least integer not less than
°5u<tt>x</tt>
ceiling :: (RealFrac a, Integral b) => a -> b

-- | <tt><a>floor</a> x</tt> returns the greatest integer not greater than
°5u<tt>x</tt>
floor :: (RealFrac a, Integral b) => a -> b

-- | Conversion of values to readable <a>String</a>s.
°5u
°5uDerived instances of <a>Show</a> have the following properties, which
°5uare compatible with derived instances of <a>Read</a>:
°5u
°5u<ul>
°5u<li>The result of <a>show</a> is a syntactically correct Haskell
°5uexpression containing only constants, given the fixity declarations in
°5uforce at the point where the type is declared. It contains only the
°5uconstructor names defined in the data type, parentheses, and spaces.
°5uWhen labelled constructor fields are used, braces, commas, field
°5unames, and equal signs are also used.</li>
°5u<li>If the constructor is defined to be an infix operator, then
°5u<a>showsPrec</a> will produce infix applications of the
°5uconstructor.</li>
°5u<li>the representation will be enclosed in parentheses if the
°5uprecedence of the top-level constructor in <tt>x</tt> is less than
°5u<tt>d</tt> (associativity is ignored). Thus, if <tt>d</tt> is
°5u<tt>0</tt> then the result is never surrounded in parentheses; if
°5u<tt>d</tt> is <tt>11</tt> it is always surrounded in parentheses,
°5uunless it is an atomic expression.</li>
°5u<li>If the constructor is defined using record syntax, then
°5u<a>show</a> will produce the record-syntax form, with the fields given
°5uin the same order as the original declaration.</li>
°5u</ul>
°5u
°5uFor example, given the declarations
°5u
°5u<pre>
°5uinfixr 5 :^:
°5udata Tree a =  Leaf a  |  Tree a :^: Tree a
°5u</pre>
°5u
°5uthe derived instance of <a>Show</a> is equivalent to
°5u
°5u<pre>
°5uinstance (Show a) =&gt; Show (Tree a) where
°5u
°5u       showsPrec d (Leaf m) = showParen (d &gt; app_prec) $
°5u            showString "Leaf " . showsPrec (app_prec+1) m
°5u         where app_prec = 10
°5u
°5u       showsPrec d (u :^: v) = showParen (d &gt; up_prec) $
°5u            showsPrec (up_prec+1) u .
°5u            showString " :^: "      .
°5u            showsPrec (up_prec+1) v
°5u         where up_prec = 5
°5u</pre>
°5u
°5uNote that right-associativity of <tt>:^:</tt> is ignored. For example,
°5u
°5u<ul>
°5u<li><tt><a>show</a> (Leaf 1 :^: Leaf 2 :^: Leaf 3)</tt> produces the
°5ustring <tt>"Leaf 1 :^: (Leaf 2 :^: Leaf 3)"</tt>.</li>
°5u</ul>
class Show a

-- | Convert a value to a readable <a>String</a>.
°5u
°5u<a>showsPrec</a> should satisfy the law
°5u
°5u<pre>
°5ushowsPrec d x r ++ s  ==  showsPrec d x (r ++ s)
°5u</pre>
°5u
°5uDerived instances of <a>Read</a> and <a>Show</a> satisfy the
°5ufollowing:
°5u
°5u<ul>
°5u<li><tt>(x,"")</tt> is an element of <tt>(<a>readsPrec</a> d
°5u(<a>showsPrec</a> d x ""))</tt>.</li>
°5u</ul>
°5u
°5uThat is, <a>readsPrec</a> parses the string produced by
°5u<a>showsPrec</a>, and delivers the value that <a>showsPrec</a> started
°5uwith.
showsPrec :: Show a => Int -> a -> ShowS

-- | A specialised variant of <a>showsPrec</a>, using precedence context
°5uzero, and returning an ordinary <a>String</a>.
show :: Show a => a -> String

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

-- | A functor with application, providing operations to
°5u
°5u<ul>
°5u<li>embed pure expressions (<a>pure</a>), and</li>
°5u<li>sequence computations and combine their results (<a>&lt;*&gt;</a>
°5uand <a>liftA2</a>).</li>
°5u</ul>
°5u
°5uA minimal complete definition must include implementations of
°5u<a>pure</a> and of either <a>&lt;*&gt;</a> or <a>liftA2</a>. If it
°5udefines both, then they must behave the same as their default
°5udefinitions:
°5u
°5u<pre>
°5u(<a>&lt;*&gt;</a>) = <a>liftA2</a> <a>id</a>
°5u</pre>
°5u
°5u<pre>
°5u<a>liftA2</a> f x y = f <tt>&lt;$&gt;</tt> x <a>&lt;*&gt;</a> y
°5u</pre>
°5u
°5uFurther, any definition must satisfy the following:
°5u
°5u<ul>
°5u<li><i><i>identity</i></i> <pre><a>pure</a> <a>id</a> <a>&lt;*&gt;</a>
°5uv = v</pre></li>
°5u<li><i><i>composition</i></i> <pre><a>pure</a> (.) <a>&lt;*&gt;</a> u
°5u<a>&lt;*&gt;</a> v <a>&lt;*&gt;</a> w = u <a>&lt;*&gt;</a> (v
°5u<a>&lt;*&gt;</a> w)</pre></li>
°5u<li><i><i>homomorphism</i></i> <pre><a>pure</a> f <a>&lt;*&gt;</a>
°5u<a>pure</a> x = <a>pure</a> (f x)</pre></li>
°5u<li><i><i>interchange</i></i> <pre>u <a>&lt;*&gt;</a> <a>pure</a> y =
°5u<a>pure</a> (<a>$</a> y) <a>&lt;*&gt;</a> u</pre></li>
°5u</ul>
°5u
°5uThe other methods have the following default definitions, which may be
°5uoverridden with equivalent specialized implementations:
°5u
°5u<ul>
°5u<li><pre>u <a>*&gt;</a> v = (<a>id</a> <a>&lt;$</a> u)
°5u<a>&lt;*&gt;</a> v</pre></li>
°5u<li><pre>u <a>&lt;*</a> v = <a>liftA2</a> <a>const</a> u v</pre></li>
°5u</ul>
°5u
°5uAs a consequence of these laws, the <a>Functor</a> instance for
°5u<tt>f</tt> will satisfy
°5u
°5u<ul>
°5u<li><pre><a>fmap</a> f x = <a>pure</a> f <a>&lt;*&gt;</a> x</pre></li>
°5u</ul>
°5u
°5uIt may be useful to note that supposing
°5u
°5u<pre>
°5uforall x y. p (q x y) = f x . g y
°5u</pre>
°5u
°5uit follows from the above that
°5u
°5u<pre>
°5u<a>liftA2</a> p (<a>liftA2</a> q u v) = <a>liftA2</a> f u . <a>liftA2</a> g v
°5u</pre>
°5u
°5uIf <tt>f</tt> is also a <a>Monad</a>, it should satisfy
°5u
°5u<ul>
°5u<li><pre><a>pure</a> = <a>return</a></pre></li>
°5u<li><pre>(<a>&lt;*&gt;</a>) = <a>ap</a></pre></li>
°5u<li><pre>(<a>*&gt;</a>) = (<a>&gt;&gt;</a>)</pre></li>
°5u</ul>
°5u
°5u(which implies that <a>pure</a> and <a>&lt;*&gt;</a> satisfy the
°5uapplicative functor laws).
class Functor f => Applicative (f :: * -> *)

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

-- | Sequential application.
°5u
°5uA few functors support an implementation of <a>&lt;*&gt;</a> that is
°5umore efficient than the default one.
(<*>) :: Applicative f => f a -> b -> f a -> f b

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

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

-- | Left-associative fold of a structure.
°5u
°5uIn the case of lists, <a>foldl</a>, when applied to a binary operator,
°5ua starting value (typically the left-identity of the operator), and a
°5ulist, reduces the list using the binary operator, from left to right:
°5u
°5u<pre>
°5ufoldl f z [x1, x2, ..., xn] == (...((z `f` x1) `f` x2) `f`...) `f` xn
°5u</pre>
°5u
°5uNote that to produce the outermost application of the operator the
°5uentire input list must be traversed. This means that <a>foldl'</a>
°5uwill diverge if given an infinite list.
°5u
°5uAlso note that if you want an efficient left-fold, you probably want
°5uto use <a>foldl'</a> instead of <a>foldl</a>. The reason for this is
°5uthat latter does not force the "inner" results (e.g. <tt>z <tt>f</tt>
°5ux1</tt> in the above example) before applying them to the operator
°5u(e.g. to <tt>(<tt>f</tt> x2)</tt>). This results in a thunk chain
°5u<tt>O(n)</tt> elements long, which then must be evaluated from the
°5uoutside-in.
°5u
°5uFor a general <a>Foldable</a> structure this should be semantically
°5uidentical to,
°5u
°5u<pre>
°5ufoldl f z = <a>foldl</a> f z . <a>toList</a>
°5u</pre>
foldl :: Foldable t => b -> a -> b -> b -> t a -> b

-- | A variant of <a>foldl</a> that has no base case, and thus may only be
°5uapplied to non-empty structures.
°5u
°5u<pre>
°5u<a>foldl1</a> f = <a>foldl1</a> f . <a>toList</a>
°5u</pre>
foldl1 :: Foldable t => a -> a -> a -> t a -> a

-- | The <a>sum</a> function computes the sum of the numbers of a
°5ustructure.
sum :: (Foldable t, Num a) => t a -> a

-- | The <a>product</a> function computes the product of the numbers of a
°5ustructure.
product :: (Foldable t, Num a) => t a -> a

-- | A variant of <a>foldr</a> that has no base case, and thus may only be
°5uapplied to non-empty structures.
°5u
°5u<pre>
°5u<a>foldr1</a> f = <a>foldr1</a> f . <a>toList</a>
°5u</pre>
foldr1 :: Foldable t => a -> a -> a -> t a -> a

-- | The largest element of a non-empty structure.
maximum :: (Foldable t, Ord a) => t a -> a

-- | The least element of a non-empty structure.
minimum :: (Foldable t, Ord a) => t a -> a

-- | Does the element occur in the structure?
elem :: (Foldable t, Eq a) => a -> t a -> Bool
infix 4 `elem`

-- | The class of semigroups (types with an associative binary operation).
°5u
°5uInstances should satisfy the associativity law:
°5u
°5u<ul>
°5u<li><pre>x <a>&lt;&gt;</a> (y <a>&lt;&gt;</a> z) = (x <a>&lt;&gt;</a>
°5uy) <a>&lt;&gt;</a> z</pre></li>
°5u</ul>
class Semigroup a

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

-- | The class of monoids (types with an associative binary operation that
°5uhas an identity). Instances should satisfy the following laws:
°5u
°5u<ul>
°5u<li><pre>x <a>&lt;&gt;</a> <a>mempty</a> = x</pre></li>
°5u<li><pre><a>mempty</a> <a>&lt;&gt;</a> x = x</pre></li>
°5u<li><tt>x <a>&lt;&gt;</a> (y <a>&lt;&gt;</a> z) = (x <a>&lt;&gt;</a>
°5uy) <a>&lt;&gt;</a> z</tt> (<a>Semigroup</a> law)</li>
°5u<li><pre><a>mconcat</a> = <a>foldr</a> '(&lt;&gt;)'
°5u<a>mempty</a></pre></li>
°5u</ul>
°5u
°5uThe method names refer to the monoid of lists under concatenation, but
°5uthere are many other instances.
°5u
°5uSome types can be viewed as a monoid in more than one way, e.g. both
°5uaddition and multiplication on numbers. In such cases we often define
°5u<tt>newtype</tt>s and make those instances of <a>Monoid</a>, e.g.
°5u<tt>Sum</tt> and <tt>Product</tt>.
°5u
°5u<b>NOTE</b>: <a>Semigroup</a> is a superclass of <a>Monoid</a> since
°5u<i>base-4.11.0.0</i>.
class Semigroup a => Monoid a

-- | Identity of <a>mappend</a>
mempty :: Monoid a => a

-- | An associative operation
°5u
°5u<b>NOTE</b>: This method is redundant and has the default
°5uimplementation <tt><a>mappend</a> = '(&lt;&gt;)'</tt> since
°5u<i>base-4.11.0.0</i>.
mappend :: Monoid a => a -> a -> a

-- | Fold a list using the monoid.
°5u
°5uFor most types, the default definition for <a>mconcat</a> will be
°5uused, but the function is included in the class definition so that an
°5uoptimized version can be provided for specific types.
mconcat :: Monoid a => [a] -> a
data Bool
False :: Bool
True :: Bool
data Char
data Double
data Float
data Int
data Integer

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

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

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

-- | The <a>readIO</a> function is similar to <a>read</a> except that it
°5usignals parse failure to the <a>IO</a> monad instead of terminating
°5uthe program.
readIO :: Read a => String -> IO a

-- | The <a>readLn</a> function combines <a>getLine</a> and <a>readIO</a>.
readLn :: Read a => IO a

-- | The computation <a>appendFile</a> <tt>file str</tt> function appends
°5uthe string <tt>str</tt>, to the file <tt>file</tt>.
°5u
°5uNote that <a>writeFile</a> and <a>appendFile</a> write a literal
°5ustring to a file. To write a value of any printable type, as with
°5u<a>print</a>, use the <a>show</a> function to convert the value to a
°5ustring first.
°5u
°5u<pre>
°5umain = appendFile "squares" (show [(x,x*x) | x &lt;- [0,0.1..2]])
°5u</pre>
appendFile :: FilePath -> String -> IO ()

-- | The computation <a>writeFile</a> <tt>file str</tt> function writes the
°5ustring <tt>str</tt>, to the file <tt>file</tt>.
writeFile :: FilePath -> String -> IO ()

-- | The <a>readFile</a> function reads a file and returns the contents of
°5uthe file as a string. The file is read lazily, on demand, as with
°5u<a>getContents</a>.
readFile :: FilePath -> IO String

-- | The <a>interact</a> function takes a function of type
°5u<tt>String-&gt;String</tt> as its argument. The entire input from the
°5ustandard input device is passed to this function as its argument, and
°5uthe resulting string is output on the standard output device.
interact :: String -> String -> IO ()

-- | The <a>getContents</a> operation returns all user input as a single
°5ustring, which is read lazily as it is needed (same as
°5u<a>hGetContents</a> <a>stdin</a>).
getContents :: IO String

-- | Read a line from the standard input device (same as <a>hGetLine</a>
°5u<a>stdin</a>).
getLine :: IO String

-- | Read a character from the standard input device (same as
°5u<a>hGetChar</a> <a>stdin</a>).
getChar :: IO Char

-- | The same as <a>putStr</a>, but adds a newline character.
putStrLn :: String -> IO ()

-- | Write a string to the standard output device (same as <a>hPutStr</a>
°5u<a>stdout</a>).
putStr :: String -> IO ()

-- | Write a character to the standard output device (same as
°5u<a>hPutChar</a> <a>stdout</a>).
putChar :: Char -> IO ()

-- | Raise an <a>IOError</a> in the <a>IO</a> monad.
ioError :: () => IOError -> IO a

-- | File and directory names are values of type <a>String</a>, whose
°5uprecise meaning is operating system dependent. Files can be opened,
°5uyielding a handle which can then be used to operate on the contents of
°5uthat file.
type FilePath = String

-- | Construct an <a>IOError</a> value with a string describing the error.
°5uThe <a>fail</a> method of the <a>IO</a> instance of the <a>Monad</a>
°5uclass raises a <a>userError</a>, thus:
°5u
°5u<pre>
°5uinstance Monad IO where
°5u  ...
°5u  fail s = ioError (userError s)
°5u</pre>
userError :: String -> IOError

-- | The Haskell 2010 type for exceptions in the <a>IO</a> monad. Any I/O
°5uoperation may raise an <a>IOError</a> instead of returning a result.
°5uFor a more general type of exception, including also those that arise
°5uin pure code, see <a>Exception</a>.
°5u
°5uIn Haskell 2010, this is an opaque type.
type IOError = IOException

-- | <a>notElem</a> is the negation of <a>elem</a>.
notElem :: (Foldable t, Eq a) => a -> t a -> Bool
infix 4 `notElem`

-- | <a>or</a> returns the disjunction of a container of Bools. For the
°5uresult to be <a>False</a>, the container must be finite; <a>True</a>,
°5uhowever, results from a <a>True</a> value finitely far from the left
°5uend.
or :: Foldable t => t Bool -> Bool

-- | <a>and</a> returns the conjunction of a container of Bools. For the
°5uresult to be <a>True</a>, the container must be finite; <a>False</a>,
°5uhowever, results from a <a>False</a> value finitely far from the left
°5uend.
and :: Foldable t => t Bool -> Bool

-- | Map a function over all the elements of a container and concatenate
°5uthe resulting lists.
concatMap :: Foldable t => a -> [b] -> t a -> [b]

-- | The concatenation of all the elements of a container of lists.
concat :: Foldable t => t [a] -> [a]

-- | Evaluate each monadic action in the structure from left to right, and
°5uignore the results. For a version that doesn't ignore the results see
°5u<a>sequence</a>.
°5u
°5uAs of base 4.8.0.0, <a>sequence_</a> is just <a>sequenceA_</a>,
°5uspecialized to <a>Monad</a>.
sequence_ :: (Foldable t, Monad m) => t m a -> m ()

-- | <a>unwords</a> is an inverse operation to <a>words</a>. It joins words
°5uwith separating spaces.
°5u
°5u<pre>
°5u&gt;&gt;&gt; unwords ["Lorem", "ipsum", "dolor"]
°5u"Lorem ipsum dolor"
°5u</pre>
unwords :: [String] -> String

-- | <a>words</a> breaks a string up into a list of words, which were
°5udelimited by white space.
°5u
°5u<pre>
°5u&gt;&gt;&gt; words "Lorem ipsum\ndolor"
°5u["Lorem","ipsum","dolor"]
°5u</pre>
words :: String -> [String]

-- | <a>unlines</a> is an inverse operation to <a>lines</a>. It joins
°5ulines, after appending a terminating newline to each.
°5u
°5u<pre>
°5u&gt;&gt;&gt; unlines ["Hello", "World", "!"]
°5u"Hello\nWorld\n!\n"
°5u</pre>
unlines :: [String] -> String

-- | <a>lines</a> breaks a string up into a list of strings at newline
°5ucharacters. The resulting strings do not contain newlines.
°5u
°5uNote that after splitting the string at newline characters, the last
°5upart of the string is considered a line even if it doesn't end with a
°5unewline. For example,
°5u
°5u<pre>
°5u&gt;&gt;&gt; lines ""
°5u[]
°5u</pre>
°5u
°5u<pre>
°5u&gt;&gt;&gt; lines "\n"
°5u[""]
°5u</pre>
°5u
°5u<pre>
°5u&gt;&gt;&gt; lines "one"
°5u["one"]
°5u</pre>
°5u
°5u<pre>
°5u&gt;&gt;&gt; lines "one\n"
°5u["one"]
°5u</pre>
°5u
°5u<pre>
°5u&gt;&gt;&gt; lines "one\n\n"
°5u["one",""]
°5u</pre>
°5u
°5u<pre>
°5u&gt;&gt;&gt; lines "one\ntwo"
°5u["one","two"]
°5u</pre>
°5u
°5u<pre>
°5u&gt;&gt;&gt; lines "one\ntwo\n"
°5u["one","two"]
°5u</pre>
°5u
°5uThus <tt><a>lines</a> s</tt> contains at least as many elements as
°5unewlines in <tt>s</tt>.
lines :: String -> [String]

-- | The <a>read</a> function reads input from a string, which must be
°5ucompletely consumed by the input process. <a>read</a> fails with an
°5u<a>error</a> if the parse is unsuccessful, and it is therefore
°5udiscouraged from being used in real applications. Use <a>readMaybe</a>
°5uor <a>readEither</a> for safe alternatives.
°5u
°5u<pre>
°5u&gt;&gt;&gt; read "123" :: Int
°5u123
°5u</pre>
°5u
°5u<pre>
°5u&gt;&gt;&gt; read "hello" :: Int
°5u*** Exception: Prelude.read: no parse
°5u</pre>
read :: Read a => String -> a

-- | equivalent to <a>readsPrec</a> with a precedence of 0.
reads :: Read a => ReadS a

-- | Case analysis for the <a>Either</a> type. If the value is
°5u<tt><a>Left</a> a</tt>, apply the first function to <tt>a</tt>; if it
°5uis <tt><a>Right</a> b</tt>, apply the second function to <tt>b</tt>.
°5u
°5u<h4><b>Examples</b></h4>
°5u
°5uWe create two values of type <tt><a>Either</a> <a>String</a>
°5u<a>Int</a></tt>, one using the <a>Left</a> constructor and another
°5uusing the <a>Right</a> constructor. Then we apply "either" the
°5u<tt>length</tt> function (if we have a <a>String</a>) or the
°5u"times-two" function (if we have an <a>Int</a>):
°5u
°5u<pre>
°5u&gt;&gt;&gt; let s = Left "foo" :: Either String Int
°5u
°5u&gt;&gt;&gt; let n = Right 3 :: Either String Int
°5u
°5u&gt;&gt;&gt; either length (*2) s
°5u3
°5u
°5u&gt;&gt;&gt; either length (*2) n
°5u6
°5u</pre>
either :: () => a -> c -> b -> c -> Either a b -> c

-- | The <a>lex</a> function reads a single lexeme from the input,
°5udiscarding initial white space, and returning the characters that
°5uconstitute the lexeme. If the input string contains only white space,
°5u<a>lex</a> returns a single successful `lexeme' consisting of the
°5uempty string. (Thus <tt><a>lex</a> "" = [("","")]</tt>.) If there is
°5uno legal lexeme at the beginning of the input string, <a>lex</a> fails
°5u(i.e. returns <tt>[]</tt>).
°5u
°5uThis lexer is not completely faithful to the Haskell lexical syntax in
°5uthe following respects:
°5u
°5u<ul>
°5u<li>Qualified names are not handled properly</li>
°5u<li>Octal and hexadecimal numerics are not recognized as a single
°5utoken</li>
°5u<li>Comments are not treated properly</li>
°5u</ul>
lex :: ReadS String

-- | <tt><a>readParen</a> <a>True</a> p</tt> parses what <tt>p</tt> parses,
°5ubut surrounded with parentheses.
°5u
°5u<tt><a>readParen</a> <a>False</a> p</tt> parses what <tt>p</tt>
°5uparses, but optionally surrounded with parentheses.
readParen :: () => Bool -> ReadS a -> ReadS a

-- | A parser for a type <tt>a</tt>, represented as a function that takes a
°5u<a>String</a> and returns a list of possible parses as
°5u<tt>(a,<a>String</a>)</tt> pairs.
°5u
°5uNote that this kind of backtracking parser is very inefficient;
°5ureading a large structure may be quite slow (cf <a>ReadP</a>).
type ReadS a = String -> [(a, String)]

-- | An infix synonym for <a>fmap</a>.
°5u
°5uThe name of this operator is an allusion to <tt>$</tt>. Note the
°5usimilarities between their types:
°5u
°5u<pre>
°5u ($)  ::              (a -&gt; b) -&gt;   a -&gt;   b
°5u(&lt;$&gt;) :: Functor f =&gt; (a -&gt; b) -&gt; f a -&gt; f b
°5u</pre>
°5u
°5uWhereas <tt>$</tt> is function application, <a>&lt;$&gt;</a> is
°5ufunction application lifted over a <a>Functor</a>.
°5u
°5u<h4><b>Examples</b></h4>
°5u
°5uConvert from a <tt><tt>Maybe</tt> <tt>Int</tt></tt> to a
°5u<tt><tt>Maybe</tt> <tt>String</tt></tt> using <tt>show</tt>:
°5u
°5u<pre>
°5u&gt;&gt;&gt; show &lt;$&gt; Nothing
°5uNothing
°5u
°5u&gt;&gt;&gt; show &lt;$&gt; Just 3
°5uJust "3"
°5u</pre>
°5u
°5uConvert from an <tt><tt>Either</tt> <tt>Int</tt> <tt>Int</tt></tt> to
°5uan <tt><tt>Either</tt> <tt>Int</tt></tt> <tt>String</tt> using
°5u<tt>show</tt>:
°5u
°5u<pre>
°5u&gt;&gt;&gt; show &lt;$&gt; Left 17
°5uLeft 17
°5u
°5u&gt;&gt;&gt; show &lt;$&gt; Right 17
°5uRight "17"
°5u</pre>
°5u
°5uDouble each element of a list:
°5u
°5u<pre>
°5u&gt;&gt;&gt; (*2) &lt;$&gt; [1,2,3]
°5u[2,4,6]
°5u</pre>
°5u
°5uApply <tt>even</tt> to the second element of a pair:
°5u
°5u<pre>
°5u&gt;&gt;&gt; even &lt;$&gt; (2,2)
°5u(2,True)
°5u</pre>
(<$>) :: Functor f => a -> b -> f a -> f b
infixl 4 <$>

-- | <tt><a>lcm</a> x y</tt> is the smallest positive integer that both
°5u<tt>x</tt> and <tt>y</tt> divide.
lcm :: Integral a => a -> a -> a

-- | <tt><a>gcd</a> x y</tt> is the non-negative factor of both <tt>x</tt>
°5uand <tt>y</tt> of which every common factor of <tt>x</tt> and
°5u<tt>y</tt> is also a factor; for example <tt><a>gcd</a> 4 2 = 2</tt>,
°5u<tt><a>gcd</a> (-4) 6 = 2</tt>, <tt><a>gcd</a> 0 4</tt> = <tt>4</tt>.
°5u<tt><a>gcd</a> 0 0</tt> = <tt>0</tt>. (That is, the common divisor
°5uthat is "greatest" in the divisibility preordering.)
°5u
°5uNote: Since for signed fixed-width integer types, <tt><a>abs</a>
°5u<a>minBound</a> &lt; 0</tt>, the result may be negative if one of the
°5uarguments is <tt><a>minBound</a></tt> (and necessarily is if the other
°5uis <tt>0</tt> or <tt><a>minBound</a></tt>) for such types.
gcd :: Integral a => a -> a -> a

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

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

-- | utility function that surrounds the inner show function with
°5uparentheses when the <a>Bool</a> parameter is <a>True</a>.
showParen :: Bool -> ShowS -> ShowS

-- | utility function converting a <a>String</a> to a show function that
°5usimply prepends the string unchanged.
showString :: String -> ShowS

-- | utility function converting a <a>Char</a> to a show function that
°5usimply prepends the character unchanged.
showChar :: Char -> ShowS

-- | equivalent to <a>showsPrec</a> with a precedence of 0.
shows :: Show a => a -> ShowS

-- | The <tt>shows</tt> functions return a function that prepends the
°5uoutput <a>String</a> to an existing <a>String</a>. This allows
°5uconstant-time concatenation of results using function composition.
type ShowS = String -> String

-- | The <a>unzip3</a> function takes a list of triples and returns three
°5ulists, analogous to <a>unzip</a>.
unzip3 :: () => [(a, b, c)] -> ([a], [b], [c])

-- | <a>unzip</a> transforms a list of pairs into a list of first
°5ucomponents and a list of second components.
unzip :: () => [(a, b)] -> ([a], [b])

-- | The <a>zipWith3</a> function takes a function which combines three
°5uelements, as well as three lists and returns a list of their
°5upoint-wise combination, analogous to <a>zipWith</a>.
zipWith3 :: () => a -> b -> c -> d -> [a] -> [b] -> [c] -> [d]

-- | <a>zipWith</a> generalises <a>zip</a> by zipping with the function
°5ugiven as the first argument, instead of a tupling function. For
°5uexample, <tt><a>zipWith</a> (+)</tt> is applied to two lists to
°5uproduce the list of corresponding sums.
°5u
°5u<a>zipWith</a> is right-lazy:
°5u
°5u<pre>
°5uzipWith f [] _|_ = []
°5u</pre>
zipWith :: () => a -> b -> c -> [a] -> [b] -> [c]

-- | <a>zip3</a> takes three lists and returns a list of triples, analogous
°5uto <a>zip</a>.
zip3 :: () => [a] -> [b] -> [c] -> [(a, b, c)]

-- | List index (subscript) operator, starting from 0. It is an instance of
°5uthe more general <a>genericIndex</a>, which takes an index of any
°5uintegral type.
(!!) :: () => [a] -> Int -> a
infixl 9 !!

-- | <a>lookup</a> <tt>key assocs</tt> looks up a key in an association
°5ulist.
lookup :: Eq a => a -> [(a, b)] -> Maybe b

-- | <a>reverse</a> <tt>xs</tt> returns the elements of <tt>xs</tt> in
°5ureverse order. <tt>xs</tt> must be finite.
reverse :: () => [a] -> [a]

-- | <a>break</a>, applied to a predicate <tt>p</tt> and a list
°5u<tt>xs</tt>, returns a tuple where first element is longest prefix
°5u(possibly empty) of <tt>xs</tt> of elements that <i>do not satisfy</i>
°5u<tt>p</tt> and second element is the remainder of the list:
°5u
°5u<pre>
°5ubreak (&gt; 3) [1,2,3,4,1,2,3,4] == ([1,2,3],[4,1,2,3,4])
°5ubreak (&lt; 9) [1,2,3] == ([],[1,2,3])
°5ubreak (&gt; 9) [1,2,3] == ([1,2,3],[])
°5u</pre>
°5u
°5u<a>break</a> <tt>p</tt> is equivalent to <tt><a>span</a> (<a>not</a> .
°5up)</tt>.
break :: () => a -> Bool -> [a] -> ([a], [a])

-- | <a>span</a>, applied to a predicate <tt>p</tt> and a list <tt>xs</tt>,
°5ureturns a tuple where first element is longest prefix (possibly empty)
°5uof <tt>xs</tt> of elements that satisfy <tt>p</tt> and second element
°5uis the remainder of the list:
°5u
°5u<pre>
°5uspan (&lt; 3) [1,2,3,4,1,2,3,4] == ([1,2],[3,4,1,2,3,4])
°5uspan (&lt; 9) [1,2,3] == ([1,2,3],[])
°5uspan (&lt; 0) [1,2,3] == ([],[1,2,3])
°5u</pre>
°5u
°5u<a>span</a> <tt>p xs</tt> is equivalent to <tt>(<a>takeWhile</a> p xs,
°5u<a>dropWhile</a> p xs)</tt>
span :: () => a -> Bool -> [a] -> ([a], [a])

-- | <a>splitAt</a> <tt>n xs</tt> returns a tuple where first element is
°5u<tt>xs</tt> prefix of length <tt>n</tt> and second element is the
°5uremainder of the list:
°5u
°5u<pre>
°5usplitAt 6 "Hello World!" == ("Hello ","World!")
°5usplitAt 3 [1,2,3,4,5] == ([1,2,3],[4,5])
°5usplitAt 1 [1,2,3] == ([1],[2,3])
°5usplitAt 3 [1,2,3] == ([1,2,3],[])
°5usplitAt 4 [1,2,3] == ([1,2,3],[])
°5usplitAt 0 [1,2,3] == ([],[1,2,3])
°5usplitAt (-1) [1,2,3] == ([],[1,2,3])
°5u</pre>
°5u
°5uIt is equivalent to <tt>(<a>take</a> n xs, <a>drop</a> n xs)</tt> when
°5u<tt>n</tt> is not <tt>_|_</tt> (<tt>splitAt _|_ xs = _|_</tt>).
°5u<a>splitAt</a> is an instance of the more general
°5u<a>genericSplitAt</a>, in which <tt>n</tt> may be of any integral
°5utype.
splitAt :: () => Int -> [a] -> ([a], [a])

-- | <a>drop</a> <tt>n xs</tt> returns the suffix of <tt>xs</tt> after the
°5ufirst <tt>n</tt> elements, or <tt>[]</tt> if <tt>n &gt; <a>length</a>
°5uxs</tt>:
°5u
°5u<pre>
°5udrop 6 "Hello World!" == "World!"
°5udrop 3 [1,2,3,4,5] == [4,5]
°5udrop 3 [1,2] == []
°5udrop 3 [] == []
°5udrop (-1) [1,2] == [1,2]
°5udrop 0 [1,2] == [1,2]
°5u</pre>
°5u
°5uIt is an instance of the more general <a>genericDrop</a>, in which
°5u<tt>n</tt> may be of any integral type.
drop :: () => Int -> [a] -> [a]

-- | <a>take</a> <tt>n</tt>, applied to a list <tt>xs</tt>, returns the
°5uprefix of <tt>xs</tt> of length <tt>n</tt>, or <tt>xs</tt> itself if
°5u<tt>n &gt; <a>length</a> xs</tt>:
°5u
°5u<pre>
°5utake 5 "Hello World!" == "Hello"
°5utake 3 [1,2,3,4,5] == [1,2,3]
°5utake 3 [1,2] == [1,2]
°5utake 3 [] == []
°5utake (-1) [1,2] == []
°5utake 0 [1,2] == []
°5u</pre>
°5u
°5uIt is an instance of the more general <a>genericTake</a>, in which
°5u<tt>n</tt> may be of any integral type.
take :: () => Int -> [a] -> [a]

-- | <a>dropWhile</a> <tt>p xs</tt> returns the suffix remaining after
°5u<a>takeWhile</a> <tt>p xs</tt>:
°5u
°5u<pre>
°5udropWhile (&lt; 3) [1,2,3,4,5,1,2,3] == [3,4,5,1,2,3]
°5udropWhile (&lt; 9) [1,2,3] == []
°5udropWhile (&lt; 0) [1,2,3] == [1,2,3]
°5u</pre>
dropWhile :: () => a -> Bool -> [a] -> [a]

-- | <a>takeWhile</a>, applied to a predicate <tt>p</tt> and a list
°5u<tt>xs</tt>, returns the longest prefix (possibly empty) of
°5u<tt>xs</tt> of elements that satisfy <tt>p</tt>:
°5u
°5u<pre>
°5utakeWhile (&lt; 3) [1,2,3,4,1,2,3,4] == [1,2]
°5utakeWhile (&lt; 9) [1,2,3] == [1,2,3]
°5utakeWhile (&lt; 0) [1,2,3] == []
°5u</pre>
takeWhile :: () => a -> Bool -> [a] -> [a]

-- | <a>cycle</a> ties a finite list into a circular one, or equivalently,
°5uthe infinite repetition of the original list. It is the identity on
°5uinfinite lists.
cycle :: () => [a] -> [a]

-- | <a>replicate</a> <tt>n x</tt> is a list of length <tt>n</tt> with
°5u<tt>x</tt> the value of every element. It is an instance of the more
°5ugeneral <a>genericReplicate</a>, in which <tt>n</tt> may be of any
°5uintegral type.
replicate :: () => Int -> a -> [a]

-- | <a>repeat</a> <tt>x</tt> is an infinite list, with <tt>x</tt> the
°5uvalue of every element.
repeat :: () => a -> [a]

-- | <a>iterate</a> <tt>f x</tt> returns an infinite list of repeated
°5uapplications of <tt>f</tt> to <tt>x</tt>:
°5u
°5u<pre>
°5uiterate f x == [x, f x, f (f x), ...]
°5u</pre>
°5u
°5uNote that <a>iterate</a> is lazy, potentially leading to thunk
°5ubuild-up if the consumer doesn't force each iterate. See 'iterate\''
°5ufor a strict variant of this function.
iterate :: () => a -> a -> a -> [a]

-- | <a>scanr1</a> is a variant of <a>scanr</a> that has no starting value
°5uargument.
scanr1 :: () => a -> a -> a -> [a] -> [a]

-- | <a>scanr</a> is the right-to-left dual of <a>scanl</a>. Note that
°5u
°5u<pre>
°5uhead (scanr f z xs) == foldr f z xs.
°5u</pre>
scanr :: () => a -> b -> b -> b -> [a] -> [b]

-- | <a>scanl1</a> is a variant of <a>scanl</a> that has no starting value
°5uargument:
°5u
°5u<pre>
°5uscanl1 f [x1, x2, ...] == [x1, x1 `f` x2, ...]
°5u</pre>
scanl1 :: () => a -> a -> a -> [a] -> [a]

-- | <a>scanl</a> is similar to <a>foldl</a>, but returns a list of
°5usuccessive reduced values from the left:
°5u
°5u<pre>
°5uscanl f z [x1, x2, ...] == [z, z `f` x1, (z `f` x1) `f` x2, ...]
°5u</pre>
°5u
°5uNote that
°5u
°5u<pre>
°5ulast (scanl f z xs) == foldl f z xs.
°5u</pre>
scanl :: () => b -> a -> b -> b -> [a] -> [b]

-- | Return all the elements of a list except the last one. The list must
°5ube non-empty.
init :: () => [a] -> [a]

-- | Extract the last element of a list, which must be finite and
°5unon-empty.
last :: () => [a] -> a

-- | Extract the elements after the head of a list, which must be
°5unon-empty.
tail :: () => [a] -> [a]

-- | Extract the first element of a list, which must be non-empty.
head :: () => [a] -> a

-- | The <a>maybe</a> function takes a default value, a function, and a
°5u<a>Maybe</a> value. If the <a>Maybe</a> value is <a>Nothing</a>, the
°5ufunction returns the default value. Otherwise, it applies the function
°5uto the value inside the <a>Just</a> and returns the result.
°5u
°5u<h4><b>Examples</b></h4>
°5u
°5uBasic usage:
°5u
°5u<pre>
°5u&gt;&gt;&gt; maybe False odd (Just 3)
°5uTrue
°5u</pre>
°5u
°5u<pre>
°5u&gt;&gt;&gt; maybe False odd Nothing
°5uFalse
°5u</pre>
°5u
°5uRead an integer from a string using <tt>readMaybe</tt>. If we succeed,
°5ureturn twice the integer; that is, apply <tt>(*2)</tt> to it. If
°5uinstead we fail to parse an integer, return <tt>0</tt> by default:
°5u
°5u<pre>
°5u&gt;&gt;&gt; import Text.Read ( readMaybe )
°5u
°5u&gt;&gt;&gt; maybe 0 (*2) (readMaybe "5")
°5u10
°5u
°5u&gt;&gt;&gt; maybe 0 (*2) (readMaybe "")
°5u0
°5u</pre>
°5u
°5uApply <tt>show</tt> to a <tt>Maybe Int</tt>. If we have <tt>Just
°5un</tt>, we want to show the underlying <a>Int</a> <tt>n</tt>. But if
°5uwe have <a>Nothing</a>, we return the empty string instead of (for
°5uexample) "Nothing":
°5u
°5u<pre>
°5u&gt;&gt;&gt; maybe "" show (Just 5)
°5u"5"
°5u
°5u&gt;&gt;&gt; maybe "" show Nothing
°5u""
°5u</pre>
maybe :: () => b -> a -> b -> Maybe a -> b

-- | <a>uncurry</a> converts a curried function to a function on pairs.
°5u
°5u<h4><b>Examples</b></h4>
°5u
°5u<pre>
°5u&gt;&gt;&gt; uncurry (+) (1,2)
°5u3
°5u</pre>
°5u
°5u<pre>
°5u&gt;&gt;&gt; uncurry ($) (show, 1)
°5u"1"
°5u</pre>
°5u
°5u<pre>
°5u&gt;&gt;&gt; map (uncurry max) [(1,2), (3,4), (6,8)]
°5u[2,4,8]
°5u</pre>
uncurry :: () => a -> b -> c -> (a, b) -> c

-- | <a>curry</a> converts an uncurried function to a curried function.
°5u
°5u<h4><b>Examples</b></h4>
°5u
°5u<pre>
°5u&gt;&gt;&gt; curry fst 1 2
°5u1
°5u</pre>
curry :: () => (a, b) -> c -> a -> b -> c

-- | the same as <tt><a>flip</a> (<a>-</a>)</tt>.
°5u
°5uBecause <tt>-</tt> is treated specially in the Haskell grammar,
°5u<tt>(-</tt> <i>e</i><tt>)</tt> is not a section, but an application of
°5uprefix negation. However, <tt>(<a>subtract</a></tt>
°5u<i>exp</i><tt>)</tt> is equivalent to the disallowed section.
subtract :: Num a => a -> a -> a

-- | <a>asTypeOf</a> is a type-restricted version of <a>const</a>. It is
°5uusually used as an infix operator, and its typing forces its first
°5uargument (which is usually overloaded) to have the same type as the
°5usecond.
asTypeOf :: () => a -> a -> a

-- | <tt><a>until</a> p f</tt> yields the result of applying <tt>f</tt>
°5uuntil <tt>p</tt> holds.
until :: () => a -> Bool -> a -> a -> a -> a

-- | Strict (call-by-value) application operator. It takes a function and
°5uan argument, evaluates the argument to weak head normal form (WHNF),
°5uthen calls the function with that value.
($!) :: () => a -> b -> a -> b
infixr 0 $!

-- | <tt><a>flip</a> f</tt> takes its (first) two arguments in the reverse
°5uorder of <tt>f</tt>.
°5u
°5u<pre>
°5u&gt;&gt;&gt; flip (++) "hello" "world"
°5u"worldhello"
°5u</pre>
flip :: () => a -> b -> c -> b -> a -> c

-- | Function composition.
(.) :: () => b -> c -> a -> b -> a -> c
infixr 9 .

-- | <tt>const x</tt> is a unary function which evaluates to <tt>x</tt> for
°5uall inputs.
°5u
°5u<pre>
°5u&gt;&gt;&gt; const 42 "hello"
°5u42
°5u</pre>
°5u
°5u<pre>
°5u&gt;&gt;&gt; map (const 42) [0..3]
°5u[42,42,42,42]
°5u</pre>
const :: () => a -> b -> a

-- | Identity function.
°5u
°5u<pre>
°5uid x = x
°5u</pre>
id :: () => a -> a

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

-- | A <a>String</a> is a list of characters. String constants in Haskell
°5uare values of type <a>String</a>.
type String = [Char]

-- | A special case of <a>error</a>. It is expected that compilers will
°5urecognize this and insert error messages which are more appropriate to
°5uthe context in which <a>undefined</a> appears.
undefined :: HasCallStack => a

-- | A variant of <a>error</a> that does not produce a stack trace.
errorWithoutStackTrace :: () => [Char] -> a

-- | <a>error</a> stops execution and displays an error message.
error :: HasCallStack => [Char] -> a
(&&) :: Bool -> Bool -> Bool
(||) :: Bool -> Bool -> Bool
not :: Bool -> Bool

-- | The class of semigroups (types with an associative binary operation).
°5u
°5uInstances should satisfy the associativity law:
°5u
°5u<ul>
°5u<li><pre>x <a>&lt;&gt;</a> (y <a>&lt;&gt;</a> z) = (x <a>&lt;&gt;</a>
°5uy) <a>&lt;&gt;</a> z</pre></li>
°5u</ul>
class Semigroup a

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

-- | Generically generate a <a>Semigroup</a> (<a>&lt;&gt;</a>) operation
°5ufor any type implementing <a>Generic</a>. This operation will append
°5utwo values by point-wise appending their component fields. It is only
°5udefined for product types.
°5u
°5u<pre>
°5u<a>gmappend</a> a (<a>gmappend</a> b c) = <a>gmappend</a> (<a>gmappend</a> a b) c
°5u</pre>
gmappend :: (Generic a, GSemigroup (Rep a)) => a -> a -> a

-- | Generically generate a <a>Monoid</a> <a>mempty</a> for any
°5uproduct-like type implementing <a>Generic</a>.
°5u
°5uIt is only defined for product types.
°5u
°5u<pre>
°5u<a>gmappend</a> <a>gmempty</a> a = a = <a>gmappend</a> a <a>gmempty</a>
°5u</pre>
gmempty :: (Generic a, GMonoid (Rep a)) => a

-- | The class <a>Typeable</a> allows a concrete representation of a type
°5uto be calculated.
class Typeable (a :: k)

-- | The <a>Data</a> class comprehends a fundamental primitive
°5u<a>gfoldl</a> for folding over constructor applications, say terms.
°5uThis primitive can be instantiated in several ways to map over the
°5uimmediate subterms of a term; see the <tt>gmap</tt> combinators later
°5uin this class. Indeed, a generic programmer does not necessarily need
°5uto use the ingenious gfoldl primitive but rather the intuitive
°5u<tt>gmap</tt> combinators. The <a>gfoldl</a> primitive is completed by
°5umeans to query top-level constructors, to turn constructor
°5urepresentations into proper terms, and to list all possible datatype
°5uconstructors. This completion allows us to serve generic programming
°5uscenarios like read, show, equality, term generation.
°5u
°5uThe combinators <a>gmapT</a>, <a>gmapQ</a>, <a>gmapM</a>, etc are all
°5uprovided with default definitions in terms of <a>gfoldl</a>, leaving
°5uopen the opportunity to provide datatype-specific definitions. (The
°5uinclusion of the <tt>gmap</tt> combinators as members of class
°5u<a>Data</a> allows the programmer or the compiler to derive
°5uspecialised, and maybe more efficient code per datatype. <i>Note</i>:
°5u<a>gfoldl</a> is more higher-order than the <tt>gmap</tt> combinators.
°5uThis is subject to ongoing benchmarking experiments. It might turn out
°5uthat the <tt>gmap</tt> combinators will be moved out of the class
°5u<a>Data</a>.)
°5u
°5uConceptually, the definition of the <tt>gmap</tt> combinators in terms
°5uof the primitive <a>gfoldl</a> requires the identification of the
°5u<a>gfoldl</a> function arguments. Technically, we also need to
°5uidentify the type constructor <tt>c</tt> for the construction of the
°5uresult type from the folded term type.
°5u
°5uIn the definition of <tt>gmapQ</tt><i>x</i> combinators, we use
°5uphantom type constructors for the <tt>c</tt> in the type of
°5u<a>gfoldl</a> because the result type of a query does not involve the
°5u(polymorphic) type of the term argument. In the definition of
°5u<a>gmapQl</a> we simply use the plain constant type constructor
°5ubecause <a>gfoldl</a> is left-associative anyway and so it is readily
°5usuited to fold a left-associative binary operation over the immediate
°5usubterms. In the definition of gmapQr, extra effort is needed. We use
°5ua higher-order accumulation trick to mediate between left-associative
°5uconstructor application vs. right-associative binary operation (e.g.,
°5u<tt>(:)</tt>). When the query is meant to compute a value of type
°5u<tt>r</tt>, then the result type withing generic folding is <tt>r
°5u-&gt; r</tt>. So the result of folding is a function to which we
°5ufinally pass the right unit.
°5u
°5uWith the <tt>-XDeriveDataTypeable</tt> option, GHC can generate
°5uinstances of the <a>Data</a> class automatically. For example, given
°5uthe declaration
°5u
°5u<pre>
°5udata T a b = C1 a b | C2 deriving (Typeable, Data)
°5u</pre>
°5u
°5uGHC will generate an instance that is equivalent to
°5u
°5u<pre>
°5uinstance (Data a, Data b) =&gt; Data (T a b) where
°5u    gfoldl k z (C1 a b) = z C1 `k` a `k` b
°5u    gfoldl k z C2       = z C2
°5u
°5u    gunfold k z c = case constrIndex c of
°5u                        1 -&gt; k (k (z C1))
°5u                        2 -&gt; z C2
°5u
°5u    toConstr (C1 _ _) = con_C1
°5u    toConstr C2       = con_C2
°5u
°5u    dataTypeOf _ = ty_T
°5u
°5ucon_C1 = mkConstr ty_T "C1" [] Prefix
°5ucon_C2 = mkConstr ty_T "C2" [] Prefix
°5uty_T   = mkDataType "Module.T" [con_C1, con_C2]
°5u</pre>
°5u
°5uThis is suitable for datatypes that are exported transparently.
class Typeable a => Data a

-- | Representable types of kind <tt>*</tt>. This class is derivable in GHC
°5uwith the <tt>DeriveGeneric</tt> flag on.
°5u
°5uA <a>Generic</a> instance must satisfy the following laws:
°5u
°5u<pre>
°5u<a>from</a> . <a>to</a> ≡ <tt>id</tt>
°5u<a>to</a> . <a>from</a> ≡ <tt>id</tt>
°5u</pre>
class Generic a

-- | A class of types that can be fully evaluated.
class NFData a

-- | <a>rnf</a> should reduce its argument to normal form (that is, fully
°5uevaluate all sub-components), and then return '()'.
°5u
°5u<h3><a>Generic</a> <a>NFData</a> deriving</h3>
°5u
°5uStarting with GHC 7.2, you can automatically derive instances for
°5utypes possessing a <a>Generic</a> instance.
°5u
°5uNote: <a>Generic1</a> can be auto-derived starting with GHC 7.4
°5u
°5u<pre>
°5u{-# LANGUAGE DeriveGeneric #-}
°5u
°5uimport GHC.Generics (Generic, Generic1)
°5uimport Control.DeepSeq
°5u
°5udata Foo a = Foo a String
°5u             deriving (Eq, Generic, Generic1)
°5u
°5uinstance NFData a =&gt; NFData (Foo a)
°5uinstance NFData1 Foo
°5u
°5udata Colour = Red | Green | Blue
°5u              deriving Generic
°5u
°5uinstance NFData Colour
°5u</pre>
°5u
°5uStarting with GHC 7.10, the example above can be written more
°5uconcisely by enabling the new <tt>DeriveAnyClass</tt> extension:
°5u
°5u<pre>
°5u{-# LANGUAGE DeriveGeneric, DeriveAnyClass #-}
°5u
°5uimport GHC.Generics (Generic)
°5uimport Control.DeepSeq
°5u
°5udata Foo a = Foo a String
°5u             deriving (Eq, Generic, Generic1, NFData, NFData1)
°5u
°5udata Colour = Red | Green | Blue
°5u              deriving (Generic, NFData)
°5u</pre>
°5u
°5u<h3>Compatibility with previous <tt>deepseq</tt> versions</h3>
°5u
°5uPrior to version 1.4.0.0, the default implementation of the <a>rnf</a>
°5umethod was defined as
°5u
°5u<pre>
°5u<a>rnf</a> a = <a>seq</a> a ()
°5u</pre>
°5u
°5uHowever, starting with <tt>deepseq-1.4.0.0</tt>, the default
°5uimplementation is based on <tt>DefaultSignatures</tt> allowing for
°5umore accurate auto-derived <a>NFData</a> instances. If you need the
°5upreviously used exact default <a>rnf</a> method implementation
°5usemantics, use
°5u
°5u<pre>
°5uinstance NFData Colour where rnf x = seq x ()
°5u</pre>
°5u
°5uor alternatively
°5u
°5u<pre>
°5uinstance NFData Colour where rnf = rwhnf
°5u</pre>
°5u
°5uor
°5u
°5u<pre>
°5u{-# LANGUAGE BangPatterns #-}
°5uinstance NFData Colour where rnf !_ = ()
°5u</pre>
rnf :: NFData a => a -> ()

-- | <a>GHC.Generics</a>-based <a>rnf</a> implementation
°5u
°5uThis is needed in order to support <tt>deepseq &lt; 1.4</tt> which
°5udidn't have a <a>Generic</a>-based default <a>rnf</a> implementation
°5uyet.
°5u
°5uIn order to define instances, use e.g.
°5u
°5u<pre>
°5uinstance NFData MyType where rnf = genericRnf
°5u</pre>
°5u
°5uThe implementation has been taken from <tt>deepseq-1.4.2</tt>'s
°5udefault <a>rnf</a> implementation.
genericRnf :: (Generic a, GNFData (Rep a)) => a -> ()

-- | The <a>Binary</a> class provides <a>put</a> and <a>get</a>, methods to
°5uencode and decode a Haskell value to a lazy <a>ByteString</a>. It
°5umirrors the <a>Read</a> and <a>Show</a> classes for textual
°5urepresentation of Haskell types, and is suitable for serialising
°5uHaskell values to disk, over the network.
°5u
°5uFor decoding and generating simple external binary formats (e.g. C
°5ustructures), Binary may be used, but in general is not suitable for
°5ucomplex protocols. Instead use the <a>Put</a> and <a>Get</a>
°5uprimitives directly.
°5u
°5uInstances of Binary should satisfy the following property:
°5u
°5u<pre>
°5udecode . encode == id
°5u</pre>
°5u
°5uThat is, the <a>get</a> and <a>put</a> methods should be the inverse
°5uof each other. A range of instances are provided for basic Haskell
°5utypes.
class Binary t

-- | Encode a value in the Put monad.
put :: Binary t => t -> Put

-- | Decode a value in the Get monad
get :: Binary t => Get t

-- | Encode a list of values in the Put monad. The default implementation
°5umay be overridden to be more efficient but must still have the same
°5uencoding format.
putList :: Binary t => [t] -> Put

-- | A monoid on applicative functors.
°5u
°5uIf defined, <a>some</a> and <a>many</a> should be the least solutions
°5uof the equations:
°5u
°5u<ul>
°5u<li><pre><a>some</a> v = (:) <tt>&lt;$&gt;</tt> v <a>&lt;*&gt;</a>
°5u<a>many</a> v</pre></li>
°5u<li><pre><a>many</a> v = <a>some</a> v <a>&lt;|&gt;</a> <a>pure</a>
°5u[]</pre></li>
°5u</ul>
class Applicative f => Alternative (f :: * -> *)

-- | The identity of <a>&lt;|&gt;</a>
empty :: Alternative f => f a

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

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

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

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

-- | The identity of <a>mplus</a>. It should also satisfy the equations
°5u
°5u<pre>
°5umzero &gt;&gt;= f  =  mzero
°5uv &gt;&gt; mzero   =  mzero
°5u</pre>
°5u
°5uThe default definition is
°5u
°5u<pre>
°5umzero = <a>empty</a>
°5u</pre>
mzero :: MonadPlus m => m a

-- | An associative operation. The default definition is
°5u
°5u<pre>
°5umplus = (<a>&lt;|&gt;</a>)
°5u</pre>
mplus :: MonadPlus m => m a -> m a -> m a

-- | Class for string-like datastructures; used by the overloaded string
°5uextension (-XOverloadedStrings in GHC).
class IsString a
fromString :: IsString a => String -> a
type IO a = WithCallStack (IO a)
type NoCallStackIO a = IO a

-- | A Map from keys <tt>k</tt> to values <tt>a</tt>.
data Map k a

-- | The <a>catMaybes</a> function takes a list of <a>Maybe</a>s and
°5ureturns a list of all the <a>Just</a> values.
°5u
°5u<h4><b>Examples</b></h4>
°5u
°5uBasic usage:
°5u
°5u<pre>
°5u&gt;&gt;&gt; catMaybes [Just 1, Nothing, Just 3]
°5u[1,3]
°5u</pre>
°5u
°5uWhen constructing a list of <a>Maybe</a> values, <a>catMaybes</a> can
°5ube used to return all of the "success" results (if the list is the
°5uresult of a <a>map</a>, then <a>mapMaybe</a> would be more
°5uappropriate):
°5u
°5u<pre>
°5u&gt;&gt;&gt; import Text.Read ( readMaybe )
°5u
°5u&gt;&gt;&gt; [readMaybe x :: Maybe Int | x &lt;- ["1", "Foo", "3"] ]
°5u[Just 1,Nothing,Just 3]
°5u
°5u&gt;&gt;&gt; catMaybes $ [readMaybe x :: Maybe Int | x &lt;- ["1", "Foo", "3"] ]
°5u[1,3]
°5u</pre>
catMaybes :: () => [Maybe a] -> [a]

-- | The <a>mapMaybe</a> function is a version of <a>map</a> which can
°5uthrow out elements. In particular, the functional argument returns
°5usomething of type <tt><a>Maybe</a> b</tt>. If this is <a>Nothing</a>,
°5uno element is added on to the result list. If it is <tt><a>Just</a>
°5ub</tt>, then <tt>b</tt> is included in the result list.
°5u
°5u<h4><b>Examples</b></h4>
°5u
°5uUsing <tt><a>mapMaybe</a> f x</tt> is a shortcut for
°5u<tt><a>catMaybes</a> $ <a>map</a> f x</tt> in most cases:
°5u
°5u<pre>
°5u&gt;&gt;&gt; import Text.Read ( readMaybe )
°5u
°5u&gt;&gt;&gt; let readMaybeInt = readMaybe :: String -&gt; Maybe Int
°5u
°5u&gt;&gt;&gt; mapMaybe readMaybeInt ["1", "Foo", "3"]
°5u[1,3]
°5u
°5u&gt;&gt;&gt; catMaybes $ map readMaybeInt ["1", "Foo", "3"]
°5u[1,3]
°5u</pre>
°5u
°5uIf we map the <a>Just</a> constructor, the entire list should be
°5ureturned:
°5u
°5u<pre>
°5u&gt;&gt;&gt; mapMaybe Just [1,2,3]
°5u[1,2,3]
°5u</pre>
mapMaybe :: () => a -> Maybe b -> [a] -> [b]

-- | The <a>fromMaybe</a> function takes a default value and and
°5u<a>Maybe</a> value. If the <a>Maybe</a> is <a>Nothing</a>, it returns
°5uthe default values; otherwise, it returns the value contained in the
°5u<a>Maybe</a>.
°5u
°5u<h4><b>Examples</b></h4>
°5u
°5uBasic usage:
°5u
°5u<pre>
°5u&gt;&gt;&gt; fromMaybe "" (Just "Hello, World!")
°5u"Hello, World!"
°5u</pre>
°5u
°5u<pre>
°5u&gt;&gt;&gt; fromMaybe "" Nothing
°5u""
°5u</pre>
°5u
°5uRead an integer from a string using <tt>readMaybe</tt>. If we fail to
°5uparse an integer, we want to return <tt>0</tt> by default:
°5u
°5u<pre>
°5u&gt;&gt;&gt; import Text.Read ( readMaybe )
°5u
°5u&gt;&gt;&gt; fromMaybe 0 (readMaybe "5")
°5u5
°5u
°5u&gt;&gt;&gt; fromMaybe 0 (readMaybe "")
°5u0
°5u</pre>
fromMaybe :: () => a -> Maybe a -> a

-- | The <a>maybeToList</a> function returns an empty list when given
°5u<a>Nothing</a> or a singleton list when not given <a>Nothing</a>.
°5u
°5u<h4><b>Examples</b></h4>
°5u
°5uBasic usage:
°5u
°5u<pre>
°5u&gt;&gt;&gt; maybeToList (Just 7)
°5u[7]
°5u</pre>
°5u
°5u<pre>
°5u&gt;&gt;&gt; maybeToList Nothing
°5u[]
°5u</pre>
°5u
°5uOne can use <a>maybeToList</a> to avoid pattern matching when combined
°5uwith a function that (safely) works on lists:
°5u
°5u<pre>
°5u&gt;&gt;&gt; import Text.Read ( readMaybe )
°5u
°5u&gt;&gt;&gt; sum $ maybeToList (readMaybe "3")
°5u3
°5u
°5u&gt;&gt;&gt; sum $ maybeToList (readMaybe "")
°5u0
°5u</pre>
maybeToList :: () => Maybe a -> [a]

-- | The <a>listToMaybe</a> function returns <a>Nothing</a> on an empty
°5ulist or <tt><a>Just</a> a</tt> where <tt>a</tt> is the first element
°5uof the list.
°5u
°5u<h4><b>Examples</b></h4>
°5u
°5uBasic usage:
°5u
°5u<pre>
°5u&gt;&gt;&gt; listToMaybe []
°5uNothing
°5u</pre>
°5u
°5u<pre>
°5u&gt;&gt;&gt; listToMaybe [9]
°5uJust 9
°5u</pre>
°5u
°5u<pre>
°5u&gt;&gt;&gt; listToMaybe [1,2,3]
°5uJust 1
°5u</pre>
°5u
°5uComposing <a>maybeToList</a> with <a>listToMaybe</a> should be the
°5uidentity on singleton/empty lists:
°5u
°5u<pre>
°5u&gt;&gt;&gt; maybeToList $ listToMaybe [5]
°5u[5]
°5u
°5u&gt;&gt;&gt; maybeToList $ listToMaybe []
°5u[]
°5u</pre>
°5u
°5uBut not on lists with more than one element:
°5u
°5u<pre>
°5u&gt;&gt;&gt; maybeToList $ listToMaybe [1,2,3]
°5u[1]
°5u</pre>
listToMaybe :: () => [a] -> Maybe a

-- | The <a>isNothing</a> function returns <a>True</a> iff its argument is
°5u<a>Nothing</a>.
°5u
°5u<h4><b>Examples</b></h4>
°5u
°5uBasic usage:
°5u
°5u<pre>
°5u&gt;&gt;&gt; isNothing (Just 3)
°5uFalse
°5u</pre>
°5u
°5u<pre>
°5u&gt;&gt;&gt; isNothing (Just ())
°5uFalse
°5u</pre>
°5u
°5u<pre>
°5u&gt;&gt;&gt; isNothing Nothing
°5uTrue
°5u</pre>
°5u
°5uOnly the outer constructor is taken into consideration:
°5u
°5u<pre>
°5u&gt;&gt;&gt; isNothing (Just Nothing)
°5uFalse
°5u</pre>
isNothing :: () => Maybe a -> Bool

-- | The <a>isJust</a> function returns <a>True</a> iff its argument is of
°5uthe form <tt>Just _</tt>.
°5u
°5u<h4><b>Examples</b></h4>
°5u
°5uBasic usage:
°5u
°5u<pre>
°5u&gt;&gt;&gt; isJust (Just 3)
°5uTrue
°5u</pre>
°5u
°5u<pre>
°5u&gt;&gt;&gt; isJust (Just ())
°5uTrue
°5u</pre>
°5u
°5u<pre>
°5u&gt;&gt;&gt; isJust Nothing
°5uFalse
°5u</pre>
°5u
°5uOnly the outer constructor is taken into consideration:
°5u
°5u<pre>
°5u&gt;&gt;&gt; isJust (Just Nothing)
°5uTrue
°5u</pre>
isJust :: () => Maybe a -> Bool

-- | The <a>unfoldr</a> function is a `dual' to <a>foldr</a>: while
°5u<a>foldr</a> reduces a list to a summary value, <a>unfoldr</a> builds
°5ua list from a seed value. The function takes the element and returns
°5u<a>Nothing</a> if it is done producing the list or returns <a>Just</a>
°5u<tt>(a,b)</tt>, in which case, <tt>a</tt> is a prepended to the list
°5uand <tt>b</tt> is used as the next element in a recursive call. For
°5uexample,
°5u
°5u<pre>
°5uiterate f == unfoldr (\x -&gt; Just (x, f x))
°5u</pre>
°5u
°5uIn some cases, <a>unfoldr</a> can undo a <a>foldr</a> operation:
°5u
°5u<pre>
°5uunfoldr f' (foldr f z xs) == xs
°5u</pre>
°5u
°5uif the following holds:
°5u
°5u<pre>
°5uf' (f x y) = Just (x,y)
°5uf' z       = Nothing
°5u</pre>
°5u
°5uA simple use of unfoldr:
°5u
°5u<pre>
°5u&gt;&gt;&gt; unfoldr (\b -&gt; if b == 0 then Nothing else Just (b, b-1)) 10
°5u[10,9,8,7,6,5,4,3,2,1]
°5u</pre>
unfoldr :: () => b -> Maybe (a, b) -> b -> [a]

-- | The <a>isPrefixOf</a> function takes two lists and returns <a>True</a>
°5uiff the first list is a prefix of the second.
°5u
°5u<pre>
°5u&gt;&gt;&gt; "Hello" `isPrefixOf` "Hello World!"
°5uTrue
°5u</pre>
°5u
°5u<pre>
°5u&gt;&gt;&gt; "Hello" `isPrefixOf` "Wello Horld!"
°5uFalse
°5u</pre>
isPrefixOf :: Eq a => [a] -> [a] -> Bool

-- | The <a>isSuffixOf</a> function takes two lists and returns <a>True</a>
°5uiff the first list is a suffix of the second. The second list must be
°5ufinite.
°5u
°5u<pre>
°5u&gt;&gt;&gt; "ld!" `isSuffixOf` "Hello World!"
°5uTrue
°5u</pre>
°5u
°5u<pre>
°5u&gt;&gt;&gt; "World" `isSuffixOf` "Hello World!"
°5uFalse
°5u</pre>
isSuffixOf :: Eq a => [a] -> [a] -> Bool

-- | <a>intercalate</a> <tt>xs xss</tt> is equivalent to <tt>(<a>concat</a>
°5u(<a>intersperse</a> xs xss))</tt>. It inserts the list <tt>xs</tt> in
°5ubetween the lists in <tt>xss</tt> and concatenates the result.
°5u
°5u<pre>
°5u&gt;&gt;&gt; intercalate ", " ["Lorem", "ipsum", "dolor"]
°5u"Lorem, ipsum, dolor"
°5u</pre>
intercalate :: () => [a] -> [[a]] -> [a]

-- | The <a>intersperse</a> function takes an element and a list and
°5u`intersperses' that element between the elements of the list. For
°5uexample,
°5u
°5u<pre>
°5u&gt;&gt;&gt; intersperse ',' "abcde"
°5u"a,b,c,d,e"
°5u</pre>
intersperse :: () => a -> [a] -> [a]

-- | The <a>sort</a> function implements a stable sorting algorithm. It is
°5ua special case of <a>sortBy</a>, which allows the programmer to supply
°5utheir own comparison function.
°5u
°5uElements are arranged from from lowest to highest, keeping duplicates
°5uin the order they appeared in the input.
°5u
°5u<pre>
°5u&gt;&gt;&gt; sort [1,6,4,3,2,5]
°5u[1,2,3,4,5,6]
°5u</pre>
sort :: Ord a => [a] -> [a]

-- | The <a>sortBy</a> function is the non-overloaded version of
°5u<a>sort</a>.
°5u
°5u<pre>
°5u&gt;&gt;&gt; sortBy (\(a,_) (b,_) -&gt; compare a b) [(2, "world"), (4, "!"), (1, "Hello")]
°5u[(1,"Hello"),(2,"world"),(4,"!")]
°5u</pre>
sortBy :: () => a -> a -> Ordering -> [a] -> [a]

-- | <i>O(n^2)</i>. The <a>nub</a> function removes duplicate elements from
°5ua list. In particular, it keeps only the first occurrence of each
°5uelement. (The name <a>nub</a> means `essence'.) It is a special case
°5uof <a>nubBy</a>, which allows the programmer to supply their own
°5uequality test.
°5u
°5u<pre>
°5u&gt;&gt;&gt; nub [1,2,3,4,3,2,1,2,4,3,5]
°5u[1,2,3,4,5]
°5u</pre>
nub :: Eq a => [a] -> [a]

-- | The <a>nubBy</a> function behaves just like <a>nub</a>, except it uses
°5ua user-supplied equality predicate instead of the overloaded <a>==</a>
°5ufunction.
°5u
°5u<pre>
°5u&gt;&gt;&gt; nubBy (\x y -&gt; mod x 3 == mod y 3) [1,2,4,5,6]
°5u[1,2,6]
°5u</pre>
nubBy :: () => a -> a -> Bool -> [a] -> [a]

-- | Data structures that can be folded.
°5u
°5uFor example, given a data type
°5u
°5u<pre>
°5udata Tree a = Empty | Leaf a | Node (Tree a) a (Tree a)
°5u</pre>
°5u
°5ua suitable instance would be
°5u
°5u<pre>
°5uinstance Foldable Tree where
°5u   foldMap f Empty = mempty
°5u   foldMap f (Leaf x) = f x
°5u   foldMap f (Node l k r) = foldMap f l `mappend` f k `mappend` foldMap f r
°5u</pre>
°5u
°5uThis is suitable even for abstract types, as the monoid is assumed to
°5usatisfy the monoid laws. Alternatively, one could define
°5u<tt>foldr</tt>:
°5u
°5u<pre>
°5uinstance Foldable Tree where
°5u   foldr f z Empty = z
°5u   foldr f z (Leaf x) = f x z
°5u   foldr f z (Node l k r) = foldr f (f k (foldr f z r)) l
°5u</pre>
°5u
°5u<tt>Foldable</tt> instances are expected to satisfy the following
°5ulaws:
°5u
°5u<pre>
°5ufoldr f z t = appEndo (foldMap (Endo . f) t ) z
°5u</pre>
°5u
°5u<pre>
°5ufoldl f z t = appEndo (getDual (foldMap (Dual . Endo . flip f) t)) z
°5u</pre>
°5u
°5u<pre>
°5ufold = foldMap id
°5u</pre>
°5u
°5u<pre>
°5ulength = getSum . foldMap (Sum . const  1)
°5u</pre>
°5u
°5u<tt>sum</tt>, <tt>product</tt>, <tt>maximum</tt>, and <tt>minimum</tt>
°5ushould all be essentially equivalent to <tt>foldMap</tt> forms, such
°5uas
°5u
°5u<pre>
°5usum = getSum . foldMap Sum
°5u</pre>
°5u
°5ubut may be less defined.
°5u
°5uIf the type is also a <a>Functor</a> instance, it should satisfy
°5u
°5u<pre>
°5ufoldMap f = fold . fmap f
°5u</pre>
°5u
°5uwhich implies that
°5u
°5u<pre>
°5ufoldMap f . fmap g = foldMap (f . g)
°5u</pre>
class Foldable (t :: * -> *)

-- | Map each element of the structure to a monoid, and combine the
°5uresults.
foldMap :: (Foldable t, Monoid m) => a -> m -> t a -> m

-- | Right-associative fold of a structure.
°5u
°5uIn the case of lists, <a>foldr</a>, when applied to a binary operator,
°5ua starting value (typically the right-identity of the operator), and a
°5ulist, reduces the list using the binary operator, from right to left:
°5u
°5u<pre>
°5ufoldr f z [x1, x2, ..., xn] == x1 `f` (x2 `f` ... (xn `f` z)...)
°5u</pre>
°5u
°5uNote that, since the head of the resulting expression is produced by
°5uan application of the operator to the first element of the list,
°5u<a>foldr</a> can produce a terminating expression from an infinite
°5ulist.
°5u
°5uFor a general <a>Foldable</a> structure this should be semantically
°5uidentical to,
°5u
°5u<pre>
°5ufoldr f z = <a>foldr</a> f z . <a>toList</a>
°5u</pre>
foldr :: Foldable t => a -> b -> b -> b -> t a -> b

-- | Test whether the structure is empty. The default implementation is
°5uoptimized for structures that are similar to cons-lists, because there
°5uis no general way to do better.
null :: Foldable t => t a -> Bool

-- | Returns the size/length of a finite structure as an <a>Int</a>. The
°5udefault implementation is optimized for structures that are similar to
°5ucons-lists, because there is no general way to do better.
length :: Foldable t => t a -> Int

-- | The <a>find</a> function takes a predicate and a structure and returns
°5uthe leftmost element of the structure matching the predicate, or
°5u<a>Nothing</a> if there is no such element.
find :: Foldable t => a -> Bool -> t a -> Maybe a

-- | Left-associative fold of a structure but with strict application of
°5uthe operator.
°5u
°5uThis ensures that each step of the fold is forced to weak head normal
°5uform before being applied, avoiding the collection of thunks that
°5uwould otherwise occur. This is often what you want to strictly reduce
°5ua finite list to a single, monolithic result (e.g. <a>length</a>).
°5u
°5uFor a general <a>Foldable</a> structure this should be semantically
°5uidentical to,
°5u
°5u<pre>
°5ufoldl f z = <a>foldl'</a> f z . <a>toList</a>
°5u</pre>
foldl' :: Foldable t => b -> a -> b -> b -> t a -> b

-- | Map each element of a structure to an action, evaluate these actions
°5ufrom left to right, and ignore the results. For a version that doesn't
°5uignore the results see <a>traverse</a>.
traverse_ :: (Foldable t, Applicative f) => a -> f b -> t a -> f ()

-- | <a>for_</a> is <a>traverse_</a> with its arguments flipped. For a
°5uversion that doesn't ignore the results see <a>for</a>.
°5u
°5u<pre>
°5u&gt;&gt;&gt; for_ [1..4] print
°5u1
°5u2
°5u3
°5u4
°5u</pre>
for_ :: (Foldable t, Applicative f) => t a -> a -> f b -> f ()

-- | Determines whether any element of the structure satisfies the
°5upredicate.
any :: Foldable t => a -> Bool -> t a -> Bool

-- | Determines whether all elements of the structure satisfy the
°5upredicate.
all :: Foldable t => a -> Bool -> t a -> Bool

-- | Functors representing data structures that can be traversed from left
°5uto right.
°5u
°5uA definition of <a>traverse</a> must satisfy the following laws:
°5u
°5u<ul>
°5u<li><i><i>naturality</i></i> <tt>t . <a>traverse</a> f =
°5u<a>traverse</a> (t . f)</tt> for every applicative transformation
°5u<tt>t</tt></li>
°5u<li><i><i>identity</i></i> <tt><a>traverse</a> Identity =
°5uIdentity</tt></li>
°5u<li><i><i>composition</i></i> <tt><a>traverse</a> (Compose .
°5u<a>fmap</a> g . f) = Compose . <a>fmap</a> (<a>traverse</a> g) .
°5u<a>traverse</a> f</tt></li>
°5u</ul>
°5u
°5uA definition of <a>sequenceA</a> must satisfy the following laws:
°5u
°5u<ul>
°5u<li><i><i>naturality</i></i> <tt>t . <a>sequenceA</a> =
°5u<a>sequenceA</a> . <a>fmap</a> t</tt> for every applicative
°5utransformation <tt>t</tt></li>
°5u<li><i><i>identity</i></i> <tt><a>sequenceA</a> . <a>fmap</a> Identity
°5u= Identity</tt></li>
°5u<li><i><i>composition</i></i> <tt><a>sequenceA</a> . <a>fmap</a>
°5uCompose = Compose . <a>fmap</a> <a>sequenceA</a> .
°5u<a>sequenceA</a></tt></li>
°5u</ul>
°5u
°5uwhere an <i>applicative transformation</i> is a function
°5u
°5u<pre>
°5ut :: (Applicative f, Applicative g) =&gt; f a -&gt; g a
°5u</pre>
°5u
°5upreserving the <a>Applicative</a> operations, i.e.
°5u
°5u<ul>
°5u<li><pre>t (<a>pure</a> x) = <a>pure</a> x</pre></li>
°5u<li><pre>t (x <a>&lt;*&gt;</a> y) = t x <a>&lt;*&gt;</a> t
°5uy</pre></li>
°5u</ul>
°5u
°5uand the identity functor <tt>Identity</tt> and composition of functors
°5u<tt>Compose</tt> are defined as
°5u
°5u<pre>
°5unewtype Identity a = Identity a
°5u
°5uinstance Functor Identity where
°5u  fmap f (Identity x) = Identity (f x)
°5u
°5uinstance Applicative Identity where
°5u  pure x = Identity x
°5u  Identity f &lt;*&gt; Identity x = Identity (f x)
°5u
°5unewtype Compose f g a = Compose (f (g a))
°5u
°5uinstance (Functor f, Functor g) =&gt; Functor (Compose f g) where
°5u  fmap f (Compose x) = Compose (fmap (fmap f) x)
°5u
°5uinstance (Applicative f, Applicative g) =&gt; Applicative (Compose f g) where
°5u  pure x = Compose (pure (pure x))
°5u  Compose f &lt;*&gt; Compose x = Compose ((&lt;*&gt;) &lt;$&gt; f &lt;*&gt; x)
°5u</pre>
°5u
°5u(The naturality law is implied by parametricity.)
°5u
°5uInstances are similar to <a>Functor</a>, e.g. given a data type
°5u
°5u<pre>
°5udata Tree a = Empty | Leaf a | Node (Tree a) a (Tree a)
°5u</pre>
°5u
°5ua suitable instance would be
°5u
°5u<pre>
°5uinstance Traversable Tree where
°5u   traverse f Empty = pure Empty
°5u   traverse f (Leaf x) = Leaf &lt;$&gt; f x
°5u   traverse f (Node l k r) = Node &lt;$&gt; traverse f l &lt;*&gt; f k &lt;*&gt; traverse f r
°5u</pre>
°5u
°5uThis is suitable even for abstract types, as the laws for
°5u<a>&lt;*&gt;</a> imply a form of associativity.
°5u
°5uThe superclass instances should satisfy the following:
°5u
°5u<ul>
°5u<li>In the <a>Functor</a> instance, <a>fmap</a> should be equivalent
°5uto traversal with the identity applicative functor
°5u(<a>fmapDefault</a>).</li>
°5u<li>In the <a>Foldable</a> instance, <a>foldMap</a> should be
°5uequivalent to traversal with a constant applicative functor
°5u(<a>foldMapDefault</a>).</li>
°5u</ul>
class (Functor t, Foldable t) => Traversable (t :: * -> *)

-- | Map each element of a structure to an action, evaluate these actions
°5ufrom left to right, and collect the results. For a version that
°5uignores the results see <a>traverse_</a>.
traverse :: (Traversable t, Applicative f) => a -> f b -> t a -> f t b

-- | Evaluate each action in the structure from left to right, and and
°5ucollect the results. For a version that ignores the results see
°5u<a>sequenceA_</a>.
sequenceA :: (Traversable t, Applicative f) => t f a -> f t a

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

-- | Send the first component of the input through the argument arrow, and
°5ucopy the rest unchanged to the output.
first :: Arrow a => a b c -> a (b, d) (c, d)

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

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

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

-- | Conditional execution of <a>Applicative</a> expressions. For example,
°5u
°5u<pre>
°5uwhen debug (putStrLn "Debugging")
°5u</pre>
°5u
°5uwill output the string <tt>Debugging</tt> if the Boolean value
°5u<tt>debug</tt> is <a>True</a>, and otherwise do nothing.
when :: Applicative f => Bool -> f () -> f ()

-- | In many situations, the <a>liftM</a> operations can be replaced by
°5uuses of <a>ap</a>, which promotes function application.
°5u
°5u<pre>
°5ureturn f `ap` x1 `ap` ... `ap` xn
°5u</pre>
°5u
°5uis equivalent to
°5u
°5u<pre>
°5uliftMn f x1 x2 ... xn
°5u</pre>
ap :: Monad m => m a -> b -> m a -> m b

-- | <tt><a>void</a> value</tt> discards or ignores the result of
°5uevaluation, such as the return value of an <a>IO</a> action.
°5u
°5u<h4><b>Examples</b></h4>
°5u
°5uReplace the contents of a <tt><tt>Maybe</tt> <tt>Int</tt></tt> with
°5uunit:
°5u
°5u<pre>
°5u&gt;&gt;&gt; void Nothing
°5uNothing
°5u
°5u&gt;&gt;&gt; void (Just 3)
°5uJust ()
°5u</pre>
°5u
°5uReplace the contents of an <tt><tt>Either</tt> <tt>Int</tt>
°5u<tt>Int</tt></tt> with unit, resulting in an <tt><tt>Either</tt>
°5u<tt>Int</tt> '()'</tt>:
°5u
°5u<pre>
°5u&gt;&gt;&gt; void (Left 8675309)
°5uLeft 8675309
°5u
°5u&gt;&gt;&gt; void (Right 8675309)
°5uRight ()
°5u</pre>
°5u
°5uReplace every element of a list with unit:
°5u
°5u<pre>
°5u&gt;&gt;&gt; void [1,2,3]
°5u[(),(),()]
°5u</pre>
°5u
°5uReplace the second element of a pair with unit:
°5u
°5u<pre>
°5u&gt;&gt;&gt; void (1,2)
°5u(1,())
°5u</pre>
°5u
°5uDiscard the result of an <a>IO</a> action:
°5u
°5u<pre>
°5u&gt;&gt;&gt; mapM print [1,2]
°5u1
°5u2
°5u[(),()]
°5u
°5u&gt;&gt;&gt; void $ mapM print [1,2]
°5u1
°5u2
°5u</pre>
void :: Functor f => f a -> f ()

-- | The <a>foldM</a> function is analogous to <tt>foldl</tt>, except that
°5uits result is encapsulated in a monad. Note that <a>foldM</a> works
°5ufrom left-to-right over the list arguments. This could be an issue
°5uwhere <tt>(<a>&gt;&gt;</a>)</tt> and the `folded function' are not
°5ucommutative.
°5u
°5u<pre>
°5ufoldM f a1 [x1, x2, ..., xm]
°5u
°5u==
°5u
°5udo
°5u  a2 &lt;- f a1 x1
°5u  a3 &lt;- f a2 x2
°5u  ...
°5u  f am xm
°5u</pre>
°5u
°5uIf right-to-left evaluation is required, the input list should be
°5ureversed.
°5u
°5uNote: <a>foldM</a> is the same as <a>foldlM</a>
foldM :: (Foldable t, Monad m) => b -> a -> m b -> b -> t a -> m b

-- | This generalizes the list-based <tt>filter</tt> function.
filterM :: Applicative m => a -> m Bool -> [a] -> m [a]

-- | Returns <a>True</a> for any Unicode space character, and the control
°5ucharacters <tt>\t</tt>, <tt>\n</tt>, <tt>\r</tt>, <tt>\f</tt>,
°5u<tt>\v</tt>.
isSpace :: Char -> Bool

-- | Selects ASCII digits, i.e. <tt>'0'</tt>..<tt>'9'</tt>.
isDigit :: Char -> Bool

-- | Selects upper-case or title-case alphabetic Unicode characters
°5u(letters). Title case is used by a small number of letter ligatures
°5ulike the single-character form of <i>Lj</i>.
isUpper :: Char -> Bool

-- | Selects alphabetic Unicode characters (lower-case, upper-case and
°5utitle-case letters, plus letters of caseless scripts and modifiers
°5uletters). This function is equivalent to <a>isLetter</a>.
isAlpha :: Char -> Bool

-- | Selects alphabetic or numeric digit Unicode characters.
°5u
°5uNote that numeric digits outside the ASCII range are selected by this
°5ufunction but not by <a>isDigit</a>. Such digits may be part of
°5uidentifiers but are not used by the printer and reader to represent
°5unumbers.
isAlphaNum :: Char -> Bool

-- | The <a>toEnum</a> method restricted to the type <a>Char</a>.
chr :: Int -> Char

-- | The <a>fromEnum</a> method restricted to the type <a>Char</a>.
ord :: Char -> Int

-- | Convert a letter to the corresponding lower-case letter, if any. Any
°5uother character is returned unchanged.
toLower :: Char -> Char

-- | Convert a letter to the corresponding upper-case letter, if any. Any
°5uother character is returned unchanged.
toUpper :: Char -> Char
data Word

-- | 8-bit unsigned integer type
data Word8

-- | 16-bit unsigned integer type
data Word16

-- | 32-bit unsigned integer type
data Word32

-- | 64-bit unsigned integer type
data Word64

-- | 8-bit signed integer type
data Int8

-- | 16-bit signed integer type
data Int16

-- | 32-bit signed integer type
data Int32

-- | 64-bit signed integer type
data Int64

-- | New name for <a>&lt;&gt;</a>
(<<>>) :: Doc -> Doc -> Doc


-- | Alternative parser combinators.
°5u
°5uOriginally in <tt>parsers</tt> package.
module Distribution.Compat.Parsing

-- | <tt>choice ps</tt> tries to apply the parsers in the list <tt>ps</tt>
°5uin order, until one of them succeeds. Returns the value of the
°5usucceeding parser.
choice :: Alternative m => [m a] -> m a

-- | <tt>option x p</tt> tries to apply parser <tt>p</tt>. If <tt>p</tt>
°5ufails without consuming input, it returns the value <tt>x</tt>,
°5uotherwise the value returned by <tt>p</tt>.
°5u
°5u<pre>
°5upriority = option 0 (digitToInt &lt;$&gt; digit)
°5u</pre>
option :: Alternative m => a -> m a -> m a

-- | One or none.
optional :: Alternative f => f a -> f Maybe a

-- | <tt>skipOptional p</tt> tries to apply parser <tt>p</tt>. It will
°5uparse <tt>p</tt> or nothing. It only fails if <tt>p</tt> fails after
°5uconsuming input. It discards the result of <tt>p</tt>. (Plays the role
°5uof parsec's optional, which conflicts with Applicative's optional)
skipOptional :: Alternative m => m a -> m ()

-- | <tt>between open close p</tt> parses <tt>open</tt>, followed by
°5u<tt>p</tt> and <tt>close</tt>. Returns the value returned by
°5u<tt>p</tt>.
°5u
°5u<pre>
°5ubraces  = between (symbol "{") (symbol "}")
°5u</pre>
between :: Applicative m => m bra -> m ket -> m a -> m a

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

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

-- | <tt>sepBy p sep</tt> parses <i>zero</i> or more occurrences of
°5u<tt>p</tt>, separated by <tt>sep</tt>. Returns a list of values
°5ureturned by <tt>p</tt>.
°5u
°5u<pre>
°5ucommaSep p  = p `sepBy` (symbol ",")
°5u</pre>
sepBy :: Alternative m => m a -> m sep -> m [a]

-- | <tt>sepBy1 p sep</tt> parses <i>one</i> or more occurrences of
°5u<tt>p</tt>, separated by <tt>sep</tt>. Returns a list of values
°5ureturned by <tt>p</tt>.
sepBy1 :: Alternative m => m a -> m sep -> m [a]

-- | <tt>sepEndBy1 p sep</tt> parses <i>one</i> or more occurrences of
°5u<tt>p</tt>, separated and optionally ended by <tt>sep</tt>. Returns a
°5ulist of values returned by <tt>p</tt>.
sepEndBy1 :: Alternative m => m a -> m sep -> m [a]

-- | <tt>sepEndBy p sep</tt> parses <i>zero</i> or more occurrences of
°5u<tt>p</tt>, separated and optionally ended by <tt>sep</tt>, ie.
°5uhaskell style statements. Returns a list of values returned by
°5u<tt>p</tt>.
°5u
°5u<pre>
°5uhaskellStatements  = haskellStatement `sepEndBy` semi
°5u</pre>
sepEndBy :: Alternative m => m a -> m sep -> m [a]

-- | <tt>endBy1 p sep</tt> parses <i>one</i> or more occurrences of
°5u<tt>p</tt>, separated and ended by <tt>sep</tt>. Returns a list of
°5uvalues returned by <tt>p</tt>.
endBy1 :: Alternative m => m a -> m sep -> m [a]

-- | <tt>endBy p sep</tt> parses <i>zero</i> or more occurrences of
°5u<tt>p</tt>, separated and ended by <tt>sep</tt>. Returns a list of
°5uvalues returned by <tt>p</tt>.
°5u
°5u<pre>
°5ucStatements  = cStatement `endBy` semi
°5u</pre>
endBy :: Alternative m => m a -> m sep -> m [a]

-- | <tt>count n p</tt> parses <tt>n</tt> occurrences of <tt>p</tt>. If
°5u<tt>n</tt> is smaller or equal to zero, the parser equals to
°5u<tt>return []</tt>. Returns a list of <tt>n</tt> values returned by
°5u<tt>p</tt>.
count :: Applicative m => Int -> m a -> m [a]

-- | <tt>chainl p op x</tt> parses <i>zero</i> or more occurrences of
°5u<tt>p</tt>, separated by <tt>op</tt>. Returns a value obtained by a
°5u<i>left</i> associative application of all functions returned by
°5u<tt>op</tt> to the values returned by <tt>p</tt>. If there are zero
°5uoccurrences of <tt>p</tt>, the value <tt>x</tt> is returned.
chainl :: Alternative m => m a -> m (a -> a -> a) -> a -> m a

-- | <tt>chainr p op x</tt> parses <i>zero</i> or more occurrences of
°5u<tt>p</tt>, separated by <tt>op</tt> Returns a value obtained by a
°5u<i>right</i> associative application of all functions returned by
°5u<tt>op</tt> to the values returned by <tt>p</tt>. If there are no
°5uoccurrences of <tt>p</tt>, the value <tt>x</tt> is returned.
chainr :: Alternative m => m a -> m (a -> a -> a) -> a -> m a

-- | <tt>chainl1 p op x</tt> parses <i>one</i> or more occurrences of
°5u<tt>p</tt>, separated by <tt>op</tt> Returns a value obtained by a
°5u<i>left</i> associative application of all functions returned by
°5u<tt>op</tt> to the values returned by <tt>p</tt>. . This parser can
°5ufor example be used to eliminate left recursion which typically occurs
°5uin expression grammars.
°5u
°5u<pre>
°5uexpr   = term   `chainl1` addop
°5uterm   = factor `chainl1` mulop
°5ufactor = parens expr &lt;|&gt; integer
°5u
°5umulop  = (*) &lt;$ symbol "*"
°5u     &lt;|&gt; div &lt;$ symbol "/"
°5u
°5uaddop  = (+) &lt;$ symbol "+"
°5u     &lt;|&gt; (-) &lt;$ symbol "-"
°5u</pre>
chainl1 :: Alternative m => m a -> m (a -> a -> a) -> m a

-- | <tt>chainr1 p op x</tt> parses <i>one</i> or more occurrences of
°5u<tt>p</tt>, separated by <tt>op</tt> Returns a value obtained by a
°5u<i>right</i> associative application of all functions returned by
°5u<tt>op</tt> to the values returned by <tt>p</tt>.
chainr1 :: Alternative m => m a -> m (a -> a -> a) -> m a

-- | <tt>manyTill p end</tt> applies parser <tt>p</tt> <i>zero</i> or more
°5utimes until parser <tt>end</tt> succeeds. Returns the list of values
°5ureturned by <tt>p</tt>. This parser can be used to scan comments:
°5u
°5u<pre>
°5usimpleComment   = do{ string "&lt;!--"
°5u                    ; manyTill anyChar (try (string "--&gt;"))
°5u                    }
°5u</pre>
°5u
°5uNote the overlapping parsers <tt>anyChar</tt> and <tt>string
°5u"--&gt;"</tt>, and therefore the use of the <a>try</a> combinator.
manyTill :: Alternative m => m a -> m end -> m [a]

-- | Additional functionality needed to describe parsers independent of
°5uinput type.
class Alternative m => Parsing m

-- | Take a parser that may consume input, and on failure, go back to where
°5uwe started and fail as if we didn't consume input.
try :: Parsing m => m a -> m a

-- | Give a parser a name
(<?>) :: Parsing m => m a -> String -> m a

-- | A version of many that discards its input. Specialized because it can
°5uoften be implemented more cheaply.
skipMany :: Parsing m => m a -> m ()

-- | <tt>skipSome p</tt> applies the parser <tt>p</tt> <i>one</i> or more
°5utimes, skipping its result. (aka skipMany1 in parsec)
skipSome :: Parsing m => m a -> m ()

-- | Used to emit an error on an unexpected token
unexpected :: Parsing m => String -> m a

-- | This parser only succeeds at the end of the input. This is not a
°5uprimitive parser but it is defined using <a>notFollowedBy</a>.
°5u
°5u<pre>
°5ueof  = notFollowedBy anyChar &lt;?&gt; "end of input"
°5u</pre>
eof :: Parsing m => m ()

-- | <tt>notFollowedBy p</tt> only succeeds when parser <tt>p</tt> fails.
°5uThis parser does not consume any input. This parser can be used to
°5uimplement the 'longest match' rule. For example, when recognizing
°5ukeywords (for example <tt>let</tt>), we want to make sure that a
°5ukeyword is not followed by a legal identifier character, in which case
°5uthe keyword is actually an identifier (for example <tt>lets</tt>). We
°5ucan program this behaviour as follows:
°5u
°5u<pre>
°5ukeywordLet  = try $ string "let" &lt;* notFollowedBy alphaNum
°5u</pre>
notFollowedBy :: (Parsing m, Show a) => m a -> m ()
instance (Distribution.Compat.Parsing.Parsing m, GHC.Base.MonadPlus m) => Distribution.Compat.Parsing.Parsing (Control.Monad.Trans.State.Lazy.StateT s m)
instance (Distribution.Compat.Parsing.Parsing m, GHC.Base.MonadPlus m) => Distribution.Compat.Parsing.Parsing (Control.Monad.Trans.State.Strict.StateT s m)
instance (Distribution.Compat.Parsing.Parsing m, GHC.Base.MonadPlus m) => Distribution.Compat.Parsing.Parsing (Control.Monad.Trans.Reader.ReaderT e m)
instance (Distribution.Compat.Parsing.Parsing m, GHC.Base.MonadPlus m, GHC.Base.Monoid w) => Distribution.Compat.Parsing.Parsing (Control.Monad.Trans.Writer.Strict.WriterT w m)
instance (Distribution.Compat.Parsing.Parsing m, GHC.Base.MonadPlus m, GHC.Base.Monoid w) => Distribution.Compat.Parsing.Parsing (Control.Monad.Trans.Writer.Lazy.WriterT w m)
instance (Distribution.Compat.Parsing.Parsing m, GHC.Base.MonadPlus m, GHC.Base.Monoid w) => Distribution.Compat.Parsing.Parsing (Control.Monad.Trans.RWS.Lazy.RWST r w s m)
instance (Distribution.Compat.Parsing.Parsing m, GHC.Base.MonadPlus m, GHC.Base.Monoid w) => Distribution.Compat.Parsing.Parsing (Control.Monad.Trans.RWS.Strict.RWST r w s m)
instance (Distribution.Compat.Parsing.Parsing m, GHC.Base.Monad m) => Distribution.Compat.Parsing.Parsing (Control.Monad.Trans.Identity.IdentityT m)
instance (Text.Parsec.Prim.Stream s m t, GHC.Show.Show t) => Distribution.Compat.Parsing.Parsing (Text.Parsec.Prim.ParsecT s u m)
instance (t ~ GHC.Types.Char) => Distribution.Compat.Parsing.Parsing (Distribution.Compat.ReadP.Parser r t)


-- | A data type representing directed graphs, backed by <a>Data.Graph</a>.
°5uIt is strict in the node type.
°5u
°5uThis is an alternative interface to <a>Data.Graph</a>. In this
°5uinterface, nodes (identified by the <a>IsNode</a> type class) are
°5uassociated with a key and record the keys of their neighbors. This
°5uinterface is more convenient than <a>Graph</a>, which requires
°5uvertices to be explicitly handled by integer indexes.
°5u
°5uThe current implementation has somewhat peculiar performance
°5ucharacteristics. The asymptotics of all map-like operations mirror
°5utheir counterparts in <a>Data.Map</a>. However, to perform a graph
°5uoperation, we first must build the <a>Data.Graph</a> representation,
°5uan operation that takes <i>O(V + E log V)</i>. However, this operation
°5ucan be amortized across all queries on that particular graph.
°5u
°5uSome nodes may be broken, i.e., refer to neighbors which are not
°5ustored in the graph. In our graph algorithms, we transparently ignore
°5usuch edges; however, you can easily query for the broken vertices of a
°5ugraph using <a>broken</a> (and should, e.g., to ensure that a closure
°5uof a graph is well-formed.) It's possible to take a closed subset of a
°5ubroken graph and get a well-formed graph.
module Distribution.Compat.Graph

-- | A graph of nodes <tt>a</tt>. The nodes are expected to have instance
°5uof class <a>IsNode</a>.
data Graph a

-- | The <a>IsNode</a> class is used for datatypes which represent directed
°5ugraph nodes. A node of type <tt>a</tt> is associated with some unique
°5ukey of type <tt><a>Key</a> a</tt>; given a node we can determine its
°5ukey (<a>nodeKey</a>) and the keys of its neighbors
°5u(<a>nodeNeighbors</a>).
class Ord (Key a) => IsNode a where {
    type family Key a :: *;
}
nodeKey :: IsNode a => a -> Key a
nodeNeighbors :: IsNode a => a -> [Key a]

-- | <i>O(1)</i>. Is the graph empty?
null :: Graph a -> Bool

-- | <i>O(1)</i>. The number of nodes in the graph.
size :: Graph a -> Int

-- | <i>O(log V)</i>. Check if the key is in the graph.
member :: IsNode a => Key a -> Graph a -> Bool

-- | <i>O(log V)</i>. Lookup the node at a key in the graph.
lookup :: IsNode a => Key a -> Graph a -> Maybe a

-- | <i>O(1)</i>. The empty graph.
empty :: IsNode a => Graph a

-- | <i>O(log V)</i>. Insert a node into a graph.
insert :: IsNode a => a -> Graph a -> Graph a

-- | <i>O(log V)</i>. Delete the node at a key from the graph.
deleteKey :: IsNode a => Key a -> Graph a -> Graph a

-- | <i>O(log V)</i>. Lookup and delete. This function returns the deleted
°5uvalue if it existed.
deleteLookup :: IsNode a => Key a -> Graph a -> (Maybe a, Graph a)

-- | <i>O(V + V')</i>. Left-biased union, preferring entries from the first
°5umap when conflicts occur.
unionLeft :: IsNode a => Graph a -> Graph a -> Graph a

-- | <i>O(V + V')</i>. Right-biased union, preferring entries from the
°5usecond map when conflicts occur. <tt><a>nodeKey</a> x = <a>nodeKey</a>
°5u(f x)</tt>.
unionRight :: IsNode a => Graph a -> Graph a -> Graph a

-- | <i>Ω(V + E)</i>. Compute the strongly connected components of a graph.
°5uRequires amortized construction of graph.
stronglyConnComp :: Graph a -> [SCC a]

-- | Strongly connected component.
data SCC vertex

-- | A single vertex that is not in any cycle.
AcyclicSCC :: vertex -> SCC vertex

-- | A maximal set of mutually reachable vertices.
CyclicSCC :: [vertex] -> SCC vertex

-- | <i>Ω(V + E)</i>. Compute the cycles of a graph. Requires amortized
°5uconstruction of graph.
cycles :: Graph a -> [[a]]

-- | <i>O(1)</i>. Return a list of nodes paired with their broken neighbors
°5u(i.e., neighbor keys which are not in the graph). Requires amortized
°5uconstruction of graph.
broken :: Graph a -> [(a, [Key a])]

-- | Lookup the immediate neighbors from a key in the graph. Requires
°5uamortized construction of graph.
neighbors :: Graph a -> Key a -> Maybe [a]

-- | Lookup the immediate reverse neighbors from a key in the graph.
°5uRequires amortized construction of graph.
revNeighbors :: Graph a -> Key a -> Maybe [a]

-- | Compute the subgraph which is the closure of some set of keys. Returns
°5u<tt>Nothing</tt> if one (or more) keys are not present in the graph.
°5uRequires amortized construction of graph.
closure :: Graph a -> [Key a] -> Maybe [a]

-- | Compute the reverse closure of a graph from some set of keys. Returns
°5u<tt>Nothing</tt> if one (or more) keys are not present in the graph.
°5uRequires amortized construction of graph.
revClosure :: Graph a -> [Key a] -> Maybe [a]

-- | Topologically sort the nodes of a graph. Requires amortized
°5uconstruction of graph.
topSort :: Graph a -> [a]

-- | Reverse topologically sort the nodes of a graph. Requires amortized
°5uconstruction of graph.
revTopSort :: Graph a -> [a]

-- | <i>O(1)</i>. Convert a graph into a map from keys to nodes. The
°5uresulting map <tt>m</tt> is guaranteed to have the property that
°5u<tt><a>all</a> ((k,n) -&gt; k == <a>nodeKey</a> n) (<a>toList</a>
°5um)</tt>.
toMap :: Graph a -> Map (Key a) a

-- | <i>O(V log V)</i>. Convert a list of nodes (with distinct keys) into a
°5ugraph.
fromDistinctList :: (IsNode a, Show (Key a)) => [a] -> Graph a

-- | <i>O(V)</i>. Convert a graph into a list of nodes.
toList :: Graph a -> [a]

-- | <i>O(V)</i>. Convert a graph into a list of keys.
keys :: Graph a -> [Key a]

-- | <i>O(V)</i>. Convert a graph into a set of keys.
keysSet :: Graph a -> Set (Key a)

-- | <i>O(1)</i>. Convert a graph into a <a>Graph</a>. Requires amortized
°5uconstruction of graph.
toGraph :: Graph a -> (Graph, Vertex -> a, Key a -> Maybe Vertex)

-- | A simple, trivial data type which admits an <a>IsNode</a> instance.
data Node k a
N :: a -> k -> [k] -> Node k a

-- | Get the value from a <a>Node</a>.
nodeValue :: Node k a -> a
instance (GHC.Classes.Eq a, GHC.Classes.Eq k) => GHC.Classes.Eq (Distribution.Compat.Graph.Node k a)
instance (GHC.Show.Show a, GHC.Show.Show k) => GHC.Show.Show (Distribution.Compat.Graph.Node k a)
instance GHC.Base.Functor (Distribution.Compat.Graph.Node k)
instance GHC.Classes.Ord k => Distribution.Compat.Graph.IsNode (Distribution.Compat.Graph.Node k a)
instance GHC.Show.Show a => GHC.Show.Show (Distribution.Compat.Graph.Graph a)
instance (Distribution.Compat.Graph.IsNode a, GHC.Read.Read a, GHC.Show.Show (Distribution.Compat.Graph.Key a)) => GHC.Read.Read (Distribution.Compat.Graph.Graph a)
instance (Distribution.Compat.Graph.IsNode a, Data.Binary.Class.Binary a, GHC.Show.Show (Distribution.Compat.Graph.Key a)) => Data.Binary.Class.Binary (Distribution.Compat.Graph.Graph a)
instance (GHC.Classes.Eq (Distribution.Compat.Graph.Key a), GHC.Classes.Eq a) => GHC.Classes.Eq (Distribution.Compat.Graph.Graph a)
instance Data.Foldable.Foldable Distribution.Compat.Graph.Graph
instance (Control.DeepSeq.NFData a, Control.DeepSeq.NFData (Distribution.Compat.Graph.Key a)) => Control.DeepSeq.NFData (Distribution.Compat.Graph.Graph a)
instance (Distribution.Compat.Graph.IsNode a, Distribution.Compat.Graph.IsNode b, Distribution.Compat.Graph.Key a ~ Distribution.Compat.Graph.Key b) => Distribution.Compat.Graph.IsNode (Data.Either.Either a b)


-- | A very simple difference list.
module Distribution.Compat.DList

-- | Difference list.
data DList a
runDList :: DList a -> [a]

-- | Make <a>DList</a> with containing single element.
singleton :: a -> DList a
fromList :: [a] -> DList a
toList :: DList a -> [a]
snoc :: DList a -> a -> DList a
instance GHC.Base.Monoid (Distribution.Compat.DList.DList a)
instance GHC.Base.Semigroup (Distribution.Compat.DList.DList a)


-- | This module provides very basic lens functionality, without extra
°5udependencies.
°5u
°5uFor the documentation of the combinators see <a>lens</a> package. This
°5umodule uses the same vocabulary.
module Distribution.Compat.Lens
type Lens s t a b = forall f. Functor f => LensLike f s t a b
type Lens' s a = Lens s s a a
type Traversal s t a b = forall f. Applicative f => LensLike f s t a b
type Traversal' s a = Traversal s s a a
type LensLike f s t a b = (a -> f b) -> s -> f t
type LensLike' f s a = (a -> f a) -> s -> f s
type Getting r s a = LensLike (Const r) s s a a
type AGetter s a = LensLike (Const a) s s a a
type ASetter s t a b = LensLike Identity s t a b
type ALens s t a b = LensLike (Pretext a b) s t a b
type ALens' s a = ALens s s a a
view :: Getting a s a -> s -> a
use :: MonadState s m => Getting a s a -> m a
set :: ASetter s t a b -> b -> s -> t
over :: ASetter s t a b -> (a -> b) -> s -> t
toDListOf :: Getting (DList a) s a -> s -> DList a
toListOf :: Getting (DList a) s a -> s -> [a]
toSetOf :: Getting (Set a) s a -> s -> Set a
cloneLens :: Functor f => ALens s t a b -> LensLike f s t a b
aview :: ALens s t a b -> s -> a
_1 :: Lens (a, c) (b, c) a b
_2 :: Lens (c, a) (c, b) a b

-- | <a>&amp;</a> is a reverse application operator
(&) :: a -> (a -> b) -> b
infixl 1 &
(^.) :: s -> Getting a s a -> a
infixl 8 ^.
(.~) :: ASetter s t a b -> b -> s -> t
infixr 4 .~
(?~) :: ASetter s t a (Maybe b) -> b -> s -> t
infixr 4 ?~
(%~) :: ASetter s t a b -> (a -> b) -> s -> t
infixr 4 %~
(.=) :: MonadState s m => ASetter s s a b -> b -> m ()
infixr 4 .=
(?=) :: MonadState s m => ASetter s s a (Maybe b) -> b -> m ()
infixr 4 ?=
(%=) :: MonadState s m => ASetter s s a b -> (a -> b) -> m ()
infixr 4 %=
(^#) :: s -> ALens s t a b -> a
infixl 8 ^#
(#~) :: ALens s t a b -> b -> s -> t
infixr 4 #~
(#%~) :: ALens s t a b -> (a -> b) -> s -> t
infixr 4 #%~

-- | <tt>lens</tt> variant is also parametrised by profunctor.
data Pretext a b t
Pretext :: forall f. Functor f => (a -> f b) -> f t -> Pretext a b t
[runPretext] :: Pretext a b t -> forall f. Functor f => (a -> f b) -> f t
instance GHC.Base.Functor (Distribution.Compat.Lens.Pretext a b)


-- | Parsers for character streams
°5u
°5uOriginally in <tt>parsers</tt> package.
module Distribution.Compat.CharParsing

-- | <tt>oneOf cs</tt> succeeds if the current character is in the supplied
°5ulist of characters <tt>cs</tt>. Returns the parsed character. See also
°5u<a>satisfy</a>.
°5u
°5u<pre>
°5uvowel  = oneOf "aeiou"
°5u</pre>
oneOf :: CharParsing m => [Char] -> m Char

-- | As the dual of <a>oneOf</a>, <tt>noneOf cs</tt> succeeds if the
°5ucurrent character is <i>not</i> in the supplied list of characters
°5u<tt>cs</tt>. Returns the parsed character.
°5u
°5u<pre>
°5uconsonant = noneOf "aeiou"
°5u</pre>
noneOf :: CharParsing m => [Char] -> m Char

-- | Skips <i>zero</i> or more white space characters. See also
°5u<a>skipMany</a>.
spaces :: CharParsing m => m ()

-- | Parses a white space character (any character which satisfies
°5u<a>isSpace</a>) Returns the parsed character.
space :: CharParsing m => m Char

-- | Parses a newline character ('\n'). Returns a newline character.
newline :: CharParsing m => m Char

-- | Parses a tab character ('\t'). Returns a tab character.
tab :: CharParsing m => m Char

-- | Parses an upper case letter. Returns the parsed character.
upper :: CharParsing m => m Char

-- | Parses a lower case character. Returns the parsed character.
lower :: CharParsing m => m Char

-- | Parses a letter or digit. Returns the parsed character.
alphaNum :: CharParsing m => m Char

-- | Parses a letter (an upper case or lower case character). Returns the
°5uparsed character.
letter :: CharParsing m => m Char

-- | Parses a digit. Returns the parsed character.
digit :: CharParsing m => m Char

-- | Parses a hexadecimal digit (a digit or a letter between 'a' and 'f' or
°5u'A' and 'F'). Returns the parsed character.
hexDigit :: CharParsing m => m Char

-- | Parses an octal digit (a character between '0' and '7'). Returns the
°5uparsed character.
octDigit :: CharParsing m => m Char
satisfyRange :: CharParsing m => Char -> Char -> m Char

-- | Additional functionality needed to parse character streams.
class Parsing m => CharParsing m

-- | Parse a single character of the input, with UTF-8 decoding
satisfy :: CharParsing m => (Char -> Bool) -> m Char

-- | <tt>char c</tt> parses a single character <tt>c</tt>. Returns the
°5uparsed character (i.e. <tt>c</tt>).
°5u
°5u<i>e.g.</i>
°5u
°5u<pre>
°5usemiColon = <a>char</a> ';'
°5u</pre>
char :: CharParsing m => Char -> m Char

-- | <tt>notChar c</tt> parses any single character other than <tt>c</tt>.
°5uReturns the parsed character.
notChar :: CharParsing m => Char -> m Char

-- | This parser succeeds for any character. Returns the parsed character.
anyChar :: CharParsing m => m Char

-- | <tt>string s</tt> parses a sequence of characters given by <tt>s</tt>.
°5uReturns the parsed string (i.e. <tt>s</tt>).
°5u
°5u<pre>
°5udivOrMod    =   string "div"
°5u            &lt;|&gt; string "mod"
°5u</pre>
string :: CharParsing m => String -> m String

-- | <tt>text t</tt> parses a sequence of characters determined by the text
°5u<tt>t</tt> Returns the parsed text fragment (i.e. <tt>t</tt>).
°5u
°5uUsing <tt>OverloadedStrings</tt>:
°5u
°5u<pre>
°5udivOrMod    =   text "div"
°5u            &lt;|&gt; text "mod"
°5u</pre>
text :: CharParsing m => Text -> m Text
integral :: (CharParsing m, Integral a) => m a

-- | Greedily munch characters while predicate holds. Require at least one
°5ucharacter.
munch1 :: CharParsing m => (Char -> Bool) -> m String

-- | Greedely munch characters while predicate holds. Always succeeds.
munch :: CharParsing m => (Char -> Bool) -> m String
skipSpaces1 :: CharParsing m => m ()
instance (Distribution.Compat.CharParsing.CharParsing m, GHC.Base.MonadPlus m) => Distribution.Compat.CharParsing.CharParsing (Control.Monad.Trans.State.Lazy.StateT s m)
instance (Distribution.Compat.CharParsing.CharParsing m, GHC.Base.MonadPlus m) => Distribution.Compat.CharParsing.CharParsing (Control.Monad.Trans.State.Strict.StateT s m)
instance (Distribution.Compat.CharParsing.CharParsing m, GHC.Base.MonadPlus m) => Distribution.Compat.CharParsing.CharParsing (Control.Monad.Trans.Reader.ReaderT e m)
instance (Distribution.Compat.CharParsing.CharParsing m, GHC.Base.MonadPlus m, GHC.Base.Monoid w) => Distribution.Compat.CharParsing.CharParsing (Control.Monad.Trans.Writer.Strict.WriterT w m)
instance (Distribution.Compat.CharParsing.CharParsing m, GHC.Base.MonadPlus m, GHC.Base.Monoid w) => Distribution.Compat.CharParsing.CharParsing (Control.Monad.Trans.Writer.Lazy.WriterT w m)
instance (Distribution.Compat.CharParsing.CharParsing m, GHC.Base.MonadPlus m, GHC.Base.Monoid w) => Distribution.Compat.CharParsing.CharParsing (Control.Monad.Trans.RWS.Lazy.RWST r w s m)
instance (Distribution.Compat.CharParsing.CharParsing m, GHC.Base.MonadPlus m, GHC.Base.Monoid w) => Distribution.Compat.CharParsing.CharParsing (Control.Monad.Trans.RWS.Strict.RWST r w s m)
instance (Distribution.Compat.CharParsing.CharParsing m, GHC.Base.MonadPlus m) => Distribution.Compat.CharParsing.CharParsing (Control.Monad.Trans.Identity.IdentityT m)
instance Text.Parsec.Prim.Stream s m GHC.Types.Char => Distribution.Compat.CharParsing.CharParsing (Text.Parsec.Prim.ParsecT s u m)
instance (t ~ GHC.Types.Char) => Distribution.Compat.CharParsing.CharParsing (Distribution.Compat.ReadP.Parser r t)

module Distribution.CabalSpecVersion

-- | Different Cabal-the-spec versions.
°5u
°5uWe branch based on this at least in the parser.
data CabalSpecVersion
CabalSpecOld :: CabalSpecVersion
CabalSpecV20 :: CabalSpecVersion
CabalSpecV22 :: CabalSpecVersion
cabalSpecLatest :: CabalSpecVersion
cabalSpecFeatures :: CabalSpecVersion -> Set CabalFeature
cabalSpecSupports :: CabalSpecVersion -> [Int] -> Bool
specHasCommonStanzas :: CabalSpecVersion -> HasCommonStanzas
specHasElif :: CabalSpecVersion -> HasElif
data CabalFeature
Elif :: CabalFeature
CommonStanzas :: CabalFeature
data HasElif
HasElif :: HasElif
NoElif :: HasElif
data HasCommonStanzas
HasCommonStanzas :: HasCommonStanzas
NoCommonStanzas :: HasCommonStanzas
instance GHC.Show.Show Distribution.CabalSpecVersion.HasCommonStanzas
instance GHC.Classes.Eq Distribution.CabalSpecVersion.HasCommonStanzas
instance GHC.Show.Show Distribution.CabalSpecVersion.HasElif
instance GHC.Classes.Eq Distribution.CabalSpecVersion.HasElif
instance GHC.Generics.Generic Distribution.CabalSpecVersion.CabalFeature
instance Data.Data.Data Distribution.CabalSpecVersion.CabalFeature
instance GHC.Enum.Bounded Distribution.CabalSpecVersion.CabalFeature
instance GHC.Enum.Enum Distribution.CabalSpecVersion.CabalFeature
instance GHC.Read.Read Distribution.CabalSpecVersion.CabalFeature
instance GHC.Show.Show Distribution.CabalSpecVersion.CabalFeature
instance GHC.Classes.Ord Distribution.CabalSpecVersion.CabalFeature
instance GHC.Classes.Eq Distribution.CabalSpecVersion.CabalFeature
instance GHC.Generics.Generic Distribution.CabalSpecVersion.CabalSpecVersion
instance Data.Data.Data Distribution.CabalSpecVersion.CabalSpecVersion
instance GHC.Enum.Bounded Distribution.CabalSpecVersion.CabalSpecVersion
instance GHC.Enum.Enum Distribution.CabalSpecVersion.CabalSpecVersion
instance GHC.Read.Read Distribution.CabalSpecVersion.CabalSpecVersion
instance GHC.Show.Show Distribution.CabalSpecVersion.CabalSpecVersion
instance GHC.Classes.Ord Distribution.CabalSpecVersion.CabalSpecVersion
instance GHC.Classes.Eq Distribution.CabalSpecVersion.CabalSpecVersion

module Distribution.Compat.CreatePipe
createPipe :: IO (Handle, Handle)


module Distribution.PackageDescription.Quirks

-- | Patch legacy <tt>.cabal</tt> file contents to allow parsec parser to
°5uaccept all of Hackage.
°5u
°5uBool part of the result tells whether the output is modified.
patchQuirks :: ByteString -> (Bool, ByteString)


-- | Common utils used by modules under Distribution.PackageDescription.*.
module Distribution.PackageDescription.Utils
cabalBug :: String -> a
userBug :: String -> a


-- | Module containing small types
module Distribution.Parsec.Common

-- | Parser error.
data PError
PError :: Position -> String -> PError
showPError :: FilePath -> PError -> String

-- | Parser warning.
data PWarning
PWarning :: !PWarnType -> !Position -> String -> PWarning

-- | Type of parser warning. We do classify warnings.
°5u
°5uDifferent application may decide not to show some, or have fatal
°5ubehaviour on others
data PWarnType

-- | Unclassified warning
PWTOther :: PWarnType

-- | Invalid UTF encoding
PWTUTF :: PWarnType

-- | <tt>true</tt> or <tt>false</tt>, not <tt>True</tt> or <tt>False</tt>
PWTBoolCase :: PWarnType

-- | there are version with tags
PWTVersionTag :: PWarnType

-- | New syntax used, but no <tt>cabal-version: &gt;= 1.2</tt> specified
PWTNewSyntax :: PWarnType

-- | Old syntax used, and <tt>cabal-version &gt;= 1.2</tt> specified
PWTOldSyntax :: PWarnType
PWTDeprecatedField :: PWarnType
PWTInvalidSubsection :: PWarnType
PWTUnknownField :: PWarnType
PWTUnknownSection :: PWarnType
PWTTrailingFields :: PWarnType

-- | extra main-is field
PWTExtraMainIs :: PWarnType

-- | extra test-module field
PWTExtraTestModule :: PWarnType

-- | extra benchmark-module field
PWTExtraBenchmarkModule :: PWarnType
PWTLexNBSP :: PWarnType
PWTLexBOM :: PWarnType
PWTLexTab :: PWarnType

-- | legacy cabal file that we know how to patch
PWTQuirkyCabalFile :: PWarnType

-- | Double dash token, most likely it's a mistake - it's not a comment
PWTDoubleDash :: PWarnType

-- | e.g. name or version should be specified only once.
PWTMultipleSingularField :: PWarnType

-- | Workaround for derive-package having build-type: Default. See
°5u<a>https://github.com/haskell/cabal/issues/5020</a>.
PWTBuildTypeDefault :: PWarnType
showPWarning :: FilePath -> PWarning -> String

-- | 1-indexed row and column positions in a file.
data Position
Position :: {-# UNPACK #-} !Int -> {-# UNPACK #-} !Int -> Position

-- | Shift position by n columns to the right.
incPos :: Int -> Position -> Position

-- | Shift position to beginning of next row.
retPos :: Position -> Position
showPos :: Position -> String
zeroPos :: Position
instance GHC.Show.Show Distribution.Parsec.Common.PError
instance GHC.Show.Show Distribution.Parsec.Common.PWarning
instance GHC.Show.Show Distribution.Parsec.Common.Position
instance GHC.Classes.Ord Distribution.Parsec.Common.Position
instance GHC.Classes.Eq Distribution.Parsec.Common.Position
instance GHC.Enum.Bounded Distribution.Parsec.Common.PWarnType
instance GHC.Enum.Enum Distribution.Parsec.Common.PWarnType
instance GHC.Show.Show Distribution.Parsec.Common.PWarnType
instance GHC.Classes.Ord Distribution.Parsec.Common.PWarnType
instance GHC.Classes.Eq Distribution.Parsec.Common.PWarnType

module Distribution.Parsec.Class

-- | Class for parsing with <tt>parsec</tt>. Mainly used for
°5u<tt>.cabal</tt> file fields.
class Parsec a
parsec :: (Parsec a, CabalParsing m) => m a
newtype ParsecParser a
PP :: CabalSpecVersion -> Parsec String [PWarning] a -> ParsecParser a
[unPP] :: ParsecParser a -> CabalSpecVersion -> Parsec String [PWarning] a

-- | Run <a>ParsecParser</a> with <a>cabalSpecLatest</a>.
runParsecParser :: ParsecParser a -> FilePath -> String -> Either ParseError a

-- | Parse a <a>String</a> with <a>lexemeParsec</a>.
simpleParsec :: Parsec a => String -> Maybe a

-- | <a>parsec</a> <i>could</i> consume trailing spaces, this function
°5u<i>will</i> consume.
lexemeParsec :: (CabalParsing m, Parsec a) => m a

-- | Parse a <a>String</a> with <a>lexemeParsec</a>.
eitherParsec :: Parsec a => String -> Either String a

-- | Parsing class which
°5u
°5u<ul>
°5u<li>can report Cabal parser warnings.</li>
°5u<li>knows <tt>cabal-version</tt> we work with</li>
°5u</ul>
class (CharParsing m, MonadPlus m) => CabalParsing m
parsecWarning :: CabalParsing m => PWarnType -> String -> m ()
parsecHaskellString :: CabalParsing m => m String
askCabalSpecVersion :: CabalParsing m => m CabalSpecVersion

-- | Type of parser warning. We do classify warnings.
°5u
°5uDifferent application may decide not to show some, or have fatal
°5ubehaviour on others
data PWarnType

-- | Unclassified warning
PWTOther :: PWarnType

-- | Invalid UTF encoding
PWTUTF :: PWarnType

-- | <tt>true</tt> or <tt>false</tt>, not <tt>True</tt> or <tt>False</tt>
PWTBoolCase :: PWarnType

-- | there are version with tags
PWTVersionTag :: PWarnType

-- | New syntax used, but no <tt>cabal-version: &gt;= 1.2</tt> specified
PWTNewSyntax :: PWarnType

-- | Old syntax used, and <tt>cabal-version &gt;= 1.2</tt> specified
PWTOldSyntax :: PWarnType
PWTDeprecatedField :: PWarnType
PWTInvalidSubsection :: PWarnType
PWTUnknownField :: PWarnType
PWTUnknownSection :: PWarnType
PWTTrailingFields :: PWarnType

-- | extra main-is field
PWTExtraMainIs :: PWarnType

-- | extra test-module field
PWTExtraTestModule :: PWarnType

-- | extra benchmark-module field
PWTExtraBenchmarkModule :: PWarnType
PWTLexNBSP :: PWarnType
PWTLexBOM :: PWarnType
PWTLexTab :: PWarnType

-- | legacy cabal file that we know how to patch
PWTQuirkyCabalFile :: PWarnType

-- | Double dash token, most likely it's a mistake - it's not a comment
PWTDoubleDash :: PWarnType

-- | e.g. name or version should be specified only once.
PWTMultipleSingularField :: PWarnType

-- | Workaround for derive-package having build-type: Default. See
°5u<a>https://github.com/haskell/cabal/issues/5020</a>.
PWTBuildTypeDefault :: PWarnType

-- | <pre>
°5u[^ ,]
°5u</pre>
parsecToken :: CabalParsing m => m String

-- | <pre>
°5u[^ ]
°5u</pre>
parsecToken' :: CabalParsing m => m String
parsecFilePath :: CabalParsing m => m FilePath

-- | Content isn't unquoted
parsecQuoted :: CabalParsing m => m a -> m a

-- | <tt>parsecMaybeQuoted p = <a>parsecQuoted</a> p <a>|</a> p</tt>.
parsecMaybeQuoted :: CabalParsing m => m a -> m a
parsecCommaList :: CabalParsing m => m a -> m [a]

-- | Like <a>parsecCommaList</a> but accept leading or trailing comma.
°5u
°5u<pre>
°5up (comma p)*  -- p <tt>sepBy</tt> comma
°5u(comma p)*    -- leading comma
°5u(p comma)*    -- trailing comma
°5u</pre>
parsecLeadingCommaList :: CabalParsing m => m a -> m [a]
parsecOptCommaList :: CabalParsing m => m a -> m [a]

-- | Parse a benchmark/test-suite types.
parsecStandard :: (CabalParsing m, Parsec ver) => (ver -> String -> a) -> m a
parsecUnqualComponentName :: CabalParsing m => m String
instance GHC.Base.Functor Distribution.Parsec.Class.ParsecParser
instance GHC.Base.Applicative Distribution.Parsec.Class.ParsecParser
instance GHC.Base.Alternative Distribution.Parsec.Class.ParsecParser
instance GHC.Base.Monad Distribution.Parsec.Class.ParsecParser
instance GHC.Base.MonadPlus Distribution.Parsec.Class.ParsecParser
instance Control.Monad.Fail.MonadFail Distribution.Parsec.Class.ParsecParser
instance Distribution.Compat.Parsing.Parsing Distribution.Parsec.Class.ParsecParser
instance Distribution.Compat.CharParsing.CharParsing Distribution.Parsec.Class.ParsecParser
instance Distribution.Parsec.Class.CabalParsing Distribution.Parsec.Class.ParsecParser
instance Distribution.Parsec.Class.Parsec a => Distribution.Parsec.Class.Parsec (Data.Functor.Identity.Identity a)
instance Distribution.Parsec.Class.Parsec GHC.Types.Bool
instance (t ~ GHC.Types.Char) => Distribution.Parsec.Class.CabalParsing (Distribution.Compat.ReadP.Parser r t)


-- | Cabal-like file AST types: <a>Field</a>, <a>Section</a> etc
°5u
°5uThese types are parametrized by an annotation.
module Distribution.Parsec.Field

-- | A Cabal-like file consists of a series of fields (<tt>foo: bar</tt>)
°5uand sections (<tt>library ...</tt>).
data Field ann
Field :: !(Name ann) -> [FieldLine ann] -> Field ann
Section :: !(Name ann) -> [SectionArg ann] -> [Field ann] -> Field ann

-- | Section of field name
fieldName :: Field ann -> Name ann
fieldAnn :: Field ann -> ann

-- | All transitive descendands of <a>Field</a>, including itself.
°5u
°5u<i>Note:</i> the resulting list is never empty.
fieldUniverse :: Field ann -> [Field ann]

-- | A line of text representing the value of a field from a Cabal file. A
°5ufield may contain multiple lines.
°5u
°5u<i>Invariant:</i> <a>ByteString</a> has no newlines.
data FieldLine ann
FieldLine :: !ann -> !ByteString -> FieldLine ann

-- | Section arguments, e.g. name of the library
data SectionArg ann

-- | identifier, or omething which loos like number. Also many dot numbers,
°5ui.e. "7.6.3"
SecArgName :: !ann -> !ByteString -> SectionArg ann

-- | quoted string
SecArgStr :: !ann -> !ByteString -> SectionArg ann

-- | everything else, mm. operators (e.g. in if-section conditionals)
SecArgOther :: !ann -> !ByteString -> SectionArg ann

-- | Extract annotation from <a>SectionArg</a>.
sectionArgAnn :: SectionArg ann -> ann
type FieldName = ByteString

-- | A field name.
°5u
°5u<i>Invariant</i>: <a>ByteString</a> is lower-case ASCII.
data Name ann
Name :: !ann -> !FieldName -> Name ann
mkName :: ann -> FieldName -> Name ann
getName :: Name ann -> FieldName
nameAnn :: Name ann -> ann
instance GHC.Base.Functor Distribution.Parsec.Field.Field
instance GHC.Show.Show ann => GHC.Show.Show (Distribution.Parsec.Field.Field ann)
instance GHC.Classes.Eq ann => GHC.Classes.Eq (Distribution.Parsec.Field.Field ann)
instance GHC.Base.Functor Distribution.Parsec.Field.Name
instance GHC.Show.Show ann => GHC.Show.Show (Distribution.Parsec.Field.Name ann)
instance GHC.Classes.Eq ann => GHC.Classes.Eq (Distribution.Parsec.Field.Name ann)
instance GHC.Base.Functor Distribution.Parsec.Field.SectionArg
instance GHC.Show.Show ann => GHC.Show.Show (Distribution.Parsec.Field.SectionArg ann)
instance GHC.Classes.Eq ann => GHC.Classes.Eq (Distribution.Parsec.Field.SectionArg ann)
instance GHC.Base.Functor Distribution.Parsec.Field.FieldLine
instance GHC.Show.Show ann => GHC.Show.Show (Distribution.Parsec.Field.FieldLine ann)
instance GHC.Classes.Eq ann => GHC.Classes.Eq (Distribution.Parsec.Field.FieldLine ann)


module Distribution.Parsec.LexerMonad
type InputStream = ByteString
data LexState
LexState :: {-# UNPACK #-} !Position -> {-# UNPACK #-} !InputStream -> {-# UNPACK #-} !StartCode -> [LexWarning] -> LexState

-- | position at current input location
[curPos] :: LexState -> {-# UNPACK #-} !Position

-- | the current input
[curInput] :: LexState -> {-# UNPACK #-} !InputStream

-- | lexer code
[curCode] :: LexState -> {-# UNPACK #-} !StartCode
[warnings] :: LexState -> [LexWarning]
data LexResult a
LexResult :: {-# UNPACK #-} !LexState -> a -> LexResult a
newtype Lex a
Lex :: LexState -> LexResult a -> Lex a
[unLex] :: Lex a -> LexState -> LexResult a

-- | Execute the given lexer on the supplied input stream.
execLexer :: Lex a -> InputStream -> ([LexWarning], a)
getPos :: Lex Position
setPos :: Position -> Lex ()
adjustPos :: (Position -> Position) -> Lex ()
getInput :: Lex InputStream
setInput :: InputStream -> Lex ()
getStartCode :: Lex Int
setStartCode :: Int -> Lex ()
data LexWarning
LexWarning :: !LexWarningType -> {-# UNPACK #-} !Position -> LexWarning
data LexWarningType

-- | Encountered non breaking space
LexWarningNBSP :: LexWarningType

-- | BOM at the start of the cabal file
LexWarningBOM :: LexWarningType

-- | Leading tags
LexWarningTab :: LexWarningType

-- | Add warning at the current position
addWarning :: LexWarningType -> Lex ()
toPWarnings :: [LexWarning] -> [PWarning]
instance GHC.Show.Show Distribution.Parsec.LexerMonad.LexWarning
instance GHC.Show.Show Distribution.Parsec.LexerMonad.LexWarningType
instance GHC.Classes.Ord Distribution.Parsec.LexerMonad.LexWarningType
instance GHC.Classes.Eq Distribution.Parsec.LexerMonad.LexWarningType
instance GHC.Base.Functor Distribution.Parsec.LexerMonad.Lex
instance GHC.Base.Applicative Distribution.Parsec.LexerMonad.Lex
instance GHC.Base.Monad Distribution.Parsec.LexerMonad.Lex


-- | Lexer for the cabal files.
module Distribution.Parsec.Lexer
ltest :: Int -> String -> IO ()
lexToken :: Lex LToken

-- | Tokens of outer cabal file structure. Field values are treated
°5uopaquely.
data Token

-- | Haskell-like identifier, number or operator
TokSym :: !ByteString -> Token

-- | String in quotes
TokStr :: !ByteString -> Token

-- | Operators and parens
TokOther :: !ByteString -> Token

-- | Indentation token
Indent :: !Int -> Token

-- | Lines after <tt>:</tt>
TokFieldLine :: !ByteString -> Token
Colon :: Token
OpenBrace :: Token
CloseBrace :: Token
EOF :: Token
LexicalError :: InputStream -> Token
data LToken
L :: !Position -> !Token -> LToken
bol_section :: Int
in_section :: Int
in_field_layout :: Int
in_field_braces :: Int
mkLexState :: ByteString -> LexState
instance GHC.Show.Show Distribution.Parsec.Lexer.LToken
instance GHC.Show.Show Distribution.Parsec.Lexer.Token
instance GHC.Base.Functor Distribution.Parsec.Lexer.AlexLastAcc


module Distribution.Parsec.Parser

-- | A Cabal-like file consists of a series of fields (<tt>foo: bar</tt>)
°5uand sections (<tt>library ...</tt>).
data Field ann
Field :: !(Name ann) -> [FieldLine ann] -> Field ann
Section :: !(Name ann) -> [SectionArg ann] -> [Field ann] -> Field ann

-- | A field name.
°5u
°5u<i>Invariant</i>: <a>ByteString</a> is lower-case ASCII.
data Name ann
Name :: !ann -> !FieldName -> Name ann

-- | A line of text representing the value of a field from a Cabal file. A
°5ufield may contain multiple lines.
°5u
°5u<i>Invariant:</i> <a>ByteString</a> has no newlines.
data FieldLine ann
FieldLine :: !ann -> !ByteString -> FieldLine ann

-- | Section arguments, e.g. name of the library
data SectionArg ann

-- | identifier, or omething which loos like number. Also many dot numbers,
°5ui.e. "7.6.3"
SecArgName :: !ann -> !ByteString -> SectionArg ann

-- | quoted string
SecArgStr :: !ann -> !ByteString -> SectionArg ann

-- | everything else, mm. operators (e.g. in if-section conditionals)
SecArgOther :: !ann -> !ByteString -> SectionArg ann

-- | Parse cabal style <a>ByteString</a> into list of <a>Field</a>s, i.e.
°5uthe cabal AST.
readFields :: ByteString -> Either ParseError [Field Position]

-- | Like <a>readFields</a> but also return lexer warnings
readFields' :: ByteString -> Either ParseError ([Field Position], [LexWarning])
instance Text.Parsec.Prim.Stream Distribution.Parsec.Parser.LexState' Data.Functor.Identity.Identity Distribution.Parsec.Lexer.LToken

module Distribution.Pretty
class Pretty a
pretty :: Pretty a => a -> Doc
prettyShow :: Pretty a => a -> String

-- | The default rendering style used in Cabal for console output. It has a
°5ufixed page width and adds line breaks automatically.
defaultStyle :: Style

-- | A style for rendering all on one line.
flatStyle :: Style
showFilePath :: FilePath -> Doc
showToken :: String -> Doc

-- | Pretty-print free-format text, ensuring that it is vertically aligned,
°5uand with blank lines replaced by dots for correct re-parsing.
showFreeText :: String -> Doc

-- | the indentation used for pretty printing
indentWith :: Int
type Separator = [Doc] -> Doc
instance Distribution.Pretty.Pretty GHC.Types.Bool
instance Distribution.Pretty.Pretty GHC.Types.Int
instance Distribution.Pretty.Pretty a => Distribution.Pretty.Pretty (Data.Functor.Identity.Identity a)

module Distribution.FieldGrammar.Class

-- | <a>FieldGrammar</a> is parametrised by
°5u
°5u<ul>
°5u<li><tt>s</tt> which is a structure we are parsing. We need this to
°5uprovide prettyprinter functionality</li>
°5u<li><tt>a</tt> type of the field.</li>
°5u</ul>
°5u
°5u<i>Note:</i> We'd like to have <tt>forall s. Applicative (f s)</tt>
°5ucontext.
class FieldGrammar g

-- | Unfocus, zoom out, <i>blur</i> <a>FieldGrammar</a>.
blurFieldGrammar :: FieldGrammar g => ALens' a b -> g b c -> g a c

-- | Field which should be defined, exactly once.
uniqueFieldAla :: (FieldGrammar g, Parsec b, Pretty b, Newtype b a) => FieldName -> (a -> b) -> ALens' s a -> g s a

-- | Boolean field with a default value.
booleanFieldDef :: FieldGrammar g => FieldName -> ALens' s Bool -> Bool -> g s Bool

-- | Optional field.
optionalFieldAla :: (FieldGrammar g, Parsec b, Pretty b, Newtype b a) => FieldName -> (a -> b) -> ALens' s (Maybe a) -> g s (Maybe a)

-- | Optional field with default value.
optionalFieldDefAla :: (FieldGrammar g, Parsec b, Pretty b, Newtype b a, Eq a) => FieldName -> (a -> b) -> ALens' s a -> a -> g s a

-- | Monoidal field.
°5u
°5uValues are combined with <a>mappend</a>.
°5u
°5u<i>Note:</i> <a>optionalFieldAla</a> is a <tt>monoidalField</tt> with
°5u<tt>Last</tt> monoid.
monoidalFieldAla :: (FieldGrammar g, Parsec b, Pretty b, Monoid a, Newtype b a) => FieldName -> (a -> b) -> ALens' s a -> g s a

-- | Parser matching all fields with a name starting with a prefix.
prefixedFields :: FieldGrammar g => FieldName -> ALens' s [(String, String)] -> g s [(String, String)]

-- | Known field, which we don't parse, neither pretty print.
knownField :: FieldGrammar g => FieldName -> g s ()

-- | Field which is parsed but not pretty printed.
hiddenField :: FieldGrammar g => g s a -> g s a

-- | Deprecated since
deprecatedSince :: FieldGrammar g => [Int] -> String -> g s a -> g s a

-- | Annotate field with since spec-version.
availableSince :: FieldGrammar g => [Int] -> a -> g s a -> g s a

-- | Field which can be defined at most once.
uniqueField :: (FieldGrammar g, Parsec a, Pretty a) => FieldName -> ALens' s a -> g s a

-- | Field which can be defined at most once.
optionalField :: (FieldGrammar g, Parsec a, Pretty a) => FieldName -> ALens' s (Maybe a) -> g s (Maybe a)

-- | Optional field with default value.
optionalFieldDef :: (FieldGrammar g, Functor (g s), Parsec a, Pretty a, Eq a) => FieldName -> ALens' s a -> a -> g s a

-- | Field which can be define multiple times, and the results are
°5u<tt>mappend</tt>ed.
monoidalField :: (FieldGrammar g, Parsec a, Pretty a, Monoid a) => FieldName -> ALens' s a -> g s a

-- | Deprecated field. If found, warning is issued.
°5u
°5u<i>Note:</i> also it's not pretty printed!
deprecatedField' :: FieldGrammar g => String -> g s a -> g s a


-- | Simple parsing with failure
module Distribution.ReadE

-- | Parser with simple error reporting
newtype ReadE a
ReadE :: String -> Either ErrorMsg a -> ReadE a
[runReadE] :: ReadE a -> String -> Either ErrorMsg a
succeedReadE :: (String -> a) -> ReadE a
failReadE :: ErrorMsg -> ReadE a
parseReadE :: ReadE a -> ReadP r a
readEOrFail :: ReadE a -> String -> a
readP_to_E :: (String -> ErrorMsg) -> ReadP a a -> ReadE a
parsecToReadE :: (String -> ErrorMsg) -> ParsecParser a -> ReadE a
instance GHC.Base.Functor Distribution.ReadE.ReadE


-- | This simple package provides types and functions for interacting with
°5uC compilers. Currently it's just a type enumerating extant C-like
°5ulanguages, which we call dialects.
module Distribution.Simple.CCompiler

-- | Represents a dialect of C. The Monoid instance expresses backward
°5ucompatibility, in the sense that 'mappend a b' is the least inclusive
°5udialect which both <tt>a</tt> and <tt>b</tt> can be correctly
°5uinterpreted as.
data CDialect
C :: CDialect
ObjectiveC :: CDialect
CPlusPlus :: CDialect
ObjectiveCPlusPlus :: CDialect

-- | A list of all file extensions which are recognized as possibly
°5ucontaining some dialect of C code. Note that this list is only for
°5usource files, not for header files.
cSourceExtensions :: [String]

-- | Takes a dialect of C and whether code is intended to be passed through
°5uthe preprocessor, and returns a filename extension for containing that
°5ucode.
cDialectFilenameExtension :: CDialect -> Bool -> String

-- | Infers from a filename's extension the dialect of C which it contains,
°5uand whether it is intended to be passed through the preprocessor.
filenameCDialect :: String -> Maybe (CDialect, Bool)
instance GHC.Show.Show Distribution.Simple.CCompiler.CDialect
instance GHC.Classes.Eq Distribution.Simple.CCompiler.CDialect
instance GHC.Base.Monoid Distribution.Simple.CCompiler.CDialect
instance GHC.Base.Semigroup Distribution.Simple.CCompiler.CDialect


-- | Remove the "literal" markups from a Haskell source file, including
°5u"<tt>&gt;</tt>", "<tt>\begin{code}</tt>", "<tt>\end{code}</tt>", and
°5u"<tt>#</tt>"
module Distribution.Simple.PreProcess.Unlit

-- | <a>unlit</a> takes a filename (for error reports), and transforms the
°5ugiven string, to eliminate the literate comments from the program
°5utext.
unlit :: FilePath -> String -> Either String String

-- | No unliteration.
plain :: String -> String -> String


-- | Internal utilities used by Distribution.Simple.Program.*.
module Distribution.Simple.Program.Internal

-- | Extract the version number from the output of 'strip --version'.
°5u
°5uInvoking "strip --version" gives very inconsistent results. We ignore
°5ueverything in parentheses (see #2497), look for the first word that
°5ustarts with a number, and try parsing out the first two components of
°5uit. Non-GNU <tt>strip</tt> doesn't appear to have a version flag.
stripExtractVersion :: String -> String


-- | This module defines the detailed test suite interface which makes it
°5upossible to expose individual tests to Cabal or other test agents.
module Distribution.TestSuite
data TestInstance
TestInstance :: IO Progress -> String -> [String] -> [OptionDescr] -> String -> String -> Either String TestInstance -> TestInstance

-- | Perform the test.
[run] :: TestInstance -> IO Progress

-- | A name for the test, unique within a test suite.
[name] :: TestInstance -> String

-- | Users can select groups of tests by their tags.
[tags] :: TestInstance -> [String]

-- | Descriptions of the options recognized by this test.
[options] :: TestInstance -> [OptionDescr]

-- | Try to set the named option to the given value. Returns an error
°5umessage if the option is not supported or the value could not be
°5ucorrectly parsed; otherwise, a <a>TestInstance</a> with the option set
°5uto the given value is returned.
[setOption] :: TestInstance -> String -> String -> Either String TestInstance
data OptionDescr
OptionDescr :: String -> String -> OptionType -> Maybe String -> OptionDescr
[optionName] :: OptionDescr -> String

-- | A human-readable description of the option to guide the user setting
°5uit.
[optionDescription] :: OptionDescr -> String
[optionType] :: OptionDescr -> OptionType
[optionDefault] :: OptionDescr -> Maybe String
data OptionType
OptionFile :: Bool -> Bool -> [String] -> OptionType
[optionFileMustExist] :: OptionType -> Bool
[optionFileIsDir] :: OptionType -> Bool
[optionFileExtensions] :: OptionType -> [String]
OptionString :: Bool -> OptionType
[optionStringMultiline] :: OptionType -> Bool
OptionNumber :: Bool -> (Maybe String, Maybe String) -> OptionType
[optionNumberIsInt] :: OptionType -> Bool
[optionNumberBounds] :: OptionType -> (Maybe String, Maybe String)
OptionBool :: OptionType
OptionEnum :: [String] -> OptionType
OptionSet :: [String] -> OptionType
OptionRngSeed :: OptionType
data Test
Test :: TestInstance -> Test
Group :: String -> Bool -> [Test] -> Test
[groupName] :: Test -> String

-- | If true, then children of this group may be run in parallel. Note that
°5uthis setting is not inherited by children. In particular, consider a
°5ugroup F with "concurrently = False" that has some children, including
°5ua group T with "concurrently = True". The children of group T may be
°5urun concurrently with each other, as long as none are run at the same
°5utime as any of the direct children of group F.
[concurrently] :: Test -> Bool
[groupTests] :: Test -> [Test]
ExtraOptions :: [OptionDescr] -> Test -> Test
type Options = [(String, String)]
data Progress
Finished :: Result -> Progress
Progress :: String -> (IO Progress) -> Progress
data Result
Pass :: Result
Fail :: String -> Result
Error :: String -> Result

-- | Create a named group of tests, which are assumed to be safe to run in
°5uparallel.
testGroup :: String -> [Test] -> Test
instance GHC.Show.Show Distribution.TestSuite.Result
instance GHC.Read.Read Distribution.TestSuite.Result
instance GHC.Classes.Eq Distribution.TestSuite.Result
instance GHC.Show.Show Distribution.TestSuite.OptionDescr
instance GHC.Read.Read Distribution.TestSuite.OptionDescr
instance GHC.Classes.Eq Distribution.TestSuite.OptionDescr
instance GHC.Show.Show Distribution.TestSuite.OptionType
instance GHC.Read.Read Distribution.TestSuite.OptionType
instance GHC.Classes.Eq Distribution.TestSuite.OptionType


-- | This defines a <a>Text</a> class which is a bit like the <a>Read</a>
°5uand <a>Show</a> classes. The difference is that it uses a modern
°5upretty printer and parser system and the format is not expected to be
°5uHaskell concrete syntax but rather the external human readable
°5urepresentation used by Cabal.
module Distribution.Text

-- | <i>Note:</i> this class will soon be deprecated. It's not yet, so that
°5uwe are <tt>-Wall</tt> clean.
class Text a
disp :: Text a => a -> Doc
disp :: (Text a, Pretty a) => a -> Doc
parse :: Text a => ReadP r a
parse :: (Text a, Parsec a) => ReadP r a

-- | The default rendering style used in Cabal for console output. It has a
°5ufixed page width and adds line breaks automatically.
defaultStyle :: Style

-- | Pretty-prints with the default style.
display :: Text a => a -> String

-- | A style for rendering all on one line.
flatStyle :: Style
simpleParse :: Text a => String -> Maybe a
stdParse :: Text ver => (ver -> String -> res) -> ReadP r res
instance Distribution.Text.Text GHC.Types.Bool
instance Distribution.Text.Text GHC.Types.Int
instance Distribution.Text.Text a => Distribution.Text.Text (Data.Functor.Identity.Identity a)
instance Distribution.Text.Text Data.Version.Version

module Distribution.Types.BuildType

-- | The type of build system used by this package.
data BuildType

-- | calls <tt>Distribution.Simple.defaultMain</tt>
Simple :: BuildType

-- | calls <tt>Distribution.Simple.defaultMainWithHooks
°5udefaultUserHooks</tt>, which invokes <tt>configure</tt> to generate
°5uadditional build information used by later phases.
Configure :: BuildType

-- | calls <tt>Distribution.Make.defaultMain</tt>
Make :: BuildType

-- | uses user-supplied <tt>Setup.hs</tt> or <tt>Setup.lhs</tt> (default)
Custom :: BuildType
knownBuildTypes :: [BuildType]
instance Data.Data.Data Distribution.Types.BuildType.BuildType
instance GHC.Classes.Eq Distribution.Types.BuildType.BuildType
instance GHC.Read.Read Distribution.Types.BuildType.BuildType
instance GHC.Show.Show Distribution.Types.BuildType.BuildType
instance GHC.Generics.Generic Distribution.Types.BuildType.BuildType
instance Data.Binary.Class.Binary Distribution.Types.BuildType.BuildType
instance Control.DeepSeq.NFData Distribution.Types.BuildType.BuildType
instance Distribution.Pretty.Pretty Distribution.Types.BuildType.BuildType
instance Distribution.Parsec.Class.Parsec Distribution.Types.BuildType.BuildType
instance Distribution.Text.Text Distribution.Types.BuildType.BuildType

module Distribution.Types.Condition

-- | A boolean expression parameterized over the variable type used.
data Condition c
Var :: c -> Condition c
Lit :: Bool -> Condition c
CNot :: (Condition c) -> Condition c
COr :: (Condition c) -> (Condition c) -> Condition c
CAnd :: (Condition c) -> (Condition c) -> Condition c

-- | Boolean negation of a <a>Condition</a> value.
cNot :: Condition a -> Condition a

-- | Boolean AND of two <tt>Condtion</tt> values.
cAnd :: Condition a -> Condition a -> Condition a

-- | Boolean OR of two <a>Condition</a> values.
cOr :: Eq v => Condition v -> Condition v -> Condition v

-- | Simplify the condition and return its free variables.
simplifyCondition :: Condition c -> (c -> Either d Bool) -> (Condition d, [d])
instance GHC.Generics.Generic (Distribution.Types.Condition.Condition c)
instance Data.Data.Data c => Data.Data.Data (Distribution.Types.Condition.Condition c)
instance GHC.Classes.Eq c => GHC.Classes.Eq (Distribution.Types.Condition.Condition c)
instance GHC.Show.Show c => GHC.Show.Show (Distribution.Types.Condition.Condition c)
instance GHC.Base.Functor Distribution.Types.Condition.Condition
instance Data.Foldable.Foldable Distribution.Types.Condition.Condition
instance Data.Traversable.Traversable Distribution.Types.Condition.Condition
instance GHC.Base.Applicative Distribution.Types.Condition.Condition
instance GHC.Base.Monad Distribution.Types.Condition.Condition
instance GHC.Base.Monoid (Distribution.Types.Condition.Condition a)
instance GHC.Base.Semigroup (Distribution.Types.Condition.Condition a)
instance GHC.Base.Alternative Distribution.Types.Condition.Condition
instance GHC.Base.MonadPlus Distribution.Types.Condition.Condition
instance Data.Binary.Class.Binary c => Data.Binary.Class.Binary (Distribution.Types.Condition.Condition c)
instance Control.DeepSeq.NFData c => Control.DeepSeq.NFData (Distribution.Types.Condition.Condition c)

module Distribution.Types.CondTree

-- | A <a>CondTree</a> is used to represent the conditional structure of a
°5uCabal file, reflecting a syntax element subject to constraints, and
°5uthen any number of sub-elements which may be enabled subject to some
°5ucondition. Both <tt>a</tt> and <tt>c</tt> are usually <a>Monoid</a>s.
°5u
°5uTo be more concrete, consider the following fragment of a
°5u<tt>Cabal</tt> file:
°5u
°5u<pre>
°5ubuild-depends: base &gt;= 4.0
°5uif flag(extra)
°5u    build-depends: base &gt;= 4.2
°5u</pre>
°5u
°5uOne way to represent this is to have <tt><a>CondTree</a>
°5u<tt>ConfVar</tt> [<tt>Dependency</tt>] <tt>BuildInfo</tt></tt>. Here,
°5u<a>condTreeData</a> represents the actual fields which are not behind
°5uany conditional, while <a>condTreeComponents</a> recursively records
°5uany further fields which are behind a conditional.
°5u<a>condTreeConstraints</a> records the constraints (in this case,
°5u<tt>base &gt;= 4.0</tt>) which would be applied if you use this
°5usyntax; in general, this is derived off of <tt>targetBuildInfo</tt>
°5u(perhaps a good refactoring would be to convert this into an opaque
°5utype, with a smart constructor that pre-computes the dependencies.)
data CondTree v c a
CondNode :: a -> c -> [CondBranch v c a] -> CondTree v c a
[condTreeData] :: CondTree v c a -> a
[condTreeConstraints] :: CondTree v c a -> c
[condTreeComponents] :: CondTree v c a -> [CondBranch v c a]

-- | A <a>CondBranch</a> represents a conditional branch, e.g., <tt>if
°5uflag(foo)</tt> on some syntax <tt>a</tt>. It also has an optional
°5ufalse branch.
data CondBranch v c a
CondBranch :: Condition v -> CondTree v c a -> Maybe (CondTree v c a) -> CondBranch v c a
[condBranchCondition] :: CondBranch v c a -> Condition v
[condBranchIfTrue] :: CondBranch v c a -> CondTree v c a
[condBranchIfFalse] :: CondBranch v c a -> Maybe (CondTree v c a)
condIfThen :: Condition v -> CondTree v c a -> CondBranch v c a
condIfThenElse :: Condition v -> CondTree v c a -> CondTree v c a -> CondBranch v c a
mapCondTree :: (a -> b) -> (c -> d) -> (Condition v -> Condition w) -> CondTree v c a -> CondTree w d b
mapTreeConstrs :: (c -> d) -> CondTree v c a -> CondTree v d a
mapTreeConds :: (Condition v -> Condition w) -> CondTree v c a -> CondTree w c a
mapTreeData :: (a -> b) -> CondTree v c a -> CondTree v c b

-- | <pre>
°5uTraversal (CondTree v c a) (CondTree w c a) v w
°5u</pre>
traverseCondTreeV :: Applicative f => (v -> f w) -> CondTree v c a -> f (CondTree w c a)

-- | <pre>
°5uTraversal (CondBranch v c a) (CondBranch w c a) v w
°5u</pre>
traverseCondBranchV :: Applicative f => (v -> f w) -> CondBranch v c a -> f (CondBranch w c a)

-- | Extract the condition matched by the given predicate from a cond tree.
°5u
°5uWe use this mainly for extracting buildable conditions (see the Note
°5uabove), but the function is in fact more general.
extractCondition :: Eq v => (a -> Bool) -> CondTree v c a -> Condition v

-- | Flattens a CondTree using a partial flag assignment. When a condition
°5ucannot be evaluated, both branches are ignored.
simplifyCondTree :: (Monoid a, Monoid d) => (v -> Either v Bool) -> CondTree v d a -> (d, a)

-- | Flatten a CondTree. This will resolve the CondTree by taking all
°5upossible paths into account. Note that since branches represent
°5uexclusive choices this may not result in a "sane" result.
ignoreConditions :: (Monoid a, Monoid c) => CondTree v c a -> (a, c)
instance Data.Traversable.Traversable (Distribution.Types.CondTree.CondTree v c)
instance Data.Foldable.Foldable (Distribution.Types.CondTree.CondTree v c)
instance GHC.Base.Functor (Distribution.Types.CondTree.CondTree v c)
instance GHC.Generics.Generic (Distribution.Types.CondTree.CondTree v c a)
instance (Data.Data.Data v, Data.Data.Data c, Data.Data.Data a) => Data.Data.Data (Distribution.Types.CondTree.CondTree v c a)
instance (GHC.Classes.Eq a, GHC.Classes.Eq c, GHC.Classes.Eq v) => GHC.Classes.Eq (Distribution.Types.CondTree.CondTree v c a)
instance (GHC.Show.Show a, GHC.Show.Show c, GHC.Show.Show v) => GHC.Show.Show (Distribution.Types.CondTree.CondTree v c a)
instance Data.Traversable.Traversable (Distribution.Types.CondTree.CondBranch v c)
instance GHC.Base.Functor (Distribution.Types.CondTree.CondBranch v c)
instance GHC.Generics.Generic (Distribution.Types.CondTree.CondBranch v c a)
instance (Data.Data.Data v, Data.Data.Data c, Data.Data.Data a) => Data.Data.Data (Distribution.Types.CondTree.CondBranch v c a)
instance (GHC.Classes.Eq v, GHC.Classes.Eq a, GHC.Classes.Eq c) => GHC.Classes.Eq (Distribution.Types.CondTree.CondBranch v c a)
instance (GHC.Show.Show v, GHC.Show.Show a, GHC.Show.Show c) => GHC.Show.Show (Distribution.Types.CondTree.CondBranch v c a)
instance (Data.Binary.Class.Binary v, Data.Binary.Class.Binary c, Data.Binary.Class.Binary a) => Data.Binary.Class.Binary (Distribution.Types.CondTree.CondTree v c a)
instance (Control.DeepSeq.NFData v, Control.DeepSeq.NFData c, Control.DeepSeq.NFData a) => Control.DeepSeq.NFData (Distribution.Types.CondTree.CondTree v c a)
instance Data.Foldable.Foldable (Distribution.Types.CondTree.CondBranch v c)
instance (Data.Binary.Class.Binary v, Data.Binary.Class.Binary c, Data.Binary.Class.Binary a) => Data.Binary.Class.Binary (Distribution.Types.CondTree.CondBranch v c a)
instance (Control.DeepSeq.NFData v, Control.DeepSeq.NFData c, Control.DeepSeq.NFData a) => Control.DeepSeq.NFData (Distribution.Types.CondTree.CondBranch v c a)

module Distribution.Types.ExecutableScope
data ExecutableScope
ExecutableScopeUnknown :: ExecutableScope
ExecutablePublic :: ExecutableScope
ExecutablePrivate :: ExecutableScope
instance Data.Data.Data Distribution.Types.ExecutableScope.ExecutableScope
instance GHC.Classes.Eq Distribution.Types.ExecutableScope.ExecutableScope
instance GHC.Read.Read Distribution.Types.ExecutableScope.ExecutableScope
instance GHC.Show.Show Distribution.Types.ExecutableScope.ExecutableScope
instance GHC.Generics.Generic Distribution.Types.ExecutableScope.ExecutableScope
instance Distribution.Pretty.Pretty Distribution.Types.ExecutableScope.ExecutableScope
instance Distribution.Parsec.Class.Parsec Distribution.Types.ExecutableScope.ExecutableScope
instance Distribution.Text.Text Distribution.Types.ExecutableScope.ExecutableScope
instance Data.Binary.Class.Binary Distribution.Types.ExecutableScope.ExecutableScope
instance Control.DeepSeq.NFData Distribution.Types.ExecutableScope.ExecutableScope
instance GHC.Base.Monoid Distribution.Types.ExecutableScope.ExecutableScope
instance GHC.Base.Semigroup Distribution.Types.ExecutableScope.ExecutableScope

module Distribution.Types.ForeignLibOption
data ForeignLibOption

-- | Merge in all dependent libraries (i.e., use <tt>ghc -shared
°5u-static</tt> rather than just record the dependencies, ala <tt>ghc
°5u-shared -dynamic</tt>). This option is compulsory on Windows and
°5uunsupported on other platforms.
ForeignLibStandalone :: ForeignLibOption
instance Data.Data.Data Distribution.Types.ForeignLibOption.ForeignLibOption
instance GHC.Classes.Eq Distribution.Types.ForeignLibOption.ForeignLibOption
instance GHC.Read.Read Distribution.Types.ForeignLibOption.ForeignLibOption
instance GHC.Show.Show Distribution.Types.ForeignLibOption.ForeignLibOption
instance GHC.Generics.Generic Distribution.Types.ForeignLibOption.ForeignLibOption
instance Distribution.Pretty.Pretty Distribution.Types.ForeignLibOption.ForeignLibOption
instance Distribution.Parsec.Class.Parsec Distribution.Types.ForeignLibOption.ForeignLibOption
instance Distribution.Text.Text Distribution.Types.ForeignLibOption.ForeignLibOption
instance Data.Binary.Class.Binary Distribution.Types.ForeignLibOption.ForeignLibOption
instance Control.DeepSeq.NFData Distribution.Types.ForeignLibOption.ForeignLibOption

module Distribution.Types.ForeignLibType

-- | What kind of foreign library is to be built?
data ForeignLibType

-- | A native shared library (<tt>.so</tt> on Linux, <tt>.dylib</tt> on
°5uOSX, or <tt>.dll</tt> on Windows).
ForeignLibNativeShared :: ForeignLibType

-- | A native static library (not currently supported.)
ForeignLibNativeStatic :: ForeignLibType
ForeignLibTypeUnknown :: ForeignLibType
knownForeignLibTypes :: [ForeignLibType]
foreignLibTypeIsShared :: ForeignLibType -> Bool
instance Data.Data.Data Distribution.Types.ForeignLibType.ForeignLibType
instance GHC.Classes.Eq Distribution.Types.ForeignLibType.ForeignLibType
instance GHC.Read.Read Distribution.Types.ForeignLibType.ForeignLibType
instance GHC.Show.Show Distribution.Types.ForeignLibType.ForeignLibType
instance GHC.Generics.Generic Distribution.Types.ForeignLibType.ForeignLibType
instance Distribution.Pretty.Pretty Distribution.Types.ForeignLibType.ForeignLibType
instance Distribution.Parsec.Class.Parsec Distribution.Types.ForeignLibType.ForeignLibType
instance Distribution.Text.Text Distribution.Types.ForeignLibType.ForeignLibType
instance Data.Binary.Class.Binary Distribution.Types.ForeignLibType.ForeignLibType
instance Control.DeepSeq.NFData Distribution.Types.ForeignLibType.ForeignLibType
instance GHC.Base.Semigroup Distribution.Types.ForeignLibType.ForeignLibType
instance GHC.Base.Monoid Distribution.Types.ForeignLibType.ForeignLibType

module Distribution.Types.Version

-- | A <a>Version</a> represents the version of a software entity.
°5u
°5uInstances of <a>Eq</a> and <a>Ord</a> are provided, which gives exact
°5uequality and lexicographic ordering of the version number components
°5u(i.e. 2.1 &gt; 2.0, 1.2.3 &gt; 1.2.2, etc.).
°5u
°5uThis type is opaque and distinct from the <a>Version</a> type in
°5u<a>Data.Version</a> since <tt>Cabal-2.0</tt>. The difference extends
°5uto the <a>Binary</a> instance using a different (and more compact)
°5uencoding.
data Version

-- | Construct <a>Version</a> from list of version number components.
°5u
°5uFor instance, <tt>mkVersion [3,2,1]</tt> constructs a <a>Version</a>
°5urepresenting the version <tt>3.2.1</tt>.
°5u
°5uAll version components must be non-negative. <tt>mkVersion []</tt>
°5ucurrently represents the special <i>null</i> version; see also
°5u<a>nullVersion</a>.
mkVersion :: [Int] -> Version

-- | Variant of <a>Version</a> which converts a <a>Data.Version</a>
°5u<a>Version</a> into Cabal's <a>Version</a> type.
mkVersion' :: Version -> Version

-- | Unpack <a>Version</a> into list of version number components.
°5u
°5uThis is the inverse to <a>mkVersion</a>, so the following holds:
°5u
°5u<pre>
°5u(versionNumbers . mkVersion) vs == vs
°5u</pre>
versionNumbers :: Version -> [Int]

-- | Constant representing the special <i>null</i> <a>Version</a>
°5u
°5uThe <a>nullVersion</a> compares (via <a>Ord</a>) as less than every
°5uproper <a>Version</a> value.
nullVersion :: Version

-- | Apply function to list of version number components
°5u
°5u<pre>
°5ualterVersion f == mkVersion . f . versionNumbers
°5u</pre>
alterVersion :: ([Int] -> [Int]) -> Version -> Version

-- | Version 0. A lower bound of <a>Version</a>.
version0 :: Version

-- | <i>Deprecated: Use prettyShow. This function will be removed in
°5uCabal-3.0 (estimated Oct 2018)</i>
showVersion :: Version -> String
validVersion :: Version -> Bool
instance GHC.Generics.Generic Distribution.Types.Version.Version
instance GHC.Classes.Eq Distribution.Types.Version.Version
instance Data.Data.Data Distribution.Types.Version.Version
instance GHC.Classes.Ord Distribution.Types.Version.Version
instance GHC.Show.Show Distribution.Types.Version.Version
instance GHC.Read.Read Distribution.Types.Version.Version
instance Data.Binary.Class.Binary Distribution.Types.Version.Version
instance Control.DeepSeq.NFData Distribution.Types.Version.Version
instance Distribution.Pretty.Pretty Distribution.Types.Version.Version
instance Distribution.Parsec.Class.Parsec Distribution.Types.Version.Version
instance Distribution.Text.Text Distribution.Types.Version.Version

module Distribution.Types.VersionRange
data VersionRange

-- | <i>Deprecated: Use <a>anyVersion</a>, <a>foldVersionRange</a> or
°5u<tt>asVersionIntervals</tt></i>
AnyVersion :: VersionRange

-- | <i>Deprecated: Use <a>thisVersion</a>, <a>foldVersionRange</a> or
°5u<tt>asVersionIntervals</tt></i>
ThisVersion :: Version -> VersionRange

-- | <i>Deprecated: Use <a>laterVersion</a>, <a>foldVersionRange</a> or
°5u<tt>asVersionIntervals</tt></i>
LaterVersion :: Version -> VersionRange
OrLaterVersion :: Version -> VersionRange

-- | <i>Deprecated: Use <a>earlierVersion</a>, <a>foldVersionRange</a> or
°5u<tt>asVersionIntervals</tt></i>
EarlierVersion :: Version -> VersionRange
OrEarlierVersion :: Version -> VersionRange

-- | <i>Deprecated: Use <a>anyVersion</a>, <a>foldVersionRange</a> or
°5u<tt>asVersionIntervals</tt></i>
WildcardVersion :: Version -> VersionRange
MajorBoundVersion :: Version -> VersionRange

-- | <i>Deprecated: Use <a>unionVersionRanges</a>, <a>foldVersionRange</a>
°5uor <tt>asVersionIntervals</tt></i>
UnionVersionRanges :: VersionRange -> VersionRange -> VersionRange

-- | <i>Deprecated: Use <a>intersectVersionRanges</a>,
°5u<a>foldVersionRange</a> or <tt>asVersionIntervals</tt></i>
IntersectVersionRanges :: VersionRange -> VersionRange -> VersionRange
VersionRangeParens :: VersionRange -> VersionRange

-- | The version range <tt>-any</tt>. That is, a version range containing
°5uall versions.
°5u
°5u<pre>
°5uwithinRange v anyVersion = True
°5u</pre>
anyVersion :: VersionRange

-- | The empty version range, that is a version range containing no
°5uversions.
°5u
°5uThis can be constructed using any unsatisfiable version range
°5uexpression, for example <tt>&gt; 1 &amp;&amp; &lt; 1</tt>.
°5u
°5u<pre>
°5uwithinRange v noVersion = False
°5u</pre>
noVersion :: VersionRange

-- | The version range <tt>== v</tt>
°5u
°5u<pre>
°5uwithinRange v' (thisVersion v) = v' == v
°5u</pre>
thisVersion :: Version -> VersionRange

-- | The version range <tt><a>||</a> v</tt>
°5u
°5u<pre>
°5uwithinRange v' (notThisVersion v) = v' /= v
°5u</pre>
notThisVersion :: Version -> VersionRange

-- | The version range <tt>&gt; v</tt>
°5u
°5u<pre>
°5uwithinRange v' (laterVersion v) = v' &gt; v
°5u</pre>
laterVersion :: Version -> VersionRange

-- | The version range <tt>&lt; v</tt>
°5u
°5u<pre>
°5uwithinRange v' (earlierVersion v) = v' &lt; v
°5u</pre>
earlierVersion :: Version -> VersionRange

-- | The version range <tt>&gt;= v</tt>
°5u
°5u<pre>
°5uwithinRange v' (orLaterVersion v) = v' &gt;= v
°5u</pre>
orLaterVersion :: Version -> VersionRange

-- | The version range <tt>&lt;= v</tt>
°5u
°5u<pre>
°5uwithinRange v' (orEarlierVersion v) = v' &lt;= v
°5u</pre>
orEarlierVersion :: Version -> VersionRange

-- | The version range <tt>vr1 || vr2</tt>
°5u
°5u<pre>
°5u  withinRange v' (unionVersionRanges vr1 vr2)
°5u= withinRange v' vr1 || withinRange v' vr2
°5u</pre>
unionVersionRanges :: VersionRange -> VersionRange -> VersionRange

-- | The version range <tt>vr1 &amp;&amp; vr2</tt>
°5u
°5u<pre>
°5u  withinRange v' (intersectVersionRanges vr1 vr2)
°5u= withinRange v' vr1 &amp;&amp; withinRange v' vr2
°5u</pre>
intersectVersionRanges :: VersionRange -> VersionRange -> VersionRange

-- | The version range <tt>== v.*</tt>.
°5u
°5uFor example, for version <tt>1.2</tt>, the version range <tt>==
°5u1.2.*</tt> is the same as <tt>&gt;= 1.2 &amp;&amp; &lt; 1.3</tt>
°5u
°5u<pre>
°5uwithinRange v' (laterVersion v) = v' &gt;= v &amp;&amp; v' &lt; upper v
°5u  where
°5u    upper (Version lower t) = Version (init lower ++ [last lower + 1]) t
°5u</pre>
withinVersion :: Version -> VersionRange

-- | The version range <tt>^&gt;= v</tt>.
°5u
°5uFor example, for version <tt>1.2.3.4</tt>, the version range
°5u<tt>^&gt;= 1.2.3.4</tt> is the same as <tt>&gt;= 1.2.3.4 &amp;&amp;
°5u&lt; 1.3</tt>.
°5u
°5uNote that <tt>^&gt;= 1</tt> is equivalent to <tt>&gt;= 1 &amp;&amp;
°5u&lt; 1.1</tt>.
majorBoundVersion :: Version -> VersionRange

-- | Does this version fall within the given range?
°5u
°5uThis is the evaluation function for the <a>VersionRange</a> type.
withinRange :: Version -> VersionRange -> Bool

-- | Fold over the basic syntactic structure of a <a>VersionRange</a>.
°5u
°5uThis provides a syntactic view of the expression defining the version
°5urange. The syntactic sugar <tt>"&gt;= v"</tt>, <tt>"&lt;= v"</tt> and
°5u<tt>"== v.*"</tt> is presented in terms of the other basic syntax.
°5u
°5uFor a semantic view use <tt>asVersionIntervals</tt>.
foldVersionRange :: a -> (Version -> a) -> (Version -> a) -> (Version -> a) -> (a -> a -> a) -> (a -> a -> a) -> VersionRange -> a

-- | Normalise <a>VersionRange</a>.
°5u
°5uIn particular collapse <tt>(== v || &gt; v)</tt> into <tt>&gt;=
°5uv</tt>, and so on.
normaliseVersionRange :: VersionRange -> VersionRange

-- | Remove <a>VersionRangeParens</a> constructors.
stripParensVersionRange :: VersionRange -> VersionRange

-- | Does the version range have an upper bound?
hasUpperBound :: VersionRange -> Bool

-- | Does the version range have an explicit lower bound?
°5u
°5uNote: this function only considers the user-specified lower bounds,
°5ubut not the implicit &gt;=0 lower bound.
hasLowerBound :: VersionRange -> Bool

-- | F-Algebra of <a>VersionRange</a>. See <a>cataVersionRange</a>.
data VersionRangeF a
AnyVersionF :: VersionRangeF a
ThisVersionF :: Version -> VersionRangeF a
LaterVersionF :: Version -> VersionRangeF a
OrLaterVersionF :: Version -> VersionRangeF a
EarlierVersionF :: Version -> VersionRangeF a
OrEarlierVersionF :: Version -> VersionRangeF a
WildcardVersionF :: Version -> VersionRangeF a
MajorBoundVersionF :: Version -> VersionRangeF a
UnionVersionRangesF :: a -> a -> VersionRangeF a
IntersectVersionRangesF :: a -> a -> VersionRangeF a
VersionRangeParensF :: a -> VersionRangeF a

-- | Fold <a>VersionRange</a>.
cataVersionRange :: (VersionRangeF a -> a) -> VersionRange -> a

-- | Unfold <a>VersionRange</a>.
anaVersionRange :: (a -> VersionRangeF a) -> a -> VersionRange

-- | Refold <a>VersionRange</a>
hyloVersionRange :: (VersionRangeF VersionRange -> VersionRange) -> (VersionRange -> VersionRangeF VersionRange) -> VersionRange -> VersionRange

projectVersionRange :: VersionRange -> VersionRangeF VersionRange

embedVersionRange :: VersionRangeF VersionRange -> VersionRange

wildcardUpperBound :: Version -> Version

-- | Compute next greater major version to be used as upper bound
°5u
°5uExample: <tt>0.4.1</tt> produces the version <tt>0.5</tt> which then
°5ucan be used to construct a range <tt>&gt;= 0.4.1 &amp;&amp; &lt;
°5u0.5</tt>
majorUpperBound :: Version -> Version
isWildcardRange :: Version -> Version -> Bool
instance Data.Traversable.Traversable Distribution.Types.VersionRange.VersionRangeF
instance Data.Foldable.Foldable Distribution.Types.VersionRange.VersionRangeF
instance GHC.Base.Functor Distribution.Types.VersionRange.VersionRangeF
instance GHC.Show.Show a => GHC.Show.Show (Distribution.Types.VersionRange.VersionRangeF a)
instance GHC.Read.Read a => GHC.Read.Read (Distribution.Types.VersionRange.VersionRangeF a)
instance GHC.Generics.Generic (Distribution.Types.VersionRange.VersionRangeF a)
instance GHC.Classes.Eq a => GHC.Classes.Eq (Distribution.Types.VersionRange.VersionRangeF a)
instance Data.Data.Data a => Data.Data.Data (Distribution.Types.VersionRange.VersionRangeF a)
instance GHC.Show.Show Distribution.Types.VersionRange.VersionRange
instance GHC.Read.Read Distribution.Types.VersionRange.VersionRange
instance GHC.Generics.Generic Distribution.Types.VersionRange.VersionRange
instance GHC.Classes.Eq Distribution.Types.VersionRange.VersionRange
instance Data.Data.Data Distribution.Types.VersionRange.VersionRange
instance Distribution.Pretty.Pretty Distribution.Types.VersionRange.VersionRange
instance Data.Binary.Class.Binary Distribution.Types.VersionRange.VersionRange
instance Control.DeepSeq.NFData Distribution.Types.VersionRange.VersionRange
instance Distribution.Parsec.Class.Parsec Distribution.Types.VersionRange.VersionRange
instance Distribution.Text.Text Distribution.Types.VersionRange.VersionRange

module Distribution.Types.VersionInterval

-- | A complementary representation of a <a>VersionRange</a>. Instead of a
°5uboolean version predicate it uses an increasing sequence of
°5unon-overlapping, non-empty intervals.
°5u
°5uThe key point is that this representation gives a canonical
°5urepresentation for the semantics of <a>VersionRange</a>s. This makes
°5uit easier to check things like whether a version range is empty,
°5ucovers all versions, or requires a certain minimum or maximum version.
°5uIt also makes it easy to check equality or containment. It also makes
°5uit easier to identify 'simple' version predicates for translation into
°5uforeign packaging systems that do not support complex version range
°5uexpressions.
data VersionIntervals

-- | Convert a <a>VersionRange</a> to a sequence of version intervals.
toVersionIntervals :: VersionRange -> VersionIntervals

-- | Convert a <a>VersionIntervals</a> value back into a
°5u<a>VersionRange</a> expression representing the version intervals.
fromVersionIntervals :: VersionIntervals -> VersionRange

-- | Test if a version falls within the version intervals.
°5u
°5uIt exists mostly for completeness and testing. It satisfies the
°5ufollowing properties:
°5u
°5u<pre>
°5uwithinIntervals v (toVersionIntervals vr) = withinRange v vr
°5uwithinIntervals v ivs = withinRange v (fromVersionIntervals ivs)
°5u</pre>
withinIntervals :: Version -> VersionIntervals -> Bool

-- | Inspect the list of version intervals.
versionIntervals :: VersionIntervals -> [VersionInterval]

-- | Directly construct a <a>VersionIntervals</a> from a list of intervals.
°5u
°5uIn <tt>Cabal-2.2</tt> the <a>Maybe</a> is dropped from the result
°5utype.
mkVersionIntervals :: [VersionInterval] -> VersionIntervals
unionVersionIntervals :: VersionIntervals -> VersionIntervals -> VersionIntervals
intersectVersionIntervals :: VersionIntervals -> VersionIntervals -> VersionIntervals
invertVersionIntervals :: VersionIntervals -> VersionIntervals
relaxLastInterval :: VersionIntervals -> VersionIntervals
relaxHeadInterval :: VersionIntervals -> VersionIntervals

-- | View a <a>VersionRange</a> as a union of intervals.
°5u
°5uThis provides a canonical view of the semantics of a
°5u<a>VersionRange</a> as opposed to the syntax of the expression used to
°5udefine it. For the syntactic view use <a>foldVersionRange</a>.
°5u
°5uEach interval is non-empty. The sequence is in increasing order and no
°5uintervals overlap or touch. Therefore only the first and last can be
°5uunbounded. The sequence can be empty if the range is empty (e.g. a
°5urange expression like <tt><a>&amp;&amp;</a> 2</tt>).
°5u
°5uOther checks are trivial to implement using this view. For example:
°5u
°5u<pre>
°5uisNoVersion vr | [] &lt;- asVersionIntervals vr = True
°5u               | otherwise                   = False
°5u</pre>
°5u
°5u<pre>
°5uisSpecificVersion vr
°5u   | [(LowerBound v  InclusiveBound
°5u      ,UpperBound v' InclusiveBound)] &lt;- asVersionIntervals vr
°5u   , v == v'   = Just v
°5u   | otherwise = Nothing
°5u</pre>
asVersionIntervals :: VersionRange -> [VersionInterval]
type VersionInterval = (LowerBound, UpperBound)
data LowerBound
LowerBound :: Version -> !Bound -> LowerBound
data UpperBound
NoUpperBound :: UpperBound
UpperBound :: Version -> !Bound -> UpperBound
data Bound
ExclusiveBound :: Bound
InclusiveBound :: Bound
instance GHC.Show.Show Distribution.Types.VersionInterval.VersionIntervals
instance GHC.Classes.Eq Distribution.Types.VersionInterval.VersionIntervals
instance GHC.Show.Show Distribution.Types.VersionInterval.LowerBound
instance GHC.Classes.Eq Distribution.Types.VersionInterval.LowerBound
instance GHC.Show.Show Distribution.Types.VersionInterval.UpperBound
instance GHC.Classes.Eq Distribution.Types.VersionInterval.UpperBound
instance GHC.Show.Show Distribution.Types.VersionInterval.Bound
instance GHC.Classes.Eq Distribution.Types.VersionInterval.Bound
instance GHC.Classes.Ord Distribution.Types.VersionInterval.LowerBound
instance GHC.Classes.Ord Distribution.Types.VersionInterval.UpperBound


module Distribution.Utils.IOData

-- | Represents either textual or binary data passed via I/O functions
°5uwhich support binary/text mode
data IOData

-- | How Text gets encoded is usually locale-dependent.
IODataText :: String -> IOData

-- | Raw binary which gets read/written in binary mode.
IODataBinary :: ByteString -> IOData
data IODataMode
IODataModeText :: IODataMode
IODataModeBinary :: IODataMode

-- | Test whether <a>IOData</a> is empty
null :: IOData -> Bool

-- | <a>IOData</a> Wrapper for <a>hGetContents</a>
°5u
°5u<b>Note</b>: This operation uses lazy I/O. Use <a>NFData</a> to force
°5uall data to be read and consequently the internal file handle to be
°5uclosed.
hGetContents :: Handle -> IODataMode -> IO IOData

-- | <a>IOData</a> Wrapper for <a>hPutStr</a> and <a>hClose</a>
°5u
°5uThis is the dual operation ot <tt>ioDataHGetContents</tt>, and
°5uconsequently the handle is closed with <tt>hClose</tt>.
hPutContents :: Handle -> IOData -> IO ()
instance Control.DeepSeq.NFData Distribution.Utils.IOData.IOData

module Distribution.Utils.MapAccum

-- | Monadic variant of <tt>mapAccumL</tt>.
mapAccumM :: (Monad m, Traversable t) => (a -> b -> m (a, c)) -> a -> t b -> m (a, t c)
instance GHC.Base.Functor m => GHC.Base.Functor (Distribution.Utils.MapAccum.StateM s m)
instance GHC.Base.Monad m => GHC.Base.Applicative (Distribution.Utils.MapAccum.StateM s m)


-- | A progress monad, which we use to report failure and logging from
°5uotherwise pure code.
module Distribution.Utils.Progress

-- | A type to represent the unfolding of an expensive long running
°5ucalculation that may fail (or maybe not expensive, but complicated!)
°5uWe may get intermediate steps before the final result which may be
°5uused to indicate progress and/or logging messages.
°5u
°5uTODO: Apply Codensity to avoid left-associativity problem. See
°5u<a>http://comonad.com/reader/2011/free-monads-for-less/</a> and
°5u<a>http://blog.ezyang.com/2012/01/problem-set-the-codensity-transformation/</a>
data Progress step fail done

-- | Emit a step and then continue.
stepProgress :: step -> Progress step fail ()

-- | Fail the computation.
failProgress :: fail -> Progress step fail done

-- | Consume a <a>Progress</a> calculation. Much like <a>foldr</a> for
°5ulists but with two base cases, one for a final result and one for
°5ufailure.
°5u
°5uEg to convert into a simple <a>Either</a> result use:
°5u
°5u<pre>
°5ufoldProgress (flip const) Left Right
°5u</pre>
foldProgress :: (step -> a -> a) -> (fail -> a) -> (done -> a) -> Progress step fail done -> a
instance GHC.Base.Functor (Distribution.Utils.Progress.Progress step fail)
instance GHC.Base.Monad (Distribution.Utils.Progress.Progress step fail)
instance GHC.Base.Applicative (Distribution.Utils.Progress.Progress step fail)
instance GHC.Base.Monoid fail => GHC.Base.Alternative (Distribution.Utils.Progress.Progress step fail)

module Distribution.Utils.ShortText

-- | Compact representation of short <tt>Strings</tt>
°5u
°5uThe data is stored internally as UTF8 in an <a>ShortByteString</a>
°5uwhen compiled against <tt>bytestring &gt;= 0.10.4</tt>, and otherwise
°5uthe fallback is to use plain old non-compat '[Char]'.
°5u
°5uNote: This type is for internal uses (such as e.g.
°5u<tt>PackageName</tt>) and shall not be exposed in Cabal's API
data ShortText

-- | Construct <a>ShortText</a> from <a>String</a>
toShortText :: String -> ShortText

-- | Convert <a>ShortText</a> to <a>String</a>
fromShortText :: ShortText -> String

-- | Decode <a>String</a> from UTF8-encoded octets.
°5u
°5uInvalid data in the UTF8 stream (this includes code-points
°5u<tt>U+D800</tt> through <tt>U+DFFF</tt>) will be decoded as the
°5ureplacement character (<tt>U+FFFD</tt>).
°5u
°5uSee also <a>encodeStringUtf8</a>
decodeStringUtf8 :: [Word8] -> String

-- | Encode <a>String</a> to a list of UTF8-encoded octets
°5u
°5uCode-points in the <tt>U+D800</tt>-<tt>U+DFFF</tt> range will be
°5uencoded as the replacement character (i.e. <tt>U+FFFD</tt>).
°5u
°5uSee also <tt>decodeUtf8</tt>
encodeStringUtf8 :: String -> [Word8]
instance Data.Data.Data Distribution.Utils.ShortText.ShortText
instance GHC.Generics.Generic Distribution.Utils.ShortText.ShortText
instance GHC.Classes.Ord Distribution.Utils.ShortText.ShortText
instance GHC.Classes.Eq Distribution.Utils.ShortText.ShortText
instance Data.Binary.Class.Binary Distribution.Utils.ShortText.ShortText
instance Control.DeepSeq.NFData Distribution.Utils.ShortText.ShortText
instance GHC.Show.Show Distribution.Utils.ShortText.ShortText
instance GHC.Read.Read Distribution.Utils.ShortText.ShortText
instance GHC.Base.Semigroup Distribution.Utils.ShortText.ShortText
instance GHC.Base.Monoid Distribution.Utils.ShortText.ShortText
instance Data.String.IsString Distribution.Utils.ShortText.ShortText

module Distribution.Types.PkgconfigName

-- | A pkg-config library name
°5u
°5uThis is parsed as any valid argument to the pkg-config utility.
data PkgconfigName

-- | Convert <a>PkgconfigName</a> to <a>String</a>
unPkgconfigName :: PkgconfigName -> String

-- | Construct a <a>PkgconfigName</a> from a <a>String</a>
°5u
°5u<a>mkPkgconfigName</a> is the inverse to <a>unPkgconfigName</a>
°5u
°5uNote: No validations are performed to ensure that the resulting
°5u<a>PkgconfigName</a> is valid
mkPkgconfigName :: String -> PkgconfigName
instance Data.Data.Data Distribution.Types.PkgconfigName.PkgconfigName
instance GHC.Classes.Ord Distribution.Types.PkgconfigName.PkgconfigName
instance GHC.Classes.Eq Distribution.Types.PkgconfigName.PkgconfigName
instance GHC.Show.Show Distribution.Types.PkgconfigName.PkgconfigName
instance GHC.Read.Read Distribution.Types.PkgconfigName.PkgconfigName
instance GHC.Generics.Generic Distribution.Types.PkgconfigName.PkgconfigName
instance Data.String.IsString Distribution.Types.PkgconfigName.PkgconfigName
instance Data.Binary.Class.Binary Distribution.Types.PkgconfigName.PkgconfigName
instance Distribution.Pretty.Pretty Distribution.Types.PkgconfigName.PkgconfigName
instance Distribution.Parsec.Class.Parsec Distribution.Types.PkgconfigName.PkgconfigName
instance Distribution.Text.Text Distribution.Types.PkgconfigName.PkgconfigName
instance Control.DeepSeq.NFData Distribution.Types.PkgconfigName.PkgconfigName

module Distribution.Types.ComponentId

-- | A <a>ComponentId</a> uniquely identifies the transitive source code
°5uclosure of a component (i.e. libraries, executables).
°5u
°5uFor non-Backpack components, this corresponds one to one with the
°5u<tt>UnitId</tt>, which serves as the basis for install paths, linker
°5usymbols, etc.
°5u
°5uUse <a>mkComponentId</a> and <a>unComponentId</a> to convert from/to a
°5u<a>String</a>.
°5u
°5uThis type is opaque since <tt>Cabal-2.0</tt>
data ComponentId

-- | Convert <a>ComponentId</a> to <a>String</a>
unComponentId :: ComponentId -> String

-- | Construct a <a>ComponentId</a> from a <a>String</a>
°5u
°5u<a>mkComponentId</a> is the inverse to <a>unComponentId</a>
°5u
°5uNote: No validations are performed to ensure that the resulting
°5u<a>ComponentId</a> is valid
mkComponentId :: String -> ComponentId
instance Data.Data.Data Distribution.Types.ComponentId.ComponentId
instance GHC.Classes.Ord Distribution.Types.ComponentId.ComponentId
instance GHC.Classes.Eq Distribution.Types.ComponentId.ComponentId
instance GHC.Show.Show Distribution.Types.ComponentId.ComponentId
instance GHC.Read.Read Distribution.Types.ComponentId.ComponentId
instance GHC.Generics.Generic Distribution.Types.ComponentId.ComponentId
instance Data.String.IsString Distribution.Types.ComponentId.ComponentId
instance Data.Binary.Class.Binary Distribution.Types.ComponentId.ComponentId
instance Distribution.Pretty.Pretty Distribution.Types.ComponentId.ComponentId
instance Distribution.Parsec.Class.Parsec Distribution.Types.ComponentId.ComponentId
instance Distribution.Text.Text Distribution.Types.ComponentId.ComponentId
instance Control.DeepSeq.NFData Distribution.Types.ComponentId.ComponentId

module Distribution.Types.AbiHash

-- | ABI Hashes
°5u
°5uUse <a>mkAbiHash</a> and <a>unAbiHash</a> to convert from/to a
°5u<a>String</a>.
°5u
°5uThis type is opaque since <tt>Cabal-2.0</tt>
data AbiHash

-- | Construct a <a>AbiHash</a> from a <a>String</a>
°5u
°5u<a>mkAbiHash</a> is the inverse to <a>unAbiHash</a>
°5u
°5uNote: No validations are performed to ensure that the resulting
°5u<a>AbiHash</a> is valid
unAbiHash :: AbiHash -> String

-- | Convert <a>AbiHash</a> to <a>String</a>
mkAbiHash :: String -> AbiHash
instance GHC.Generics.Generic Distribution.Types.AbiHash.AbiHash
instance GHC.Read.Read Distribution.Types.AbiHash.AbiHash
instance GHC.Show.Show Distribution.Types.AbiHash.AbiHash
instance GHC.Classes.Eq Distribution.Types.AbiHash.AbiHash
instance Data.String.IsString Distribution.Types.AbiHash.AbiHash
instance Data.Binary.Class.Binary Distribution.Types.AbiHash.AbiHash
instance Control.DeepSeq.NFData Distribution.Types.AbiHash.AbiHash
instance Distribution.Pretty.Pretty Distribution.Types.AbiHash.AbiHash
instance Distribution.Parsec.Class.Parsec Distribution.Types.AbiHash.AbiHash
instance Distribution.Text.Text Distribution.Types.AbiHash.AbiHash


-- | Data type for Haskell module names.
module Distribution.ModuleName

-- | A valid Haskell module name.
newtype ModuleName
ModuleName :: ShortTextLst -> ModuleName
fromString :: IsString a => String -> a

-- | Construct a <a>ModuleName</a> from valid module components, i.e. parts
°5useparated by dots.
fromComponents :: [String] -> ModuleName

-- | The individual components of a hierarchical module name. For example
°5u
°5u<pre>
°5ucomponents (fromString "A.B.C") = ["A", "B", "C"]
°5u</pre>
components :: ModuleName -> [String]

-- | Convert a module name to a file path, but without any file extension.
°5uFor example:
°5u
°5u<pre>
°5utoFilePath (fromString "A.B.C") = "A/B/C"
°5u</pre>
toFilePath :: ModuleName -> FilePath

-- | The module name <tt>Main</tt>.
main :: ModuleName

-- | <i>Deprecated: use ModuleName.fromString instead. This symbol will be
°5uremoved in Cabal-3.0 (est. Oct 2018).</i>
simple :: String -> ModuleName
validModuleComponent :: String -> Bool
instance Data.Data.Data Distribution.ModuleName.ModuleName
instance GHC.Show.Show Distribution.ModuleName.ModuleName
instance GHC.Read.Read Distribution.ModuleName.ModuleName
instance GHC.Classes.Ord Distribution.ModuleName.ModuleName
instance GHC.Generics.Generic Distribution.ModuleName.ModuleName
instance GHC.Classes.Eq Distribution.ModuleName.ModuleName
instance Data.Data.Data Distribution.ModuleName.ShortTextLst
instance GHC.Classes.Ord Distribution.ModuleName.ShortTextLst
instance GHC.Generics.Generic Distribution.ModuleName.ShortTextLst
instance GHC.Classes.Eq Distribution.ModuleName.ShortTextLst
instance Data.Binary.Class.Binary Distribution.ModuleName.ModuleName
instance Control.DeepSeq.NFData Distribution.ModuleName.ModuleName
instance Distribution.Pretty.Pretty Distribution.ModuleName.ModuleName
instance Distribution.Parsec.Class.Parsec Distribution.ModuleName.ModuleName
instance Distribution.Text.Text Distribution.ModuleName.ModuleName
instance Data.String.IsString Distribution.ModuleName.ModuleName
instance Control.DeepSeq.NFData Distribution.ModuleName.ShortTextLst
instance GHC.Show.Show Distribution.ModuleName.ShortTextLst
instance GHC.Read.Read Distribution.ModuleName.ShortTextLst
instance Data.Binary.Class.Binary Distribution.ModuleName.ShortTextLst

module Distribution.Types.ModuleRenaming

-- | Renaming applied to the modules provided by a package. The boolean
°5uindicates whether or not to also include all of the original names of
°5umodules. Thus, <tt>ModuleRenaming False []</tt> is "don't expose any
°5umodules, and <tt>ModuleRenaming True [(<a>Data.Bool</a>,
°5u<a>Bool</a>)]</tt> is, "expose all modules, but also expose
°5u<tt>Data.Bool</tt> as <tt>Bool</tt>". If a renaming is omitted you get
°5uthe <a>DefaultRenaming</a>.
°5u
°5u(NB: This is a list not a map so that we can preserve order.)
data ModuleRenaming

-- | A module renaming/thinning; e.g., <tt>(A as B, C as C)</tt> brings
°5u<tt>B</tt> and <tt>C</tt> into scope.
ModuleRenaming :: [(ModuleName, ModuleName)] -> ModuleRenaming

-- | The default renaming, bringing all exported modules into scope.
DefaultRenaming :: ModuleRenaming

-- | Hiding renaming, e.g., <tt>hiding (A, B)</tt>, bringing all exported
°5umodules into scope except the hidden ones.
HidingRenaming :: [ModuleName] -> ModuleRenaming

-- | Interpret a <a>ModuleRenaming</a> as a partial map from
°5u<a>ModuleName</a> to <a>ModuleName</a>. For efficiency, you should
°5upartially apply it with <a>ModuleRenaming</a> and then reuse it.
interpModuleRenaming :: ModuleRenaming -> ModuleName -> Maybe ModuleName

-- | The default renaming, if something is specified in
°5u<tt>build-depends</tt> only.
defaultRenaming :: ModuleRenaming

-- | Tests if its the default renaming; we can use a more compact syntax in
°5u<a>IncludeRenaming</a> in this case.
isDefaultRenaming :: ModuleRenaming -> Bool
instance GHC.Generics.Generic Distribution.Types.ModuleRenaming.ModuleRenaming
instance Data.Data.Data Distribution.Types.ModuleRenaming.ModuleRenaming
instance GHC.Classes.Ord Distribution.Types.ModuleRenaming.ModuleRenaming
instance GHC.Classes.Eq Distribution.Types.ModuleRenaming.ModuleRenaming
instance GHC.Read.Read Distribution.Types.ModuleRenaming.ModuleRenaming
instance GHC.Show.Show Distribution.Types.ModuleRenaming.ModuleRenaming
instance Data.Binary.Class.Binary Distribution.Types.ModuleRenaming.ModuleRenaming
instance Control.DeepSeq.NFData Distribution.Types.ModuleRenaming.ModuleRenaming
instance Distribution.Pretty.Pretty Distribution.Types.ModuleRenaming.ModuleRenaming
instance Distribution.Parsec.Class.Parsec Distribution.Types.ModuleRenaming.ModuleRenaming
instance Distribution.Text.Text Distribution.Types.ModuleRenaming.ModuleRenaming

module Distribution.Types.IncludeRenaming

-- | A renaming on an include: (provides renaming, requires renaming)
data IncludeRenaming
IncludeRenaming :: ModuleRenaming -> ModuleRenaming -> IncludeRenaming
[includeProvidesRn] :: IncludeRenaming -> ModuleRenaming
[includeRequiresRn] :: IncludeRenaming -> ModuleRenaming

-- | The <a>defaultIncludeRenaming</a> applied when you only
°5u<tt>build-depends</tt> on a package.
defaultIncludeRenaming :: IncludeRenaming

-- | Is an <a>IncludeRenaming</a> the default one?
isDefaultIncludeRenaming :: IncludeRenaming -> Bool
instance GHC.Generics.Generic Distribution.Types.IncludeRenaming.IncludeRenaming
instance Data.Data.Data Distribution.Types.IncludeRenaming.IncludeRenaming
instance GHC.Classes.Ord Distribution.Types.IncludeRenaming.IncludeRenaming
instance GHC.Classes.Eq Distribution.Types.IncludeRenaming.IncludeRenaming
instance GHC.Read.Read Distribution.Types.IncludeRenaming.IncludeRenaming
instance GHC.Show.Show Distribution.Types.IncludeRenaming.IncludeRenaming
instance Data.Binary.Class.Binary Distribution.Types.IncludeRenaming.IncludeRenaming
instance Control.DeepSeq.NFData Distribution.Types.IncludeRenaming.IncludeRenaming
instance Distribution.Pretty.Pretty Distribution.Types.IncludeRenaming.IncludeRenaming
instance Distribution.Parsec.Class.Parsec Distribution.Types.IncludeRenaming.IncludeRenaming
instance Distribution.Text.Text Distribution.Types.IncludeRenaming.IncludeRenaming


-- | A large and somewhat miscellaneous collection of utility functions
°5uused throughout the rest of the Cabal lib and in other tools that use
°5uthe Cabal lib like <tt>cabal-install</tt>. It has a very simple set of
°5ulogging actions. It has low level functions for running programs, a
°5ubunch of wrappers for various directory and file functions that do
°5uextra logging.
module Distribution.Utils.Generic

-- | Gets the contents of a file, but guarantee that it gets closed.
°5u
°5uThe file is read lazily but if it is not fully consumed by the action
°5uthen the remaining input is truncated and the file is closed.
withFileContents :: FilePath -> (String -> NoCallStackIO a) -> NoCallStackIO a

-- | Writes a file atomically.
°5u
°5uThe file is either written successfully or an IO exception is raised
°5uand the original file is left unchanged.
°5u
°5uOn windows it is not possible to delete a file that is open by a
°5uprocess. This case will give an IO exception but the atomic property
°5uis not affected.
writeFileAtomic :: FilePath -> ByteString -> NoCallStackIO ()

-- | Decode <a>String</a> from UTF8-encoded <a>ByteString</a>
°5u
°5uInvalid data in the UTF8 stream (this includes code-points
°5u<tt>U+D800</tt> through <tt>U+DFFF</tt>) will be decoded as the
°5ureplacement character (<tt>U+FFFD</tt>).
fromUTF8BS :: ByteString -> String

-- | Variant of <a>fromUTF8BS</a> for lazy <a>ByteString</a>s
fromUTF8LBS :: ByteString -> String

-- | Encode <a>String</a> to to UTF8-encoded <a>ByteString</a>
°5u
°5uCode-points in the <tt>U+D800</tt>-<tt>U+DFFF</tt> range will be
°5uencoded as the replacement character (i.e. <tt>U+FFFD</tt>).
toUTF8BS :: String -> ByteString

-- | Variant of <a>toUTF8BS</a> for lazy <a>ByteString</a>s
toUTF8LBS :: String -> ByteString

-- | Reads a UTF8 encoded text file as a Unicode String
°5u
°5uReads lazily using ordinary <a>readFile</a>.
readUTF8File :: FilePath -> NoCallStackIO String

-- | Reads a UTF8 encoded text file as a Unicode String
°5u
°5uSame behaviour as <a>withFileContents</a>.
withUTF8FileContents :: FilePath -> (String -> IO a) -> IO a

-- | Writes a Unicode String as a UTF8 encoded text file.
°5u
°5uUses <a>writeFileAtomic</a>, so provides the same guarantees.
writeUTF8File :: FilePath -> String -> NoCallStackIO ()

-- | Ignore a Unicode byte order mark (BOM) at the beginning of the input
ignoreBOM :: String -> String

-- | Fix different systems silly line ending conventions
normaliseLineEndings :: String -> String

-- | <tt>dropWhileEndLE p</tt> is equivalent to <tt>reverse . dropWhile p .
°5ureverse</tt>, but quite a bit faster. The difference between
°5u"Data.List.dropWhileEnd" and this version is that the one in
°5u<a>Data.List</a> is strict in elements, but spine-lazy, while this one
°5uis spine-strict but lazy in elements. That's what <tt>LE</tt> stands
°5ufor - "lazy in elements".
°5u
°5uExample:
°5u
°5u<pre>
°5u&gt;&gt;&gt; tail $ Data.List.dropWhileEnd (&lt;3) [undefined, 5, 4, 3, 2, 1]
°5u*** Exception: Prelude.undefined
°5u...
°5u</pre>
°5u
°5u<pre>
°5u&gt;&gt;&gt; tail $ dropWhileEndLE (&lt;3) [undefined, 5, 4, 3, 2, 1]
°5u[5,4,3]
°5u</pre>
°5u
°5u<pre>
°5u&gt;&gt;&gt; take 3 $ Data.List.dropWhileEnd (&lt;3) [5, 4, 3, 2, 1, undefined]
°5u[5,4,3]
°5u</pre>
°5u
°5u<pre>
°5u&gt;&gt;&gt; take 3 $ dropWhileEndLE (&lt;3) [5, 4, 3, 2, 1, undefined]
°5u*** Exception: Prelude.undefined
°5u...
°5u</pre>
dropWhileEndLE :: (a -> Bool) -> [a] -> [a]

-- | <tt>takeWhileEndLE p</tt> is equivalent to <tt>reverse . takeWhile p .
°5ureverse</tt>, but is usually faster (as well as being easier to read).
takeWhileEndLE :: (a -> Bool) -> [a] -> [a]
equating :: Eq a => (b -> a) -> b -> b -> Bool

-- | <pre>
°5ucomparing p x y = compare (p x) (p y)
°5u</pre>
°5u
°5uUseful combinator for use in conjunction with the <tt>xxxBy</tt>
°5ufamily of functions from <a>Data.List</a>, for example:
°5u
°5u<pre>
°5u... sortBy (comparing fst) ...
°5u</pre>
comparing :: Ord a => b -> a -> b -> b -> Ordering

-- | The <a>isInfixOf</a> function takes two lists and returns <a>True</a>
°5uiff the first list is contained, wholly and intact, anywhere within
°5uthe second.
°5u
°5u<pre>
°5u&gt;&gt;&gt; isInfixOf "Haskell" "I really like Haskell."
°5uTrue
°5u</pre>
°5u
°5u<pre>
°5u&gt;&gt;&gt; isInfixOf "Ial" "I really like Haskell."
°5uFalse
°5u</pre>
isInfixOf :: Eq a => [a] -> [a] -> Bool

-- | <a>intercalate</a> <tt>xs xss</tt> is equivalent to <tt>(<a>concat</a>
°5u(<a>intersperse</a> xs xss))</tt>. It inserts the list <tt>xs</tt> in
°5ubetween the lists in <tt>xss</tt> and concatenates the result.
°5u
°5u<pre>
°5u&gt;&gt;&gt; intercalate ", " ["Lorem", "ipsum", "dolor"]
°5u"Lorem, ipsum, dolor"
°5u</pre>
intercalate :: () => [a] -> [[a]] -> [a]

-- | Lower case string
°5u
°5u<pre>
°5u&gt;&gt;&gt; lowercase "Foobar"
°5u"foobar"
°5u</pre>
lowercase :: String -> String

-- | Ascii characters
isAscii :: Char -> Bool

-- | Ascii letters.
isAsciiAlpha :: Char -> Bool

-- | Ascii letters and digits.
°5u
°5u<pre>
°5u&gt;&gt;&gt; isAsciiAlphaNum 'a'
°5uTrue
°5u</pre>
°5u
°5u<pre>
°5u&gt;&gt;&gt; isAsciiAlphaNum 'ä'
°5uFalse
°5u</pre>
isAsciiAlphaNum :: Char -> Bool

-- | Like "Data.List.union", but has <tt>O(n log n)</tt> complexity instead
°5uof <tt>O(n^2)</tt>.
listUnion :: (Ord a) => [a] -> [a] -> [a]

-- | A right-biased version of <a>listUnion</a>.
°5u
°5uExample:
°5u
°5u<pre>
°5u&gt;&gt;&gt; listUnion [1,2,3,4,3] [2,1,1]
°5u[1,2,3,4,3]
°5u</pre>
°5u
°5u<pre>
°5u&gt;&gt;&gt; listUnionRight [1,2,3,4,3] [2,1,1]
°5u[4,3,2,1,1]
°5u</pre>
listUnionRight :: (Ord a) => [a] -> [a] -> [a]

-- | Like <a>nub</a>, but has <tt>O(n log n)</tt> complexity instead of
°5u<tt>O(n^2)</tt>. Code for <a>ordNub</a> and <a>listUnion</a> taken
°5ufrom Niklas Hambüchen's <a>ordnub</a> package.
ordNub :: Ord a => [a] -> [a]

-- | Like <a>ordNub</a> and <a>nubBy</a>. Selects a key for each element
°5uand takes the nub based on that key.
ordNubBy :: Ord b => (a -> b) -> [a] -> [a]

-- | A right-biased version of <a>ordNub</a>.
°5u
°5uExample:
°5u
°5u<pre>
°5u&gt;&gt;&gt; ordNub [1,2,1] :: [Int]
°5u[1,2]
°5u</pre>
°5u
°5u<pre>
°5u&gt;&gt;&gt; ordNubRight [1,2,1] :: [Int]
°5u[2,1]
°5u</pre>
ordNubRight :: (Ord a) => [a] -> [a]

-- | A total variant of <a>tail</a>.
safeTail :: [a] -> [a]
unintersperse :: Char -> String -> [String]

-- | Wraps text to the default line width. Existing newlines are preserved.
wrapText :: String -> String

-- | Wraps a list of words to a list of lines of words of a particular
°5uwidth.
wrapLine :: Int -> [String] -> [[String]]

-- | <a>unfoldr</a> with monadic action.
°5u
°5u<pre>
°5u&gt;&gt;&gt; take 5 $ unfoldrM (\b r -&gt; Just (r + b, b + 1)) (1 :: Int) 2
°5u[3,4,5,6,7]
°5u</pre>
unfoldrM :: Monad m => (b -> m (Maybe (a, b))) -> b -> m [a]

-- | Like <a>span</a> but with <a>Maybe</a> predicate
°5u
°5u<pre>
°5u&gt;&gt;&gt; spanMaybe listToMaybe [[1,2],[3],[],[4,5],[6,7]]
°5u([1,3],[[],[4,5],[6,7]])
°5u</pre>
°5u
°5u<pre>
°5u&gt;&gt;&gt; spanMaybe (readMaybe :: String -&gt; Maybe Int) ["1", "2", "foo"]
°5u([1,2],["foo"])
°5u</pre>
spanMaybe :: (a -> Maybe b) -> [a] -> ([b], [a])

-- | Like <a>break</a>, but with <a>Maybe</a> predicate
°5u
°5u<pre>
°5u&gt;&gt;&gt; breakMaybe (readMaybe :: String -&gt; Maybe Int) ["foo", "bar", "1", "2", "quu"]
°5u(["foo","bar"],Just (1,["2","quu"]))
°5u</pre>
°5u
°5u<pre>
°5u&gt;&gt;&gt; breakMaybe (readMaybe :: String -&gt; Maybe Int) ["foo", "bar"]
°5u(["foo","bar"],Nothing)
°5u</pre>
breakMaybe :: (a -> Maybe b) -> [a] -> ([a], Maybe (b, [a]))

-- | <a>isAbsoluteOnAnyPlatform</a> and <a>isRelativeOnAnyPlatform</a> are
°5ulike <a>isAbsolute</a> and <a>isRelative</a> but have platform
°5uindependent heuristics. The System.FilePath exists in two versions,
°5uWindows and Posix. The two versions don't agree on what is a relative
°5upath and we don't know if we're given Windows or Posix paths. This
°5uresults in false positives when running on Posix and inspecting
°5uWindows paths, like the hackage server does.
°5uSystem.FilePath.Posix.isAbsolute "C:\hello" == False
°5uSystem.FilePath.Windows.isAbsolute "/hello" == False This means that
°5uwe would treat paths that start with "/" to be absolute. On Posix they
°5uare indeed absolute, while on Windows they are not.
°5u
°5uThe portable versions should be used when we might deal with paths
°5uthat are from another OS than the host OS. For example, the Hackage
°5uServer deals with both Windows and Posix paths while performing the
°5uPackageDescription checks. In contrast, when we run 'cabal configure'
°5uwe do expect the paths to be correct for our OS and we should not have
°5uto use the platform independent heuristics.
isAbsoluteOnAnyPlatform :: FilePath -> Bool

-- | <pre>
°5uisRelativeOnAnyPlatform = not . <a>isAbsoluteOnAnyPlatform</a>
°5u</pre>
isRelativeOnAnyPlatform :: FilePath -> Bool

module Distribution.Types.SourceRepo

-- | Information about the source revision control system for a package.
°5u
°5uWhen specifying a repo it is useful to know the meaning or intention
°5uof the information as doing so enables automation. There are two
°5uobvious common purposes: one is to find the repo for the latest
°5udevelopment version, the other is to find the repo for this specific
°5urelease. The <tt>ReopKind</tt> specifies which one we mean (or another
°5ucustom one).
°5u
°5uA package can specify one or the other kind or both. Most will specify
°5ujust a head repo but some may want to specify a repo to reconstruct
°5uthe sources for this package release.
°5u
°5uThe required information is the <a>RepoType</a> which tells us if it's
°5uusing <a>Darcs</a>, <a>Git</a> for example. The <a>repoLocation</a>
°5uand other details are interpreted according to the repo type.
data SourceRepo
SourceRepo :: RepoKind -> Maybe RepoType -> Maybe String -> Maybe String -> Maybe String -> Maybe String -> Maybe FilePath -> SourceRepo

-- | The kind of repo. This field is required.
[repoKind] :: SourceRepo -> RepoKind

-- | The type of the source repository system for this repo, eg
°5u<a>Darcs</a> or <a>Git</a>. This field is required.
[repoType] :: SourceRepo -> Maybe RepoType

-- | The location of the repository. For most <a>RepoType</a>s this is a
°5uURL. This field is required.
[repoLocation] :: SourceRepo -> Maybe String

-- | <a>CVS</a> can put multiple "modules" on one server and requires a
°5umodule name in addition to the location to identify a particular repo.
°5uLogically this is part of the location but unfortunately has to be
°5uspecified separately. This field is required for the <a>CVS</a>
°5u<a>RepoType</a> and should not be given otherwise.
[repoModule] :: SourceRepo -> Maybe String

-- | The name or identifier of the branch, if any. Many source control
°5usystems have the notion of multiple branches in a repo that exist in
°5uthe same location. For example <a>Git</a> and <a>CVS</a> use this
°5uwhile systems like <a>Darcs</a> use different locations for different
°5ubranches. This field is optional but should be used if necessary to
°5uidentify the sources, especially for the <a>RepoThis</a> repo kind.
[repoBranch] :: SourceRepo -> Maybe String

-- | The tag identify a particular state of the repository. This should be
°5ugiven for the <a>RepoThis</a> repo kind and not for <a>RepoHead</a>
°5ukind.
[repoTag] :: SourceRepo -> Maybe String

-- | Some repositories contain multiple projects in different
°5usubdirectories This field specifies the subdirectory where this
°5upackages sources can be found, eg the subdirectory containing the
°5u<tt>.cabal</tt> file. It is interpreted relative to the root of the
°5urepository. This field is optional. If not given the default is "." ie
°5uno subdirectory.
[repoSubdir] :: SourceRepo -> Maybe FilePath

-- | What this repo info is for, what it represents.
data RepoKind

-- | The repository for the "head" or development version of the project.
°5uThis repo is where we should track the latest development activity or
°5uthe usual repo people should get to contribute patches.
RepoHead :: RepoKind

-- | The repository containing the sources for this exact package version
°5uor release. For this kind of repo a tag should be given to give enough
°5uinformation to re-create the exact sources.
RepoThis :: RepoKind
RepoKindUnknown :: String -> RepoKind

-- | An enumeration of common source control systems. The fields used in
°5uthe <a>SourceRepo</a> depend on the type of repo. The tools and
°5umethods used to obtain and track the repo depend on the repo type.
data RepoType
Darcs :: RepoType
Git :: RepoType
SVN :: RepoType
CVS :: RepoType
Mercurial :: RepoType
GnuArch :: RepoType
Bazaar :: RepoType
Monotone :: RepoType
OtherRepoType :: String -> RepoType
knownRepoTypes :: [RepoType]
emptySourceRepo :: RepoKind -> SourceRepo
classifyRepoType :: String -> RepoType
classifyRepoKind :: String -> RepoKind
instance Data.Data.Data Distribution.Types.SourceRepo.SourceRepo
instance GHC.Show.Show Distribution.Types.SourceRepo.SourceRepo
instance GHC.Read.Read Distribution.Types.SourceRepo.SourceRepo
instance GHC.Generics.Generic Distribution.Types.SourceRepo.SourceRepo
instance GHC.Classes.Eq Distribution.Types.SourceRepo.SourceRepo
instance Data.Data.Data Distribution.Types.SourceRepo.RepoType
instance GHC.Show.Show Distribution.Types.SourceRepo.RepoType
instance GHC.Read.Read Distribution.Types.SourceRepo.RepoType
instance GHC.Classes.Ord Distribution.Types.SourceRepo.RepoType
instance GHC.Generics.Generic Distribution.Types.SourceRepo.RepoType
instance GHC.Classes.Eq Distribution.Types.SourceRepo.RepoType
instance Data.Data.Data Distribution.Types.SourceRepo.RepoKind
instance GHC.Show.Show Distribution.Types.SourceRepo.RepoKind
instance GHC.Read.Read Distribution.Types.SourceRepo.RepoKind
instance GHC.Classes.Ord Distribution.Types.SourceRepo.RepoKind
instance GHC.Generics.Generic Distribution.Types.SourceRepo.RepoKind
instance GHC.Classes.Eq Distribution.Types.SourceRepo.RepoKind
instance Data.Binary.Class.Binary Distribution.Types.SourceRepo.SourceRepo
instance Control.DeepSeq.NFData Distribution.Types.SourceRepo.SourceRepo
instance Data.Binary.Class.Binary Distribution.Types.SourceRepo.RepoType
instance Control.DeepSeq.NFData Distribution.Types.SourceRepo.RepoType
instance Distribution.Pretty.Pretty Distribution.Types.SourceRepo.RepoType
instance Distribution.Parsec.Class.Parsec Distribution.Types.SourceRepo.RepoType
instance Distribution.Text.Text Distribution.Types.SourceRepo.RepoType
instance Data.Binary.Class.Binary Distribution.Types.SourceRepo.RepoKind
instance Control.DeepSeq.NFData Distribution.Types.SourceRepo.RepoKind
instance Distribution.Pretty.Pretty Distribution.Types.SourceRepo.RepoKind
instance Distribution.Parsec.Class.Parsec Distribution.Types.SourceRepo.RepoKind
instance Distribution.Text.Text Distribution.Types.SourceRepo.RepoKind

module Distribution.Types.SourceRepo.Lens

-- | Information about the source revision control system for a package.
°5u
°5uWhen specifying a repo it is useful to know the meaning or intention
°5uof the information as doing so enables automation. There are two
°5uobvious common purposes: one is to find the repo for the latest
°5udevelopment version, the other is to find the repo for this specific
°5urelease. The <tt>ReopKind</tt> specifies which one we mean (or another
°5ucustom one).
°5u
°5uA package can specify one or the other kind or both. Most will specify
°5ujust a head repo but some may want to specify a repo to reconstruct
°5uthe sources for this package release.
°5u
°5uThe required information is the <a>RepoType</a> which tells us if it's
°5uusing <a>Darcs</a>, <a>Git</a> for example. The <a>repoLocation</a>
°5uand other details are interpreted according to the repo type.
data SourceRepo
repoKind :: Lens' SourceRepo RepoKind
repoType :: Lens' SourceRepo (Maybe RepoType)
repoLocation :: Lens' SourceRepo (Maybe String)
repoModule :: Lens' SourceRepo (Maybe String)
repoBranch :: Lens' SourceRepo (Maybe String)
repoTag :: Lens' SourceRepo (Maybe String)
repoSubdir :: Lens' SourceRepo (Maybe FilePath)


-- | Cabal often needs to do slightly different things on specific
°5uplatforms. You probably know about the <a>os</a> however using that is
°5uvery inconvenient because it is a string and different Haskell
°5uimplementations do not agree on using the same strings for the same
°5uplatforms! (In particular see the controversy over "windows" vs
°5u"mingw32"). So to make it more consistent and easy to use we have an
°5u<a>OS</a> enumeration.
module Distribution.System

-- | These are the known OS names: Linux, Windows, OSX ,FreeBSD, OpenBSD,
°5uNetBSD, DragonFly ,Solaris, AIX, HPUX, IRIX ,HaLVM ,Hurd ,IOS,
°5uAndroid,Ghcjs
°5u
°5uThe following aliases can also be used:, * Windows aliases: mingw32,
°5uwin32, cygwin32 * OSX alias: darwin * Hurd alias: gnu * FreeBSD alias:
°5ukfreebsdgnu * Solaris alias: solaris2
data OS
Linux :: OS
Windows :: OS
OSX :: OS
FreeBSD :: OS
OpenBSD :: OS
NetBSD :: OS
DragonFly :: OS
Solaris :: OS
AIX :: OS
HPUX :: OS
IRIX :: OS
HaLVM :: OS
Hurd :: OS
IOS :: OS
Android :: OS
Ghcjs :: OS
OtherOS :: String -> OS
buildOS :: OS

-- | These are the known Arches: I386, X86_64, PPC, PPC64, Sparc ,Arm,
°5uMips, SH, IA64, S39, Alpha, Hppa, Rs6000, M68k, Vax and JavaScript.
°5u
°5uThe following aliases can also be used: * PPC alias: powerpc * PPC64
°5ualias : powerpc64 * Sparc aliases: sparc64, sun4 * Mips aliases:
°5umipsel, mipseb * Arm aliases: armeb, armel
data Arch
I386 :: Arch
X86_64 :: Arch
PPC :: Arch
PPC64 :: Arch
Sparc :: Arch
Arm :: Arch
Mips :: Arch
SH :: Arch
IA64 :: Arch
S390 :: Arch
Alpha :: Arch
Hppa :: Arch
Rs6000 :: Arch
M68k :: Arch
Vax :: Arch
JavaScript :: Arch
OtherArch :: String -> Arch
buildArch :: Arch
data Platform
Platform :: Arch -> OS -> Platform

-- | The platform Cabal was compiled on. In most cases,
°5u<tt>LocalBuildInfo.hostPlatform</tt> should be used instead (the
°5uplatform we're targeting).
buildPlatform :: Platform
platformFromTriple :: String -> Maybe Platform
knownOSs :: [OS]
knownArches :: [Arch]

-- | How strict to be when classifying strings into the <a>OS</a> and
°5u<a>Arch</a> enums.
°5u
°5uThe reason we have multiple ways to do the classification is because
°5uthere are two situations where we need to do it.
°5u
°5uFor parsing OS and arch names in .cabal files we really want everyone
°5uto be referring to the same or or arch by the same name. Variety is
°5unot a virtue in this case. We don't mind about case though.
°5u
°5uFor the System.Info.os/arch different Haskell implementations use
°5udifferent names for the same or/arch. Also they tend to distinguish
°5uversions of an OS/arch which we just don't care about.
°5u
°5uThe <a>Compat</a> classification allows us to recognise aliases that
°5uare already in common use but it allows us to distinguish them from
°5uthe canonical name which enables us to warn about such deprecated
°5ualiases.
data ClassificationStrictness
Permissive :: ClassificationStrictness
Compat :: ClassificationStrictness
Strict :: ClassificationStrictness
classifyOS :: ClassificationStrictness -> String -> OS
classifyArch :: ClassificationStrictness -> String -> Arch
instance Data.Data.Data Distribution.System.Platform
instance GHC.Read.Read Distribution.System.Platform
instance GHC.Show.Show Distribution.System.Platform
instance GHC.Classes.Ord Distribution.System.Platform
instance GHC.Generics.Generic Distribution.System.Platform
instance GHC.Classes.Eq Distribution.System.Platform
instance Data.Data.Data Distribution.System.Arch
instance GHC.Read.Read Distribution.System.Arch
instance GHC.Show.Show Distribution.System.Arch
instance GHC.Classes.Ord Distribution.System.Arch
instance GHC.Generics.Generic Distribution.System.Arch
instance GHC.Classes.Eq Distribution.System.Arch
instance Data.Data.Data Distribution.System.OS
instance GHC.Read.Read Distribution.System.OS
instance GHC.Show.Show Distribution.System.OS
instance GHC.Classes.Ord Distribution.System.OS
instance GHC.Generics.Generic Distribution.System.OS
instance GHC.Classes.Eq Distribution.System.OS
instance Data.Binary.Class.Binary Distribution.System.Platform
instance Control.DeepSeq.NFData Distribution.System.Platform
instance Distribution.Pretty.Pretty Distribution.System.Platform
instance Distribution.Parsec.Class.Parsec Distribution.System.Platform
instance Distribution.Text.Text Distribution.System.Platform
instance Data.Binary.Class.Binary Distribution.System.Arch
instance Control.DeepSeq.NFData Distribution.System.Arch
instance Distribution.Pretty.Pretty Distribution.System.Arch
instance Distribution.Parsec.Class.Parsec Distribution.System.Arch
instance Distribution.Text.Text Distribution.System.Arch
instance Data.Binary.Class.Binary Distribution.System.OS
instance Control.DeepSeq.NFData Distribution.System.OS
instance Distribution.Pretty.Pretty Distribution.System.OS
instance Distribution.Parsec.Class.Parsec Distribution.System.OS
instance Distribution.Text.Text Distribution.System.OS

module Distribution.SPDX.LicenseReference

-- | A user defined license reference denoted by
°5u<tt>LicenseRef-[idstring]</tt> (for a license not on the SPDX License
°5uList);
data LicenseRef

-- | License reference.
licenseRef :: LicenseRef -> String

-- | Document reference.
licenseDocumentRef :: LicenseRef -> Maybe String

-- | Create <a>LicenseRef</a> from optional document ref and name.
mkLicenseRef :: Maybe String -> String -> Maybe LicenseRef

-- | Like <a>mkLicenseRef</a> but convert invalid characters into
°5u<tt>-</tt>.
mkLicenseRef' :: Maybe String -> String -> LicenseRef
instance GHC.Generics.Generic Distribution.SPDX.LicenseReference.LicenseRef
instance Data.Data.Data Distribution.SPDX.LicenseReference.LicenseRef
instance GHC.Classes.Ord Distribution.SPDX.LicenseReference.LicenseRef
instance GHC.Classes.Eq Distribution.SPDX.LicenseReference.LicenseRef
instance GHC.Read.Read Distribution.SPDX.LicenseReference.LicenseRef
instance GHC.Show.Show Distribution.SPDX.LicenseReference.LicenseRef
instance Data.Binary.Class.Binary Distribution.SPDX.LicenseReference.LicenseRef
instance Control.DeepSeq.NFData Distribution.SPDX.LicenseReference.LicenseRef
instance Distribution.Pretty.Pretty Distribution.SPDX.LicenseReference.LicenseRef
instance Distribution.Parsec.Class.Parsec Distribution.SPDX.LicenseReference.LicenseRef

module Distribution.SPDX.LicenseId

-- | SPDX License identifier
data LicenseId

-- | <tt>Glide</tt>, 3dfx Glide License
Glide :: LicenseId

-- | <tt>Abstyles</tt>, Abstyles License
Abstyles :: LicenseId

-- | <tt>AFL-1.1</tt>, Academic Free License v1.1
AFL_1_1 :: LicenseId

-- | <tt>AFL-1.2</tt>, Academic Free License v1.2
AFL_1_2 :: LicenseId

-- | <tt>AFL-2.0</tt>, Academic Free License v2.0
AFL_2_0 :: LicenseId

-- | <tt>AFL-2.1</tt>, Academic Free License v2.1
AFL_2_1 :: LicenseId

-- | <tt>AFL-3.0</tt>, Academic Free License v3.0
AFL_3_0 :: LicenseId

-- | <tt>AMPAS</tt>, Academy of Motion Picture Arts and Sciences BSD
AMPAS :: LicenseId

-- | <tt>APL-1.0</tt>, Adaptive Public License 1.0
APL_1_0 :: LicenseId

-- | <tt>Adobe-Glyph</tt>, Adobe Glyph List License
Adobe_Glyph :: LicenseId

-- | <tt>APAFML</tt>, Adobe Postscript AFM License
APAFML :: LicenseId

-- | <tt>Adobe-2006</tt>, Adobe Systems Incorporated Source Code License
°5uAgreement
Adobe_2006 :: LicenseId

-- | <tt>AGPL-1.0</tt>, Affero General Public License v1.0
AGPL_1_0 :: LicenseId

-- | <tt>Afmparse</tt>, Afmparse License
Afmparse :: LicenseId

-- | <tt>Aladdin</tt>, Aladdin Free Public License
Aladdin :: LicenseId

-- | <tt>ADSL</tt>, Amazon Digital Services License
ADSL :: LicenseId

-- | <tt>AMDPLPA</tt>, AMD's plpa_map.c License
AMDPLPA :: LicenseId

-- | <tt>ANTLR-PD</tt>, ANTLR Software Rights Notice
ANTLR_PD :: LicenseId

-- | <tt>Apache-1.0</tt>, Apache License 1.0
Apache_1_0 :: LicenseId

-- | <tt>Apache-1.1</tt>, Apache License 1.1
Apache_1_1 :: LicenseId

-- | <tt>Apache-2.0</tt>, Apache License 2.0
Apache_2_0 :: LicenseId

-- | <tt>AML</tt>, Apple MIT License
AML :: LicenseId

-- | <tt>APSL-1.0</tt>, Apple Public Source License 1.0
APSL_1_0 :: LicenseId

-- | <tt>APSL-1.1</tt>, Apple Public Source License 1.1
APSL_1_1 :: LicenseId

-- | <tt>APSL-1.2</tt>, Apple Public Source License 1.2
APSL_1_2 :: LicenseId

-- | <tt>APSL-2.0</tt>, Apple Public Source License 2.0
APSL_2_0 :: LicenseId

-- | <tt>Artistic-1.0</tt>, Artistic License 1.0
Artistic_1_0 :: LicenseId

-- | <tt>Artistic-1.0-Perl</tt>, Artistic License 1.0 (Perl)
Artistic_1_0_Perl :: LicenseId

-- | <tt>Artistic-1.0-cl8</tt>, Artistic License 1.0 w/clause 8
Artistic_1_0_cl8 :: LicenseId

-- | <tt>Artistic-2.0</tt>, Artistic License 2.0
Artistic_2_0 :: LicenseId

-- | <tt>AAL</tt>, Attribution Assurance License
AAL :: LicenseId

-- | <tt>Bahyph</tt>, Bahyph License
Bahyph :: LicenseId

-- | <tt>Barr</tt>, Barr License
Barr :: LicenseId

-- | <tt>Beerware</tt>, Beerware License
Beerware :: LicenseId

-- | <tt>BitTorrent-1.0</tt>, BitTorrent Open Source License v1.0
BitTorrent_1_0 :: LicenseId

-- | <tt>BitTorrent-1.1</tt>, BitTorrent Open Source License v1.1
BitTorrent_1_1 :: LicenseId

-- | <tt>BSL-1.0</tt>, Boost Software License 1.0
BSL_1_0 :: LicenseId

-- | <tt>Borceux</tt>, Borceux license
Borceux :: LicenseId

-- | <tt>BSD-2-Clause</tt>, BSD 2-clause <a>Simplified</a> License
BSD_2_Clause :: LicenseId

-- | <tt>BSD-2-Clause-FreeBSD</tt>, BSD 2-clause FreeBSD License
BSD_2_Clause_FreeBSD :: LicenseId

-- | <tt>BSD-2-Clause-NetBSD</tt>, BSD 2-clause NetBSD License
BSD_2_Clause_NetBSD :: LicenseId

-- | <tt>BSD-3-Clause</tt>, BSD 3-clause <a>New</a> or <a>Revised</a>
°5uLicense
BSD_3_Clause :: LicenseId

-- | <tt>BSD-3-Clause-Clear</tt>, BSD 3-clause Clear License
BSD_3_Clause_Clear :: LicenseId

-- | <tt>BSD-3-Clause-No-Nuclear-License</tt>, BSD 3-Clause No Nuclear
°5uLicense
BSD_3_Clause_No_Nuclear_License :: LicenseId

-- | <tt>BSD-3-Clause-No-Nuclear-License-2014</tt>, BSD 3-Clause No Nuclear
°5uLicense 2014
BSD_3_Clause_No_Nuclear_License_2014 :: LicenseId

-- | <tt>BSD-3-Clause-No-Nuclear-Warranty</tt>, BSD 3-Clause No Nuclear
°5uWarranty
BSD_3_Clause_No_Nuclear_Warranty :: LicenseId

-- | <tt>BSD-4-Clause</tt>, BSD 4-clause <a>Original</a> or <a>Old</a>
°5uLicense
BSD_4_Clause :: LicenseId

-- | <tt>BSD-Protection</tt>, BSD Protection License
BSD_Protection :: LicenseId

-- | <tt>BSD-Source-Code</tt>, BSD Source Code Attribution
BSD_Source_Code :: LicenseId

-- | <tt>BSD-3-Clause-Attribution</tt>, BSD with attribution
BSD_3_Clause_Attribution :: LicenseId

-- | <tt>0BSD</tt>, BSD Zero Clause License
NullBSD :: LicenseId

-- | <tt>BSD-4-Clause-UC</tt>, BSD-4-Clause (University of
°5uCalifornia-Specific)
BSD_4_Clause_UC :: LicenseId

-- | <tt>bzip2-1.0.5</tt>, bzip2 and libbzip2 License v1.0.5
Bzip2_1_0_5 :: LicenseId

-- | <tt>bzip2-1.0.6</tt>, bzip2 and libbzip2 License v1.0.6
Bzip2_1_0_6 :: LicenseId

-- | <tt>Caldera</tt>, Caldera License
Caldera :: LicenseId

-- | <tt>CECILL-1.0</tt>, CeCILL Free Software License Agreement v1.0
CECILL_1_0 :: LicenseId

-- | <tt>CECILL-1.1</tt>, CeCILL Free Software License Agreement v1.1
CECILL_1_1 :: LicenseId

-- | <tt>CECILL-2.0</tt>, CeCILL Free Software License Agreement v2.0
CECILL_2_0 :: LicenseId

-- | <tt>CECILL-2.1</tt>, CeCILL Free Software License Agreement v2.1
CECILL_2_1 :: LicenseId

-- | <tt>CECILL-B</tt>, CeCILL-B Free Software License Agreement
CECILL_B :: LicenseId

-- | <tt>CECILL-C</tt>, CeCILL-C Free Software License Agreement
CECILL_C :: LicenseId

-- | <tt>ClArtistic</tt>, Clarified Artistic License
ClArtistic :: LicenseId

-- | <tt>MIT-CMU</tt>, CMU License
MIT_CMU :: LicenseId

-- | <tt>CNRI-Jython</tt>, CNRI Jython License
CNRI_Jython :: LicenseId

-- | <tt>CNRI-Python</tt>, CNRI Python License
CNRI_Python :: LicenseId

-- | <tt>CNRI-Python-GPL-Compatible</tt>, CNRI Python Open Source GPL
°5uCompatible License Agreement
CNRI_Python_GPL_Compatible :: LicenseId

-- | <tt>CPOL-1.02</tt>, Code Project Open License 1.02
CPOL_1_02 :: LicenseId

-- | <tt>CDDL-1.0</tt>, Common Development and Distribution License 1.0
CDDL_1_0 :: LicenseId

-- | <tt>CDDL-1.1</tt>, Common Development and Distribution License 1.1
CDDL_1_1 :: LicenseId

-- | <tt>CPAL-1.0</tt>, Common Public Attribution License 1.0
CPAL_1_0 :: LicenseId

-- | <tt>CPL-1.0</tt>, Common Public License 1.0
CPL_1_0 :: LicenseId

-- | <tt>CATOSL-1.1</tt>, Computer Associates Trusted Open Source License
°5u1.1
CATOSL_1_1 :: LicenseId

-- | <tt>Condor-1.1</tt>, Condor Public License v1.1
Condor_1_1 :: LicenseId

-- | <tt>CC-BY-1.0</tt>, Creative Commons Attribution 1.0
CC_BY_1_0 :: LicenseId

-- | <tt>CC-BY-2.0</tt>, Creative Commons Attribution 2.0
CC_BY_2_0 :: LicenseId

-- | <tt>CC-BY-2.5</tt>, Creative Commons Attribution 2.5
CC_BY_2_5 :: LicenseId

-- | <tt>CC-BY-3.0</tt>, Creative Commons Attribution 3.0
CC_BY_3_0 :: LicenseId

-- | <tt>CC-BY-4.0</tt>, Creative Commons Attribution 4.0
CC_BY_4_0 :: LicenseId

-- | <tt>CC-BY-ND-1.0</tt>, Creative Commons Attribution No Derivatives 1.0
CC_BY_ND_1_0 :: LicenseId

-- | <tt>CC-BY-ND-2.0</tt>, Creative Commons Attribution No Derivatives 2.0
CC_BY_ND_2_0 :: LicenseId

-- | <tt>CC-BY-ND-2.5</tt>, Creative Commons Attribution No Derivatives 2.5
CC_BY_ND_2_5 :: LicenseId

-- | <tt>CC-BY-ND-3.0</tt>, Creative Commons Attribution No Derivatives 3.0
CC_BY_ND_3_0 :: LicenseId

-- | <tt>CC-BY-ND-4.0</tt>, Creative Commons Attribution No Derivatives 4.0
CC_BY_ND_4_0 :: LicenseId

-- | <tt>CC-BY-NC-1.0</tt>, Creative Commons Attribution Non Commercial 1.0
CC_BY_NC_1_0 :: LicenseId

-- | <tt>CC-BY-NC-2.0</tt>, Creative Commons Attribution Non Commercial 2.0
CC_BY_NC_2_0 :: LicenseId

-- | <tt>CC-BY-NC-2.5</tt>, Creative Commons Attribution Non Commercial 2.5
CC_BY_NC_2_5 :: LicenseId

-- | <tt>CC-BY-NC-3.0</tt>, Creative Commons Attribution Non Commercial 3.0
CC_BY_NC_3_0 :: LicenseId

-- | <tt>CC-BY-NC-4.0</tt>, Creative Commons Attribution Non Commercial 4.0
CC_BY_NC_4_0 :: LicenseId

-- | <tt>CC-BY-NC-ND-1.0</tt>, Creative Commons Attribution Non Commercial
°5uNo Derivatives 1.0
CC_BY_NC_ND_1_0 :: LicenseId

-- | <tt>CC-BY-NC-ND-2.0</tt>, Creative Commons Attribution Non Commercial
°5uNo Derivatives 2.0
CC_BY_NC_ND_2_0 :: LicenseId

-- | <tt>CC-BY-NC-ND-2.5</tt>, Creative Commons Attribution Non Commercial
°5uNo Derivatives 2.5
CC_BY_NC_ND_2_5 :: LicenseId

-- | <tt>CC-BY-NC-ND-3.0</tt>, Creative Commons Attribution Non Commercial
°5uNo Derivatives 3.0
CC_BY_NC_ND_3_0 :: LicenseId

-- | <tt>CC-BY-NC-ND-4.0</tt>, Creative Commons Attribution Non Commercial
°5uNo Derivatives 4.0
CC_BY_NC_ND_4_0 :: LicenseId

-- | <tt>CC-BY-NC-SA-1.0</tt>, Creative Commons Attribution Non Commercial
°5uShare Alike 1.0
CC_BY_NC_SA_1_0 :: LicenseId

-- | <tt>CC-BY-NC-SA-2.0</tt>, Creative Commons Attribution Non Commercial
°5uShare Alike 2.0
CC_BY_NC_SA_2_0 :: LicenseId

-- | <tt>CC-BY-NC-SA-2.5</tt>, Creative Commons Attribution Non Commercial
°5uShare Alike 2.5
CC_BY_NC_SA_2_5 :: LicenseId

-- | <tt>CC-BY-NC-SA-3.0</tt>, Creative Commons Attribution Non Commercial
°5uShare Alike 3.0
CC_BY_NC_SA_3_0 :: LicenseId

-- | <tt>CC-BY-NC-SA-4.0</tt>, Creative Commons Attribution Non Commercial
°5uShare Alike 4.0
CC_BY_NC_SA_4_0 :: LicenseId

-- | <tt>CC-BY-SA-1.0</tt>, Creative Commons Attribution Share Alike 1.0
CC_BY_SA_1_0 :: LicenseId

-- | <tt>CC-BY-SA-2.0</tt>, Creative Commons Attribution Share Alike 2.0
CC_BY_SA_2_0 :: LicenseId

-- | <tt>CC-BY-SA-2.5</tt>, Creative Commons Attribution Share Alike 2.5
CC_BY_SA_2_5 :: LicenseId

-- | <tt>CC-BY-SA-3.0</tt>, Creative Commons Attribution Share Alike 3.0
CC_BY_SA_3_0 :: LicenseId

-- | <tt>CC-BY-SA-4.0</tt>, Creative Commons Attribution Share Alike 4.0
CC_BY_SA_4_0 :: LicenseId

-- | <tt>CC0-1.0</tt>, Creative Commons Zero v1.0 Universal
CC0_1_0 :: LicenseId

-- | <tt>Crossword</tt>, Crossword License
Crossword :: LicenseId

-- | <tt>CrystalStacker</tt>, CrystalStacker License
CrystalStacker :: LicenseId

-- | <tt>CUA-OPL-1.0</tt>, CUA Office Public License v1.0
CUA_OPL_1_0 :: LicenseId

-- | <tt>Cube</tt>, Cube License
Cube :: LicenseId

-- | <tt>curl</tt>, curl License
Curl :: LicenseId

-- | <tt>D-FSL-1.0</tt>, Deutsche Freie Software Lizenz
D_FSL_1_0 :: LicenseId

-- | <tt>diffmark</tt>, diffmark license
Diffmark :: LicenseId

-- | <tt>WTFPL</tt>, Do What The F*ck You Want To Public License
WTFPL :: LicenseId

-- | <tt>DOC</tt>, DOC License
DOC :: LicenseId

-- | <tt>Dotseqn</tt>, Dotseqn License
Dotseqn :: LicenseId

-- | <tt>DSDP</tt>, DSDP License
DSDP :: LicenseId

-- | <tt>dvipdfm</tt>, dvipdfm License
Dvipdfm :: LicenseId

-- | <tt>EPL-1.0</tt>, Eclipse Public License 1.0
EPL_1_0 :: LicenseId

-- | <tt>ECL-1.0</tt>, Educational Community License v1.0
ECL_1_0 :: LicenseId

-- | <tt>ECL-2.0</tt>, Educational Community License v2.0
ECL_2_0 :: LicenseId

-- | <tt>eGenix</tt>, eGenix.com Public License 1.1.0
EGenix :: LicenseId

-- | <tt>EFL-1.0</tt>, Eiffel Forum License v1.0
EFL_1_0 :: LicenseId

-- | <tt>EFL-2.0</tt>, Eiffel Forum License v2.0
EFL_2_0 :: LicenseId

-- | <tt>MIT-advertising</tt>, Enlightenment License (e16)
MIT_advertising :: LicenseId

-- | <tt>MIT-enna</tt>, enna License
MIT_enna :: LicenseId

-- | <tt>Entessa</tt>, Entessa Public License v1.0
Entessa :: LicenseId

-- | <tt>ErlPL-1.1</tt>, Erlang Public License v1.1
ErlPL_1_1 :: LicenseId

-- | <tt>EUDatagrid</tt>, EU DataGrid Software License
EUDatagrid :: LicenseId

-- | <tt>EUPL-1.0</tt>, European Union Public License 1.0
EUPL_1_0 :: LicenseId

-- | <tt>EUPL-1.1</tt>, European Union Public License 1.1
EUPL_1_1 :: LicenseId

-- | <tt>Eurosym</tt>, Eurosym License
Eurosym :: LicenseId

-- | <tt>Fair</tt>, Fair License
Fair :: LicenseId

-- | <tt>MIT-feh</tt>, feh License
MIT_feh :: LicenseId

-- | <tt>Frameworx-1.0</tt>, Frameworx Open License 1.0
Frameworx_1_0 :: LicenseId

-- | <tt>FreeImage</tt>, FreeImage Public License v1.0
FreeImage :: LicenseId

-- | <tt>FTL</tt>, Freetype Project License
FTL :: LicenseId

-- | <tt>FSFAP</tt>, FSF All Permissive License
FSFAP :: LicenseId

-- | <tt>FSFUL</tt>, FSF Unlimited License
FSFUL :: LicenseId

-- | <tt>FSFULLR</tt>, FSF Unlimited License (with License Retention)
FSFULLR :: LicenseId

-- | <tt>Giftware</tt>, Giftware License
Giftware :: LicenseId

-- | <tt>GL2PS</tt>, GL2PS License
GL2PS :: LicenseId

-- | <tt>Glulxe</tt>, Glulxe License
Glulxe :: LicenseId

-- | <tt>AGPL-3.0</tt>, GNU Affero General Public License v3.0
AGPL_3_0 :: LicenseId

-- | <tt>GFDL-1.1</tt>, GNU Free Documentation License v1.1
GFDL_1_1 :: LicenseId

-- | <tt>GFDL-1.2</tt>, GNU Free Documentation License v1.2
GFDL_1_2 :: LicenseId

-- | <tt>GFDL-1.3</tt>, GNU Free Documentation License v1.3
GFDL_1_3 :: LicenseId

-- | <tt>GPL-1.0</tt>, GNU General Public License v1.0 only
GPL_1_0 :: LicenseId

-- | <tt>GPL-2.0</tt>, GNU General Public License v2.0 only
GPL_2_0 :: LicenseId

-- | <tt>GPL-3.0</tt>, GNU General Public License v3.0 only
GPL_3_0 :: LicenseId

-- | <tt>LGPL-2.1</tt>, GNU Lesser General Public License v2.1 only
LGPL_2_1 :: LicenseId

-- | <tt>LGPL-3.0</tt>, GNU Lesser General Public License v3.0 only
LGPL_3_0 :: LicenseId

-- | <tt>LGPL-2.0</tt>, GNU Library General Public License v2 only
LGPL_2_0 :: LicenseId

-- | <tt>gnuplot</tt>, gnuplot License
Gnuplot :: LicenseId

-- | <tt>gSOAP-1.3b</tt>, gSOAP Public License v1.3b
GSOAP_1_3b :: LicenseId

-- | <tt>HaskellReport</tt>, Haskell Language Report License
HaskellReport :: LicenseId

-- | <tt>HPND</tt>, Historic Permission Notice and Disclaimer
HPND :: LicenseId

-- | <tt>IBM-pibs</tt>, IBM PowerPC Initialization and Boot Software
IBM_pibs :: LicenseId

-- | <tt>IPL-1.0</tt>, IBM Public License v1.0
IPL_1_0 :: LicenseId

-- | <tt>ICU</tt>, ICU License
ICU :: LicenseId

-- | <tt>ImageMagick</tt>, ImageMagick License
ImageMagick :: LicenseId

-- | <tt>iMatix</tt>, iMatix Standard Function Library Agreement
IMatix :: LicenseId

-- | <tt>Imlib2</tt>, Imlib2 License
Imlib2 :: LicenseId

-- | <tt>IJG</tt>, Independent JPEG Group License
IJG :: LicenseId

-- | <tt>Info-ZIP</tt>, Info-ZIP License
Info_ZIP :: LicenseId

-- | <tt>Intel-ACPI</tt>, Intel ACPI Software License Agreement
Intel_ACPI :: LicenseId

-- | <tt>Intel</tt>, Intel Open Source License
Intel :: LicenseId

-- | <tt>Interbase-1.0</tt>, Interbase Public License v1.0
Interbase_1_0 :: LicenseId

-- | <tt>IPA</tt>, IPA Font License
IPA :: LicenseId

-- | <tt>ISC</tt>, ISC License
ISC :: LicenseId

-- | <tt>JasPer-2.0</tt>, JasPer License
JasPer_2_0 :: LicenseId

-- | <tt>JSON</tt>, JSON License
JSON :: LicenseId

-- | <tt>LPPL-1.0</tt>, LaTeX Project Public License v1.0
LPPL_1_0 :: LicenseId

-- | <tt>LPPL-1.1</tt>, LaTeX Project Public License v1.1
LPPL_1_1 :: LicenseId

-- | <tt>LPPL-1.2</tt>, LaTeX Project Public License v1.2
LPPL_1_2 :: LicenseId

-- | <tt>LPPL-1.3a</tt>, LaTeX Project Public License v1.3a
LPPL_1_3a :: LicenseId

-- | <tt>LPPL-1.3c</tt>, LaTeX Project Public License v1.3c
LPPL_1_3c :: LicenseId

-- | <tt>Latex2e</tt>, Latex2e License
Latex2e :: LicenseId

-- | <tt>BSD-3-Clause-LBNL</tt>, Lawrence Berkeley National Labs BSD
°5uvariant license
BSD_3_Clause_LBNL :: LicenseId

-- | <tt>Leptonica</tt>, Leptonica License
Leptonica :: LicenseId

-- | <tt>LGPLLR</tt>, Lesser General Public License For Linguistic
°5uResources
LGPLLR :: LicenseId

-- | <tt>Libpng</tt>, libpng License
Libpng :: LicenseId

-- | <tt>libtiff</tt>, libtiff License
Libtiff :: LicenseId

-- | <tt>LAL-1.2</tt>, Licence Art Libre 1.2
LAL_1_2 :: LicenseId

-- | <tt>LAL-1.3</tt>, Licence Art Libre 1.3
LAL_1_3 :: LicenseId

-- | <tt>LiLiQ-P-1.1</tt>, Licence Libre du Québec – Permissive version 1.1
LiLiQ_P_1_1 :: LicenseId

-- | <tt>LiLiQ-Rplus-1.1</tt>, Licence Libre du Québec – Réciprocité forte
°5uversion 1.1
LiLiQ_Rplus_1_1 :: LicenseId

-- | <tt>LiLiQ-R-1.1</tt>, Licence Libre du Québec – Réciprocité version
°5u1.1
LiLiQ_R_1_1 :: LicenseId

-- | <tt>LPL-1.02</tt>, Lucent Public License v1.02
LPL_1_02 :: LicenseId

-- | <tt>LPL-1.0</tt>, Lucent Public License Version 1.0
LPL_1_0 :: LicenseId

-- | <tt>MakeIndex</tt>, MakeIndex License
MakeIndex :: LicenseId

-- | <tt>MTLL</tt>, Matrix Template Library License
MTLL :: LicenseId

-- | <tt>MS-PL</tt>, Microsoft Public License
MS_PL :: LicenseId

-- | <tt>MS-RL</tt>, Microsoft Reciprocal License
MS_RL :: LicenseId

-- | <tt>MirOS</tt>, MirOS Licence
MirOS :: LicenseId

-- | <tt>MITNFA</tt>, MIT +no-false-attribs license
MITNFA :: LicenseId

-- | <tt>MIT</tt>, MIT License
MIT :: LicenseId

-- | <tt>Motosoto</tt>, Motosoto License
Motosoto :: LicenseId

-- | <tt>MPL-1.0</tt>, Mozilla Public License 1.0
MPL_1_0 :: LicenseId

-- | <tt>MPL-1.1</tt>, Mozilla Public License 1.1
MPL_1_1 :: LicenseId

-- | <tt>MPL-2.0</tt>, Mozilla Public License 2.0
MPL_2_0 :: LicenseId

-- | <tt>MPL-2.0-no-copyleft-exception</tt>, Mozilla Public License 2.0 (no
°5ucopyleft exception)
MPL_2_0_no_copyleft_exception :: LicenseId

-- | <tt>mpich2</tt>, mpich2 License
Mpich2 :: LicenseId

-- | <tt>Multics</tt>, Multics License
Multics :: LicenseId

-- | <tt>Mup</tt>, Mup License
Mup :: LicenseId

-- | <tt>NASA-1.3</tt>, NASA Open Source Agreement 1.3
NASA_1_3 :: LicenseId

-- | <tt>Naumen</tt>, Naumen Public License
Naumen :: LicenseId

-- | <tt>NBPL-1.0</tt>, Net Boolean Public License v1
NBPL_1_0 :: LicenseId

-- | <tt>Net-SNMP</tt>, Net-SNMP License
Net_SNMP :: LicenseId

-- | <tt>NetCDF</tt>, NetCDF license
NetCDF :: LicenseId

-- | <tt>NGPL</tt>, Nethack General Public License
NGPL :: LicenseId

-- | <tt>NOSL</tt>, Netizen Open Source License
NOSL :: LicenseId

-- | <tt>NPL-1.0</tt>, Netscape Public License v1.0
NPL_1_0 :: LicenseId

-- | <tt>NPL-1.1</tt>, Netscape Public License v1.1
NPL_1_1 :: LicenseId

-- | <tt>Newsletr</tt>, Newsletr License
Newsletr :: LicenseId

-- | <tt>NLPL</tt>, No Limit Public License
NLPL :: LicenseId

-- | <tt>Nokia</tt>, Nokia Open Source License
Nokia :: LicenseId

-- | <tt>NPOSL-3.0</tt>, Non-Profit Open Software License 3.0
NPOSL_3_0 :: LicenseId

-- | <tt>NLOD-1.0</tt>, Norwegian Licence for Open Government Data
NLOD_1_0 :: LicenseId

-- | <tt>Noweb</tt>, Noweb License
Noweb :: LicenseId

-- | <tt>NRL</tt>, NRL License
NRL :: LicenseId

-- | <tt>NTP</tt>, NTP License
NTP :: LicenseId

-- | <tt>Nunit</tt>, Nunit License
Nunit :: LicenseId

-- | <tt>OCLC-2.0</tt>, OCLC Research Public License 2.0
OCLC_2_0 :: LicenseId

-- | <tt>ODbL-1.0</tt>, ODC Open Database License v1.0
ODbL_1_0 :: LicenseId

-- | <tt>PDDL-1.0</tt>, ODC Public Domain Dedication &amp; License 1.0
PDDL_1_0 :: LicenseId

-- | <tt>OCCT-PL</tt>, Open CASCADE Technology Public License
OCCT_PL :: LicenseId

-- | <tt>OGTSL</tt>, Open Group Test Suite License
OGTSL :: LicenseId

-- | <tt>OLDAP-2.2.2</tt>, Open LDAP Public License 2.2.2
OLDAP_2_2_2 :: LicenseId

-- | <tt>OLDAP-1.1</tt>, Open LDAP Public License v1.1
OLDAP_1_1 :: LicenseId

-- | <tt>OLDAP-1.2</tt>, Open LDAP Public License v1.2
OLDAP_1_2 :: LicenseId

-- | <tt>OLDAP-1.3</tt>, Open LDAP Public License v1.3
OLDAP_1_3 :: LicenseId

-- | <tt>OLDAP-1.4</tt>, Open LDAP Public License v1.4
OLDAP_1_4 :: LicenseId

-- | <tt>OLDAP-2.0</tt>, Open LDAP Public License v2.0 (or possibly 2.0A
°5uand 2.0B)
OLDAP_2_0 :: LicenseId

-- | <tt>OLDAP-2.0.1</tt>, Open LDAP Public License v2.0.1
OLDAP_2_0_1 :: LicenseId

-- | <tt>OLDAP-2.1</tt>, Open LDAP Public License v2.1
OLDAP_2_1 :: LicenseId

-- | <tt>OLDAP-2.2</tt>, Open LDAP Public License v2.2
OLDAP_2_2 :: LicenseId

-- | <tt>OLDAP-2.2.1</tt>, Open LDAP Public License v2.2.1
OLDAP_2_2_1 :: LicenseId

-- | <tt>OLDAP-2.3</tt>, Open LDAP Public License v2.3
OLDAP_2_3 :: LicenseId

-- | <tt>OLDAP-2.4</tt>, Open LDAP Public License v2.4
OLDAP_2_4 :: LicenseId

-- | <tt>OLDAP-2.5</tt>, Open LDAP Public License v2.5
OLDAP_2_5 :: LicenseId

-- | <tt>OLDAP-2.6</tt>, Open LDAP Public License v2.6
OLDAP_2_6 :: LicenseId

-- | <tt>OLDAP-2.7</tt>, Open LDAP Public License v2.7
OLDAP_2_7 :: LicenseId

-- | <tt>OLDAP-2.8</tt>, Open LDAP Public License v2.8
OLDAP_2_8 :: LicenseId

-- | <tt>OML</tt>, Open Market License
OML :: LicenseId

-- | <tt>OPL-1.0</tt>, Open Public License v1.0
OPL_1_0 :: LicenseId

-- | <tt>OSL-1.0</tt>, Open Software License 1.0
OSL_1_0 :: LicenseId

-- | <tt>OSL-1.1</tt>, Open Software License 1.1
OSL_1_1 :: LicenseId

-- | <tt>OSL-2.0</tt>, Open Software License 2.0
OSL_2_0 :: LicenseId

-- | <tt>OSL-2.1</tt>, Open Software License 2.1
OSL_2_1 :: LicenseId

-- | <tt>OSL-3.0</tt>, Open Software License 3.0
OSL_3_0 :: LicenseId

-- | <tt>OpenSSL</tt>, OpenSSL License
OpenSSL :: LicenseId

-- | <tt>OSET-PL-2.1</tt>, OSET Public License version 2.1
OSET_PL_2_1 :: LicenseId

-- | <tt>PHP-3.0</tt>, PHP License v3.0
PHP_3_0 :: LicenseId

-- | <tt>PHP-3.01</tt>, PHP License v3.01
PHP_3_01 :: LicenseId

-- | <tt>Plexus</tt>, Plexus Classworlds License
Plexus :: LicenseId

-- | <tt>PostgreSQL</tt>, PostgreSQL License
PostgreSQL :: LicenseId

-- | <tt>psfrag</tt>, psfrag License
Psfrag :: LicenseId

-- | <tt>psutils</tt>, psutils License
Psutils :: LicenseId

-- | <tt>Python-2.0</tt>, Python License 2.0
Python_2_0 :: LicenseId

-- | <tt>QPL-1.0</tt>, Q Public License 1.0
QPL_1_0 :: LicenseId

-- | <tt>Qhull</tt>, Qhull License
Qhull :: LicenseId

-- | <tt>Rdisc</tt>, Rdisc License
Rdisc :: LicenseId

-- | <tt>RPSL-1.0</tt>, RealNetworks Public Source License v1.0
RPSL_1_0 :: LicenseId

-- | <tt>RPL-1.1</tt>, Reciprocal Public License 1.1
RPL_1_1 :: LicenseId

-- | <tt>RPL-1.5</tt>, Reciprocal Public License 1.5
RPL_1_5 :: LicenseId

-- | <tt>RHeCos-1.1</tt>, Red Hat eCos Public License v1.1
RHeCos_1_1 :: LicenseId

-- | <tt>RSCPL</tt>, Ricoh Source Code Public License
RSCPL :: LicenseId

-- | <tt>RSA-MD</tt>, RSA Message-Digest License
RSA_MD :: LicenseId

-- | <tt>Ruby</tt>, Ruby License
Ruby :: LicenseId

-- | <tt>SAX-PD</tt>, Sax Public Domain Notice
SAX_PD :: LicenseId

-- | <tt>Saxpath</tt>, Saxpath License
Saxpath :: LicenseId

-- | <tt>SCEA</tt>, SCEA Shared Source License
SCEA :: LicenseId

-- | <tt>SWL</tt>, Scheme Widget Library (SWL) Software License Agreement
SWL :: LicenseId

-- | <tt>SMPPL</tt>, Secure Messaging Protocol Public License
SMPPL :: LicenseId

-- | <tt>Sendmail</tt>, Sendmail License
Sendmail :: LicenseId

-- | <tt>SGI-B-1.0</tt>, SGI Free Software License B v1.0
SGI_B_1_0 :: LicenseId

-- | <tt>SGI-B-1.1</tt>, SGI Free Software License B v1.1
SGI_B_1_1 :: LicenseId

-- | <tt>SGI-B-2.0</tt>, SGI Free Software License B v2.0
SGI_B_2_0 :: LicenseId

-- | <tt>OFL-1.0</tt>, SIL Open Font License 1.0
OFL_1_0 :: LicenseId

-- | <tt>OFL-1.1</tt>, SIL Open Font License 1.1
OFL_1_1 :: LicenseId

-- | <tt>SimPL-2.0</tt>, Simple Public License 2.0
SimPL_2_0 :: LicenseId

-- | <tt>Sleepycat</tt>, Sleepycat License
Sleepycat :: LicenseId

-- | <tt>SNIA</tt>, SNIA Public License 1.1
SNIA :: LicenseId

-- | <tt>Spencer-86</tt>, Spencer License 86
Spencer_86 :: LicenseId

-- | <tt>Spencer-94</tt>, Spencer License 94
Spencer_94 :: LicenseId

-- | <tt>Spencer-99</tt>, Spencer License 99
Spencer_99 :: LicenseId

-- | <tt>SMLNJ</tt>, Standard ML of New Jersey License
SMLNJ :: LicenseId

-- | <tt>SugarCRM-1.1.3</tt>, SugarCRM Public License v1.1.3
SugarCRM_1_1_3 :: LicenseId

-- | <tt>SISSL</tt>, Sun Industry Standards Source License v1.1
SISSL :: LicenseId

-- | <tt>SISSL-1.2</tt>, Sun Industry Standards Source License v1.2
SISSL_1_2 :: LicenseId

-- | <tt>SPL-1.0</tt>, Sun Public License v1.0
SPL_1_0 :: LicenseId

-- | <tt>Watcom-1.0</tt>, Sybase Open Watcom Public License 1.0
Watcom_1_0 :: LicenseId

-- | <tt>TCL</tt>, TCL/TK License
TCL :: LicenseId

-- | <tt>TCP-wrappers</tt>, TCP Wrappers License
TCP_wrappers :: LicenseId

-- | <tt>Unlicense</tt>, The Unlicense
Unlicense :: LicenseId

-- | <tt>TMate</tt>, TMate Open Source License
TMate :: LicenseId

-- | <tt>TORQUE-1.1</tt>, TORQUE v2.5+ Software License v1.1
TORQUE_1_1 :: LicenseId

-- | <tt>TOSL</tt>, Trusster Open Source License
TOSL :: LicenseId

-- | <tt>Unicode-DFS-2015</tt>, Unicode License Agreement - Data Files and
°5uSoftware (2015)
Unicode_DFS_2015 :: LicenseId

-- | <tt>Unicode-DFS-2016</tt>, Unicode License Agreement - Data Files and
°5uSoftware (2016)
Unicode_DFS_2016 :: LicenseId

-- | <tt>Unicode-TOU</tt>, Unicode Terms of Use
Unicode_TOU :: LicenseId

-- | <tt>UPL-1.0</tt>, Universal Permissive License v1.0
UPL_1_0 :: LicenseId

-- | <tt>NCSA</tt>, University of Illinois/NCSA Open Source License
NCSA :: LicenseId

-- | <tt>Vim</tt>, Vim License
Vim :: LicenseId

-- | <tt>VOSTROM</tt>, VOSTROM Public License for Open Source
VOSTROM :: LicenseId

-- | <tt>VSL-1.0</tt>, Vovida Software License v1.0
VSL_1_0 :: LicenseId

-- | <tt>W3C-20150513</tt>, W3C Software Notice and Document License
°5u(2015-05-13)
W3C_20150513 :: LicenseId

-- | <tt>W3C-19980720</tt>, W3C Software Notice and License (1998-07-20)
W3C_19980720 :: LicenseId

-- | <tt>W3C</tt>, W3C Software Notice and License (2002-12-31)
W3C :: LicenseId

-- | <tt>Wsuipa</tt>, Wsuipa License
Wsuipa :: LicenseId

-- | <tt>Xnet</tt>, X.Net License
Xnet :: LicenseId

-- | <tt>X11</tt>, X11 License
X11 :: LicenseId

-- | <tt>Xerox</tt>, Xerox License
Xerox :: LicenseId

-- | <tt>XFree86-1.1</tt>, XFree86 License 1.1
XFree86_1_1 :: LicenseId

-- | <tt>xinetd</tt>, xinetd License
Xinetd :: LicenseId

-- | <tt>xpp</tt>, XPP License
Xpp :: LicenseId

-- | <tt>XSkat</tt>, XSkat License
XSkat :: LicenseId

-- | <tt>YPL-1.0</tt>, Yahoo! Public License v1.0
YPL_1_0 :: LicenseId

-- | <tt>YPL-1.1</tt>, Yahoo! Public License v1.1
YPL_1_1 :: LicenseId

-- | <tt>Zed</tt>, Zed License
Zed :: LicenseId

-- | <tt>Zend-2.0</tt>, Zend License v2.0
Zend_2_0 :: LicenseId

-- | <tt>Zimbra-1.3</tt>, Zimbra Public License v1.3
Zimbra_1_3 :: LicenseId

-- | <tt>Zimbra-1.4</tt>, Zimbra Public License v1.4
Zimbra_1_4 :: LicenseId

-- | <tt>Zlib</tt>, zlib License
Zlib :: LicenseId

-- | <tt>zlib-acknowledgement</tt>, zlib/libpng License with
°5uAcknowledgement
Zlib_acknowledgement :: LicenseId

-- | <tt>ZPL-1.1</tt>, Zope Public License 1.1
ZPL_1_1 :: LicenseId

-- | <tt>ZPL-2.0</tt>, Zope Public License 2.0
ZPL_2_0 :: LicenseId

-- | <tt>ZPL-2.1</tt>, Zope Public License 2.1
ZPL_2_1 :: LicenseId

-- | License SPDX identifier, e.g. <tt><a>BSD-3-Clause</a></tt>.
licenseId :: LicenseId -> String

-- | License name, e.g. <tt>"GNU General Public License v2.0 only"</tt>
licenseName :: LicenseId -> String

-- | Whether the license is approved by Open Source Initiative (OSI).
°5u
°5uSee <a>https://opensource.org/licenses/alphabetical</a>.
licenseIsOsiApproved :: LicenseId -> Bool

-- | Create a <a>LicenseId</a> from a <a>String</a>.
mkLicenseId :: String -> Maybe LicenseId
instance GHC.Generics.Generic Distribution.SPDX.LicenseId.LicenseId
instance Data.Data.Data Distribution.SPDX.LicenseId.LicenseId
instance GHC.Read.Read Distribution.SPDX.LicenseId.LicenseId
instance GHC.Show.Show Distribution.SPDX.LicenseId.LicenseId
instance GHC.Enum.Bounded Distribution.SPDX.LicenseId.LicenseId
instance GHC.Enum.Enum Distribution.SPDX.LicenseId.LicenseId
instance GHC.Classes.Ord Distribution.SPDX.LicenseId.LicenseId
instance GHC.Classes.Eq Distribution.SPDX.LicenseId.LicenseId
instance Data.Binary.Class.Binary Distribution.SPDX.LicenseId.LicenseId
instance Distribution.Pretty.Pretty Distribution.SPDX.LicenseId.LicenseId
instance Distribution.Parsec.Class.Parsec Distribution.SPDX.LicenseId.LicenseId
instance Control.DeepSeq.NFData Distribution.SPDX.LicenseId.LicenseId

module Distribution.SPDX.LicenseExceptionId

-- | SPDX License identifier
data LicenseExceptionId

-- | <tt>389-exception</tt>, 389 Directory Server Exception
DS389_exception :: LicenseExceptionId

-- | <tt>Autoconf-exception-2.0</tt>, Autoconf exception 2.0
Autoconf_exception_2_0 :: LicenseExceptionId

-- | <tt>Autoconf-exception-3.0</tt>, Autoconf exception 3.0
Autoconf_exception_3_0 :: LicenseExceptionId

-- | <tt>Bison-exception-2.2</tt>, Bison exception 2.2
Bison_exception_2_2 :: LicenseExceptionId

-- | <tt>Classpath-exception-2.0</tt>, Classpath exception 2.0
Classpath_exception_2_0 :: LicenseExceptionId

-- | <tt>CLISP-exception-2.0</tt>, CLISP exception 2.0
CLISP_exception_2_0 :: LicenseExceptionId

-- | <tt>DigiRule-FOSS-exception</tt>, DigiRule FOSS License Exception
DigiRule_FOSS_exception :: LicenseExceptionId

-- | <tt>eCos-exception-2.0</tt>, eCos exception 2.0
ECos_exception_2_0 :: LicenseExceptionId

-- | <tt>Fawkes-Runtime-exception</tt>, Fawkes Runtime Exception
Fawkes_Runtime_exception :: LicenseExceptionId

-- | <tt>FLTK-exception</tt>, FLTK exception
FLTK_exception :: LicenseExceptionId

-- | <tt>Font-exception-2.0</tt>, Font exception 2.0
Font_exception_2_0 :: LicenseExceptionId

-- | <tt>freertos-exception-2.0</tt>, FreeRTOS Exception 2.0
Freertos_exception_2_0 :: LicenseExceptionId

-- | <tt>GCC-exception-2.0</tt>, GCC Runtime Library exception 2.0
GCC_exception_2_0 :: LicenseExceptionId

-- | <tt>GCC-exception-3.1</tt>, GCC Runtime Library exception 3.1
GCC_exception_3_1 :: LicenseExceptionId

-- | <tt>gnu-javamail-exception</tt>, GNU JavaMail exception
Gnu_javamail_exception :: LicenseExceptionId

-- | <tt>i2p-gpl-java-exception</tt>, i2p GPL+Java Exception
I2p_gpl_java_exception :: LicenseExceptionId

-- | <tt>Libtool-exception</tt>, Libtool Exception
Libtool_exception :: LicenseExceptionId

-- | <tt>LZMA-exception</tt>, LZMA exception
LZMA_exception :: LicenseExceptionId

-- | <tt>mif-exception</tt>, Macros and Inline Functions Exception
Mif_exception :: LicenseExceptionId

-- | <tt>Nokia-Qt-exception-1.1</tt>, Nokia Qt LGPL exception 1.1
Nokia_Qt_exception_1_1 :: LicenseExceptionId

-- | <tt>OCCT-exception-1.0</tt>, Open CASCADE Exception 1.0
OCCT_exception_1_0 :: LicenseExceptionId

-- | <tt>openvpn-openssl-exception</tt>, OpenVPN OpenSSL Exception
Openvpn_openssl_exception :: LicenseExceptionId

-- | <tt>Qwt-exception-1.0</tt>, Qwt exception 1.0
Qwt_exception_1_0 :: LicenseExceptionId

-- | <tt>u-boot-exception-2.0</tt>, U-Boot exception 2.0
U_boot_exception_2_0 :: LicenseExceptionId

-- | <tt>WxWindows-exception-3.1</tt>, WxWindows Library Exception 3.1
WxWindows_exception_3_1 :: LicenseExceptionId

-- | License SPDX identifier, e.g. <tt><a>BSD-3-Clause</a></tt>.
licenseExceptionId :: LicenseExceptionId -> String

-- | License name, e.g. <tt>"GNU General Public License v2.0 only"</tt>
licenseExceptionName :: LicenseExceptionId -> String

-- | Create a <a>LicenseExceptionId</a> from a <a>String</a>.
mkLicenseExceptionId :: String -> Maybe LicenseExceptionId
instance GHC.Generics.Generic Distribution.SPDX.LicenseExceptionId.LicenseExceptionId
instance Data.Data.Data Distribution.SPDX.LicenseExceptionId.LicenseExceptionId
instance GHC.Read.Read Distribution.SPDX.LicenseExceptionId.LicenseExceptionId
instance GHC.Show.Show Distribution.SPDX.LicenseExceptionId.LicenseExceptionId
instance GHC.Enum.Bounded Distribution.SPDX.LicenseExceptionId.LicenseExceptionId
instance GHC.Enum.Enum Distribution.SPDX.LicenseExceptionId.LicenseExceptionId
instance GHC.Classes.Ord Distribution.SPDX.LicenseExceptionId.LicenseExceptionId
instance GHC.Classes.Eq Distribution.SPDX.LicenseExceptionId.LicenseExceptionId
instance Data.Binary.Class.Binary Distribution.SPDX.LicenseExceptionId.LicenseExceptionId
instance Distribution.Pretty.Pretty Distribution.SPDX.LicenseExceptionId.LicenseExceptionId
instance Distribution.Parsec.Class.Parsec Distribution.SPDX.LicenseExceptionId.LicenseExceptionId
instance Control.DeepSeq.NFData Distribution.SPDX.LicenseExceptionId.LicenseExceptionId

module Distribution.SPDX.LicenseExpression

-- | SPDX License Expression.
°5u
°5u<pre>
°5uidstring              = 1*(ALPHA / DIGIT / "-" / "." )
°5ulicense id            = &lt;short form license identifier inAppendix I.1&gt;
°5ulicense exception id  = &lt;short form license exception identifier inAppendix I.2&gt;
°5ulicense ref           = ["DocumentRef-"1*(idstring)":"]"LicenseRef-"1*(idstring)
°5u
°5usimple expression     = license id / license id"+" / license ref
°5u
°5ucompound expression   = 1*1(simple expression /
°5u                        simple expression "WITH" license exception id /
°5u                        compound expression "AND" compound expression /
°5u                        compound expression "OR" compound expression ) /
°5u                        "(" compound expression ")" )
°5u
°5ulicense expression    = 1*1(simple expression / compound expression)
°5u</pre>
data LicenseExpression
ELicense :: !SimpleLicenseExpression -> !(Maybe LicenseExceptionId) -> LicenseExpression
EAnd :: !LicenseExpression -> !LicenseExpression -> LicenseExpression
EOr :: !LicenseExpression -> !LicenseExpression -> LicenseExpression

-- | Simple License Expressions.
data SimpleLicenseExpression

-- | An SPDX License List Short Form Identifier. For example:
°5u<tt>GPL-2.0</tt>
ELicenseId :: LicenseId -> SimpleLicenseExpression

-- | An SPDX License List Short Form Identifier with a unary"+" operator
°5usuffix to represent the current version of the license or any later
°5uversion. For example: <tt>GPL-2.0+</tt>
ELicenseIdPlus :: LicenseId -> SimpleLicenseExpression

-- | A SPDX user defined license reference: For example:
°5u<tt>LicenseRef-23</tt>, <tt>LicenseRef-MIT-Style-1</tt>, or
°5u<tt>DocumentRef-spdx-tool-1.2:LicenseRef-MIT-Style-2</tt>
ELicenseRef :: LicenseRef -> SimpleLicenseExpression
simpleLicenseExpression :: LicenseId -> LicenseExpression
instance GHC.Generics.Generic Distribution.SPDX.LicenseExpression.LicenseExpression
instance Data.Data.Data Distribution.SPDX.LicenseExpression.LicenseExpression
instance GHC.Classes.Ord Distribution.SPDX.LicenseExpression.LicenseExpression
instance GHC.Classes.Eq Distribution.SPDX.LicenseExpression.LicenseExpression
instance GHC.Read.Read Distribution.SPDX.LicenseExpression.LicenseExpression
instance GHC.Show.Show Distribution.SPDX.LicenseExpression.LicenseExpression
instance GHC.Generics.Generic Distribution.SPDX.LicenseExpression.SimpleLicenseExpression
instance Data.Data.Data Distribution.SPDX.LicenseExpression.SimpleLicenseExpression
instance GHC.Classes.Ord Distribution.SPDX.LicenseExpression.SimpleLicenseExpression
instance GHC.Classes.Eq Distribution.SPDX.LicenseExpression.SimpleLicenseExpression
instance GHC.Read.Read Distribution.SPDX.LicenseExpression.SimpleLicenseExpression
instance GHC.Show.Show Distribution.SPDX.LicenseExpression.SimpleLicenseExpression
instance Data.Binary.Class.Binary Distribution.SPDX.LicenseExpression.LicenseExpression
instance Distribution.Pretty.Pretty Distribution.SPDX.LicenseExpression.LicenseExpression
instance Distribution.Parsec.Class.Parsec Distribution.SPDX.LicenseExpression.LicenseExpression
instance Control.DeepSeq.NFData Distribution.SPDX.LicenseExpression.LicenseExpression
instance Data.Binary.Class.Binary Distribution.SPDX.LicenseExpression.SimpleLicenseExpression
instance Distribution.Pretty.Pretty Distribution.SPDX.LicenseExpression.SimpleLicenseExpression
instance Distribution.Parsec.Class.Parsec Distribution.SPDX.LicenseExpression.SimpleLicenseExpression
instance Control.DeepSeq.NFData Distribution.SPDX.LicenseExpression.SimpleLicenseExpression

module Distribution.SPDX.License

-- | Declared license. See <a>section 3.15 of SPDX Specification 2.1</a>
°5u
°5u<i>Note:</i> the NOASSERTION case is omitted.
°5u
°5uOld <a>License</a> can be migrated using following rules:
°5u
°5u<ul>
°5u<li><tt>AllRightsReserved</tt> and <tt>UnspecifiedLicense</tt> to
°5u<a>NONE</a>. No license specified which legally defaults to <i>All
°5uRights Reserved</i>. The package may not be legally modified or
°5uredistributed by anyone but the rightsholder.</li>
°5u<li><tt>OtherLicense</tt> can be converted to <tt>LicenseRef</tt>
°5upointing to the file in the package.</li>
°5u<li><tt>UnknownLicense</tt> i.e. other licenses of the form
°5u<tt>name-x.y</tt>, should be covered by SPDX license list, otherwise
°5uuse <tt>LicenseRef</tt>.</li>
°5u<li><tt>PublicDomain</tt> isn't covered. Consider using CC0. See
°5u<a>https://wiki.spdx.org/view/Legal_Team/Decisions/Dealing_with_Public_Domain_within_SPDX_Files</a>
°5ufor more information.</li>
°5u</ul>
data License

-- | if the package contains no license information whatsoever; or
NONE :: License

-- | A valid SPDX License Expression as defined in Appendix IV.
License :: LicenseExpression -> License
instance GHC.Generics.Generic Distribution.SPDX.License.License
instance Data.Data.Data Distribution.SPDX.License.License
instance GHC.Classes.Ord Distribution.SPDX.License.License
instance GHC.Classes.Eq Distribution.SPDX.License.License
instance GHC.Read.Read Distribution.SPDX.License.License
instance GHC.Show.Show Distribution.SPDX.License.License
instance Data.Binary.Class.Binary Distribution.SPDX.License.License
instance Control.DeepSeq.NFData Distribution.SPDX.License.License
instance Distribution.Pretty.Pretty Distribution.SPDX.License.License
instance Distribution.Parsec.Class.Parsec Distribution.SPDX.License.License


-- | This module contains a SPDX data from specification version 2.1
°5u
°5uSpecification is available on <a>https://spdx.org/specifications</a>
module Distribution.SPDX

-- | Declared license. See <a>section 3.15 of SPDX Specification 2.1</a>
°5u
°5u<i>Note:</i> the NOASSERTION case is omitted.
°5u
°5uOld <a>License</a> can be migrated using following rules:
°5u
°5u<ul>
°5u<li><tt>AllRightsReserved</tt> and <tt>UnspecifiedLicense</tt> to
°5u<a>NONE</a>. No license specified which legally defaults to <i>All
°5uRights Reserved</i>. The package may not be legally modified or
°5uredistributed by anyone but the rightsholder.</li>
°5u<li><tt>OtherLicense</tt> can be converted to <tt>LicenseRef</tt>
°5upointing to the file in the package.</li>
°5u<li><tt>UnknownLicense</tt> i.e. other licenses of the form
°5u<tt>name-x.y</tt>, should be covered by SPDX license list, otherwise
°5uuse <tt>LicenseRef</tt>.</li>
°5u<li><tt>PublicDomain</tt> isn't covered. Consider using CC0. See
°5u<a>https://wiki.spdx.org/view/Legal_Team/Decisions/Dealing_with_Public_Domain_within_SPDX_Files</a>
°5ufor more information.</li>
°5u</ul>
data License

-- | if the package contains no license information whatsoever; or
NONE :: License

-- | A valid SPDX License Expression as defined in Appendix IV.
License :: LicenseExpression -> License

-- | SPDX License Expression.
°5u
°5u<pre>
°5uidstring              = 1*(ALPHA / DIGIT / "-" / "." )
°5ulicense id            = &lt;short form license identifier inAppendix I.1&gt;
°5ulicense exception id  = &lt;short form license exception identifier inAppendix I.2&gt;
°5ulicense ref           = ["DocumentRef-"1*(idstring)":"]"LicenseRef-"1*(idstring)
°5u
°5usimple expression     = license id / license id"+" / license ref
°5u
°5ucompound expression   = 1*1(simple expression /
°5u                        simple expression "WITH" license exception id /
°5u                        compound expression "AND" compound expression /
°5u                        compound expression "OR" compound expression ) /
°5u                        "(" compound expression ")" )
°5u
°5ulicense expression    = 1*1(simple expression / compound expression)
°5u</pre>
data LicenseExpression
ELicense :: !SimpleLicenseExpression -> !(Maybe LicenseExceptionId) -> LicenseExpression
EAnd :: !LicenseExpression -> !LicenseExpression -> LicenseExpression
EOr :: !LicenseExpression -> !LicenseExpression -> LicenseExpression

-- | Simple License Expressions.
data SimpleLicenseExpression

-- | An SPDX License List Short Form Identifier. For example:
°5u<tt>GPL-2.0</tt>
ELicenseId :: LicenseId -> SimpleLicenseExpression

-- | An SPDX License List Short Form Identifier with a unary"+" operator
°5usuffix to represent the current version of the license or any later
°5uversion. For example: <tt>GPL-2.0+</tt>
ELicenseIdPlus :: LicenseId -> SimpleLicenseExpression

-- | A SPDX user defined license reference: For example:
°5u<tt>LicenseRef-23</tt>, <tt>LicenseRef-MIT-Style-1</tt>, or
°5u<tt>DocumentRef-spdx-tool-1.2:LicenseRef-MIT-Style-2</tt>
ELicenseRef :: LicenseRef -> SimpleLicenseExpression
simpleLicenseExpression :: LicenseId -> LicenseExpression

-- | SPDX License identifier
data LicenseId

-- | <tt>Glide</tt>, 3dfx Glide License
Glide :: LicenseId

-- | <tt>Abstyles</tt>, Abstyles License
Abstyles :: LicenseId

-- | <tt>AFL-1.1</tt>, Academic Free License v1.1
AFL_1_1 :: LicenseId

-- | <tt>AFL-1.2</tt>, Academic Free License v1.2
AFL_1_2 :: LicenseId

-- | <tt>AFL-2.0</tt>, Academic Free License v2.0
AFL_2_0 :: LicenseId

-- | <tt>AFL-2.1</tt>, Academic Free License v2.1
AFL_2_1 :: LicenseId

-- | <tt>AFL-3.0</tt>, Academic Free License v3.0
AFL_3_0 :: LicenseId

-- | <tt>AMPAS</tt>, Academy of Motion Picture Arts and Sciences BSD
AMPAS :: LicenseId

-- | <tt>APL-1.0</tt>, Adaptive Public License 1.0
APL_1_0 :: LicenseId

-- | <tt>Adobe-Glyph</tt>, Adobe Glyph List License
Adobe_Glyph :: LicenseId

-- | <tt>APAFML</tt>, Adobe Postscript AFM License
APAFML :: LicenseId

-- | <tt>Adobe-2006</tt>, Adobe Systems Incorporated Source Code License
°5uAgreement
Adobe_2006 :: LicenseId

-- | <tt>AGPL-1.0</tt>, Affero General Public License v1.0
AGPL_1_0 :: LicenseId

-- | <tt>Afmparse</tt>, Afmparse License
Afmparse :: LicenseId

-- | <tt>Aladdin</tt>, Aladdin Free Public License
Aladdin :: LicenseId

-- | <tt>ADSL</tt>, Amazon Digital Services License
ADSL :: LicenseId

-- | <tt>AMDPLPA</tt>, AMD's plpa_map.c License
AMDPLPA :: LicenseId

-- | <tt>ANTLR-PD</tt>, ANTLR Software Rights Notice
ANTLR_PD :: LicenseId

-- | <tt>Apache-1.0</tt>, Apache License 1.0
Apache_1_0 :: LicenseId

-- | <tt>Apache-1.1</tt>, Apache License 1.1
Apache_1_1 :: LicenseId

-- | <tt>Apache-2.0</tt>, Apache License 2.0
Apache_2_0 :: LicenseId

-- | <tt>AML</tt>, Apple MIT License
AML :: LicenseId

-- | <tt>APSL-1.0</tt>, Apple Public Source License 1.0
APSL_1_0 :: LicenseId

-- | <tt>APSL-1.1</tt>, Apple Public Source License 1.1
APSL_1_1 :: LicenseId

-- | <tt>APSL-1.2</tt>, Apple Public Source License 1.2
APSL_1_2 :: LicenseId

-- | <tt>APSL-2.0</tt>, Apple Public Source License 2.0
APSL_2_0 :: LicenseId

-- | <tt>Artistic-1.0</tt>, Artistic License 1.0
Artistic_1_0 :: LicenseId

-- | <tt>Artistic-1.0-Perl</tt>, Artistic License 1.0 (Perl)
Artistic_1_0_Perl :: LicenseId

-- | <tt>Artistic-1.0-cl8</tt>, Artistic License 1.0 w/clause 8
Artistic_1_0_cl8 :: LicenseId

-- | <tt>Artistic-2.0</tt>, Artistic License 2.0
Artistic_2_0 :: LicenseId

-- | <tt>AAL</tt>, Attribution Assurance License
AAL :: LicenseId

-- | <tt>Bahyph</tt>, Bahyph License
Bahyph :: LicenseId

-- | <tt>Barr</tt>, Barr License
Barr :: LicenseId

-- | <tt>Beerware</tt>, Beerware License
Beerware :: LicenseId

-- | <tt>BitTorrent-1.0</tt>, BitTorrent Open Source License v1.0
BitTorrent_1_0 :: LicenseId

-- | <tt>BitTorrent-1.1</tt>, BitTorrent Open Source License v1.1
BitTorrent_1_1 :: LicenseId

-- | <tt>BSL-1.0</tt>, Boost Software License 1.0
BSL_1_0 :: LicenseId

-- | <tt>Borceux</tt>, Borceux license
Borceux :: LicenseId

-- | <tt>BSD-2-Clause</tt>, BSD 2-clause <a>Simplified</a> License
BSD_2_Clause :: LicenseId

-- | <tt>BSD-2-Clause-FreeBSD</tt>, BSD 2-clause FreeBSD License
BSD_2_Clause_FreeBSD :: LicenseId

-- | <tt>BSD-2-Clause-NetBSD</tt>, BSD 2-clause NetBSD License
BSD_2_Clause_NetBSD :: LicenseId

-- | <tt>BSD-3-Clause</tt>, BSD 3-clause <a>New</a> or <a>Revised</a>
°5uLicense
BSD_3_Clause :: LicenseId

-- | <tt>BSD-3-Clause-Clear</tt>, BSD 3-clause Clear License
BSD_3_Clause_Clear :: LicenseId

-- | <tt>BSD-3-Clause-No-Nuclear-License</tt>, BSD 3-Clause No Nuclear
°5uLicense
BSD_3_Clause_No_Nuclear_License :: LicenseId

-- | <tt>BSD-3-Clause-No-Nuclear-License-2014</tt>, BSD 3-Clause No Nuclear
°5uLicense 2014
BSD_3_Clause_No_Nuclear_License_2014 :: LicenseId

-- | <tt>BSD-3-Clause-No-Nuclear-Warranty</tt>, BSD 3-Clause No Nuclear
°5uWarranty
BSD_3_Clause_No_Nuclear_Warranty :: LicenseId

-- | <tt>BSD-4-Clause</tt>, BSD 4-clause <a>Original</a> or <a>Old</a>
°5uLicense
BSD_4_Clause :: LicenseId

-- | <tt>BSD-Protection</tt>, BSD Protection License
BSD_Protection :: LicenseId

-- | <tt>BSD-Source-Code</tt>, BSD Source Code Attribution
BSD_Source_Code :: LicenseId

-- | <tt>BSD-3-Clause-Attribution</tt>, BSD with attribution
BSD_3_Clause_Attribution :: LicenseId

-- | <tt>0BSD</tt>, BSD Zero Clause License
NullBSD :: LicenseId

-- | <tt>BSD-4-Clause-UC</tt>, BSD-4-Clause (University of
°5uCalifornia-Specific)
BSD_4_Clause_UC :: LicenseId

-- | <tt>bzip2-1.0.5</tt>, bzip2 and libbzip2 License v1.0.5
Bzip2_1_0_5 :: LicenseId

-- | <tt>bzip2-1.0.6</tt>, bzip2 and libbzip2 License v1.0.6
Bzip2_1_0_6 :: LicenseId

-- | <tt>Caldera</tt>, Caldera License
Caldera :: LicenseId

-- | <tt>CECILL-1.0</tt>, CeCILL Free Software License Agreement v1.0
CECILL_1_0 :: LicenseId

-- | <tt>CECILL-1.1</tt>, CeCILL Free Software License Agreement v1.1
CECILL_1_1 :: LicenseId

-- | <tt>CECILL-2.0</tt>, CeCILL Free Software License Agreement v2.0
CECILL_2_0 :: LicenseId

-- | <tt>CECILL-2.1</tt>, CeCILL Free Software License Agreement v2.1
CECILL_2_1 :: LicenseId

-- | <tt>CECILL-B</tt>, CeCILL-B Free Software License Agreement
CECILL_B :: LicenseId

-- | <tt>CECILL-C</tt>, CeCILL-C Free Software License Agreement
CECILL_C :: LicenseId

-- | <tt>ClArtistic</tt>, Clarified Artistic License
ClArtistic :: LicenseId

-- | <tt>MIT-CMU</tt>, CMU License
MIT_CMU :: LicenseId

-- | <tt>CNRI-Jython</tt>, CNRI Jython License
CNRI_Jython :: LicenseId

-- | <tt>CNRI-Python</tt>, CNRI Python License
CNRI_Python :: LicenseId

-- | <tt>CNRI-Python-GPL-Compatible</tt>, CNRI Python Open Source GPL
°5uCompatible License Agreement
CNRI_Python_GPL_Compatible :: LicenseId

-- | <tt>CPOL-1.02</tt>, Code Project Open License 1.02
CPOL_1_02 :: LicenseId

-- | <tt>CDDL-1.0</tt>, Common Development and Distribution License 1.0
CDDL_1_0 :: LicenseId

-- | <tt>CDDL-1.1</tt>, Common Development and Distribution License 1.1
CDDL_1_1 :: LicenseId

-- | <tt>CPAL-1.0</tt>, Common Public Attribution License 1.0
CPAL_1_0 :: LicenseId

-- | <tt>CPL-1.0</tt>, Common Public License 1.0
CPL_1_0 :: LicenseId

-- | <tt>CATOSL-1.1</tt>, Computer Associates Trusted Open Source License
°5u1.1
CATOSL_1_1 :: LicenseId

-- | <tt>Condor-1.1</tt>, Condor Public License v1.1
Condor_1_1 :: LicenseId

-- | <tt>CC-BY-1.0</tt>, Creative Commons Attribution 1.0
CC_BY_1_0 :: LicenseId

-- | <tt>CC-BY-2.0</tt>, Creative Commons Attribution 2.0
CC_BY_2_0 :: LicenseId

-- | <tt>CC-BY-2.5</tt>, Creative Commons Attribution 2.5
CC_BY_2_5 :: LicenseId

-- | <tt>CC-BY-3.0</tt>, Creative Commons Attribution 3.0
CC_BY_3_0 :: LicenseId

-- | <tt>CC-BY-4.0</tt>, Creative Commons Attribution 4.0
CC_BY_4_0 :: LicenseId

-- | <tt>CC-BY-ND-1.0</tt>, Creative Commons Attribution No Derivatives 1.0
CC_BY_ND_1_0 :: LicenseId

-- | <tt>CC-BY-ND-2.0</tt>, Creative Commons Attribution No Derivatives 2.0
CC_BY_ND_2_0 :: LicenseId

-- | <tt>CC-BY-ND-2.5</tt>, Creative Commons Attribution No Derivatives 2.5
CC_BY_ND_2_5 :: LicenseId

-- | <tt>CC-BY-ND-3.0</tt>, Creative Commons Attribution No Derivatives 3.0
CC_BY_ND_3_0 :: LicenseId

-- | <tt>CC-BY-ND-4.0</tt>, Creative Commons Attribution No Derivatives 4.0
CC_BY_ND_4_0 :: LicenseId

-- | <tt>CC-BY-NC-1.0</tt>, Creative Commons Attribution Non Commercial 1.0
CC_BY_NC_1_0 :: LicenseId

-- | <tt>CC-BY-NC-2.0</tt>, Creative Commons Attribution Non Commercial 2.0
CC_BY_NC_2_0 :: LicenseId

-- | <tt>CC-BY-NC-2.5</tt>, Creative Commons Attribution Non Commercial 2.5
CC_BY_NC_2_5 :: LicenseId

-- | <tt>CC-BY-NC-3.0</tt>, Creative Commons Attribution Non Commercial 3.0
CC_BY_NC_3_0 :: LicenseId

-- | <tt>CC-BY-NC-4.0</tt>, Creative Commons Attribution Non Commercial 4.0
CC_BY_NC_4_0 :: LicenseId

-- | <tt>CC-BY-NC-ND-1.0</tt>, Creative Commons Attribution Non Commercial
°5uNo Derivatives 1.0
CC_BY_NC_ND_1_0 :: LicenseId

-- | <tt>CC-BY-NC-ND-2.0</tt>, Creative Commons Attribution Non Commercial
°5uNo Derivatives 2.0
CC_BY_NC_ND_2_0 :: LicenseId

-- | <tt>CC-BY-NC-ND-2.5</tt>, Creative Commons Attribution Non Commercial
°5uNo Derivatives 2.5
CC_BY_NC_ND_2_5 :: LicenseId

-- | <tt>CC-BY-NC-ND-3.0</tt>, Creative Commons Attribution Non Commercial
°5uNo Derivatives 3.0
CC_BY_NC_ND_3_0 :: LicenseId

-- | <tt>CC-BY-NC-ND-4.0</tt>, Creative Commons Attribution Non Commercial
°5uNo Derivatives 4.0
CC_BY_NC_ND_4_0 :: LicenseId

-- | <tt>CC-BY-NC-SA-1.0</tt>, Creative Commons Attribution Non Commercial
°5uShare Alike 1.0
CC_BY_NC_SA_1_0 :: LicenseId

-- | <tt>CC-BY-NC-SA-2.0</tt>, Creative Commons Attribution Non Commercial
°5uShare Alike 2.0
CC_BY_NC_SA_2_0 :: LicenseId

-- | <tt>CC-BY-NC-SA-2.5</tt>, Creative Commons Attribution Non Commercial
°5uShare Alike 2.5
CC_BY_NC_SA_2_5 :: LicenseId

-- | <tt>CC-BY-NC-SA-3.0</tt>, Creative Commons Attribution Non Commercial
°5uShare Alike 3.0
CC_BY_NC_SA_3_0 :: LicenseId

-- | <tt>CC-BY-NC-SA-4.0</tt>, Creative Commons Attribution Non Commercial
°5uShare Alike 4.0
CC_BY_NC_SA_4_0 :: LicenseId

-- | <tt>CC-BY-SA-1.0</tt>, Creative Commons Attribution Share Alike 1.0
CC_BY_SA_1_0 :: LicenseId

-- | <tt>CC-BY-SA-2.0</tt>, Creative Commons Attribution Share Alike 2.0
CC_BY_SA_2_0 :: LicenseId

-- | <tt>CC-BY-SA-2.5</tt>, Creative Commons Attribution Share Alike 2.5
CC_BY_SA_2_5 :: LicenseId

-- | <tt>CC-BY-SA-3.0</tt>, Creative Commons Attribution Share Alike 3.0
CC_BY_SA_3_0 :: LicenseId

-- | <tt>CC-BY-SA-4.0</tt>, Creative Commons Attribution Share Alike 4.0
CC_BY_SA_4_0 :: LicenseId

-- | <tt>CC0-1.0</tt>, Creative Commons Zero v1.0 Universal
CC0_1_0 :: LicenseId

-- | <tt>Crossword</tt>, Crossword License
Crossword :: LicenseId

-- | <tt>CrystalStacker</tt>, CrystalStacker License
CrystalStacker :: LicenseId

-- | <tt>CUA-OPL-1.0</tt>, CUA Office Public License v1.0
CUA_OPL_1_0 :: LicenseId

-- | <tt>Cube</tt>, Cube License
Cube :: LicenseId

-- | <tt>curl</tt>, curl License
Curl :: LicenseId

-- | <tt>D-FSL-1.0</tt>, Deutsche Freie Software Lizenz
D_FSL_1_0 :: LicenseId

-- | <tt>diffmark</tt>, diffmark license
Diffmark :: LicenseId

-- | <tt>WTFPL</tt>, Do What The F*ck You Want To Public License
WTFPL :: LicenseId

-- | <tt>DOC</tt>, DOC License
DOC :: LicenseId

-- | <tt>Dotseqn</tt>, Dotseqn License
Dotseqn :: LicenseId

-- | <tt>DSDP</tt>, DSDP License
DSDP :: LicenseId

-- | <tt>dvipdfm</tt>, dvipdfm License
Dvipdfm :: LicenseId

-- | <tt>EPL-1.0</tt>, Eclipse Public License 1.0
EPL_1_0 :: LicenseId

-- | <tt>ECL-1.0</tt>, Educational Community License v1.0
ECL_1_0 :: LicenseId

-- | <tt>ECL-2.0</tt>, Educational Community License v2.0
ECL_2_0 :: LicenseId

-- | <tt>eGenix</tt>, eGenix.com Public License 1.1.0
EGenix :: LicenseId

-- | <tt>EFL-1.0</tt>, Eiffel Forum License v1.0
EFL_1_0 :: LicenseId

-- | <tt>EFL-2.0</tt>, Eiffel Forum License v2.0
EFL_2_0 :: LicenseId

-- | <tt>MIT-advertising</tt>, Enlightenment License (e16)
MIT_advertising :: LicenseId

-- | <tt>MIT-enna</tt>, enna License
MIT_enna :: LicenseId

-- | <tt>Entessa</tt>, Entessa Public License v1.0
Entessa :: LicenseId

-- | <tt>ErlPL-1.1</tt>, Erlang Public License v1.1
ErlPL_1_1 :: LicenseId

-- | <tt>EUDatagrid</tt>, EU DataGrid Software License
EUDatagrid :: LicenseId

-- | <tt>EUPL-1.0</tt>, European Union Public License 1.0
EUPL_1_0 :: LicenseId

-- | <tt>EUPL-1.1</tt>, European Union Public License 1.1
EUPL_1_1 :: LicenseId

-- | <tt>Eurosym</tt>, Eurosym License
Eurosym :: LicenseId

-- | <tt>Fair</tt>, Fair License
Fair :: LicenseId

-- | <tt>MIT-feh</tt>, feh License
MIT_feh :: LicenseId

-- | <tt>Frameworx-1.0</tt>, Frameworx Open License 1.0
Frameworx_1_0 :: LicenseId

-- | <tt>FreeImage</tt>, FreeImage Public License v1.0
FreeImage :: LicenseId

-- | <tt>FTL</tt>, Freetype Project License
FTL :: LicenseId

-- | <tt>FSFAP</tt>, FSF All Permissive License
FSFAP :: LicenseId

-- | <tt>FSFUL</tt>, FSF Unlimited License
FSFUL :: LicenseId

-- | <tt>FSFULLR</tt>, FSF Unlimited License (with License Retention)
FSFULLR :: LicenseId

-- | <tt>Giftware</tt>, Giftware License
Giftware :: LicenseId

-- | <tt>GL2PS</tt>, GL2PS License
GL2PS :: LicenseId

-- | <tt>Glulxe</tt>, Glulxe License
Glulxe :: LicenseId

-- | <tt>AGPL-3.0</tt>, GNU Affero General Public License v3.0
AGPL_3_0 :: LicenseId

-- | <tt>GFDL-1.1</tt>, GNU Free Documentation License v1.1
GFDL_1_1 :: LicenseId

-- | <tt>GFDL-1.2</tt>, GNU Free Documentation License v1.2
GFDL_1_2 :: LicenseId

-- | <tt>GFDL-1.3</tt>, GNU Free Documentation License v1.3
GFDL_1_3 :: LicenseId

-- | <tt>GPL-1.0</tt>, GNU General Public License v1.0 only
GPL_1_0 :: LicenseId

-- | <tt>GPL-2.0</tt>, GNU General Public License v2.0 only
GPL_2_0 :: LicenseId

-- | <tt>GPL-3.0</tt>, GNU General Public License v3.0 only
GPL_3_0 :: LicenseId

-- | <tt>LGPL-2.1</tt>, GNU Lesser General Public License v2.1 only
LGPL_2_1 :: LicenseId

-- | <tt>LGPL-3.0</tt>, GNU Lesser General Public License v3.0 only
LGPL_3_0 :: LicenseId

-- | <tt>LGPL-2.0</tt>, GNU Library General Public License v2 only
LGPL_2_0 :: LicenseId

-- | <tt>gnuplot</tt>, gnuplot License
Gnuplot :: LicenseId

-- | <tt>gSOAP-1.3b</tt>, gSOAP Public License v1.3b
GSOAP_1_3b :: LicenseId

-- | <tt>HaskellReport</tt>, Haskell Language Report License
HaskellReport :: LicenseId

-- | <tt>HPND</tt>, Historic Permission Notice and Disclaimer
HPND :: LicenseId

-- | <tt>IBM-pibs</tt>, IBM PowerPC Initialization and Boot Software
IBM_pibs :: LicenseId

-- | <tt>IPL-1.0</tt>, IBM Public License v1.0
IPL_1_0 :: LicenseId

-- | <tt>ICU</tt>, ICU License
ICU :: LicenseId

-- | <tt>ImageMagick</tt>, ImageMagick License
ImageMagick :: LicenseId

-- | <tt>iMatix</tt>, iMatix Standard Function Library Agreement
IMatix :: LicenseId

-- | <tt>Imlib2</tt>, Imlib2 License
Imlib2 :: LicenseId

-- | <tt>IJG</tt>, Independent JPEG Group License
IJG :: LicenseId

-- | <tt>Info-ZIP</tt>, Info-ZIP License
Info_ZIP :: LicenseId

-- | <tt>Intel-ACPI</tt>, Intel ACPI Software License Agreement
Intel_ACPI :: LicenseId

-- | <tt>Intel</tt>, Intel Open Source License
Intel :: LicenseId

-- | <tt>Interbase-1.0</tt>, Interbase Public License v1.0
Interbase_1_0 :: LicenseId

-- | <tt>IPA</tt>, IPA Font License
IPA :: LicenseId

-- | <tt>ISC</tt>, ISC License
ISC :: LicenseId

-- | <tt>JasPer-2.0</tt>, JasPer License
JasPer_2_0 :: LicenseId

-- | <tt>JSON</tt>, JSON License
JSON :: LicenseId

-- | <tt>LPPL-1.0</tt>, LaTeX Project Public License v1.0
LPPL_1_0 :: LicenseId

-- | <tt>LPPL-1.1</tt>, LaTeX Project Public License v1.1
LPPL_1_1 :: LicenseId

-- | <tt>LPPL-1.2</tt>, LaTeX Project Public License v1.2
LPPL_1_2 :: LicenseId

-- | <tt>LPPL-1.3a</tt>, LaTeX Project Public License v1.3a
LPPL_1_3a :: LicenseId

-- | <tt>LPPL-1.3c</tt>, LaTeX Project Public License v1.3c
LPPL_1_3c :: LicenseId

-- | <tt>Latex2e</tt>, Latex2e License
Latex2e :: LicenseId

-- | <tt>BSD-3-Clause-LBNL</tt>, Lawrence Berkeley National Labs BSD
°5uvariant license
BSD_3_Clause_LBNL :: LicenseId

-- | <tt>Leptonica</tt>, Leptonica License
Leptonica :: LicenseId

-- | <tt>LGPLLR</tt>, Lesser General Public License For Linguistic
°5uResources
LGPLLR :: LicenseId

-- | <tt>Libpng</tt>, libpng License
Libpng :: LicenseId

-- | <tt>libtiff</tt>, libtiff License
Libtiff :: LicenseId

-- | <tt>LAL-1.2</tt>, Licence Art Libre 1.2
LAL_1_2 :: LicenseId

-- | <tt>LAL-1.3</tt>, Licence Art Libre 1.3
LAL_1_3 :: LicenseId

-- | <tt>LiLiQ-P-1.1</tt>, Licence Libre du Québec – Permissive version 1.1
LiLiQ_P_1_1 :: LicenseId

-- | <tt>LiLiQ-Rplus-1.1</tt>, Licence Libre du Québec – Réciprocité forte
°5uversion 1.1
LiLiQ_Rplus_1_1 :: LicenseId

-- | <tt>LiLiQ-R-1.1</tt>, Licence Libre du Québec – Réciprocité version
°5u1.1
LiLiQ_R_1_1 :: LicenseId

-- | <tt>LPL-1.02</tt>, Lucent Public License v1.02
LPL_1_02 :: LicenseId

-- | <tt>LPL-1.0</tt>, Lucent Public License Version 1.0
LPL_1_0 :: LicenseId

-- | <tt>MakeIndex</tt>, MakeIndex License
MakeIndex :: LicenseId

-- | <tt>MTLL</tt>, Matrix Template Library License
MTLL :: LicenseId

-- | <tt>MS-PL</tt>, Microsoft Public License
MS_PL :: LicenseId

-- | <tt>MS-RL</tt>, Microsoft Reciprocal License
MS_RL :: LicenseId

-- | <tt>MirOS</tt>, MirOS Licence
MirOS :: LicenseId

-- | <tt>MITNFA</tt>, MIT +no-false-attribs license
MITNFA :: LicenseId

-- | <tt>MIT</tt>, MIT License
MIT :: LicenseId

-- | <tt>Motosoto</tt>, Motosoto License
Motosoto :: LicenseId

-- | <tt>MPL-1.0</tt>, Mozilla Public License 1.0
MPL_1_0 :: LicenseId

-- | <tt>MPL-1.1</tt>, Mozilla Public License 1.1
MPL_1_1 :: LicenseId

-- | <tt>MPL-2.0</tt>, Mozilla Public License 2.0
MPL_2_0 :: LicenseId

-- | <tt>MPL-2.0-no-copyleft-exception</tt>, Mozilla Public License 2.0 (no
°5ucopyleft exception)
MPL_2_0_no_copyleft_exception :: LicenseId

-- | <tt>mpich2</tt>, mpich2 License
Mpich2 :: LicenseId

-- | <tt>Multics</tt>, Multics License
Multics :: LicenseId

-- | <tt>Mup</tt>, Mup License
Mup :: LicenseId

-- | <tt>NASA-1.3</tt>, NASA Open Source Agreement 1.3
NASA_1_3 :: LicenseId

-- | <tt>Naumen</tt>, Naumen Public License
Naumen :: LicenseId

-- | <tt>NBPL-1.0</tt>, Net Boolean Public License v1
NBPL_1_0 :: LicenseId

-- | <tt>Net-SNMP</tt>, Net-SNMP License
Net_SNMP :: LicenseId

-- | <tt>NetCDF</tt>, NetCDF license
NetCDF :: LicenseId

-- | <tt>NGPL</tt>, Nethack General Public License
NGPL :: LicenseId

-- | <tt>NOSL</tt>, Netizen Open Source License
NOSL :: LicenseId

-- | <tt>NPL-1.0</tt>, Netscape Public License v1.0
NPL_1_0 :: LicenseId

-- | <tt>NPL-1.1</tt>, Netscape Public License v1.1
NPL_1_1 :: LicenseId

-- | <tt>Newsletr</tt>, Newsletr License
Newsletr :: LicenseId

-- | <tt>NLPL</tt>, No Limit Public License
NLPL :: LicenseId

-- | <tt>Nokia</tt>, Nokia Open Source License
Nokia :: LicenseId

-- | <tt>NPOSL-3.0</tt>, Non-Profit Open Software License 3.0
NPOSL_3_0 :: LicenseId

-- | <tt>NLOD-1.0</tt>, Norwegian Licence for Open Government Data
NLOD_1_0 :: LicenseId

-- | <tt>Noweb</tt>, Noweb License
Noweb :: LicenseId

-- | <tt>NRL</tt>, NRL License
NRL :: LicenseId

-- | <tt>NTP</tt>, NTP License
NTP :: LicenseId

-- | <tt>Nunit</tt>, Nunit License
Nunit :: LicenseId

-- | <tt>OCLC-2.0</tt>, OCLC Research Public License 2.0
OCLC_2_0 :: LicenseId

-- | <tt>ODbL-1.0</tt>, ODC Open Database License v1.0
ODbL_1_0 :: LicenseId

-- | <tt>PDDL-1.0</tt>, ODC Public Domain Dedication &amp; License 1.0
PDDL_1_0 :: LicenseId

-- | <tt>OCCT-PL</tt>, Open CASCADE Technology Public License
OCCT_PL :: LicenseId

-- | <tt>OGTSL</tt>, Open Group Test Suite License
OGTSL :: LicenseId

-- | <tt>OLDAP-2.2.2</tt>, Open LDAP Public License 2.2.2
OLDAP_2_2_2 :: LicenseId

-- | <tt>OLDAP-1.1</tt>, Open LDAP Public License v1.1
OLDAP_1_1 :: LicenseId

-- | <tt>OLDAP-1.2</tt>, Open LDAP Public License v1.2
OLDAP_1_2 :: LicenseId

-- | <tt>OLDAP-1.3</tt>, Open LDAP Public License v1.3
OLDAP_1_3 :: LicenseId

-- | <tt>OLDAP-1.4</tt>, Open LDAP Public License v1.4
OLDAP_1_4 :: LicenseId

-- | <tt>OLDAP-2.0</tt>, Open LDAP Public License v2.0 (or possibly 2.0A
°5uand 2.0B)
OLDAP_2_0 :: LicenseId

-- | <tt>OLDAP-2.0.1</tt>, Open LDAP Public License v2.0.1
OLDAP_2_0_1 :: LicenseId

-- | <tt>OLDAP-2.1</tt>, Open LDAP Public License v2.1
OLDAP_2_1 :: LicenseId

-- | <tt>OLDAP-2.2</tt>, Open LDAP Public License v2.2
OLDAP_2_2 :: LicenseId

-- | <tt>OLDAP-2.2.1</tt>, Open LDAP Public License v2.2.1
OLDAP_2_2_1 :: LicenseId

-- | <tt>OLDAP-2.3</tt>, Open LDAP Public License v2.3
OLDAP_2_3 :: LicenseId

-- | <tt>OLDAP-2.4</tt>, Open LDAP Public License v2.4
OLDAP_2_4 :: LicenseId

-- | <tt>OLDAP-2.5</tt>, Open LDAP Public License v2.5
OLDAP_2_5 :: LicenseId

-- | <tt>OLDAP-2.6</tt>, Open LDAP Public License v2.6
OLDAP_2_6 :: LicenseId

-- | <tt>OLDAP-2.7</tt>, Open LDAP Public License v2.7
OLDAP_2_7 :: LicenseId

-- | <tt>OLDAP-2.8</tt>, Open LDAP Public License v2.8
OLDAP_2_8 :: LicenseId

-- | <tt>OML</tt>, Open Market License
OML :: LicenseId

-- | <tt>OPL-1.0</tt>, Open Public License v1.0
OPL_1_0 :: LicenseId

-- | <tt>OSL-1.0</tt>, Open Software License 1.0
OSL_1_0 :: LicenseId

-- | <tt>OSL-1.1</tt>, Open Software License 1.1
OSL_1_1 :: LicenseId

-- | <tt>OSL-2.0</tt>, Open Software License 2.0
OSL_2_0 :: LicenseId

-- | <tt>OSL-2.1</tt>, Open Software License 2.1
OSL_2_1 :: LicenseId

-- | <tt>OSL-3.0</tt>, Open Software License 3.0
OSL_3_0 :: LicenseId

-- | <tt>OpenSSL</tt>, OpenSSL License
OpenSSL :: LicenseId

-- | <tt>OSET-PL-2.1</tt>, OSET Public License version 2.1
OSET_PL_2_1 :: LicenseId

-- | <tt>PHP-3.0</tt>, PHP License v3.0
PHP_3_0 :: LicenseId

-- | <tt>PHP-3.01</tt>, PHP License v3.01
PHP_3_01 :: LicenseId

-- | <tt>Plexus</tt>, Plexus Classworlds License
Plexus :: LicenseId

-- | <tt>PostgreSQL</tt>, PostgreSQL License
PostgreSQL :: LicenseId

-- | <tt>psfrag</tt>, psfrag License
Psfrag :: LicenseId

-- | <tt>psutils</tt>, psutils License
Psutils :: LicenseId

-- | <tt>Python-2.0</tt>, Python License 2.0
Python_2_0 :: LicenseId

-- | <tt>QPL-1.0</tt>, Q Public License 1.0
QPL_1_0 :: LicenseId

-- | <tt>Qhull</tt>, Qhull License
Qhull :: LicenseId

-- | <tt>Rdisc</tt>, Rdisc License
Rdisc :: LicenseId

-- | <tt>RPSL-1.0</tt>, RealNetworks Public Source License v1.0
RPSL_1_0 :: LicenseId

-- | <tt>RPL-1.1</tt>, Reciprocal Public License 1.1
RPL_1_1 :: LicenseId

-- | <tt>RPL-1.5</tt>, Reciprocal Public License 1.5
RPL_1_5 :: LicenseId

-- | <tt>RHeCos-1.1</tt>, Red Hat eCos Public License v1.1
RHeCos_1_1 :: LicenseId

-- | <tt>RSCPL</tt>, Ricoh Source Code Public License
RSCPL :: LicenseId

-- | <tt>RSA-MD</tt>, RSA Message-Digest License
RSA_MD :: LicenseId

-- | <tt>Ruby</tt>, Ruby License
Ruby :: LicenseId

-- | <tt>SAX-PD</tt>, Sax Public Domain Notice
SAX_PD :: LicenseId

-- | <tt>Saxpath</tt>, Saxpath License
Saxpath :: LicenseId

-- | <tt>SCEA</tt>, SCEA Shared Source License
SCEA :: LicenseId

-- | <tt>SWL</tt>, Scheme Widget Library (SWL) Software License Agreement
SWL :: LicenseId

-- | <tt>SMPPL</tt>, Secure Messaging Protocol Public License
SMPPL :: LicenseId

-- | <tt>Sendmail</tt>, Sendmail License
Sendmail :: LicenseId

-- | <tt>SGI-B-1.0</tt>, SGI Free Software License B v1.0
SGI_B_1_0 :: LicenseId

-- | <tt>SGI-B-1.1</tt>, SGI Free Software License B v1.1
SGI_B_1_1 :: LicenseId

-- | <tt>SGI-B-2.0</tt>, SGI Free Software License B v2.0
SGI_B_2_0 :: LicenseId

-- | <tt>OFL-1.0</tt>, SIL Open Font License 1.0
OFL_1_0 :: LicenseId

-- | <tt>OFL-1.1</tt>, SIL Open Font License 1.1
OFL_1_1 :: LicenseId

-- | <tt>SimPL-2.0</tt>, Simple Public License 2.0
SimPL_2_0 :: LicenseId

-- | <tt>Sleepycat</tt>, Sleepycat License
Sleepycat :: LicenseId

-- | <tt>SNIA</tt>, SNIA Public License 1.1
SNIA :: LicenseId

-- | <tt>Spencer-86</tt>, Spencer License 86
Spencer_86 :: LicenseId

-- | <tt>Spencer-94</tt>, Spencer License 94
Spencer_94 :: LicenseId

-- | <tt>Spencer-99</tt>, Spencer License 99
Spencer_99 :: LicenseId

-- | <tt>SMLNJ</tt>, Standard ML of New Jersey License
SMLNJ :: LicenseId

-- | <tt>SugarCRM-1.1.3</tt>, SugarCRM Public License v1.1.3
SugarCRM_1_1_3 :: LicenseId

-- | <tt>SISSL</tt>, Sun Industry Standards Source License v1.1
SISSL :: LicenseId

-- | <tt>SISSL-1.2</tt>, Sun Industry Standards Source License v1.2
SISSL_1_2 :: LicenseId

-- | <tt>SPL-1.0</tt>, Sun Public License v1.0
SPL_1_0 :: LicenseId

-- | <tt>Watcom-1.0</tt>, Sybase Open Watcom Public License 1.0
Watcom_1_0 :: LicenseId

-- | <tt>TCL</tt>, TCL/TK License
TCL :: LicenseId

-- | <tt>TCP-wrappers</tt>, TCP Wrappers License
TCP_wrappers :: LicenseId

-- | <tt>Unlicense</tt>, The Unlicense
Unlicense :: LicenseId

-- | <tt>TMate</tt>, TMate Open Source License
TMate :: LicenseId

-- | <tt>TORQUE-1.1</tt>, TORQUE v2.5+ Software License v1.1
TORQUE_1_1 :: LicenseId

-- | <tt>TOSL</tt>, Trusster Open Source License
TOSL :: LicenseId

-- | <tt>Unicode-DFS-2015</tt>, Unicode License Agreement - Data Files and
°5uSoftware (2015)
Unicode_DFS_2015 :: LicenseId

-- | <tt>Unicode-DFS-2016</tt>, Unicode License Agreement - Data Files and
°5uSoftware (2016)
Unicode_DFS_2016 :: LicenseId

-- | <tt>Unicode-TOU</tt>, Unicode Terms of Use
Unicode_TOU :: LicenseId

-- | <tt>UPL-1.0</tt>, Universal Permissive License v1.0
UPL_1_0 :: LicenseId

-- | <tt>NCSA</tt>, University of Illinois/NCSA Open Source License
NCSA :: LicenseId

-- | <tt>Vim</tt>, Vim License
Vim :: LicenseId

-- | <tt>VOSTROM</tt>, VOSTROM Public License for Open Source
VOSTROM :: LicenseId

-- | <tt>VSL-1.0</tt>, Vovida Software License v1.0
VSL_1_0 :: LicenseId

-- | <tt>W3C-20150513</tt>, W3C Software Notice and Document License
°5u(2015-05-13)
W3C_20150513 :: LicenseId

-- | <tt>W3C-19980720</tt>, W3C Software Notice and License (1998-07-20)
W3C_19980720 :: LicenseId

-- | <tt>W3C</tt>, W3C Software Notice and License (2002-12-31)
W3C :: LicenseId

-- | <tt>Wsuipa</tt>, Wsuipa License
Wsuipa :: LicenseId

-- | <tt>Xnet</tt>, X.Net License
Xnet :: LicenseId

-- | <tt>X11</tt>, X11 License
X11 :: LicenseId

-- | <tt>Xerox</tt>, Xerox License
Xerox :: LicenseId

-- | <tt>XFree86-1.1</tt>, XFree86 License 1.1
XFree86_1_1 :: LicenseId

-- | <tt>xinetd</tt>, xinetd License
Xinetd :: LicenseId

-- | <tt>xpp</tt>, XPP License
Xpp :: LicenseId

-- | <tt>XSkat</tt>, XSkat License
XSkat :: LicenseId

-- | <tt>YPL-1.0</tt>, Yahoo! Public License v1.0
YPL_1_0 :: LicenseId

-- | <tt>YPL-1.1</tt>, Yahoo! Public License v1.1
YPL_1_1 :: LicenseId

-- | <tt>Zed</tt>, Zed License
Zed :: LicenseId

-- | <tt>Zend-2.0</tt>, Zend License v2.0
Zend_2_0 :: LicenseId

-- | <tt>Zimbra-1.3</tt>, Zimbra Public License v1.3
Zimbra_1_3 :: LicenseId

-- | <tt>Zimbra-1.4</tt>, Zimbra Public License v1.4
Zimbra_1_4 :: LicenseId

-- | <tt>Zlib</tt>, zlib License
Zlib :: LicenseId

-- | <tt>zlib-acknowledgement</tt>, zlib/libpng License with
°5uAcknowledgement
Zlib_acknowledgement :: LicenseId

-- | <tt>ZPL-1.1</tt>, Zope Public License 1.1
ZPL_1_1 :: LicenseId

-- | <tt>ZPL-2.0</tt>, Zope Public License 2.0
ZPL_2_0 :: LicenseId

-- | <tt>ZPL-2.1</tt>, Zope Public License 2.1
ZPL_2_1 :: LicenseId

-- | License SPDX identifier, e.g. <tt><a>BSD-3-Clause</a></tt>.
licenseId :: LicenseId -> String

-- | License name, e.g. <tt>"GNU General Public License v2.0 only"</tt>
licenseName :: LicenseId -> String

-- | Whether the license is approved by Open Source Initiative (OSI).
°5u
°5uSee <a>https://opensource.org/licenses/alphabetical</a>.
licenseIsOsiApproved :: LicenseId -> Bool

-- | Create a <a>LicenseId</a> from a <a>String</a>.
mkLicenseId :: String -> Maybe LicenseId

-- | SPDX License identifier
data LicenseExceptionId

-- | <tt>389-exception</tt>, 389 Directory Server Exception
DS389_exception :: LicenseExceptionId

-- | <tt>Autoconf-exception-2.0</tt>, Autoconf exception 2.0
Autoconf_exception_2_0 :: LicenseExceptionId

-- | <tt>Autoconf-exception-3.0</tt>, Autoconf exception 3.0
Autoconf_exception_3_0 :: LicenseExceptionId

-- | <tt>Bison-exception-2.2</tt>, Bison exception 2.2
Bison_exception_2_2 :: LicenseExceptionId

-- | <tt>Classpath-exception-2.0</tt>, Classpath exception 2.0
Classpath_exception_2_0 :: LicenseExceptionId

-- | <tt>CLISP-exception-2.0</tt>, CLISP exception 2.0
CLISP_exception_2_0 :: LicenseExceptionId

-- | <tt>DigiRule-FOSS-exception</tt>, DigiRule FOSS License Exception
DigiRule_FOSS_exception :: LicenseExceptionId

-- | <tt>eCos-exception-2.0</tt>, eCos exception 2.0
ECos_exception_2_0 :: LicenseExceptionId

-- | <tt>Fawkes-Runtime-exception</tt>, Fawkes Runtime Exception
Fawkes_Runtime_exception :: LicenseExceptionId

-- | <tt>FLTK-exception</tt>, FLTK exception
FLTK_exception :: LicenseExceptionId

-- | <tt>Font-exception-2.0</tt>, Font exception 2.0
Font_exception_2_0 :: LicenseExceptionId

-- | <tt>freertos-exception-2.0</tt>, FreeRTOS Exception 2.0
Freertos_exception_2_0 :: LicenseExceptionId

-- | <tt>GCC-exception-2.0</tt>, GCC Runtime Library exception 2.0
GCC_exception_2_0 :: LicenseExceptionId

-- | <tt>GCC-exception-3.1</tt>, GCC Runtime Library exception 3.1
GCC_exception_3_1 :: LicenseExceptionId

-- | <tt>gnu-javamail-exception</tt>, GNU JavaMail exception
Gnu_javamail_exception :: LicenseExceptionId

-- | <tt>i2p-gpl-java-exception</tt>, i2p GPL+Java Exception
I2p_gpl_java_exception :: LicenseExceptionId

-- | <tt>Libtool-exception</tt>, Libtool Exception
Libtool_exception :: LicenseExceptionId

-- | <tt>LZMA-exception</tt>, LZMA exception
LZMA_exception :: LicenseExceptionId

-- | <tt>mif-exception</tt>, Macros and Inline Functions Exception
Mif_exception :: LicenseExceptionId

-- | <tt>Nokia-Qt-exception-1.1</tt>, Nokia Qt LGPL exception 1.1
Nokia_Qt_exception_1_1 :: LicenseExceptionId

-- | <tt>OCCT-exception-1.0</tt>, Open CASCADE Exception 1.0
OCCT_exception_1_0 :: LicenseExceptionId

-- | <tt>openvpn-openssl-exception</tt>, OpenVPN OpenSSL Exception
Openvpn_openssl_exception :: LicenseExceptionId

-- | <tt>Qwt-exception-1.0</tt>, Qwt exception 1.0
Qwt_exception_1_0 :: LicenseExceptionId

-- | <tt>u-boot-exception-2.0</tt>, U-Boot exception 2.0
U_boot_exception_2_0 :: LicenseExceptionId

-- | <tt>WxWindows-exception-3.1</tt>, WxWindows Library Exception 3.1
WxWindows_exception_3_1 :: LicenseExceptionId

-- | License SPDX identifier, e.g. <tt><a>BSD-3-Clause</a></tt>.
licenseExceptionId :: LicenseExceptionId -> String

-- | License name, e.g. <tt>"GNU General Public License v2.0 only"</tt>
licenseExceptionName :: LicenseExceptionId -> String

-- | Create a <a>LicenseExceptionId</a> from a <a>String</a>.
mkLicenseExceptionId :: String -> Maybe LicenseExceptionId

-- | A user defined license reference denoted by
°5u<tt>LicenseRef-[idstring]</tt> (for a license not on the SPDX License
°5uList);
data LicenseRef

-- | License reference.
licenseRef :: LicenseRef -> String

-- | Document reference.
licenseDocumentRef :: LicenseRef -> Maybe String

-- | Create <a>LicenseRef</a> from optional document ref and name.
mkLicenseRef :: Maybe String -> String -> Maybe LicenseRef

-- | Like <a>mkLicenseRef</a> but convert invalid characters into
°5u<tt>-</tt>.
mkLicenseRef' :: Maybe String -> String -> LicenseRef


-- | A <a>Verbosity</a> type with associated utilities.
°5u
°5uThere are 4 standard verbosity levels from <a>silent</a>,
°5u<a>normal</a>, <a>verbose</a> up to <a>deafening</a>. This is used for
°5udeciding what logging messages to print.
°5u
°5uVerbosity also is equipped with some internal settings which can be
°5uused to control at a fine granularity the verbosity of specific
°5usettings (e.g., so that you can trace only particular things you are
°5uinterested in.) It's important to note that the instances for
°5u<a>Verbosity</a> assume that this does not exist.
module Distribution.Verbosity
data Verbosity
silent :: Verbosity
normal :: Verbosity
verbose :: Verbosity
deafening :: Verbosity
moreVerbose :: Verbosity -> Verbosity
lessVerbose :: Verbosity -> Verbosity

-- | Test if we had called <a>lessVerbose</a> on the verbosity
isVerboseQuiet :: Verbosity -> Bool
intToVerbosity :: Int -> Maybe Verbosity
flagToVerbosity :: ReadE Verbosity
showForCabal :: Verbosity -> String
showForGHC :: Verbosity -> String

-- | Turn off all flags
verboseNoFlags :: Verbosity -> Verbosity
verboseHasFlags :: Verbosity -> Bool

-- | Combinator for transforming verbosity level while retaining the
°5uoriginal hidden state.
°5u
°5uFor instance, the following property holds
°5u
°5u<pre>
°5uisVerboseNoWrap (modifyVerbosity (max verbose) v) == isVerboseNoWrap v
°5u</pre>
°5u
°5u<b>Note</b>: you can use <tt>modifyVerbosity (const v1) v0</tt> to
°5uoverwrite <tt>v1</tt>'s flags with <tt>v0</tt>'s flags.
modifyVerbosity :: (Verbosity -> Verbosity) -> Verbosity -> Verbosity

-- | Turn on verbose call-site printing when we log.
verboseCallSite :: Verbosity -> Verbosity

-- | Turn on verbose call-stack printing when we log.
verboseCallStack :: Verbosity -> Verbosity

-- | Test if we should output call sites when we log.
isVerboseCallSite :: Verbosity -> Bool

-- | Test if we should output call stacks when we log.
isVerboseCallStack :: Verbosity -> Bool

-- | Turn on <tt>-----BEGIN CABAL OUTPUT-----</tt> markers for output from
°5uCabal (as opposed to GHC, or system dependent).
verboseMarkOutput :: Verbosity -> Verbosity

-- | Test if we should output markets.
isVerboseMarkOutput :: Verbosity -> Bool

-- | Turn off marking; useful for suppressing nondeterministic output.
verboseUnmarkOutput :: Verbosity -> Verbosity

-- | Disable line-wrapping for log messages.
verboseNoWrap :: Verbosity -> Verbosity

-- | Test if line-wrapping is disabled for log messages.
isVerboseNoWrap :: Verbosity -> Bool

-- | Turn on timestamps for log messages.
verboseTimestamp :: Verbosity -> Verbosity

-- | Test if if we should output timestamps when we log.
isVerboseTimestamp :: Verbosity -> Bool

-- | Turn off timestamps for log messages.
verboseNoTimestamp :: Verbosity -> Verbosity
instance GHC.Generics.Generic Distribution.Verbosity.Verbosity
instance GHC.Enum.Bounded Distribution.Verbosity.VerbosityFlag
instance GHC.Enum.Enum Distribution.Verbosity.VerbosityFlag
instance GHC.Classes.Ord Distribution.Verbosity.VerbosityFlag
instance GHC.Classes.Eq Distribution.Verbosity.VerbosityFlag
instance GHC.Read.Read Distribution.Verbosity.VerbosityFlag
instance GHC.Show.Show Distribution.Verbosity.VerbosityFlag
instance GHC.Generics.Generic Distribution.Verbosity.VerbosityFlag
instance GHC.Enum.Bounded Distribution.Verbosity.VerbosityLevel
instance GHC.Enum.Enum Distribution.Verbosity.VerbosityLevel
instance GHC.Classes.Ord Distribution.Verbosity.VerbosityLevel
instance GHC.Classes.Eq Distribution.Verbosity.VerbosityLevel
instance GHC.Read.Read Distribution.Verbosity.VerbosityLevel
instance GHC.Show.Show Distribution.Verbosity.VerbosityLevel
instance GHC.Generics.Generic Distribution.Verbosity.VerbosityLevel
instance GHC.Show.Show Distribution.Verbosity.Verbosity
instance GHC.Read.Read Distribution.Verbosity.Verbosity
instance GHC.Classes.Eq Distribution.Verbosity.Verbosity
instance GHC.Classes.Ord Distribution.Verbosity.Verbosity
instance GHC.Enum.Enum Distribution.Verbosity.Verbosity
instance GHC.Enum.Bounded Distribution.Verbosity.Verbosity
instance Data.Binary.Class.Binary Distribution.Verbosity.Verbosity
instance Data.Binary.Class.Binary Distribution.Verbosity.VerbosityFlag
instance Data.Binary.Class.Binary Distribution.Verbosity.VerbosityLevel


-- | Exports the <a>Version</a> type along with a parser and pretty
°5uprinter. A version is something like <tt>"1.3.3"</tt>. It also defines
°5uthe <a>VersionRange</a> data types. Version ranges are like <tt>"&gt;=
°5u1.2 &amp;&amp; &lt; 2"</tt>.
module Distribution.Version

-- | A <a>Version</a> represents the version of a software entity.
°5u
°5uInstances of <a>Eq</a> and <a>Ord</a> are provided, which gives exact
°5uequality and lexicographic ordering of the version number components
°5u(i.e. 2.1 &gt; 2.0, 1.2.3 &gt; 1.2.2, etc.).
°5u
°5uThis type is opaque and distinct from the <a>Version</a> type in
°5u<a>Data.Version</a> since <tt>Cabal-2.0</tt>. The difference extends
°5uto the <a>Binary</a> instance using a different (and more compact)
°5uencoding.
data Version

-- | Version 0. A lower bound of <a>Version</a>.
version0 :: Version

-- | Construct <a>Version</a> from list of version number components.
°5u
°5uFor instance, <tt>mkVersion [3,2,1]</tt> constructs a <a>Version</a>
°5urepresenting the version <tt>3.2.1</tt>.
°5u
°5uAll version components must be non-negative. <tt>mkVersion []</tt>
°5ucurrently represents the special <i>null</i> version; see also
°5u<a>nullVersion</a>.
mkVersion :: [Int] -> Version

-- | Variant of <a>Version</a> which converts a <a>Data.Version</a>
°5u<a>Version</a> into Cabal's <a>Version</a> type.
mkVersion' :: Version -> Version

-- | Unpack <a>Version</a> into list of version number components.
°5u
°5uThis is the inverse to <a>mkVersion</a>, so the following holds:
°5u
°5u<pre>
°5u(versionNumbers . mkVersion) vs == vs
°5u</pre>
versionNumbers :: Version -> [Int]

-- | Constant representing the special <i>null</i> <a>Version</a>
°5u
°5uThe <a>nullVersion</a> compares (via <a>Ord</a>) as less than every
°5uproper <a>Version</a> value.
nullVersion :: Version

-- | Apply function to list of version number components
°5u
°5u<pre>
°5ualterVersion f == mkVersion . f . versionNumbers
°5u</pre>
alterVersion :: ([Int] -> [Int]) -> Version -> Version

-- | <i>Deprecated: Use prettyShow. This function will be removed in
°5uCabal-3.0 (estimated Oct 2018)</i>
showVersion :: Version -> String
data VersionRange

-- | <i>Deprecated: Use <a>anyVersion</a>, <a>foldVersionRange</a> or
°5u<tt>asVersionIntervals</tt></i>
AnyVersion :: VersionRange

-- | <i>Deprecated: Use <a>thisVersion</a>, <a>foldVersionRange</a> or
°5u<tt>asVersionIntervals</tt></i>
ThisVersion :: Version -> VersionRange

-- | <i>Deprecated: Use <a>laterVersion</a>, <a>foldVersionRange</a> or
°5u<tt>asVersionIntervals</tt></i>
LaterVersion :: Version -> VersionRange
OrLaterVersion :: Version -> VersionRange

-- | <i>Deprecated: Use <a>earlierVersion</a>, <a>foldVersionRange</a> or
°5u<tt>asVersionIntervals</tt></i>
EarlierVersion :: Version -> VersionRange
OrEarlierVersion :: Version -> VersionRange

-- | <i>Deprecated: Use <a>anyVersion</a>, <a>foldVersionRange</a> or
°5u<tt>asVersionIntervals</tt></i>
WildcardVersion :: Version -> VersionRange
MajorBoundVersion :: Version -> VersionRange

-- | <i>Deprecated: Use <a>unionVersionRanges</a>, <a>foldVersionRange</a>
°5uor <tt>asVersionIntervals</tt></i>
UnionVersionRanges :: VersionRange -> VersionRange -> VersionRange

-- | <i>Deprecated: Use <a>intersectVersionRanges</a>,
°5u<a>foldVersionRange</a> or <tt>asVersionIntervals</tt></i>
IntersectVersionRanges :: VersionRange -> VersionRange -> VersionRange
VersionRangeParens :: VersionRange -> VersionRange

-- | The version range <tt>-any</tt>. That is, a version range containing
°5uall versions.
°5u
°5u<pre>
°5uwithinRange v anyVersion = True
°5u</pre>
anyVersion :: VersionRange

-- | The empty version range, that is a version range containing no
°5uversions.
°5u
°5uThis can be constructed using any unsatisfiable version range
°5uexpression, for example <tt>&gt; 1 &amp;&amp; &lt; 1</tt>.
°5u
°5u<pre>
°5uwithinRange v noVersion = False
°5u</pre>
noVersion :: VersionRange

-- | The version range <tt>== v</tt>
°5u
°5u<pre>
°5uwithinRange v' (thisVersion v) = v' == v
°5u</pre>
thisVersion :: Version -> VersionRange

-- | The version range <tt><a>||</a> v</tt>
°5u
°5u<pre>
°5uwithinRange v' (notThisVersion v) = v' /= v
°5u</pre>
notThisVersion :: Version -> VersionRange

-- | The version range <tt>&gt; v</tt>
°5u
°5u<pre>
°5uwithinRange v' (laterVersion v) = v' &gt; v
°5u</pre>
laterVersion :: Version -> VersionRange

-- | The version range <tt>&lt; v</tt>
°5u
°5u<pre>
°5uwithinRange v' (earlierVersion v) = v' &lt; v
°5u</pre>
earlierVersion :: Version -> VersionRange

-- | The version range <tt>&gt;= v</tt>
°5u
°5u<pre>
°5uwithinRange v' (orLaterVersion v) = v' &gt;= v
°5u</pre>
orLaterVersion :: Version -> VersionRange

-- | The version range <tt>&lt;= v</tt>
°5u
°5u<pre>
°5uwithinRange v' (orEarlierVersion v) = v' &lt;= v
°5u</pre>
orEarlierVersion :: Version -> VersionRange

-- | The version range <tt>vr1 || vr2</tt>
°5u
°5u<pre>
°5u  withinRange v' (unionVersionRanges vr1 vr2)
°5u= withinRange v' vr1 || withinRange v' vr2
°5u</pre>
unionVersionRanges :: VersionRange -> VersionRange -> VersionRange

-- | The version range <tt>vr1 &amp;&amp; vr2</tt>
°5u
°5u<pre>
°5u  withinRange v' (intersectVersionRanges vr1 vr2)
°5u= withinRange v' vr1 &amp;&amp; withinRange v' vr2
°5u</pre>
intersectVersionRanges :: VersionRange -> VersionRange -> VersionRange

-- | The difference of two version ranges
°5u
°5u<pre>
°5u  withinRange v' (differenceVersionRanges vr1 vr2)
°5u= withinRange v' vr1 &amp;&amp; not (withinRange v' vr2)
°5u</pre>
differenceVersionRanges :: VersionRange -> VersionRange -> VersionRange

-- | The inverse of a version range
°5u
°5u<pre>
°5u  withinRange v' (invertVersionRange vr)
°5u= not (withinRange v' vr)
°5u</pre>
invertVersionRange :: VersionRange -> VersionRange

-- | The version range <tt>== v.*</tt>.
°5u
°5uFor example, for version <tt>1.2</tt>, the version range <tt>==
°5u1.2.*</tt> is the same as <tt>&gt;= 1.2 &amp;&amp; &lt; 1.3</tt>
°5u
°5u<pre>
°5uwithinRange v' (laterVersion v) = v' &gt;= v &amp;&amp; v' &lt; upper v
°5u  where
°5u    upper (Version lower t) = Version (init lower ++ [last lower + 1]) t
°5u</pre>
withinVersion :: Version -> VersionRange

-- | The version range <tt>^&gt;= v</tt>.
°5u
°5uFor example, for version <tt>1.2.3.4</tt>, the version range
°5u<tt>^&gt;= 1.2.3.4</tt> is the same as <tt>&gt;= 1.2.3.4 &amp;&amp;
°5u&lt; 1.3</tt>.
°5u
°5uNote that <tt>^&gt;= 1</tt> is equivalent to <tt>&gt;= 1 &amp;&amp;
°5u&lt; 1.1</tt>.
majorBoundVersion :: Version -> VersionRange

-- | <i>Deprecated: In practice this is not very useful because we normally
°5uuse inclusive lower bounds and exclusive upper bounds</i>
betweenVersionsInclusive :: Version -> Version -> VersionRange

-- | Does this version fall within the given range?
°5u
°5uThis is the evaluation function for the <a>VersionRange</a> type.
withinRange :: Version -> VersionRange -> Bool

-- | Does this <a>VersionRange</a> place any restriction on the
°5u<a>Version</a> or is it in fact equivalent to <a>AnyVersion</a>.
°5u
°5uNote this is a semantic check, not simply a syntactic check. So for
°5uexample the following is <tt>True</tt> (for all <tt>v</tt>).
°5u
°5u<pre>
°5uisAnyVersion (EarlierVersion v `UnionVersionRanges` orLaterVersion v)
°5u</pre>
isAnyVersion :: VersionRange -> Bool

-- | This is the converse of <a>isAnyVersion</a>. It check if the version
°5urange is empty, if there is no possible version that satisfies the
°5uversion range.
°5u
°5uFor example this is <tt>True</tt> (for all <tt>v</tt>):
°5u
°5u<pre>
°5uisNoVersion (EarlierVersion v `IntersectVersionRanges` LaterVersion v)
°5u</pre>
isNoVersion :: VersionRange -> Bool

-- | Is this version range in fact just a specific version?
°5u
°5uFor example the version range <tt>"&gt;= 3 &amp;&amp; &lt;= 3"</tt>
°5ucontains only the version <tt>3</tt>.
isSpecificVersion :: VersionRange -> Maybe Version

-- | Simplify a <a>VersionRange</a> expression. For non-empty version
°5uranges this produces a canonical form. Empty or inconsistent version
°5uranges are left as-is because that provides more information.
°5u
°5uIf you need a canonical form use <tt>fromVersionIntervals .
°5utoVersionIntervals</tt>
°5u
°5uIt satisfies the following properties:
°5u
°5u<pre>
°5uwithinRange v (simplifyVersionRange r) = withinRange v r
°5u</pre>
°5u
°5u<pre>
°5u    withinRange v r = withinRange v r'
°5u==&gt; simplifyVersionRange r = simplifyVersionRange r'
°5u || isNoVersion r
°5u || isNoVersion r'
°5u</pre>
simplifyVersionRange :: VersionRange -> VersionRange

-- | Fold over the basic syntactic structure of a <a>VersionRange</a>.
°5u
°5uThis provides a syntactic view of the expression defining the version
°5urange. The syntactic sugar <tt>"&gt;= v"</tt>, <tt>"&lt;= v"</tt> and
°5u<tt>"== v.*"</tt> is presented in terms of the other basic syntax.
°5u
°5uFor a semantic view use <tt>asVersionIntervals</tt>.
foldVersionRange :: a -> (Version -> a) -> (Version -> a) -> (Version -> a) -> (a -> a -> a) -> (a -> a -> a) -> VersionRange -> a

-- | An extended variant of <a>foldVersionRange</a> that also provides a
°5uview of the expression in which the syntactic sugar <tt>"&gt;=
°5uv"</tt>, <tt>"&lt;= v"</tt> and <tt>"== v.*"</tt> is presented
°5uexplicitly rather than in terms of the other basic syntax.

-- | <i>Deprecated: Use cataVersionRange &amp; normaliseVersionRange for
°5umore principled folding</i>
foldVersionRange' :: a -> (Version -> a) -> (Version -> a) -> (Version -> a) -> (Version -> a) -> (Version -> a) -> (Version -> Version -> a) -> (Version -> Version -> a) -> (a -> a -> a) -> (a -> a -> a) -> (a -> a) -> VersionRange -> a

-- | Normalise <a>VersionRange</a>.
°5u
°5uIn particular collapse <tt>(== v || &gt; v)</tt> into <tt>&gt;=
°5uv</tt>, and so on.
normaliseVersionRange :: VersionRange -> VersionRange

-- | Remove <a>VersionRangeParens</a> constructors.
stripParensVersionRange :: VersionRange -> VersionRange

-- | Does the version range have an upper bound?
hasUpperBound :: VersionRange -> Bool

-- | Does the version range have an explicit lower bound?
°5u
°5uNote: this function only considers the user-specified lower bounds,
°5ubut not the implicit &gt;=0 lower bound.
hasLowerBound :: VersionRange -> Bool

-- | F-Algebra of <a>VersionRange</a>. See <a>cataVersionRange</a>.
data VersionRangeF a
AnyVersionF :: VersionRangeF a
ThisVersionF :: Version -> VersionRangeF a
LaterVersionF :: Version -> VersionRangeF a
OrLaterVersionF :: Version -> VersionRangeF a
EarlierVersionF :: Version -> VersionRangeF a
OrEarlierVersionF :: Version -> VersionRangeF a
WildcardVersionF :: Version -> VersionRangeF a
MajorBoundVersionF :: Version -> VersionRangeF a
UnionVersionRangesF :: a -> a -> VersionRangeF a
IntersectVersionRangesF :: a -> a -> VersionRangeF a
VersionRangeParensF :: a -> VersionRangeF a

-- | Fold <a>VersionRange</a>.
cataVersionRange :: (VersionRangeF a -> a) -> VersionRange -> a

-- | Unfold <a>VersionRange</a>.
anaVersionRange :: (a -> VersionRangeF a) -> a -> VersionRange

-- | Refold <a>VersionRange</a>
hyloVersionRange :: (VersionRangeF VersionRange -> VersionRange) -> (VersionRange -> VersionRangeF VersionRange) -> VersionRange -> VersionRange

projectVersionRange :: VersionRange -> VersionRangeF VersionRange

embedVersionRange :: VersionRangeF VersionRange -> VersionRange

wildcardUpperBound :: Version -> Version

-- | Compute next greater major version to be used as upper bound
°5u
°5uExample: <tt>0.4.1</tt> produces the version <tt>0.5</tt> which then
°5ucan be used to construct a range <tt>&gt;= 0.4.1 &amp;&amp; &lt;
°5u0.5</tt>
majorUpperBound :: Version -> Version

-- | Given a version range, remove the highest upper bound. Example:
°5u<tt>(&gt;= 1 &amp;&amp; &lt; 3) || (&gt;= 4 &amp;&amp; &lt; 5)</tt> is
°5uconverted to <tt>(&gt;= 1 &amp;&amp; <a>|| (</a>= 4)</tt>.
removeUpperBound :: VersionRange -> VersionRange

-- | Given a version range, remove the lowest lower bound. Example:
°5u<tt>(&gt;= 1 &amp;&amp; <a>|| (</a>= 4 &amp;&amp; &lt; 5)</tt> is
°5uconverted to <tt>(&gt;= 0 &amp;&amp; <a>|| (</a>= 4 &amp;&amp; &lt;
°5u5)</tt>.
removeLowerBound :: VersionRange -> VersionRange

-- | View a <a>VersionRange</a> as a union of intervals.
°5u
°5uThis provides a canonical view of the semantics of a
°5u<a>VersionRange</a> as opposed to the syntax of the expression used to
°5udefine it. For the syntactic view use <a>foldVersionRange</a>.
°5u
°5uEach interval is non-empty. The sequence is in increasing order and no
°5uintervals overlap or touch. Therefore only the first and last can be
°5uunbounded. The sequence can be empty if the range is empty (e.g. a
°5urange expression like <tt><a>&amp;&amp;</a> 2</tt>).
°5u
°5uOther checks are trivial to implement using this view. For example:
°5u
°5u<pre>
°5uisNoVersion vr | [] &lt;- asVersionIntervals vr = True
°5u               | otherwise                   = False
°5u</pre>
°5u
°5u<pre>
°5uisSpecificVersion vr
°5u   | [(LowerBound v  InclusiveBound
°5u      ,UpperBound v' InclusiveBound)] &lt;- asVersionIntervals vr
°5u   , v == v'   = Just v
°5u   | otherwise = Nothing
°5u</pre>
asVersionIntervals :: VersionRange -> [VersionInterval]
type VersionInterval = (LowerBound, UpperBound)
data LowerBound
LowerBound :: Version -> !Bound -> LowerBound
data UpperBound
NoUpperBound :: UpperBound
UpperBound :: Version -> !Bound -> UpperBound
data Bound
ExclusiveBound :: Bound
InclusiveBound :: Bound

-- | A complementary representation of a <a>VersionRange</a>. Instead of a
°5uboolean version predicate it uses an increasing sequence of
°5unon-overlapping, non-empty intervals.
°5u
°5uThe key point is that this representation gives a canonical
°5urepresentation for the semantics of <a>VersionRange</a>s. This makes
°5uit easier to check things like whether a version range is empty,
°5ucovers all versions, or requires a certain minimum or maximum version.
°5uIt also makes it easy to check equality or containment. It also makes
°5uit easier to identify 'simple' version predicates for translation into
°5uforeign packaging systems that do not support complex version range
°5uexpressions.
data VersionIntervals

-- | Convert a <a>VersionRange</a> to a sequence of version intervals.
toVersionIntervals :: VersionRange -> VersionIntervals

-- | Convert a <a>VersionIntervals</a> value back into a
°5u<a>VersionRange</a> expression representing the version intervals.
fromVersionIntervals :: VersionIntervals -> VersionRange

-- | Test if a version falls within the version intervals.
°5u
°5uIt exists mostly for completeness and testing. It satisfies the
°5ufollowing properties:
°5u
°5u<pre>
°5uwithinIntervals v (toVersionIntervals vr) = withinRange v vr
°5uwithinIntervals v ivs = withinRange v (fromVersionIntervals ivs)
°5u</pre>
withinIntervals :: Version -> VersionIntervals -> Bool

-- | Inspect the list of version intervals.
versionIntervals :: VersionIntervals -> [VersionInterval]

-- | Directly construct a <a>VersionIntervals</a> from a list of intervals.
°5u
°5uIn <tt>Cabal-2.2</tt> the <a>Maybe</a> is dropped from the result
°5utype.
mkVersionIntervals :: [VersionInterval] -> VersionIntervals
unionVersionIntervals :: VersionIntervals -> VersionIntervals -> VersionIntervals
intersectVersionIntervals :: VersionIntervals -> VersionIntervals -> VersionIntervals
invertVersionIntervals :: VersionIntervals -> VersionIntervals

module Distribution.Types.TestType

-- | The "test-type" field in the test suite stanza.
data TestType

-- | "type: exitcode-stdio-x.y"
TestTypeExe :: Version -> TestType

-- | "type: detailed-x.y"
TestTypeLib :: Version -> TestType

-- | Some unknown test type e.g. "type: foo"
TestTypeUnknown :: String -> Version -> TestType
knownTestTypes :: [TestType]
instance Data.Data.Data Distribution.Types.TestType.TestType
instance GHC.Classes.Eq Distribution.Types.TestType.TestType
instance GHC.Read.Read Distribution.Types.TestType.TestType
instance GHC.Show.Show Distribution.Types.TestType.TestType
instance GHC.Generics.Generic Distribution.Types.TestType.TestType
instance Data.Binary.Class.Binary Distribution.Types.TestType.TestType
instance Control.DeepSeq.NFData Distribution.Types.TestType.TestType
instance Distribution.Pretty.Pretty Distribution.Types.TestType.TestType
instance Distribution.Parsec.Class.Parsec Distribution.Types.TestType.TestType
instance Distribution.Text.Text Distribution.Types.TestType.TestType

module Distribution.Types.TestSuiteInterface

-- | The test suite interfaces that are currently defined. Each test suite
°5umust specify which interface it supports.
°5u
°5uMore interfaces may be defined in future, either new revisions or
°5utotally new interfaces.
data TestSuiteInterface

-- | Test interface "exitcode-stdio-1.0". The test-suite takes the form of
°5uan executable. It returns a zero exit code for success, non-zero for
°5ufailure. The stdout and stderr channels may be logged. It takes no
°5ucommand line parameters and nothing on stdin.
TestSuiteExeV10 :: Version -> FilePath -> TestSuiteInterface

-- | Test interface "detailed-0.9". The test-suite takes the form of a
°5ulibrary containing a designated module that exports "tests :: [Test]".
TestSuiteLibV09 :: Version -> ModuleName -> TestSuiteInterface

-- | A test suite that does not conform to one of the above interfaces for
°5uthe given reason (e.g. unknown test type).
TestSuiteUnsupported :: TestType -> TestSuiteInterface
instance Data.Data.Data Distribution.Types.TestSuiteInterface.TestSuiteInterface
instance GHC.Show.Show Distribution.Types.TestSuiteInterface.TestSuiteInterface
instance GHC.Read.Read Distribution.Types.TestSuiteInterface.TestSuiteInterface
instance GHC.Generics.Generic Distribution.Types.TestSuiteInterface.TestSuiteInterface
instance GHC.Classes.Eq Distribution.Types.TestSuiteInterface.TestSuiteInterface
instance Data.Binary.Class.Binary Distribution.Types.TestSuiteInterface.TestSuiteInterface
instance Control.DeepSeq.NFData Distribution.Types.TestSuiteInterface.TestSuiteInterface
instance GHC.Base.Monoid Distribution.Types.TestSuiteInterface.TestSuiteInterface
instance GHC.Base.Semigroup Distribution.Types.TestSuiteInterface.TestSuiteInterface

module Distribution.Types.PkgconfigDependency

-- | Describes a dependency on a pkg-config library
data PkgconfigDependency
PkgconfigDependency :: PkgconfigName -> VersionRange -> PkgconfigDependency
instance Data.Data.Data Distribution.Types.PkgconfigDependency.PkgconfigDependency
instance GHC.Classes.Eq Distribution.Types.PkgconfigDependency.PkgconfigDependency
instance GHC.Show.Show Distribution.Types.PkgconfigDependency.PkgconfigDependency
instance GHC.Read.Read Distribution.Types.PkgconfigDependency.PkgconfigDependency
instance GHC.Generics.Generic Distribution.Types.PkgconfigDependency.PkgconfigDependency
instance Data.Binary.Class.Binary Distribution.Types.PkgconfigDependency.PkgconfigDependency
instance Control.DeepSeq.NFData Distribution.Types.PkgconfigDependency.PkgconfigDependency
instance Distribution.Pretty.Pretty Distribution.Types.PkgconfigDependency.PkgconfigDependency
instance Distribution.Parsec.Class.Parsec Distribution.Types.PkgconfigDependency.PkgconfigDependency
instance Distribution.Text.Text Distribution.Types.PkgconfigDependency.PkgconfigDependency

module Distribution.Types.BenchmarkType

-- | The "benchmark-type" field in the benchmark stanza.
data BenchmarkType

-- | "type: exitcode-stdio-x.y"
BenchmarkTypeExe :: Version -> BenchmarkType

-- | Some unknown benchmark type e.g. "type: foo"
BenchmarkTypeUnknown :: String -> Version -> BenchmarkType
knownBenchmarkTypes :: [BenchmarkType]
instance Data.Data.Data Distribution.Types.BenchmarkType.BenchmarkType
instance GHC.Classes.Eq Distribution.Types.BenchmarkType.BenchmarkType
instance GHC.Read.Read Distribution.Types.BenchmarkType.BenchmarkType
instance GHC.Show.Show Distribution.Types.BenchmarkType.BenchmarkType
instance GHC.Generics.Generic Distribution.Types.BenchmarkType.BenchmarkType
instance Data.Binary.Class.Binary Distribution.Types.BenchmarkType.BenchmarkType
instance Control.DeepSeq.NFData Distribution.Types.BenchmarkType.BenchmarkType
instance Distribution.Pretty.Pretty Distribution.Types.BenchmarkType.BenchmarkType
instance Distribution.Parsec.Class.Parsec Distribution.Types.BenchmarkType.BenchmarkType
instance Distribution.Text.Text Distribution.Types.BenchmarkType.BenchmarkType

module Distribution.Types.BenchmarkInterface

-- | The benchmark interfaces that are currently defined. Each benchmark
°5umust specify which interface it supports.
°5u
°5uMore interfaces may be defined in future, either new revisions or
°5utotally new interfaces.
data BenchmarkInterface

-- | Benchmark interface "exitcode-stdio-1.0". The benchmark takes the form
°5uof an executable. It returns a zero exit code for success, non-zero
°5ufor failure. The stdout and stderr channels may be logged. It takes no
°5ucommand line parameters and nothing on stdin.
BenchmarkExeV10 :: Version -> FilePath -> BenchmarkInterface

-- | A benchmark that does not conform to one of the above interfaces for
°5uthe given reason (e.g. unknown benchmark type).
BenchmarkUnsupported :: BenchmarkType -> BenchmarkInterface
instance Data.Data.Data Distribution.Types.BenchmarkInterface.BenchmarkInterface
instance GHC.Show.Show Distribution.Types.BenchmarkInterface.BenchmarkInterface
instance GHC.Read.Read Distribution.Types.BenchmarkInterface.BenchmarkInterface
instance GHC.Generics.Generic Distribution.Types.BenchmarkInterface.BenchmarkInterface
instance GHC.Classes.Eq Distribution.Types.BenchmarkInterface.BenchmarkInterface
instance Data.Binary.Class.Binary Distribution.Types.BenchmarkInterface.BenchmarkInterface
instance Control.DeepSeq.NFData Distribution.Types.BenchmarkInterface.BenchmarkInterface
instance GHC.Base.Monoid Distribution.Types.BenchmarkInterface.BenchmarkInterface
instance GHC.Base.Semigroup Distribution.Types.BenchmarkInterface.BenchmarkInterface


-- | A parse result type for parsers from AST to Haskell types.
module Distribution.Parsec.ParseResult

-- | A monad with failure and accumulating errors and warnings.
data ParseResult a

-- | Destruct a <a>ParseResult</a> into the emitted warnings and either a
°5usuccessful value or list of errors and possibly recovered a
°5uspec-version declaration.
runParseResult :: ParseResult a -> ([PWarning], Either (Maybe Version, [PError]) a)

-- | <a>Recover</a> the parse result, so we can proceed parsing.
°5u<a>runParseResult</a> will still result in <a>Nothing</a>, if there
°5uare recorded errors.
recoverWith :: ParseResult a -> a -> ParseResult a

-- | Add a warning. This doesn't fail the parsing process.
parseWarning :: Position -> PWarnType -> String -> ParseResult ()

-- | Add multiple warnings at once.
parseWarnings :: [PWarning] -> ParseResult ()

-- | Add an error, but not fail the parser yet.
°5u
°5uFor fatal failure use <a>parseFatalFailure</a>
parseFailure :: Position -> String -> ParseResult ()

-- | Add an fatal error.
parseFatalFailure :: Position -> String -> ParseResult a

-- | A <a>mzero</a>.
parseFatalFailure' :: ParseResult a

-- | Get cabal spec version.
getCabalSpecVersion :: ParseResult (Maybe Version)

-- | Set cabal spec version.
setCabalSpecVersion :: Maybe Version -> ParseResult ()
instance GHC.Base.Functor Distribution.Parsec.ParseResult.ParseResult
instance GHC.Base.Applicative Distribution.Parsec.ParseResult.ParseResult
instance GHC.Base.Monad Distribution.Parsec.ParseResult.ParseResult


-- | Package descriptions contain fields for specifying the name of a
°5usoftware license and the name of the file containing the text of that
°5ulicense. While package authors may choose any license they like, Cabal
°5uprovides an enumeration of a small set of common free and open source
°5usoftware licenses. This is done so that Hackage can recognise
°5ulicenses, so that tools can detect <a>licensing conflicts</a>, and to
°5udeter <a>license proliferation</a>.
°5u
°5uIt is recommended that all package authors use the
°5u<tt>license-file</tt> or <tt>license-files</tt> fields in their
°5upackage descriptions. Further information about these fields can be
°5ufound in the <a>Cabal users guide</a>.
°5u
°5u<h1>Additional resources</h1>
°5u
°5uThe following websites provide information about free and open source
°5usoftware licenses:
°5u
°5u<ul>
°5u<li><a>The Open Source Initiative (OSI)</a></li>
°5u<li><a>The Free Software Foundation (FSF)</a></li>
°5u</ul>
°5u
°5u<h1>Disclaimer</h1>
°5u
°5uThe descriptions of software licenses provided by this documentation
°5uare intended for informational purposes only and in no way constitute
°5ulegal advice. Please read the text of the licenses and consult a
°5ulawyer for any advice regarding software licensing.
module Distribution.License

-- | Indicates the license under which a package's source code is released.
°5uVersions of the licenses not listed here will be rejected by Hackage
°5uand cause <tt>cabal check</tt> to issue a warning.
data License

-- | GNU General Public License, <a>version 2</a> or <a>version 3</a>.
GPL :: (Maybe Version) -> License

-- | <a>GNU Affero General Public License, version 3</a>.
AGPL :: (Maybe Version) -> License

-- | GNU Lesser General Public License, <a>version 2.1</a> or <a>version
°5u3</a>.
LGPL :: (Maybe Version) -> License

-- | <a>2-clause BSD license</a>.
BSD2 :: License

-- | <a>3-clause BSD license</a>.
BSD3 :: License

-- | <a>4-clause BSD license</a>. This license has not been approved by the
°5uOSI and is incompatible with the GNU GPL. It is provided for
°5uhistorical reasons and should be avoided.
BSD4 :: License

-- | <a>MIT license</a>.
MIT :: License

-- | <a>ISC license</a>
ISC :: License

-- | <a>Mozilla Public License, version 2.0</a>.
MPL :: Version -> License

-- | <a>Apache License, version 2.0</a>.
Apache :: (Maybe Version) -> License

-- | The author of a package disclaims any copyright to its source code and
°5udedicates it to the public domain. This is not a software license.
°5uPlease note that it is not possible to dedicate works to the public
°5udomain in every jurisdiction, nor is a work that is in the public
°5udomain in one jurisdiction necessarily in the public domain elsewhere.
PublicDomain :: License

-- | Explicitly 'All Rights Reserved', eg for proprietary software. The
°5upackage may not be legally modified or redistributed by anyone but the
°5urightsholder.
AllRightsReserved :: License

-- | No license specified which legally defaults to 'All Rights Reserved'.
°5uThe package may not be legally modified or redistributed by anyone but
°5uthe rightsholder.
UnspecifiedLicense :: License

-- | Any other software license.
OtherLicense :: License

-- | Indicates an erroneous license name.
UnknownLicense :: String -> License

-- | The list of all currently recognised licenses.
knownLicenses :: [License]

-- | Convert old <a>License</a> to SPDX <a>License</a>. Non-SPDX licenses
°5uare converted to <a>LicenseRef</a>.
licenseToSPDX :: License -> License

-- | Convert <a>License</a> to <a>License</a>,
°5u
°5uThis is lossy conversion. We try our best.
°5u
°5u<pre>
°5u&gt;&gt;&gt; licenseFromSPDX . licenseToSPDX $ BSD3
°5uBSD3
°5u</pre>
°5u
°5u<pre>
°5u&gt;&gt;&gt; licenseFromSPDX . licenseToSPDX $ GPL (Just (mkVersion [3]))
°5uGPL (Just (mkVersion [3]))
°5u</pre>
°5u
°5u<pre>
°5u&gt;&gt;&gt; licenseFromSPDX . licenseToSPDX $ PublicDomain
°5uUnknownLicense "LicenseRefPublicDomain"
°5u</pre>
°5u
°5u<pre>
°5u&gt;&gt;&gt; licenseFromSPDX $ SPDX.License $ SPDX.simpleLicenseExpression SPDX.EUPL_1_1
°5uUnknownLicense "EUPL-1.1"
°5u</pre>
°5u
°5u<pre>
°5u&gt;&gt;&gt; licenseFromSPDX . licenseToSPDX $ AllRightsReserved
°5uAllRightsReserved
°5u</pre>
°5u
°5u<pre>
°5u&gt;&gt;&gt; licenseFromSPDX &lt;$&gt; simpleParsec "BSD-3-Clause OR GPL-3.0"
°5uJust (UnknownLicense "BSD3ClauseORGPL30")
°5u</pre>
licenseFromSPDX :: License -> License
instance Data.Data.Data Distribution.License.License
instance GHC.Classes.Eq Distribution.License.License
instance GHC.Show.Show Distribution.License.License
instance GHC.Read.Read Distribution.License.License
instance GHC.Generics.Generic Distribution.License.License
instance Data.Binary.Class.Binary Distribution.License.License
instance Control.DeepSeq.NFData Distribution.License.License
instance Distribution.Pretty.Pretty Distribution.License.License
instance Distribution.Parsec.Class.Parsec Distribution.License.License
instance Distribution.Text.Text Distribution.License.License


-- | Haskell language dialects and extensions
module Language.Haskell.Extension

-- | This represents a Haskell language dialect.
°5u
°5uLanguage <a>Extension</a>s are interpreted relative to one of these
°5ubase languages.
data Language

-- | The Haskell 98 language as defined by the Haskell 98 report.
°5u<a>http://haskell.org/onlinereport/</a>
Haskell98 :: Language

-- | The Haskell 2010 language as defined by the Haskell 2010 report.
°5u<a>http://www.haskell.org/onlinereport/haskell2010</a>
Haskell2010 :: Language

-- | An unknown language, identified by its name.
UnknownLanguage :: String -> Language
knownLanguages :: [Language]
classifyLanguage :: String -> Language

-- | This represents language extensions beyond a base <a>Language</a>
°5udefinition (such as <a>Haskell98</a>) that are supported by some
°5uimplementations, usually in some special mode.
°5u
°5uWhere applicable, references are given to an implementation's official
°5udocumentation.
data Extension

-- | Enable a known extension
EnableExtension :: KnownExtension -> Extension

-- | Disable a known extension
DisableExtension :: KnownExtension -> Extension

-- | An unknown extension, identified by the name of its <tt>LANGUAGE</tt>
°5upragma.
UnknownExtension :: String -> Extension
data KnownExtension

-- | Allow overlapping class instances, provided there is a unique most
°5uspecific instance for each use.
°5u
°5u<ul>
°5u
°5u<li><a>https://www.haskell.org/ghc/docs/latest/html/users_guide/glasgow_exts.html#ghc-flag--XOverlappingInstances</a></li>
°5u</ul>
OverlappingInstances :: KnownExtension

-- | Ignore structural rules guaranteeing the termination of class instance
°5uresolution. Termination is guaranteed by a fixed-depth recursion
°5ustack, and compilation may fail if this depth is exceeded.
°5u
°5u<ul>
°5u
°5u<li><a>https://www.haskell.org/ghc/docs/latest/html/users_guide/glasgow_exts.html#ghc-flag--XUndecidableInstances</a></li>
°5u</ul>
UndecidableInstances :: KnownExtension

-- | Implies <a>OverlappingInstances</a>. Allow the implementation to
°5uchoose an instance even when it is possible that further instantiation
°5uof types will lead to a more specific instance being applicable.
°5u
°5u<ul>
°5u
°5u<li><a>https://www.haskell.org/ghc/docs/latest/html/users_guide/glasgow_exts.html#ghc-flag--XIncoherentInstances</a></li>
°5u</ul>
IncoherentInstances :: KnownExtension

-- | <i>(deprecated)</i> Deprecated in favour of <a>RecursiveDo</a>.
°5u
°5uOld description: Allow recursive bindings in <tt>do</tt> blocks, using
°5uthe <tt>rec</tt> keyword. See also <a>RecursiveDo</a>.
DoRec :: KnownExtension

-- | Allow recursive bindings in <tt>do</tt> blocks, using the <tt>rec</tt>
°5ukeyword, or <tt>mdo</tt>, a variant of <tt>do</tt>.
°5u
°5u<ul>
°5u
°5u<li><a>https://www.haskell.org/ghc/docs/latest/html/users_guide/glasgow_exts.html#ghc-flag--XRecursiveDo</a></li>
°5u</ul>
RecursiveDo :: KnownExtension

-- | Provide syntax for writing list comprehensions which iterate over
°5useveral lists together, like the <a>zipWith</a> family of functions.
°5u
°5u<ul>
°5u
°5u<li><a>https://www.haskell.org/ghc/docs/latest/html/users_guide/glasgow_exts.html#ghc-flag--XParallelListComp</a></li>
°5u</ul>
ParallelListComp :: KnownExtension

-- | Allow multiple parameters in a type class.
°5u
°5u<ul>
°5u
°5u<li><a>https://www.haskell.org/ghc/docs/latest/html/users_guide/glasgow_exts.html#ghc-flag--XMultiParamTypeClasses</a></li>
°5u</ul>
MultiParamTypeClasses :: KnownExtension

-- | Enable the dreaded monomorphism restriction.
°5u
°5u<ul>
°5u
°5u<li><a>https://www.haskell.org/ghc/docs/latest/html/users_guide/glasgow_exts.html#ghc-flag--XNoMonomorphismRestriction</a></li>
°5u</ul>
MonomorphismRestriction :: KnownExtension

-- | Allow a specification attached to a multi-parameter type class which
°5uindicates that some parameters are entirely determined by others. The
°5uimplementation will check that this property holds for the declared
°5uinstances, and will use this property to reduce ambiguity in instance
°5uresolution.
°5u
°5u<ul>
°5u
°5u<li><a>https://www.haskell.org/ghc/docs/latest/html/users_guide/glasgow_exts.html#ghc-flag--XFunctionalDependencies</a></li>
°5u</ul>
FunctionalDependencies :: KnownExtension

-- | <i>(deprecated)</i> A synonym for <a>RankNTypes</a>.
°5u
°5uOld description: Like <a>RankNTypes</a> but does not allow a
°5uhigher-rank type to itself appear on the left of a function arrow.
°5u
°5u<ul>
°5u
°5u<li><a>https://www.haskell.org/ghc/docs/latest/html/users_guide/glasgow_exts.html#ghc-flag--XRank2Types</a></li>
°5u</ul>
Rank2Types :: KnownExtension

-- | Allow a universally-quantified type to occur on the left of a function
°5uarrow.
°5u
°5u<ul>
°5u
°5u<li><a>https://www.haskell.org/ghc/docs/latest/html/users_guide/glasgow_exts.html#ghc-flag--XRankNTypes</a></li>
°5u</ul>
RankNTypes :: KnownExtension

-- | <i>(deprecated)</i> A synonym for <a>RankNTypes</a>.
°5u
°5uOld description: Allow data constructors to have polymorphic
°5uarguments. Unlike <a>RankNTypes</a>, does not allow this for ordinary
°5ufunctions.
°5u
°5u<ul>
°5u
°5u<li><a>https://www.haskell.org/ghc/docs/latest/html/users_guide/glasgow_exts.html#arbitrary-rank-polymorphism</a></li>
°5u</ul>
PolymorphicComponents :: KnownExtension

-- | Allow existentially-quantified data constructors.
°5u
°5u<ul>
°5u
°5u<li><a>https://www.haskell.org/ghc/docs/latest/html/users_guide/glasgow_exts.html#ghc-flag--XExistentialQuantification</a></li>
°5u</ul>
ExistentialQuantification :: KnownExtension

-- | Cause a type variable in a signature, which has an explicit
°5u<tt>forall</tt> quantifier, to scope over the definition of the
°5uaccompanying value declaration.
°5u
°5u<ul>
°5u
°5u<li><a>https://www.haskell.org/ghc/docs/latest/html/users_guide/glasgow_exts.html#ghc-flag--XScopedTypeVariables</a></li>
°5u</ul>
ScopedTypeVariables :: KnownExtension

-- | Deprecated, use <a>ScopedTypeVariables</a> instead.
PatternSignatures :: KnownExtension

-- | Enable implicit function parameters with dynamic scope.
°5u
°5u<ul>
°5u
°5u<li><a>https://www.haskell.org/ghc/docs/latest/html/users_guide/glasgow_exts.html#ghc-flag--XImplicitParams</a></li>
°5u</ul>
ImplicitParams :: KnownExtension

-- | Relax some restrictions on the form of the context of a type
°5usignature.
°5u
°5u<ul>
°5u
°5u<li><a>https://www.haskell.org/ghc/docs/latest/html/users_guide/glasgow_exts.html#ghc-flag--XFlexibleContexts</a></li>
°5u</ul>
FlexibleContexts :: KnownExtension

-- | Relax some restrictions on the form of the context of an instance
°5udeclaration.
°5u
°5u<ul>
°5u
°5u<li><a>https://www.haskell.org/ghc/docs/latest/html/users_guide/glasgow_exts.html#ghc-flag--XFlexibleInstances</a></li>
°5u</ul>
FlexibleInstances :: KnownExtension

-- | Allow data type declarations with no constructors.
°5u
°5u<ul>
°5u
°5u<li><a>https://www.haskell.org/ghc/docs/latest/html/users_guide/glasgow_exts.html#ghc-flag--XEmptyDataDecls</a></li>
°5u</ul>
EmptyDataDecls :: KnownExtension

-- | Run the C preprocessor on Haskell source code.
°5u
°5u<ul>
°5u
°5u<li><a>https://www.haskell.org/ghc/docs/latest/html/users_guide/glasgow_exts.html#language-pragma</a></li>
°5u</ul>
CPP :: KnownExtension

-- | Allow an explicit kind signature giving the kind of types over which a
°5utype variable ranges.
°5u
°5u<ul>
°5u
°5u<li><a>https://www.haskell.org/ghc/docs/latest/html/users_guide/glasgow_exts.html#ghc-flag--XKindSignatures</a></li>
°5u</ul>
KindSignatures :: KnownExtension

-- | Enable a form of pattern which forces evaluation before an attempted
°5umatch, and a form of strict <tt>let</tt>/<tt>where</tt> binding.
°5u
°5u<ul>
°5u
°5u<li><a>https://www.haskell.org/ghc/docs/latest/html/users_guide/glasgow_exts.html#ghc-flag--XBangPatterns</a></li>
°5u</ul>
BangPatterns :: KnownExtension

-- | Allow type synonyms in instance heads.
°5u
°5u<ul>
°5u
°5u<li><a>https://www.haskell.org/ghc/docs/latest/html/users_guide/glasgow_exts.html#ghc-flag--XTypeSynonymInstances</a></li>
°5u</ul>
TypeSynonymInstances :: KnownExtension

-- | Enable Template Haskell, a system for compile-time metaprogramming.
°5u
°5u<ul>
°5u
°5u<li><a>https://www.haskell.org/ghc/docs/latest/html/users_guide/glasgow_exts.html#ghc-flag--XTemplateHaskell</a></li>
°5u</ul>
TemplateHaskell :: KnownExtension

-- | Enable the Foreign Function Interface. In GHC, implements the standard
°5uHaskell 98 Foreign Function Interface Addendum, plus some GHC-specific
°5uextensions.
°5u
°5u<ul>
°5u
°5u<li><a>https://www.haskell.org/ghc/docs/latest/html/users_guide/glasgow_exts.html#language-pragma</a></li>
°5u</ul>
ForeignFunctionInterface :: KnownExtension

-- | Enable arrow notation.
°5u
°5u<ul>
°5u
°5u<li><a>https://www.haskell.org/ghc/docs/latest/html/users_guide/glasgow_exts.html#ghc-flag--XArrows</a></li>
°5u</ul>
Arrows :: KnownExtension

-- | <i>(deprecated)</i> Enable generic type classes, with default
°5uinstances defined in terms of the algebraic structure of a type.
°5u
°5u<ul>
°5u
°5u<li><a>https://haskell.org/ghc/docs/latest/html/users_guide/glasgow_exts.html#generic-classes</a></li>
°5u</ul>
Generics :: KnownExtension

-- | Enable the implicit importing of the module <a>Prelude</a>. When
°5udisabled, when desugaring certain built-in syntax into ordinary
°5uidentifiers, use whatever is in scope rather than the <a>Prelude</a>
°5u-- version.
°5u
°5u<ul>
°5u
°5u<li><a>https://haskell.org/ghc/docs/latest/html/users_guide/glasgow_exts.html#rebindable-syntax-and-the-implicit-prelude-import</a></li>
°5u</ul>
ImplicitPrelude :: KnownExtension

-- | Enable syntax for implicitly binding local names corresponding to the
°5ufield names of a record. Puns bind specific names, unlike
°5u<a>RecordWildCards</a>.
°5u
°5u<ul>
°5u
°5u<li><a>https://www.haskell.org/ghc/docs/latest/html/users_guide/glasgow_exts.html#ghc-flag--XNamedFieldPuns</a></li>
°5u</ul>
NamedFieldPuns :: KnownExtension

-- | Enable a form of guard which matches a pattern and binds variables.
°5u
°5u<ul>
°5u
°5u<li><a>https://www.haskell.org/ghc/docs/latest/html/users_guide/glasgow_exts.html#ghc-flag--XPatternGuards</a></li>
°5u</ul>
PatternGuards :: KnownExtension

-- | Allow a type declared with <tt>newtype</tt> to use <tt>deriving</tt>
°5ufor any class with an instance for the underlying type.
°5u
°5u<ul>
°5u
°5u<li><a>https://www.haskell.org/ghc/docs/latest/html/users_guide/glasgow_exts.html#ghc-flag--XGeneralizedNewtypeDeriving</a></li>
°5u</ul>
GeneralizedNewtypeDeriving :: KnownExtension

-- | Enable the "Trex" extensible records system.
°5u
°5u<ul>
°5u
°5u<li><a>http://haskell.org/hugs/pages/users_guide/hugs-only.html#TREX</a></li>
°5u</ul>
ExtensibleRecords :: KnownExtension

-- | Enable type synonyms which are transparent in some definitions and
°5uopaque elsewhere, as a way of implementing abstract datatypes.
°5u
°5u<ul>
°5u
°5u<li><a>http://haskell.org/hugs/pages/users_guide/restricted-synonyms.html</a></li>
°5u</ul>
RestrictedTypeSynonyms :: KnownExtension

-- | Enable an alternate syntax for string literals, with string
°5utemplating.
°5u
°5u<ul>
°5u
°5u<li><a>http://haskell.org/hugs/pages/users_guide/here-documents.html</a></li>
°5u</ul>
HereDocuments :: KnownExtension

-- | Allow the character <tt>#</tt> as a postfix modifier on identifiers.
°5uAlso enables literal syntax for unboxed values.
°5u
°5u<ul>
°5u
°5u<li><a>https://www.haskell.org/ghc/docs/latest/html/users_guide/glasgow_exts.html#ghc-flag--XMagicHash</a></li>
°5u</ul>
MagicHash :: KnownExtension

-- | Allow data types and type synonyms which are indexed by types, i.e.
°5uad-hoc polymorphism for types.
°5u
°5u<ul>
°5u
°5u<li><a>https://www.haskell.org/ghc/docs/latest/html/users_guide/glasgow_exts.html#ghc-flag--XTypeFamilies</a></li>
°5u</ul>
TypeFamilies :: KnownExtension

-- | Allow a standalone declaration which invokes the type class
°5u<tt>deriving</tt> mechanism.
°5u
°5u<ul>
°5u
°5u<li><a>https://www.haskell.org/ghc/docs/latest/html/users_guide/glasgow_exts.html#ghc-flag--XStandaloneDeriving</a></li>
°5u</ul>
StandaloneDeriving :: KnownExtension

-- | Allow certain Unicode characters to stand for certain ASCII character
°5usequences, e.g. keywords and punctuation.
°5u
°5u<ul>
°5u
°5u<li><a>https://www.haskell.org/ghc/docs/latest/html/users_guide/glasgow_exts.html#ghc-flag--XUnicodeSyntax</a></li>
°5u</ul>
UnicodeSyntax :: KnownExtension

-- | Allow the use of unboxed types as foreign types, e.g. in <tt>foreign
°5uimport</tt> and <tt>foreign export</tt>.
°5u
°5u<ul>
°5u
°5u<li><a>https://www.haskell.org/ghc/docs/latest/html/users_guide/glasgow_exts.html#language-options</a></li>
°5u</ul>
UnliftedFFITypes :: KnownExtension

-- | Enable interruptible FFI.
°5u
°5u<ul>
°5u
°5u<li><a>https://haskell.org/ghc/docs/latest/html/users_guide/ffi-chap.html#interruptible-foreign-calls</a></li>
°5u</ul>
InterruptibleFFI :: KnownExtension

-- | Allow use of CAPI FFI calling convention (<tt>foreign import
°5ucapi</tt>).
°5u
°5u<ul>
°5u
°5u<li><a>https://haskell.org/ghc/docs/latest/html/users_guide/ffi-chap.html#the-capi-calling-convention</a></li>
°5u</ul>
CApiFFI :: KnownExtension

-- | Defer validity checking of types until after expanding type synonyms,
°5urelaxing the constraints on how synonyms may be used.
°5u
°5u<ul>
°5u
°5u<li><a>https://www.haskell.org/ghc/docs/latest/html/users_guide/glasgow_exts.html#ghc-flag--XLiberalTypeSynonyms</a></li>
°5u</ul>
LiberalTypeSynonyms :: KnownExtension

-- | Allow the name of a type constructor, type class, or type variable to
°5ube an infix operator. *
°5u<a>https://www.haskell.org/ghc/docs/latest/html/users_guide/glasgow_exts.html#ghc-flag--XTypeOperators</a>
TypeOperators :: KnownExtension

-- | Enable syntax for implicitly binding local names corresponding to the
°5ufield names of a record. A wildcard binds all unmentioned names,
°5uunlike <a>NamedFieldPuns</a>.
°5u
°5u<ul>
°5u
°5u<li><a>https://www.haskell.org/ghc/docs/latest/html/users_guide/glasgow_exts.html#ghc-flag--XRecordWildCards</a></li>
°5u</ul>
RecordWildCards :: KnownExtension

-- | Deprecated, use <a>NamedFieldPuns</a> instead.
RecordPuns :: KnownExtension

-- | Allow a record field name to be disambiguated by the type of the
°5urecord it's in.
°5u
°5u<ul>
°5u
°5u<li><a>https://www.haskell.org/ghc/docs/latest/html/users_guide/glasgow_exts.html#ghc-flag--XDisambiguateRecordFields</a></li>
°5u</ul>
DisambiguateRecordFields :: KnownExtension

-- | Enable traditional record syntax (as supported by Haskell 98)
°5u
°5u<ul>
°5u
°5u<li><a>https://haskell.org/ghc/docs/latest/html/users_guide/glasgow_exts.html#traditional-record-syntax</a></li>
°5u</ul>
TraditionalRecordSyntax :: KnownExtension

-- | Enable overloading of string literals using a type class, much like
°5uinteger literals.
°5u
°5u<ul>
°5u
°5u<li><a>https://www.haskell.org/ghc/docs/latest/html/users_guide/glasgow_exts.html#ghc-flag--XOverloadedStrings</a></li>
°5u</ul>
OverloadedStrings :: KnownExtension

-- | Enable generalized algebraic data types, in which type variables may
°5ube instantiated on a per-constructor basis. Implies <a>GADTSyntax</a>.
°5u
°5u<ul>
°5u
°5u<li><a>https://haskell.org/ghc/docs/latest/html/users_guide/glasgow_exts.html#generalised-algebraic-data-types-gadts</a></li>
°5u</ul>
GADTs :: KnownExtension

-- | Enable GADT syntax for declaring ordinary algebraic datatypes.
°5u
°5u<ul>
°5u
°5u<li><a>https://www.haskell.org/ghc/docs/latest/html/users_guide/glasgow_exts.html#ghc-flag--XGADTSyntax</a></li>
°5u</ul>
GADTSyntax :: KnownExtension

-- | <i>(deprecated)</i> Has no effect.
°5u
°5uOld description: Make pattern bindings monomorphic.
°5u
°5u<ul>
°5u
°5u<li><a>https://downloads.haskell.org/~ghc/7.6.3/docs/html/users_guide/monomorphism.html</a></li>
°5u</ul>
MonoPatBinds :: KnownExtension

-- | Relax the requirements on mutually-recursive polymorphic functions.
°5u
°5u<ul>
°5u
°5u<li><a>https://www.haskell.org/ghc/docs/latest/html/users_guide/glasgow_exts.html#ghc-flag--XRelaxedPolyRec</a></li>
°5u</ul>
RelaxedPolyRec :: KnownExtension

-- | Allow default instantiation of polymorphic types in more situations.
°5u
°5u<ul>
°5u
°5u<li><a>http://downloads.haskell.org/~ghc/latest/docs/html/users_guide/ghci.html#type-defaulting-in-ghci</a></li>
°5u</ul>
ExtendedDefaultRules :: KnownExtension

-- | Enable unboxed tuples.
°5u
°5u<ul>
°5u
°5u<li><a>https://www.haskell.org/ghc/docs/latest/html/users_guide/glasgow_exts.html#ghc-flag--XUnboxedTuples</a></li>
°5u</ul>
UnboxedTuples :: KnownExtension

-- | Enable <tt>deriving</tt> for classes <a>Typeable</a> and <a>Data</a>.
°5u
°5u<ul>
°5u
°5u<li><a>https://www.haskell.org/ghc/docs/latest/html/users_guide/glasgow_exts.html#ghc-flag--XDeriveDataTypeable</a></li>
°5u</ul>
DeriveDataTypeable :: KnownExtension

-- | Enable <tt>deriving</tt> for <a>Generic</a> and <a>Generic1</a>.
°5u
°5u<ul>
°5u
°5u<li><a>https://www.haskell.org/ghc/docs/latest/html/users_guide/glasgow_exts.html#ghc-flag--XDeriveGeneric</a></li>
°5u</ul>
DeriveGeneric :: KnownExtension

-- | Enable support for default signatures.
°5u
°5u<ul>
°5u
°5u<li><a>https://www.haskell.org/ghc/docs/latest/html/users_guide/glasgow_exts.html#ghc-flag--XDefaultSignatures</a></li>
°5u</ul>
DefaultSignatures :: KnownExtension

-- | Allow type signatures to be specified in instance declarations.
°5u
°5u<ul>
°5u
°5u<li><a>https://www.haskell.org/ghc/docs/latest/html/users_guide/glasgow_exts.html#ghc-flag--XInstanceSigs</a></li>
°5u</ul>
InstanceSigs :: KnownExtension

-- | Allow a class method's type to place additional constraints on a class
°5utype variable.
°5u
°5u<ul>
°5u
°5u<li><a>https://www.haskell.org/ghc/docs/latest/html/users_guide/glasgow_exts.html#ghc-flag--XConstrainedClassMethods</a></li>
°5u</ul>
ConstrainedClassMethods :: KnownExtension

-- | Allow imports to be qualified by the package name the module is
°5uintended to be imported from, e.g.
°5u
°5u<pre>
°5uimport "network" Network.Socket
°5u</pre>
°5u
°5u<ul>
°5u
°5u<li><a>https://www.haskell.org/ghc/docs/latest/html/users_guide/glasgow_exts.html#ghc-flag--XPackageImports</a></li>
°5u</ul>
PackageImports :: KnownExtension

-- | <i>(deprecated)</i> Allow a type variable to be instantiated at a
°5upolymorphic type.
°5u
°5u<ul>
°5u
°5u<li><a>https://www.haskell.org/ghc/docs/latest/html/users_guide/glasgow_exts.html#ghc-flag--XImpredicativeTypes</a></li>
°5u</ul>
ImpredicativeTypes :: KnownExtension

-- | <i>(deprecated)</i> Change the syntax for qualified infix operators.
°5u
°5u<ul>
°5u
°5u<li><a>http://www.haskell.org/ghc/docs/6.12.3/html/users_guide/syntax-extns.html#new-qualified-operators</a></li>
°5u</ul>
NewQualifiedOperators :: KnownExtension

-- | Relax the interpretation of left operator sections to allow unary
°5upostfix operators.
°5u
°5u<ul>
°5u
°5u<li><a>https://www.haskell.org/ghc/docs/latest/html/users_guide/glasgow_exts.html#ghc-flag--XPostfixOperators</a></li>
°5u</ul>
PostfixOperators :: KnownExtension

-- | Enable quasi-quotation, a mechanism for defining new concrete syntax
°5ufor expressions and patterns.
°5u
°5u<ul>
°5u
°5u<li><a>https://www.haskell.org/ghc/docs/latest/html/users_guide/glasgow_exts.html#ghc-flag--XQuasiQuotes</a></li>
°5u</ul>
QuasiQuotes :: KnownExtension

-- | Enable generalized list comprehensions, supporting operations such as
°5usorting and grouping.
°5u
°5u<ul>
°5u
°5u<li><a>https://www.haskell.org/ghc/docs/latest/html/users_guide/glasgow_exts.html#ghc-flag--XTransformListComp</a></li>
°5u</ul>
TransformListComp :: KnownExtension

-- | Enable monad comprehensions, which generalise the list comprehension
°5usyntax to work for any monad.
°5u
°5u<ul>
°5u
°5u<li><a>https://www.haskell.org/ghc/docs/latest/html/users_guide/glasgow_exts.html#ghc-flag--XMonadComprehensions</a></li>
°5u</ul>
MonadComprehensions :: KnownExtension

-- | Enable view patterns, which match a value by applying a function and
°5umatching on the result.
°5u
°5u<ul>
°5u
°5u<li><a>https://www.haskell.org/ghc/docs/latest/html/users_guide/glasgow_exts.html#ghc-flag--XViewPatterns</a></li>
°5u</ul>
ViewPatterns :: KnownExtension

-- | Allow concrete XML syntax to be used in expressions and patterns, as
°5uper the Haskell Server Pages extension language:
°5u<a>http://www.haskell.org/haskellwiki/HSP</a>. The ideas behind it are
°5udiscussed in the paper "Haskell Server Pages through Dynamic Loading"
°5uby Niklas Broberg, from Haskell Workshop '05.
XmlSyntax :: KnownExtension

-- | Allow regular pattern matching over lists, as discussed in the paper
°5u"Regular Expression Patterns" by Niklas Broberg, Andreas Farre and
°5uJosef Svenningsson, from ICFP '04.
RegularPatterns :: KnownExtension

-- | Enable the use of tuple sections, e.g. <tt>(, True)</tt> desugars into
°5u<tt>x -&gt; (x, True)</tt>.
°5u
°5u<ul>
°5u
°5u<li><a>https://www.haskell.org/ghc/docs/latest/html/users_guide/glasgow_exts.html#ghc-flag--XTupleSections</a></li>
°5u</ul>
TupleSections :: KnownExtension

-- | Allow GHC primops, written in C--, to be imported into a Haskell file.
GHCForeignImportPrim :: KnownExtension

-- | Support for patterns of the form <tt>n + k</tt>, where <tt>k</tt> is
°5uan integer literal.
°5u
°5u<ul>
°5u
°5u<li><a>https://www.haskell.org/ghc/docs/latest/html/users_guide/glasgow_exts.html#ghc-flag--XNPlusKPatterns</a></li>
°5u</ul>
NPlusKPatterns :: KnownExtension

-- | Improve the layout rule when <tt>if</tt> expressions are used in a
°5u<tt>do</tt> block.
DoAndIfThenElse :: KnownExtension

-- | Enable support for multi-way <tt>if</tt>-expressions.
°5u
°5u<ul>
°5u
°5u<li><a>https://www.haskell.org/ghc/docs/latest/html/users_guide/glasgow_exts.html#ghc-flag--XMultiWayIf</a></li>
°5u</ul>
MultiWayIf :: KnownExtension

-- | Enable support lambda-<tt>case</tt> expressions.
°5u
°5u<ul>
°5u
°5u<li><a>https://www.haskell.org/ghc/docs/latest/html/users_guide/glasgow_exts.html#ghc-flag--XLambdaCase</a></li>
°5u</ul>
LambdaCase :: KnownExtension

-- | Makes much of the Haskell sugar be desugared into calls to the
°5ufunction with a particular name that is in scope.
°5u
°5u<ul>
°5u
°5u<li><a>https://www.haskell.org/ghc/docs/latest/html/users_guide/glasgow_exts.html#ghc-flag--XRebindableSyntax</a></li>
°5u</ul>
RebindableSyntax :: KnownExtension

-- | Make <tt>forall</tt> a keyword in types, which can be used to give the
°5ugeneralisation explicitly.
°5u
°5u<ul>
°5u
°5u<li><a>https://www.haskell.org/ghc/docs/latest/html/users_guide/glasgow_exts.html#ghc-flag--XExplicitForAll</a></li>
°5u</ul>
ExplicitForAll :: KnownExtension

-- | Allow contexts to be put on datatypes, e.g. the <tt>Eq a</tt> in
°5u<tt>data Eq a =&gt; Set a = NilSet | ConsSet a (Set a)</tt>.
°5u
°5u<ul>
°5u
°5u<li><a>https://www.haskell.org/ghc/docs/latest/html/users_guide/glasgow_exts.html#ghc-flag--XDatatypeContexts</a></li>
°5u</ul>
DatatypeContexts :: KnownExtension

-- | Local (<tt>let</tt> and <tt>where</tt>) bindings are monomorphic.
°5u
°5u<ul>
°5u
°5u<li><a>https://www.haskell.org/ghc/docs/latest/html/users_guide/glasgow_exts.html#ghc-flag--XMonoLocalBinds</a></li>
°5u</ul>
MonoLocalBinds :: KnownExtension

-- | Enable <tt>deriving</tt> for the <a>Functor</a> class.
°5u
°5u<ul>
°5u
°5u<li><a>https://www.haskell.org/ghc/docs/latest/html/users_guide/glasgow_exts.html#ghc-flag--XDeriveFunctor</a></li>
°5u</ul>
DeriveFunctor :: KnownExtension

-- | Enable <tt>deriving</tt> for the <a>Traversable</a> class.
°5u
°5u<ul>
°5u
°5u<li><a>https://www.haskell.org/ghc/docs/latest/html/users_guide/glasgow_exts.html#ghc-flag--XDeriveTraversable</a></li>
°5u</ul>
DeriveTraversable :: KnownExtension

-- | Enable <tt>deriving</tt> for the <a>Foldable</a> class.
°5u
°5u<ul>
°5u
°5u<li><a>https://www.haskell.org/ghc/docs/latest/html/users_guide/glasgow_exts.html#ghc-flag--XDeriveFoldable</a></li>
°5u</ul>
DeriveFoldable :: KnownExtension

-- | Enable non-decreasing indentation for <tt>do</tt> blocks.
°5u
°5u<ul>
°5u
°5u<li><a>https://haskell.org/ghc/docs/latest/html/users_guide/bugs.html#context-free-syntax</a></li>
°5u</ul>
NondecreasingIndentation :: KnownExtension

-- | Allow imports to be qualified with a safe keyword that requires the
°5uimported module be trusted as according to the Safe Haskell definition
°5uof trust.
°5u
°5u<pre>
°5uimport safe Network.Socket
°5u</pre>
°5u
°5u<ul>
°5u
°5u<li><a>https://haskell.org/ghc/docs/latest/html/users_guide/glasgow_exts.html#safe-imports</a></li>
°5u</ul>
SafeImports :: KnownExtension

-- | Compile a module in the Safe, Safe Haskell mode -- a restricted form
°5uof the Haskell language to ensure type safety.
°5u
°5u<ul>
°5u
°5u<li><a>https://www.haskell.org/ghc/docs/latest/html/users_guide/safe_haskell.html#ghc-flag--XSafe</a></li>
°5u</ul>
Safe :: KnownExtension

-- | Compile a module in the Trustworthy, Safe Haskell mode -- no
°5urestrictions apply but the module is marked as trusted as long as the
°5upackage the module resides in is trusted.
°5u
°5u<ul>
°5u
°5u<li><a>https://www.haskell.org/ghc/docs/latest/html/users_guide/safe_haskell.html#ghc-flag--XTrustworthy</a></li>
°5u</ul>
Trustworthy :: KnownExtension

-- | Compile a module in the Unsafe, Safe Haskell mode so that modules
°5ucompiled using Safe, Safe Haskell mode can't import it.
°5u
°5u<ul>
°5u
°5u<li><a>https://www.haskell.org/ghc/docs/latest/html/users_guide/safe_haskell.html#ghc-flag--XUnsafe</a></li>
°5u</ul>
Unsafe :: KnownExtension

-- | Allow type class<i>implicit parameter</i>equality constraints to be
°5uused as types with the special kind constraint. Also generalise the
°5u<tt>(ctxt =&gt; ty)</tt> syntax so that any type of kind constraint
°5ucan occur before the arrow.
°5u
°5u<ul>
°5u
°5u<li><a>https://www.haskell.org/ghc/docs/latest/html/users_guide/glasgow_exts.html#ghc-flag--XConstraintKinds</a></li>
°5u</ul>
ConstraintKinds :: KnownExtension

-- | Enable kind polymorphism.
°5u
°5u<ul>
°5u
°5u<li><a>https://www.haskell.org/ghc/docs/latest/html/users_guide/glasgow_exts.html#ghc-flag--XPolyKinds</a></li>
°5u</ul>
PolyKinds :: KnownExtension

-- | Enable datatype promotion.
°5u
°5u<ul>
°5u
°5u<li><a>https://www.haskell.org/ghc/docs/latest/html/users_guide/glasgow_exts.html#ghc-flag--XDataKinds</a></li>
°5u</ul>
DataKinds :: KnownExtension

-- | Enable parallel arrays syntax (<tt>[:</tt>, <tt>:]</tt>) for <i>Data
°5uParallel Haskell</i>.
°5u
°5u<ul>
°5u
°5u<li><a>http://www.haskell.org/haskellwiki/GHC/Data_Parallel_Haskell</a></li>
°5u</ul>
ParallelArrays :: KnownExtension

-- | Enable explicit role annotations, like in (<tt>type role Foo
°5urepresentational representational</tt>).
°5u
°5u<ul>
°5u
°5u<li><a>https://www.haskell.org/ghc/docs/latest/html/users_guide/glasgow_exts.html#ghc-flag--XRoleAnnotations</a></li>
°5u</ul>
RoleAnnotations :: KnownExtension

-- | Enable overloading of list literals, arithmetic sequences and list
°5upatterns using the <tt>IsList</tt> type class.
°5u
°5u<ul>
°5u
°5u<li><a>https://www.haskell.org/ghc/docs/latest/html/users_guide/glasgow_exts.html#ghc-flag--XOverloadedLists</a></li>
°5u</ul>
OverloadedLists :: KnownExtension

-- | Enable case expressions that have no alternatives. Also applies to
°5ulambda-case expressions if they are enabled.
°5u
°5u<ul>
°5u
°5u<li><a>https://www.haskell.org/ghc/docs/latest/html/users_guide/glasgow_exts.html#ghc-flag--XEmptyCase</a></li>
°5u</ul>
EmptyCase :: KnownExtension

-- | <i>(deprecated)</i> Deprecated in favour of <a>DeriveDataTypeable</a>.
°5u
°5uOld description: Triggers the generation of derived <a>Typeable</a>
°5uinstances for every datatype and type class declaration.
°5u
°5u<ul>
°5u
°5u<li><a>https://haskell.org/ghc/docs/7.8.4/html/users_guide/deriving.html#auto-derive-typeable</a></li>
°5u</ul>
AutoDeriveTypeable :: KnownExtension

-- | Desugars negative literals directly (without using negate).
°5u
°5u<ul>
°5u
°5u<li><a>https://www.haskell.org/ghc/docs/latest/html/users_guide/glasgow_exts.html#ghc-flag--XNegativeLiterals</a></li>
°5u</ul>
NegativeLiterals :: KnownExtension

-- | Allow the use of binary integer literal syntax (e.g.
°5u<tt>0b11001001</tt> to denote <tt>201</tt>).
°5u
°5u<ul>
°5u
°5u<li><a>https://www.haskell.org/ghc/docs/latest/html/users_guide/glasgow_exts.html#ghc-flag--XBinaryLiterals</a></li>
°5u</ul>
BinaryLiterals :: KnownExtension

-- | Allow the use of floating literal syntax for all instances of
°5u<a>Num</a>, including <a>Int</a> and <a>Integer</a>.
°5u
°5u<ul>
°5u
°5u<li><a>https://www.haskell.org/ghc/docs/latest/html/users_guide/glasgow_exts.html#ghc-flag--XNumDecimals</a></li>
°5u</ul>
NumDecimals :: KnownExtension

-- | Enable support for type classes with no type parameter.
°5u
°5u<ul>
°5u
°5u<li><a>https://www.haskell.org/ghc/docs/latest/html/users_guide/glasgow_exts.html#ghc-flag--XNullaryTypeClasses</a></li>
°5u</ul>
NullaryTypeClasses :: KnownExtension

-- | Enable explicit namespaces in module import/export lists.
°5u
°5u<ul>
°5u
°5u<li><a>https://www.haskell.org/ghc/docs/latest/html/users_guide/glasgow_exts.html#ghc-flag--XExplicitNamespaces</a></li>
°5u</ul>
ExplicitNamespaces :: KnownExtension

-- | Allow the user to write ambiguous types, and the type inference engine
°5uto infer them.
°5u
°5u<ul>
°5u
°5u<li><a>https://www.haskell.org/ghc/docs/latest/html/users_guide/glasgow_exts.html#ghc-flag--XAllowAmbiguousTypes</a></li>
°5u</ul>
AllowAmbiguousTypes :: KnownExtension

-- | Enable <tt>foreign import javascript</tt>.
JavaScriptFFI :: KnownExtension

-- | Allow giving names to and abstracting over patterns.
°5u
°5u<ul>
°5u
°5u<li><a>https://www.haskell.org/ghc/docs/latest/html/users_guide/glasgow_exts.html#ghc-flag--XPatternSynonyms</a></li>
°5u</ul>
PatternSynonyms :: KnownExtension

-- | Allow anonymous placeholders (underscore) inside type signatures. The
°5utype inference engine will generate a message describing the type
°5uinferred at the hole's location.
°5u
°5u<ul>
°5u
°5u<li><a>https://www.haskell.org/ghc/docs/latest/html/users_guide/glasgow_exts.html#ghc-flag--XPartialTypeSignatures</a></li>
°5u</ul>
PartialTypeSignatures :: KnownExtension

-- | Allow named placeholders written with a leading underscore inside type
°5usignatures. Wildcards with the same name unify to the same type.
°5u
°5u<ul>
°5u
°5u<li><a>https://www.haskell.org/ghc/docs/latest/html/users_guide/glasgow_exts.html#ghc-flag--XNamedWildCards</a></li>
°5u</ul>
NamedWildCards :: KnownExtension

-- | Enable <tt>deriving</tt> for any class.
°5u
°5u<ul>
°5u
°5u<li><a>https://www.haskell.org/ghc/docs/latest/html/users_guide/glasgow_exts.html#ghc-flag--XDeriveAnyClass</a></li>
°5u</ul>
DeriveAnyClass :: KnownExtension

-- | Enable <tt>deriving</tt> for the <a>Lift</a> class.
°5u
°5u<ul>
°5u
°5u<li><a>https://www.haskell.org/ghc/docs/latest/html/users_guide/glasgow_exts.html#ghc-flag--XDeriveLift</a></li>
°5u</ul>
DeriveLift :: KnownExtension

-- | Enable support for 'static pointers' (and the <tt>static</tt> keyword)
°5uto refer to globally stable names, even across different programs.
°5u
°5u<ul>
°5u
°5u<li><a>https://www.haskell.org/ghc/docs/latest/html/users_guide/glasgow_exts.html#ghc-flag--XStaticPointers</a></li>
°5u</ul>
StaticPointers :: KnownExtension

-- | Switches data type declarations to be strict by default (as if they
°5uhad a bang using <tt>BangPatterns</tt>), and allow opt-in field
°5ulaziness using <tt>~</tt>.
°5u
°5u<ul>
°5u
°5u<li><a>https://downloads.haskell.org/~ghc/latest/docs/html/users_guide/glasgow_exts.html#ghc-flag--XStrictData</a></li>
°5u</ul>
StrictData :: KnownExtension

-- | Switches all pattern bindings to be strict by default (as if they had
°5ua bang using <tt>BangPatterns</tt>), ordinary patterns are recovered
°5uusing <tt>~</tt>. Implies <tt>StrictData</tt>.
°5u
°5u<ul>
°5u
°5u<li><a>https://downloads.haskell.org/~ghc/latest/docs/html/users_guide/glasgow_exts.html#ghc-flag--XStrict</a></li>
°5u</ul>
Strict :: KnownExtension

-- | Allows <tt>do</tt>-notation for types that are
°5u<tt><a>Applicative</a></tt> as well as <tt><a>Monad</a></tt>. When
°5uenabled, desugaring <tt>do</tt> notation tries to use
°5u<tt>(<a>*</a>)</tt> and <tt><a>fmap</a></tt> and
°5u<tt><tt>join</tt></tt> as far as possible.
ApplicativeDo :: KnownExtension

-- | Allow records to use duplicated field labels for accessors.
DuplicateRecordFields :: KnownExtension

-- | Enable explicit type applications with the syntax <tt>id @Int</tt>.
TypeApplications :: KnownExtension

-- | Dissolve the distinction between types and kinds, allowing the
°5ucompiler to reason about kind equality and therefore enabling GADTs to
°5ube promoted to the type-level.
TypeInType :: KnownExtension

-- | Allow recursive (and therefore undecideable) super-class
°5urelationships.
UndecidableSuperClasses :: KnownExtension

-- | A temporary extension to help library authors check if their code will
°5ucompile with the new planned desugaring of fail.
MonadFailDesugaring :: KnownExtension

-- | A subset of <tt>TemplateHaskell</tt> including only quoting.
TemplateHaskellQuotes :: KnownExtension

-- | Allows use of the <tt>#label</tt> syntax.
OverloadedLabels :: KnownExtension

-- | Allow functional dependency annotations on type families to declare
°5uthem as injective.
TypeFamilyDependencies :: KnownExtension

-- | Allow multiple <tt>deriving</tt> clauses, each optionally qualified
°5uwith a <i>strategy</i>.
DerivingStrategies :: KnownExtension

-- | Enable the use of unboxed sum syntax.
UnboxedSums :: KnownExtension

-- | Allow use of hexadecimal literal notation for floating-point values.
HexFloatLiterals :: KnownExtension

-- | <i>Deprecated: KnownExtension is an instance of Enum and Bounded, use
°5uthose instead. This symbol will be removed in Cabal-3.0 (est. Oct
°5u2018).</i>
knownExtensions :: [KnownExtension]

-- | Extensions that have been deprecated, possibly paired with another
°5uextension that replaces it.
deprecatedExtensions :: [(Extension, Maybe Extension)]
classifyExtension :: String -> Extension
instance Data.Data.Data Language.Haskell.Extension.Extension
instance GHC.Classes.Ord Language.Haskell.Extension.Extension
instance GHC.Classes.Eq Language.Haskell.Extension.Extension
instance GHC.Read.Read Language.Haskell.Extension.Extension
instance GHC.Show.Show Language.Haskell.Extension.Extension
instance GHC.Generics.Generic Language.Haskell.Extension.Extension
instance Data.Data.Data Language.Haskell.Extension.KnownExtension
instance GHC.Enum.Bounded Language.Haskell.Extension.KnownExtension
instance GHC.Enum.Enum Language.Haskell.Extension.KnownExtension
instance GHC.Classes.Ord Language.Haskell.Extension.KnownExtension
instance GHC.Classes.Eq Language.Haskell.Extension.KnownExtension
instance GHC.Read.Read Language.Haskell.Extension.KnownExtension
instance GHC.Show.Show Language.Haskell.Extension.KnownExtension
instance GHC.Generics.Generic Language.Haskell.Extension.KnownExtension
instance Data.Data.Data Language.Haskell.Extension.Language
instance GHC.Classes.Eq Language.Haskell.Extension.Language
instance GHC.Read.Read Language.Haskell.Extension.Language
instance GHC.Show.Show Language.Haskell.Extension.Language
instance GHC.Generics.Generic Language.Haskell.Extension.Language
instance Data.Binary.Class.Binary Language.Haskell.Extension.Extension
instance Control.DeepSeq.NFData Language.Haskell.Extension.Extension
instance Distribution.Pretty.Pretty Language.Haskell.Extension.Extension
instance Distribution.Parsec.Class.Parsec Language.Haskell.Extension.Extension
instance Distribution.Text.Text Language.Haskell.Extension.Extension
instance Data.Binary.Class.Binary Language.Haskell.Extension.KnownExtension
instance Control.DeepSeq.NFData Language.Haskell.Extension.KnownExtension
instance Distribution.Pretty.Pretty Language.Haskell.Extension.KnownExtension
instance Distribution.Text.Text Language.Haskell.Extension.KnownExtension
instance Data.Binary.Class.Binary Language.Haskell.Extension.Language
instance Control.DeepSeq.NFData Language.Haskell.Extension.Language
instance Distribution.Pretty.Pretty Language.Haskell.Extension.Language
instance Distribution.Parsec.Class.Parsec Language.Haskell.Extension.Language
instance Distribution.Text.Text Language.Haskell.Extension.Language


-- | This has an enumeration of the various compilers that Cabal knows
°5uabout. It also specifies the default compiler. Sadly you'll often see
°5ucode that does case analysis on this compiler flavour enumeration
°5ulike:
°5u
°5u<pre>
°5ucase compilerFlavor comp of
°5u  GHC -&gt; GHC.getInstalledPackages verbosity packageDb progdb
°5u  JHC -&gt; JHC.getInstalledPackages verbosity packageDb progdb
°5u</pre>
°5u
°5uObviously it would be better to use the proper <tt>Compiler</tt>
°5uabstraction because that would keep all the compiler-specific code
°5utogether. Unfortunately we cannot make this change yet without
°5ubreaking the <tt>UserHooks</tt> api, which would break all custom
°5u<tt>Setup.hs</tt> files, so for the moment we just have to live with
°5uthis deficiency. If you're interested, see ticket #57.
module Distribution.Compiler
data CompilerFlavor
GHC :: CompilerFlavor
GHCJS :: CompilerFlavor
NHC :: CompilerFlavor
YHC :: CompilerFlavor
Hugs :: CompilerFlavor
HBC :: CompilerFlavor
Helium :: CompilerFlavor
JHC :: CompilerFlavor
LHC :: CompilerFlavor
UHC :: CompilerFlavor
HaskellSuite :: String -> CompilerFlavor
OtherCompiler :: String -> CompilerFlavor
buildCompilerId :: CompilerId
buildCompilerFlavor :: CompilerFlavor

-- | The default compiler flavour to pick when compiling stuff. This
°5udefaults to the compiler used to build the Cabal lib.
°5u
°5uHowever if it's not a recognised compiler then it's <a>Nothing</a> and
°5uthe user will have to specify which compiler they want.
defaultCompilerFlavor :: Maybe CompilerFlavor

-- | Like <a>classifyCompilerFlavor</a> but compatible with the old ReadS
°5uparser.
°5u
°5uIt is compatible in the sense that it accepts only the same strings,
°5ueg <a>GHC</a> but not "ghc". However other strings get mapped to
°5u<a>OtherCompiler</a>. The point of this is that we do not allow extra
°5uvalid values that would upset older Cabal versions that had a stricter
°5uparser however we cope with new values more gracefully so that we'll
°5ube able to introduce new value in future without breaking things so
°5umuch.
parseCompilerFlavorCompat :: ReadP r CompilerFlavor
classifyCompilerFlavor :: String -> CompilerFlavor
data CompilerId
CompilerId :: CompilerFlavor -> Version -> CompilerId

-- | Compiler information used for resolving configurations. Some fields
°5ucan be set to Nothing to indicate that the information is unknown.
data CompilerInfo
CompilerInfo :: CompilerId -> AbiTag -> Maybe [CompilerId] -> Maybe [Language] -> Maybe [Extension] -> CompilerInfo

-- | Compiler flavour and version.
[compilerInfoId] :: CompilerInfo -> CompilerId

-- | Tag for distinguishing incompatible ABI's on the same architecture/os.
[compilerInfoAbiTag] :: CompilerInfo -> AbiTag

-- | Other implementations that this compiler claims to be compatible with,
°5uif known.
[compilerInfoCompat] :: CompilerInfo -> Maybe [CompilerId]

-- | Supported language standards, if known.
[compilerInfoLanguages] :: CompilerInfo -> Maybe [Language]

-- | Supported extensions, if known.
[compilerInfoExtensions] :: CompilerInfo -> Maybe [Extension]

-- | Make a CompilerInfo of which only the known information is its
°5uCompilerId, its AbiTag and that it does not claim to be compatible
°5uwith other compiler id's.
unknownCompilerInfo :: CompilerId -> AbiTag -> CompilerInfo
data AbiTag
NoAbiTag :: AbiTag
AbiTag :: String -> AbiTag
abiTagString :: AbiTag -> String
instance GHC.Read.Read Distribution.Compiler.CompilerInfo
instance GHC.Show.Show Distribution.Compiler.CompilerInfo
instance GHC.Generics.Generic Distribution.Compiler.CompilerInfo
instance GHC.Read.Read Distribution.Compiler.AbiTag
instance GHC.Show.Show Distribution.Compiler.AbiTag
instance GHC.Generics.Generic Distribution.Compiler.AbiTag
instance GHC.Classes.Eq Distribution.Compiler.AbiTag
instance GHC.Show.Show Distribution.Compiler.CompilerId
instance GHC.Read.Read Distribution.Compiler.CompilerId
instance GHC.Classes.Ord Distribution.Compiler.CompilerId
instance GHC.Generics.Generic Distribution.Compiler.CompilerId
instance GHC.Classes.Eq Distribution.Compiler.CompilerId
instance Data.Data.Data Distribution.Compiler.CompilerFlavor
instance GHC.Classes.Ord Distribution.Compiler.CompilerFlavor
instance GHC.Classes.Eq Distribution.Compiler.CompilerFlavor
instance GHC.Read.Read Distribution.Compiler.CompilerFlavor
instance GHC.Show.Show Distribution.Compiler.CompilerFlavor
instance GHC.Generics.Generic Distribution.Compiler.CompilerFlavor
instance Data.Binary.Class.Binary Distribution.Compiler.CompilerInfo
instance Data.Binary.Class.Binary Distribution.Compiler.AbiTag
instance Distribution.Text.Text Distribution.Compiler.AbiTag
instance Data.Binary.Class.Binary Distribution.Compiler.CompilerId
instance Distribution.Text.Text Distribution.Compiler.CompilerId
instance Data.Binary.Class.Binary Distribution.Compiler.CompilerFlavor
instance Control.DeepSeq.NFData Distribution.Compiler.CompilerFlavor
instance Distribution.Pretty.Pretty Distribution.Compiler.CompilerFlavor
instance Distribution.Parsec.Class.Parsec Distribution.Compiler.CompilerFlavor
instance Distribution.Text.Text Distribution.Compiler.CompilerFlavor


-- | This module provides <tt>newtype</tt> wrappers to be used with
°5u<a>Distribution.FieldGrammar</a>.
module Distribution.Parsec.Newtypes

-- | <a>alaList</a> and <a>alaList'</a> are simply <a>List</a>, with
°5uadditional phantom arguments to constraint the resulting type
°5u
°5u<pre>
°5u&gt;&gt;&gt; :t alaList VCat
°5ualaList VCat :: [a] -&gt; List VCat (Identity a) a
°5u</pre>
°5u
°5u<pre>
°5u&gt;&gt;&gt; :t alaList' FSep Token
°5ualaList' FSep Token :: [String] -&gt; List FSep Token String
°5u</pre>
alaList :: sep -> [a] -> List sep (Identity a) a

-- | More general version of <a>alaList</a>.
alaList' :: sep -> (a -> b) -> [a] -> List sep b a

-- | Vertical list with commas. Displayed with <a>vcat</a>
data CommaVCat
CommaVCat :: CommaVCat

-- | Paragraph fill list with commas. Displayed with <a>fsep</a>
data CommaFSep
CommaFSep :: CommaFSep

-- | Vertical list with optional commas. Displayed with <a>vcat</a>.
data VCat
VCat :: VCat

-- | Paragraph fill list with optional commas. Displayed with <a>fsep</a>.
data FSep
FSep :: FSep

-- | Paragraph fill list without commas. Displayed with <a>fsep</a>.
data NoCommaFSep
NoCommaFSep :: NoCommaFSep

-- | List separated with optional commas. Displayed with <tt>sep</tt>,
°5uarguments of type <tt>a</tt> are parsed and pretty-printed as
°5u<tt>b</tt>.
data List sep b a

-- | Version range or just version, i.e. <tt>cabal-version</tt> field.
°5u
°5uThere are few things to consider:
°5u
°5u<ul>
°5u<li>Starting with 2.2 the cabal-version field should be the first
°5ufield in the file and only exact version is accepted. Therefore if we
°5uget e.g. <tt>&gt;= 2.2</tt>, we fail. See
°5u<a>https://github.com/haskell/cabal/issues/4899</a></li>
°5u</ul>
newtype SpecVersion
SpecVersion :: Either Version VersionRange -> SpecVersion
[getSpecVersion] :: SpecVersion -> Either Version VersionRange

-- | Version range or just version
newtype TestedWith
TestedWith :: (CompilerFlavor, VersionRange) -> TestedWith
[getTestedWith] :: TestedWith -> (CompilerFlavor, VersionRange)

-- | SPDX License expression or legacy license
newtype SpecLicense
SpecLicense :: Either License License -> SpecLicense
[getSpecLicense] :: SpecLicense -> Either License License

-- | Haskell string or <tt>[^ ,]+</tt>
newtype Token
Token :: String -> Token
[getToken] :: Token -> String

-- | Haskell string or <tt>[^ ]+</tt>
newtype Token'
Token' :: String -> Token'
[getToken'] :: Token' -> String

-- | Either <tt>"quoted"</tt> or <tt>un-quoted</tt>.
newtype MQuoted a
MQuoted :: a -> MQuoted a
[getMQuoted] :: MQuoted a -> a

-- | This is <i>almost</i> <tt><a>many</a> <a>anyChar</a></tt>, but it
°5u
°5u<ul>
°5u<li>trims whitespace from ends of the lines,</li>
°5u<li>converts lines with only single dot into empty line.</li>
°5u</ul>
newtype FreeText
FreeText :: String -> FreeText
[getFreeText] :: FreeText -> String

-- | Filepath are parsed as <a>Token</a>.
newtype FilePathNT
FilePathNT :: String -> FilePathNT
[getFilePathNT] :: FilePathNT -> String
instance Distribution.Compat.Newtype.Newtype Distribution.Parsec.Newtypes.FilePathNT GHC.Base.String
instance Distribution.Parsec.Class.Parsec Distribution.Parsec.Newtypes.FilePathNT
instance Distribution.Pretty.Pretty Distribution.Parsec.Newtypes.FilePathNT
instance Distribution.Compat.Newtype.Newtype Distribution.Parsec.Newtypes.FreeText GHC.Base.String
instance Distribution.Parsec.Class.Parsec Distribution.Parsec.Newtypes.FreeText
instance Distribution.Pretty.Pretty Distribution.Parsec.Newtypes.FreeText
instance Distribution.Compat.Newtype.Newtype Distribution.Parsec.Newtypes.TestedWith (Distribution.Compiler.CompilerFlavor, Distribution.Types.VersionRange.VersionRange)
instance Distribution.Parsec.Class.Parsec Distribution.Parsec.Newtypes.TestedWith
instance Distribution.Pretty.Pretty Distribution.Parsec.Newtypes.TestedWith
instance Distribution.Compat.Newtype.Newtype Distribution.Parsec.Newtypes.SpecLicense (Data.Either.Either Distribution.SPDX.License.License Distribution.License.License)
instance Distribution.Parsec.Class.Parsec Distribution.Parsec.Newtypes.SpecLicense
instance Distribution.Pretty.Pretty Distribution.Parsec.Newtypes.SpecLicense
instance Distribution.Compat.Newtype.Newtype Distribution.Parsec.Newtypes.SpecVersion (Data.Either.Either Distribution.Types.Version.Version Distribution.Types.VersionRange.VersionRange)
instance Distribution.Parsec.Class.Parsec Distribution.Parsec.Newtypes.SpecVersion
instance Distribution.Pretty.Pretty Distribution.Parsec.Newtypes.SpecVersion
instance Distribution.Compat.Newtype.Newtype (Distribution.Parsec.Newtypes.MQuoted a) a
instance Distribution.Parsec.Class.Parsec a => Distribution.Parsec.Class.Parsec (Distribution.Parsec.Newtypes.MQuoted a)
instance Distribution.Pretty.Pretty a => Distribution.Pretty.Pretty (Distribution.Parsec.Newtypes.MQuoted a)
instance Distribution.Compat.Newtype.Newtype Distribution.Parsec.Newtypes.Token' GHC.Base.String
instance Distribution.Parsec.Class.Parsec Distribution.Parsec.Newtypes.Token'
instance Distribution.Pretty.Pretty Distribution.Parsec.Newtypes.Token'
instance Distribution.Compat.Newtype.Newtype Distribution.Parsec.Newtypes.Token GHC.Base.String
instance Distribution.Parsec.Class.Parsec Distribution.Parsec.Newtypes.Token
instance Distribution.Pretty.Pretty Distribution.Parsec.Newtypes.Token
instance Distribution.Compat.Newtype.Newtype (Distribution.Parsec.Newtypes.List sep wrapper a) [a]
instance (Distribution.Compat.Newtype.Newtype b a, Distribution.Parsec.Newtypes.Sep sep, Distribution.Parsec.Class.Parsec b) => Distribution.Parsec.Class.Parsec (Distribution.Parsec.Newtypes.List sep b a)
instance (Distribution.Compat.Newtype.Newtype b a, Distribution.Parsec.Newtypes.Sep sep, Distribution.Pretty.Pretty b) => Distribution.Pretty.Pretty (Distribution.Parsec.Newtypes.List sep b a)
instance Distribution.Parsec.Newtypes.Sep Distribution.Parsec.Newtypes.CommaVCat
instance Distribution.Parsec.Newtypes.Sep Distribution.Parsec.Newtypes.CommaFSep
instance Distribution.Parsec.Newtypes.Sep Distribution.Parsec.Newtypes.VCat
instance Distribution.Parsec.Newtypes.Sep Distribution.Parsec.Newtypes.FSep
instance Distribution.Parsec.Newtypes.Sep Distribution.Parsec.Newtypes.NoCommaFSep

module Distribution.Types.PackageName

-- | A package name.
°5u
°5uUse <a>mkPackageName</a> and <a>unPackageName</a> to convert from/to a
°5u<a>String</a>.
°5u
°5uThis type is opaque since <tt>Cabal-2.0</tt>
data PackageName

-- | Convert <a>PackageName</a> to <a>String</a>
unPackageName :: PackageName -> String

-- | Construct a <a>PackageName</a> from a <a>String</a>
°5u
°5u<a>mkPackageName</a> is the inverse to <a>unPackageName</a>
°5u
°5uNote: No validations are performed to ensure that the resulting
°5u<a>PackageName</a> is valid
mkPackageName :: String -> PackageName
instance Data.Data.Data Distribution.Types.PackageName.PackageName
instance GHC.Classes.Ord Distribution.Types.PackageName.PackageName
instance GHC.Classes.Eq Distribution.Types.PackageName.PackageName
instance GHC.Show.Show Distribution.Types.PackageName.PackageName
instance GHC.Read.Read Distribution.Types.PackageName.PackageName
instance GHC.Generics.Generic Distribution.Types.PackageName.PackageName
instance Data.String.IsString Distribution.Types.PackageName.PackageName
instance Data.Binary.Class.Binary Distribution.Types.PackageName.PackageName
instance Distribution.Pretty.Pretty Distribution.Types.PackageName.PackageName
instance Distribution.Parsec.Class.Parsec Distribution.Types.PackageName.PackageName
instance Distribution.Text.Text Distribution.Types.PackageName.PackageName
instance Control.DeepSeq.NFData Distribution.Types.PackageName.PackageName

module Distribution.Types.UnqualComponentName

-- | An unqualified component name, for any kind of component.
°5u
°5uThis is distinguished from a <tt>ComponentName</tt> and
°5u<tt>ComponentId</tt>. The former also states which of a library,
°5uexecutable, etc the name refers too. The later uniquely identifiers a
°5ucomponent and its closure.
data UnqualComponentName

-- | Convert <a>UnqualComponentName</a> to <a>String</a>
unUnqualComponentName :: UnqualComponentName -> String

-- | Construct a <a>UnqualComponentName</a> from a <a>String</a>
°5u
°5u<a>mkUnqualComponentName</a> is the inverse to
°5u<a>unUnqualComponentName</a>
°5u
°5uNote: No validations are performed to ensure that the resulting
°5u<a>UnqualComponentName</a> is valid
mkUnqualComponentName :: String -> UnqualComponentName

-- | Converts a package name to an unqualified component name
°5u
°5uUseful in legacy situations where a package name may refer to an
°5uinternal component, if one is defined with that name.
packageNameToUnqualComponentName :: PackageName -> UnqualComponentName

-- | Converts an unqualified component name to a package name
°5u
°5u<a>packageNameToUnqualComponentName</a> is the inverse of
°5u<a>unqualComponentNameToPackageName</a>.
°5u
°5uUseful in legacy situations where a package name may refer to an
°5uinternal component, if one is defined with that name.
unqualComponentNameToPackageName :: UnqualComponentName -> PackageName
instance GHC.Base.Monoid Distribution.Types.UnqualComponentName.UnqualComponentName
instance GHC.Base.Semigroup Distribution.Types.UnqualComponentName.UnqualComponentName
instance Data.Data.Data Distribution.Types.UnqualComponentName.UnqualComponentName
instance GHC.Classes.Ord Distribution.Types.UnqualComponentName.UnqualComponentName
instance GHC.Classes.Eq Distribution.Types.UnqualComponentName.UnqualComponentName
instance GHC.Show.Show Distribution.Types.UnqualComponentName.UnqualComponentName
instance GHC.Read.Read Distribution.Types.UnqualComponentName.UnqualComponentName
instance GHC.Generics.Generic Distribution.Types.UnqualComponentName.UnqualComponentName
instance Data.String.IsString Distribution.Types.UnqualComponentName.UnqualComponentName
instance Data.Binary.Class.Binary Distribution.Types.UnqualComponentName.UnqualComponentName
instance Distribution.Pretty.Pretty Distribution.Types.UnqualComponentName.UnqualComponentName
instance Distribution.Parsec.Class.Parsec Distribution.Types.UnqualComponentName.UnqualComponentName
instance Distribution.Text.Text Distribution.Types.UnqualComponentName.UnqualComponentName
instance Control.DeepSeq.NFData Distribution.Types.UnqualComponentName.UnqualComponentName

module Distribution.Types.ComponentName
data ComponentName
CLibName :: ComponentName
CSubLibName :: UnqualComponentName -> ComponentName
CFLibName :: UnqualComponentName -> ComponentName
CExeName :: UnqualComponentName -> ComponentName
CTestName :: UnqualComponentName -> ComponentName
CBenchName :: UnqualComponentName -> ComponentName
defaultLibName :: ComponentName

-- | Convert the <a>UnqualComponentName</a> of a library into a
°5u<a>ComponentName</a>.
libraryComponentName :: Maybe UnqualComponentName -> ComponentName
showComponentName :: ComponentName -> String
componentNameStanza :: ComponentName -> String

-- | This gets the underlying unqualified component name. In fact, it is
°5uguaranteed to uniquely identify a component, returning
°5u<tt>Nothing</tt> if the <a>ComponentName</a> was for the public
°5ulibrary.
componentNameString :: ComponentName -> Maybe UnqualComponentName
instance GHC.Show.Show Distribution.Types.ComponentName.ComponentName
instance GHC.Read.Read Distribution.Types.ComponentName.ComponentName
instance GHC.Classes.Ord Distribution.Types.ComponentName.ComponentName
instance GHC.Generics.Generic Distribution.Types.ComponentName.ComponentName
instance GHC.Classes.Eq Distribution.Types.ComponentName.ComponentName
instance Data.Binary.Class.Binary Distribution.Types.ComponentName.ComponentName
instance Distribution.Pretty.Pretty Distribution.Types.ComponentName.ComponentName
instance Distribution.Text.Text Distribution.Types.ComponentName.ComponentName

module Distribution.Types.PackageId

-- | The name and version of a package.
data PackageIdentifier
PackageIdentifier :: PackageName -> Version -> PackageIdentifier

-- | The name of this package, eg. foo
[pkgName] :: PackageIdentifier -> PackageName

-- | the version of this package, eg 1.2
[pkgVersion] :: PackageIdentifier -> Version

-- | Type alias so we can use the shorter name PackageId.
type PackageId = PackageIdentifier
instance Data.Data.Data Distribution.Types.PackageId.PackageIdentifier
instance GHC.Classes.Ord Distribution.Types.PackageId.PackageIdentifier
instance GHC.Classes.Eq Distribution.Types.PackageId.PackageIdentifier
instance GHC.Show.Show Distribution.Types.PackageId.PackageIdentifier
instance GHC.Read.Read Distribution.Types.PackageId.PackageIdentifier
instance GHC.Generics.Generic Distribution.Types.PackageId.PackageIdentifier
instance Data.Binary.Class.Binary Distribution.Types.PackageId.PackageIdentifier
instance Distribution.Pretty.Pretty Distribution.Types.PackageId.PackageIdentifier
instance Distribution.Text.Text Distribution.Types.PackageId.PackageIdentifier
instance Control.DeepSeq.NFData Distribution.Types.PackageId.PackageIdentifier

module Distribution.Types.UnitId

-- | A unit identifier identifies a (possibly instantiated)
°5upackage/component that can be installed the installed package
°5udatabase. There are several types of components that can be installed:
°5u
°5u<ul>
°5u<li>A traditional library with no holes, so that <tt>unitIdHash</tt>
°5uis <tt>Nothing</tt>. In the absence of Backpack, <a>UnitId</a> is the
°5usame as a <a>ComponentId</a>.</li>
°5u<li>An indefinite, Backpack library with holes. In this case,
°5u<tt>unitIdHash</tt> is still <tt>Nothing</tt>, but in the install,
°5uthere are only interfaces, no compiled objects.</li>
°5u<li>An instantiated Backpack library with all the holes filled in.
°5u<tt>unitIdHash</tt> is a <tt>Just</tt> a hash of the instantiating
°5umapping.</li>
°5u</ul>
°5u
°5uA unit is a component plus the additional information on how the holes
°5uare filled in. Thus there is a one to many relationship: for a
°5uparticular component there are many different ways of filling in the
°5uholes, and each different combination is a unit (and has a separate
°5u<a>UnitId</a>).
°5u
°5u<a>UnitId</a> is distinct from <tt>OpenUnitId</tt>, in that it is
°5ualways installed, whereas <tt>OpenUnitId</tt> are intermediate unit
°5uidentities that arise during mixin linking, and don't necessarily
°5ucorrespond to any actually installed unit. Since the mapping is not
°5uactually recorded in a <a>UnitId</a>, you can't actually substitute
°5uover them (but you can substitute over <tt>OpenUnitId</tt>). See also
°5u<a>Distribution.Backpack.FullUnitId</a> for a mechanism for expanding
°5uan instantiated <a>UnitId</a> to retrieve its mapping.
°5u
°5uBackwards compatibility note: if you need to get the string
°5urepresentation of a UnitId to pass, e.g., as a <tt>-package-id</tt>
°5uflag, use the <a>display</a> function, which will work on all versions
°5uof Cabal.
data UnitId

-- | If you need backwards compatibility, consider using <a>display</a>
°5uinstead, which is supported by all versions of Cabal.
unUnitId :: UnitId -> String
mkUnitId :: String -> UnitId

-- | A <a>UnitId</a> for a definite package. The <a>DefUnitId</a> invariant
°5usays that a <a>UnitId</a> identified this way is definite; i.e., it
°5uhas no unfilled holes.
data DefUnitId

-- | Unsafely create a <a>DefUnitId</a> from a <a>UnitId</a>. Your
°5uresponsibility is to ensure that the <a>DefUnitId</a> invariant holds.
unsafeMkDefUnitId :: UnitId -> DefUnitId
unDefUnitId :: DefUnitId -> UnitId

-- | Create a unit identity with no associated hash directly from a
°5u<a>ComponentId</a>.
newSimpleUnitId :: ComponentId -> UnitId

-- | Make an old-style UnitId from a package identifier. Assumed to be for
°5uthe public library
mkLegacyUnitId :: PackageId -> UnitId

-- | Returns library name prefixed with HS, suitable for filenames
getHSLibraryName :: UnitId -> String

-- | <i>Deprecated: Use UnitId instead. This symbol will be removed in
°5uCabal-3.0 (est. Oct 2018).</i>
type InstalledPackageId = UnitId
instance Distribution.Text.Text Distribution.Types.UnitId.DefUnitId
instance Distribution.Pretty.Pretty Distribution.Types.UnitId.DefUnitId
instance Control.DeepSeq.NFData Distribution.Types.UnitId.DefUnitId
instance Data.Binary.Class.Binary Distribution.Types.UnitId.DefUnitId
instance Data.Data.Data Distribution.Types.UnitId.DefUnitId
instance GHC.Classes.Ord Distribution.Types.UnitId.DefUnitId
instance GHC.Classes.Eq Distribution.Types.UnitId.DefUnitId
instance GHC.Show.Show Distribution.Types.UnitId.DefUnitId
instance GHC.Read.Read Distribution.Types.UnitId.DefUnitId
instance GHC.Generics.Generic Distribution.Types.UnitId.DefUnitId
instance Control.DeepSeq.NFData Distribution.Types.UnitId.UnitId
instance Data.Data.Data Distribution.Types.UnitId.UnitId
instance GHC.Classes.Ord Distribution.Types.UnitId.UnitId
instance GHC.Classes.Eq Distribution.Types.UnitId.UnitId
instance GHC.Show.Show Distribution.Types.UnitId.UnitId
instance GHC.Read.Read Distribution.Types.UnitId.UnitId
instance GHC.Generics.Generic Distribution.Types.UnitId.UnitId
instance Distribution.Parsec.Class.Parsec Distribution.Types.UnitId.DefUnitId
instance Data.Binary.Class.Binary Distribution.Types.UnitId.UnitId
instance Distribution.Pretty.Pretty Distribution.Types.UnitId.UnitId
instance Distribution.Parsec.Class.Parsec Distribution.Types.UnitId.UnitId
instance Distribution.Text.Text Distribution.Types.UnitId.UnitId
instance Data.String.IsString Distribution.Types.UnitId.UnitId

module Distribution.Types.Module

-- | A module identity uniquely identifies a Haskell module by qualifying a
°5u<a>ModuleName</a> with the <a>UnitId</a> which defined it. This type
°5udistinguishes between two packages which provide a module with the
°5usame name, or a module from the same package compiled with different
°5udependencies. There are a few cases where Cabal needs to know about
°5umodule identities, e.g., when writing out reexported modules in the
°5u<tt>InstalledPackageInfo</tt>.
data Module
Module :: DefUnitId -> ModuleName -> Module
instance Data.Data.Data Distribution.Types.Module.Module
instance GHC.Classes.Ord Distribution.Types.Module.Module
instance GHC.Classes.Eq Distribution.Types.Module.Module
instance GHC.Show.Show Distribution.Types.Module.Module
instance GHC.Read.Read Distribution.Types.Module.Module
instance GHC.Generics.Generic Distribution.Types.Module.Module
instance Data.Binary.Class.Binary Distribution.Types.Module.Module
instance Distribution.Pretty.Pretty Distribution.Types.Module.Module
instance Distribution.Parsec.Class.Parsec Distribution.Types.Module.Module
instance Distribution.Text.Text Distribution.Types.Module.Module
instance Control.DeepSeq.NFData Distribution.Types.Module.Module


-- | This module defines the core data types for Backpack. For more
°5udetails, see:
°5u
°5u
°5u<a>https://github.com/ezyang/ghc-proposals/blob/backpack/proposals/0000-backpack.rst</a>
module Distribution.Backpack

-- | An <a>OpenUnitId</a> describes a (possibly partially) instantiated
°5uBackpack component, with a description of how the holes are filled in.
°5uUnlike <a>OpenUnitId</a>, the <tt>ModuleSubst</tt> is kept in a
°5ustructured form that allows for substitution (which fills in holes.)
°5uThis form of unit cannot be installed. It must first be converted to a
°5u<a>UnitId</a>.
°5u
°5uIn the absence of Backpack, there are no holes to fill, so any such
°5ucomponent always has an empty module substitution; thus we can lossly
°5urepresent it as an 'OpenUnitId uid'.
°5u
°5uFor a source component using Backpack, however, there is more
°5ustructure as components may be parametrized over some signatures, and
°5uthese "holes" may be partially or wholly filled.
°5u
°5uOpenUnitId plays an important role when we are mix-in linking, and is
°5urecorded to the installed packaged database for indefinite packages;
°5uhowever, for compiled packages that are fully instantiated, we
°5uinstantiate <a>OpenUnitId</a> into <a>UnitId</a>.
°5u
°5uFor more details see the Backpack spec
°5u<a>https://github.com/ezyang/ghc-proposals/blob/backpack/proposals/0000-backpack.rst</a>
data OpenUnitId

-- | Identifies a component which may have some unfilled holes; specifying
°5uits <a>ComponentId</a> and its <a>OpenModuleSubst</a>. TODO: Invariant
°5uthat <a>OpenModuleSubst</a> is non-empty? See also the Text instance.
IndefFullUnitId :: ComponentId -> OpenModuleSubst -> OpenUnitId

-- | Identifies a fully instantiated component, which has been compiled and
°5uabbreviated as a hash. The embedded <a>UnitId</a> MUST NOT be for an
°5uindefinite component; an <a>OpenUnitId</a> is guaranteed not to have
°5uany holes.
DefiniteUnitId :: DefUnitId -> OpenUnitId

-- | Get the set of holes (<tt>ModuleVar</tt>) embedded in a <a>UnitId</a>.
openUnitIdFreeHoles :: OpenUnitId -> Set ModuleName

-- | Safe constructor from a UnitId. The only way to do this safely is if
°5uthe instantiation is provided.
mkOpenUnitId :: UnitId -> ComponentId -> OpenModuleSubst -> OpenUnitId

-- | A <a>UnitId</a> for a definite package. The <a>DefUnitId</a> invariant
°5usays that a <a>UnitId</a> identified this way is definite; i.e., it
°5uhas no unfilled holes.
data DefUnitId
unDefUnitId :: DefUnitId -> UnitId

-- | Create a <a>DefUnitId</a> from a <a>ComponentId</a> and an
°5uinstantiation with no holes.
mkDefUnitId :: ComponentId -> Map ModuleName Module -> DefUnitId

-- | Unlike a <a>Module</a>, an <a>OpenModule</a> is either an ordinary
°5umodule from some unit, OR an <a>OpenModuleVar</a>, representing a hole
°5uthat needs to be filled in. Substitutions are over module variables.
data OpenModule
OpenModule :: OpenUnitId -> ModuleName -> OpenModule
OpenModuleVar :: ModuleName -> OpenModule

-- | Get the set of holes (<tt>ModuleVar</tt>) embedded in a <a>Module</a>.
openModuleFreeHoles :: OpenModule -> Set ModuleName

-- | An explicit substitution on modules.
°5u
°5uNB: These substitutions are NOT idempotent, for example, a valid
°5usubstitution is (A -&gt; B, B -&gt; A).
type OpenModuleSubst = Map ModuleName OpenModule

-- | Pretty-print the entries of a module substitution, suitable for
°5uembedding into a <a>OpenUnitId</a> or passing to GHC via
°5u<tt>--instantiate-with</tt>.
dispOpenModuleSubst :: OpenModuleSubst -> Doc

-- | Pretty-print a single entry of a module substitution.
dispOpenModuleSubstEntry :: (ModuleName, OpenModule) -> Doc

-- | Inverse to <tt>dispModSubst</tt>.
parseOpenModuleSubst :: ReadP r OpenModuleSubst

-- | Inverse to <tt>dispModSubstEntry</tt>.
parseOpenModuleSubstEntry :: ReadP r (ModuleName, OpenModule)

-- | Inverse to <tt>dispModSubst</tt>.
parsecOpenModuleSubst :: CabalParsing m => m OpenModuleSubst

-- | Inverse to <tt>dispModSubstEntry</tt>.
parsecOpenModuleSubstEntry :: CabalParsing m => m (ModuleName, OpenModule)

-- | Get the set of holes (<tt>ModuleVar</tt>) embedded in a
°5u<a>OpenModuleSubst</a>. This is NOT the domain of the substitution.
openModuleSubstFreeHoles :: OpenModuleSubst -> Set ModuleName

-- | When typechecking, we don't demand that a freshly instantiated
°5u<a>IndefFullUnitId</a> be compiled; instead, we just depend on the
°5uinstalled indefinite unit installed at the <a>ComponentId</a>.
abstractUnitId :: OpenUnitId -> UnitId

-- | Take a module substitution and hash it into a string suitable for
°5u<a>UnitId</a>. Note that since this takes <a>Module</a>, not
°5u<a>OpenModule</a>, you are responsible for recursively converting
°5u<a>OpenModule</a> into <a>Module</a>. See also
°5u<a>Distribution.Backpack.ReadyComponent</a>.
hashModuleSubst :: Map ModuleName Module -> Maybe String
instance Data.Data.Data Distribution.Backpack.OpenUnitId
instance GHC.Classes.Ord Distribution.Backpack.OpenUnitId
instance GHC.Classes.Eq Distribution.Backpack.OpenUnitId
instance GHC.Show.Show Distribution.Backpack.OpenUnitId
instance GHC.Read.Read Distribution.Backpack.OpenUnitId
instance GHC.Generics.Generic Distribution.Backpack.OpenUnitId
instance Data.Data.Data Distribution.Backpack.OpenModule
instance GHC.Classes.Ord Distribution.Backpack.OpenModule
instance GHC.Classes.Eq Distribution.Backpack.OpenModule
instance GHC.Show.Show Distribution.Backpack.OpenModule
instance GHC.Read.Read Distribution.Backpack.OpenModule
instance GHC.Generics.Generic Distribution.Backpack.OpenModule
instance Data.Binary.Class.Binary Distribution.Backpack.OpenUnitId
instance Control.DeepSeq.NFData Distribution.Backpack.OpenUnitId
instance Distribution.Pretty.Pretty Distribution.Backpack.OpenUnitId
instance Distribution.Parsec.Class.Parsec Distribution.Backpack.OpenUnitId
instance Distribution.Text.Text Distribution.Backpack.OpenUnitId
instance Data.Binary.Class.Binary Distribution.Backpack.OpenModule
instance Control.DeepSeq.NFData Distribution.Backpack.OpenModule
instance Distribution.Pretty.Pretty Distribution.Backpack.OpenModule
instance Distribution.Parsec.Class.Parsec Distribution.Backpack.OpenModule
instance Distribution.Text.Text Distribution.Backpack.OpenModule


-- | A type class <a>ModSubst</a> for objects which can have
°5u<tt>ModuleSubst</tt> applied to them.
°5u
°5uSee also
°5u<a>https://github.com/ezyang/ghc-proposals/blob/backpack/proposals/0000-backpack.rst</a>
module Distribution.Backpack.ModSubst

-- | Applying module substitutions to semantic objects.
class ModSubst a
modSubst :: ModSubst a => OpenModuleSubst -> a -> a
instance Distribution.Backpack.ModSubst.ModSubst Distribution.Backpack.OpenModule
instance Distribution.Backpack.ModSubst.ModSubst Distribution.Backpack.OpenUnitId
instance Distribution.Backpack.ModSubst.ModSubst (Data.Set.Internal.Set Distribution.ModuleName.ModuleName)
instance Distribution.Backpack.ModSubst.ModSubst a => Distribution.Backpack.ModSubst.ModSubst (Data.Map.Internal.Map k a)
instance Distribution.Backpack.ModSubst.ModSubst a => Distribution.Backpack.ModSubst.ModSubst [a]
instance Distribution.Backpack.ModSubst.ModSubst a => Distribution.Backpack.ModSubst.ModSubst (k, a)

module Distribution.Backpack.FullUnitId
data FullUnitId
FullUnitId :: ComponentId -> OpenModuleSubst -> FullUnitId
type FullDb = DefUnitId -> FullUnitId
expandOpenUnitId :: FullDb -> OpenUnitId -> FullUnitId
expandUnitId :: FullDb -> DefUnitId -> FullUnitId
instance GHC.Generics.Generic Distribution.Backpack.FullUnitId.FullUnitId
instance GHC.Show.Show Distribution.Backpack.FullUnitId.FullUnitId

module Distribution.Types.PackageId.Lens

-- | The name and version of a package.
data PackageIdentifier
pkgName :: Lens' PackageIdentifier PackageName
pkgVersion :: Lens' PackageIdentifier Version

module Distribution.Types.ModuleReexport
data ModuleReexport
ModuleReexport :: Maybe PackageName -> ModuleName -> ModuleName -> ModuleReexport
[moduleReexportOriginalPackage] :: ModuleReexport -> Maybe PackageName
[moduleReexportOriginalName] :: ModuleReexport -> ModuleName
[moduleReexportName] :: ModuleReexport -> ModuleName
instance Data.Data.Data Distribution.Types.ModuleReexport.ModuleReexport
instance GHC.Show.Show Distribution.Types.ModuleReexport.ModuleReexport
instance GHC.Read.Read Distribution.Types.ModuleReexport.ModuleReexport
instance GHC.Generics.Generic Distribution.Types.ModuleReexport.ModuleReexport
instance GHC.Classes.Eq Distribution.Types.ModuleReexport.ModuleReexport
instance Data.Binary.Class.Binary Distribution.Types.ModuleReexport.ModuleReexport
instance Control.DeepSeq.NFData Distribution.Types.ModuleReexport.ModuleReexport
instance Distribution.Pretty.Pretty Distribution.Types.ModuleReexport.ModuleReexport
instance Distribution.Parsec.Class.Parsec Distribution.Types.ModuleReexport.ModuleReexport
instance Distribution.Text.Text Distribution.Types.ModuleReexport.ModuleReexport

module Distribution.Types.Mixin
data Mixin
Mixin :: PackageName -> IncludeRenaming -> Mixin
[mixinPackageName] :: Mixin -> PackageName
[mixinIncludeRenaming] :: Mixin -> IncludeRenaming
instance GHC.Generics.Generic Distribution.Types.Mixin.Mixin
instance Data.Data.Data Distribution.Types.Mixin.Mixin
instance GHC.Classes.Ord Distribution.Types.Mixin.Mixin
instance GHC.Classes.Eq Distribution.Types.Mixin.Mixin
instance GHC.Read.Read Distribution.Types.Mixin.Mixin
instance GHC.Show.Show Distribution.Types.Mixin.Mixin
instance Data.Binary.Class.Binary Distribution.Types.Mixin.Mixin
instance Control.DeepSeq.NFData Distribution.Types.Mixin.Mixin
instance Distribution.Pretty.Pretty Distribution.Types.Mixin.Mixin
instance Distribution.Parsec.Class.Parsec Distribution.Types.Mixin.Mixin
instance Distribution.Text.Text Distribution.Types.Mixin.Mixin

module Distribution.Types.ExeDependency

-- | Describes a dependency on an executable from a package
data ExeDependency
ExeDependency :: PackageName -> UnqualComponentName -> VersionRange -> ExeDependency
qualifiedExeName :: ExeDependency -> ComponentName
instance Data.Data.Data Distribution.Types.ExeDependency.ExeDependency
instance GHC.Classes.Eq Distribution.Types.ExeDependency.ExeDependency
instance GHC.Show.Show Distribution.Types.ExeDependency.ExeDependency
instance GHC.Read.Read Distribution.Types.ExeDependency.ExeDependency
instance GHC.Generics.Generic Distribution.Types.ExeDependency.ExeDependency
instance Data.Binary.Class.Binary Distribution.Types.ExeDependency.ExeDependency
instance Control.DeepSeq.NFData Distribution.Types.ExeDependency.ExeDependency
instance Distribution.Pretty.Pretty Distribution.Types.ExeDependency.ExeDependency
instance Distribution.Parsec.Class.Parsec Distribution.Types.ExeDependency.ExeDependency
instance Distribution.Text.Text Distribution.Types.ExeDependency.ExeDependency

module Distribution.Types.Dependency

-- | Describes a dependency on a source package (API)
data Dependency
Dependency :: PackageName -> VersionRange -> Dependency
depPkgName :: Dependency -> PackageName
depVerRange :: Dependency -> VersionRange
thisPackageVersion :: PackageIdentifier -> Dependency
notThisPackageVersion :: PackageIdentifier -> Dependency

-- | Simplify the <a>VersionRange</a> expression in a <a>Dependency</a>.
°5uSee <a>simplifyVersionRange</a>.
simplifyDependency :: Dependency -> Dependency
instance Data.Data.Data Distribution.Types.Dependency.Dependency
instance GHC.Classes.Eq Distribution.Types.Dependency.Dependency
instance GHC.Show.Show Distribution.Types.Dependency.Dependency
instance GHC.Read.Read Distribution.Types.Dependency.Dependency
instance GHC.Generics.Generic Distribution.Types.Dependency.Dependency
instance Data.Binary.Class.Binary Distribution.Types.Dependency.Dependency
instance Control.DeepSeq.NFData Distribution.Types.Dependency.Dependency
instance Distribution.Pretty.Pretty Distribution.Types.Dependency.Dependency
instance Distribution.Parsec.Class.Parsec Distribution.Types.Dependency.Dependency
instance Distribution.Text.Text Distribution.Types.Dependency.Dependency

module Distribution.Types.SetupBuildInfo
data SetupBuildInfo
SetupBuildInfo :: [Dependency] -> Bool -> SetupBuildInfo
[setupDepends] :: SetupBuildInfo -> [Dependency]

-- | Is this a default 'custom-setup' section added by the cabal-install
°5ucode (as opposed to user-provided)? This field is only used
°5uinternally, and doesn't correspond to anything in the .cabal file. See
°5u#3199.
[defaultSetupDepends] :: SetupBuildInfo -> Bool
instance Data.Data.Data Distribution.Types.SetupBuildInfo.SetupBuildInfo
instance GHC.Read.Read Distribution.Types.SetupBuildInfo.SetupBuildInfo
instance GHC.Classes.Eq Distribution.Types.SetupBuildInfo.SetupBuildInfo
instance GHC.Show.Show Distribution.Types.SetupBuildInfo.SetupBuildInfo
instance GHC.Generics.Generic Distribution.Types.SetupBuildInfo.SetupBuildInfo
instance Data.Binary.Class.Binary Distribution.Types.SetupBuildInfo.SetupBuildInfo
instance Control.DeepSeq.NFData Distribution.Types.SetupBuildInfo.SetupBuildInfo
instance GHC.Base.Monoid Distribution.Types.SetupBuildInfo.SetupBuildInfo
instance GHC.Base.Semigroup Distribution.Types.SetupBuildInfo.SetupBuildInfo

module Distribution.Types.SetupBuildInfo.Lens
data SetupBuildInfo
setupDepends :: Lens' SetupBuildInfo [Dependency]
defaultSetupDepends :: Lens' SetupBuildInfo Bool

module Distribution.Types.DependencyMap

-- | A map of dependencies. Newtyped since the default monoid instance is
°5unot appropriate. The monoid instance uses
°5u<a>intersectVersionRanges</a>.
data DependencyMap
toDepMap :: [Dependency] -> DependencyMap
fromDepMap :: DependencyMap -> [Dependency]
constrainBy :: DependencyMap -> DependencyMap -> DependencyMap
instance GHC.Read.Read Distribution.Types.DependencyMap.DependencyMap
instance GHC.Show.Show Distribution.Types.DependencyMap.DependencyMap
instance GHC.Base.Monoid Distribution.Types.DependencyMap.DependencyMap
instance GHC.Base.Semigroup Distribution.Types.DependencyMap.DependencyMap

module Distribution.Types.MungedPackageName

-- | A combination of a package and component name used in various legacy
°5uinterfaces, chiefly bundled with a version as
°5u<tt>MungedPackageId</tt>. It's generally better to use a
°5u<tt>UnitId</tt> to opaquely refer to some compilation/packing unit,
°5ubut that doesn't always work, e.g. where a "name" is needed, in which
°5ucase this can be used as a fallback.
°5u
°5uUse <a>mkMungedPackageName</a> and <a>unMungedPackageName</a> to
°5uconvert from/to a <a>String</a>.
data MungedPackageName

-- | Convert <a>MungedPackageName</a> to <a>String</a>
unMungedPackageName :: MungedPackageName -> String

-- | Construct a <a>MungedPackageName</a> from a <a>String</a>
°5u
°5u<a>mkMungedPackageName</a> is the inverse to
°5u<a>unMungedPackageName</a>
°5u
°5uNote: No validations are performed to ensure that the resulting
°5u<a>MungedPackageName</a> is valid
mkMungedPackageName :: String -> MungedPackageName

-- | Computes the package name for a library. If this is the public
°5ulibrary, it will just be the original package name; otherwise, it will
°5ube a munged package name recording the original package name as well
°5uas the name of the internal library.
°5u
°5uA lot of tooling in the Haskell ecosystem assumes that if something is
°5uinstalled to the package database with the package name <tt>foo</tt>,
°5uthen it actually is an entry for the (only public) library in package
°5u<tt>foo</tt>. With internal packages, this is not necessarily true: a
°5upublic library as well as arbitrarily many internal libraries may come
°5ufrom the same package. To prevent tools from getting confused in this
°5ucase, the package name of these internal libraries is munged so that
°5uthey do not conflict the public library proper. A particular case
°5uwhere this matters is ghc-pkg: if we don't munge the package name, the
°5uinplace registration will OVERRIDE a different internal library.
°5u
°5uWe munge into a reserved namespace, "z-", and encode both the
°5ucomponent name and the package name of an internal library using the
°5ufollowing format:
°5u
°5ucompat-pkg-name ::= "z-" package-name "-z-" library-name
°5u
°5uwhere package-name and library-name have "-" ( "z" + ) "-" segments
°5uencoded by adding an extra "z".
°5u
°5uWhen we have the public library, the compat-pkg-name is just the
°5upackage-name, no surprises there!
computeCompatPackageName :: PackageName -> Maybe UnqualComponentName -> MungedPackageName
decodeCompatPackageName :: MungedPackageName -> (PackageName, Maybe UnqualComponentName)
instance Data.Data.Data Distribution.Types.MungedPackageName.MungedPackageName
instance GHC.Classes.Ord Distribution.Types.MungedPackageName.MungedPackageName
instance GHC.Classes.Eq Distribution.Types.MungedPackageName.MungedPackageName
instance GHC.Show.Show Distribution.Types.MungedPackageName.MungedPackageName
instance GHC.Read.Read Distribution.Types.MungedPackageName.MungedPackageName
instance GHC.Generics.Generic Distribution.Types.MungedPackageName.MungedPackageName
instance Data.String.IsString Distribution.Types.MungedPackageName.MungedPackageName
instance Data.Binary.Class.Binary Distribution.Types.MungedPackageName.MungedPackageName
instance Distribution.Pretty.Pretty Distribution.Types.MungedPackageName.MungedPackageName
instance Distribution.Parsec.Class.Parsec Distribution.Types.MungedPackageName.MungedPackageName
instance Distribution.Text.Text Distribution.Types.MungedPackageName.MungedPackageName
instance Control.DeepSeq.NFData Distribution.Types.MungedPackageName.MungedPackageName

module Distribution.Types.MungedPackageId

-- | A simple pair of a <a>MungedPackageName</a> and <a>Version</a>.
°5u<a>MungedPackageName</a> is to <a>MungedPackageId</a> as
°5u<tt>PackageName</tt> is to <a>PackageId</a>. See
°5u<a>MungedPackageName</a> for more info.
data MungedPackageId
MungedPackageId :: MungedPackageName -> Version -> MungedPackageId

-- | The combined package and component name. see documentation for
°5u<a>MungedPackageName</a>.
[mungedName] :: MungedPackageId -> MungedPackageName

-- | The version of this package / component, eg 1.2
[mungedVersion] :: MungedPackageId -> Version

-- | See docs for <a>computeCompatPackageId</a>. this is a thin wrapper
°5uaround that.
computeCompatPackageId :: PackageId -> Maybe UnqualComponentName -> MungedPackageId
instance Data.Data.Data Distribution.Types.MungedPackageId.MungedPackageId
instance GHC.Classes.Ord Distribution.Types.MungedPackageId.MungedPackageId
instance GHC.Classes.Eq Distribution.Types.MungedPackageId.MungedPackageId
instance GHC.Show.Show Distribution.Types.MungedPackageId.MungedPackageId
instance GHC.Read.Read Distribution.Types.MungedPackageId.MungedPackageId
instance GHC.Generics.Generic Distribution.Types.MungedPackageId.MungedPackageId
instance Data.Binary.Class.Binary Distribution.Types.MungedPackageId.MungedPackageId
instance Distribution.Text.Text Distribution.Types.MungedPackageId.MungedPackageId
instance Control.DeepSeq.NFData Distribution.Types.MungedPackageId.MungedPackageId


-- | Defines a package identifier along with a parser and pretty printer
°5ufor it. <a>PackageIdentifier</a>s consist of a name and an exact
°5uversion. It also defines a <a>Dependency</a> data type. A dependency
°5uis a package name and a version range, like <tt>"foo &gt;= 1.2
°5u&amp;&amp; &lt; 2"</tt>.
module Distribution.Package

-- | Class of things that have a <a>PackageIdentifier</a>
°5u
°5uTypes in this class are all notions of a package. This allows us to
°5uhave different types for the different phases that packages go though,
°5ufrom simple name/id, package description, configured or installed
°5upackages.
°5u
°5uNot all kinds of packages can be uniquely identified by a
°5u<a>PackageIdentifier</a>. In particular, installed packages cannot,
°5uthere may be many installed instances of the same source package.
class Package pkg
packageId :: Package pkg => pkg -> PackageIdentifier
packageName :: Package pkg => pkg -> PackageName
packageVersion :: Package pkg => pkg -> Version
class HasMungedPackageId pkg
mungedId :: HasMungedPackageId pkg => pkg -> MungedPackageId
mungedName' :: HasMungedPackageId pkg => pkg -> MungedPackageName
mungedVersion' :: HasMungedPackageId munged => munged -> Version

-- | Packages that have an installed unit ID
class Package pkg => HasUnitId pkg
installedUnitId :: HasUnitId pkg => pkg -> UnitId

-- | Compatibility wrapper for Cabal pre-1.24.

-- | <i>Deprecated: Use installedUnitId instead. This symbol will be
°5uremoved in Cabal-3.0 (est. Oct 2018).</i>
installedPackageId :: HasUnitId pkg => pkg -> UnitId

-- | Class of installed packages.
°5u
°5uThe primary data type which is an instance of this package is
°5u<tt>InstalledPackageInfo</tt>, but when we are doing install plans in
°5uCabal install we may have other, installed package-like things which
°5ucontain more metadata. Installed packages have exact dependencies
°5u<a>installedDepends</a>.
class (HasUnitId pkg) => PackageInstalled pkg
installedDepends :: PackageInstalled pkg => pkg -> [UnitId]
instance Distribution.Package.HasMungedPackageId Distribution.Types.MungedPackageId.MungedPackageId
instance Distribution.Package.Package Distribution.Types.PackageId.PackageIdentifier

module Distribution.Types.AnnotatedId

-- | An <a>AnnotatedId</a> is a <a>ComponentId</a>, <a>UnitId</a>, etc.
°5uwhich is annotated with some other useful information that is useful
°5ufor printing to users, etc.
°5u
°5uInvariant: if ann_id x == ann_id y, then ann_pid x == ann_pid y and
°5uann_cname x == ann_cname y
data AnnotatedId id
AnnotatedId :: PackageId -> ComponentName -> id -> AnnotatedId id
[ann_pid] :: AnnotatedId id -> PackageId
[ann_cname] :: AnnotatedId id -> ComponentName
[ann_id] :: AnnotatedId id -> id
instance GHC.Show.Show id => GHC.Show.Show (Distribution.Types.AnnotatedId.AnnotatedId id)
instance GHC.Classes.Eq id => GHC.Classes.Eq (Distribution.Types.AnnotatedId.AnnotatedId id)
instance GHC.Classes.Ord id => GHC.Classes.Ord (Distribution.Types.AnnotatedId.AnnotatedId id)
instance Distribution.Package.Package (Distribution.Types.AnnotatedId.AnnotatedId id)
instance GHC.Base.Functor Distribution.Types.AnnotatedId.AnnotatedId

module Distribution.Types.ComponentInclude
data ComponentInclude id rn
ComponentInclude :: AnnotatedId id -> rn -> Bool -> ComponentInclude id rn
[ci_ann_id] :: ComponentInclude id rn -> AnnotatedId id
[ci_renaming] :: ComponentInclude id rn -> rn

-- | Did this come from an entry in <tt>mixins</tt>, or was implicitly
°5ugenerated by <tt>build-depends</tt>?
[ci_implicit] :: ComponentInclude id rn -> Bool
ci_id :: ComponentInclude id rn -> id
ci_pkgid :: ComponentInclude id rn -> PackageId

-- | This should always return <a>CLibName</a> or <a>CSubLibName</a>
ci_cname :: ComponentInclude id rn -> ComponentName

module Distribution.Types.AbiDependency

-- | An ABI dependency is a dependency on a library which also records the
°5uABI hash (<tt>abiHash</tt>) of the library it depends on.
°5u
°5uThe primary utility of this is to enable an extra sanity when GHC
°5uloads libraries: it can check if the dependency has a matching ABI and
°5uif not, refuse to load this library. This information is critical if
°5uwe are shadowing libraries; differences in the ABI hash let us know
°5uwhat packages get shadowed by the new version of a package.
data AbiDependency
AbiDependency :: UnitId -> AbiHash -> AbiDependency
[depUnitId] :: AbiDependency -> UnitId
[depAbiHash] :: AbiDependency -> AbiHash
instance GHC.Show.Show Distribution.Types.AbiDependency.AbiDependency
instance GHC.Read.Read Distribution.Types.AbiDependency.AbiDependency
instance GHC.Generics.Generic Distribution.Types.AbiDependency.AbiDependency
instance GHC.Classes.Eq Distribution.Types.AbiDependency.AbiDependency
instance Distribution.Pretty.Pretty Distribution.Types.AbiDependency.AbiDependency
instance Distribution.Parsec.Class.Parsec Distribution.Types.AbiDependency.AbiDependency
instance Distribution.Text.Text Distribution.Types.AbiDependency.AbiDependency
instance Data.Binary.Class.Binary Distribution.Types.AbiDependency.AbiDependency
instance Control.DeepSeq.NFData Distribution.Types.AbiDependency.AbiDependency


-- | This manages everything to do with where files get installed (though
°5udoes not get involved with actually doing any installation). It
°5uprovides an <a>InstallDirs</a> type which is a set of directories for
°5uwhere to install things. It also handles the fact that we use
°5utemplates in these install dirs. For example most install dirs are
°5urelative to some <tt>$prefix</tt> and by changing the prefix all other
°5udirs still end up changed appropriately. So it provides a
°5u<a>PathTemplate</a> type and functions for substituting for these
°5utemplates.
module Distribution.Simple.InstallDirs

-- | The directories where we will install files for packages.
°5u
°5uWe have several different directories for different types of files
°5usince many systems have conventions whereby different types of files
°5uin a package are installed in different directories. This is
°5uparticularly the case on Unix style systems.
data InstallDirs dir
InstallDirs :: dir -> dir -> dir -> dir -> dir -> dir -> dir -> dir -> dir -> dir -> dir -> dir -> dir -> dir -> dir -> dir -> InstallDirs dir
[prefix] :: InstallDirs dir -> dir
[bindir] :: InstallDirs dir -> dir
[libdir] :: InstallDirs dir -> dir
[libsubdir] :: InstallDirs dir -> dir
[dynlibdir] :: InstallDirs dir -> dir

-- | foreign libraries
[flibdir] :: InstallDirs dir -> dir
[libexecdir] :: InstallDirs dir -> dir
[libexecsubdir] :: InstallDirs dir -> dir
[includedir] :: InstallDirs dir -> dir
[datadir] :: InstallDirs dir -> dir
[datasubdir] :: InstallDirs dir -> dir
[docdir] :: InstallDirs dir -> dir
[mandir] :: InstallDirs dir -> dir
[htmldir] :: InstallDirs dir -> dir
[haddockdir] :: InstallDirs dir -> dir
[sysconfdir] :: InstallDirs dir -> dir

-- | The installation directories in terms of <a>PathTemplate</a>s that
°5ucontain variables.
°5u
°5uThe defaults for most of the directories are relative to each other,
°5uin particular they are all relative to a single prefix. This makes it
°5uconvenient for the user to override the default installation directory
°5uby only having to specify --prefix=... rather than overriding each
°5uindividually. This is done by allowing $-style variables in the dirs.
°5uThese are expanded by textual substitution (see
°5u<a>substPathTemplate</a>).
°5u
°5uA few of these installation directories are split into two components,
°5uthe dir and subdir. The full installation path is formed by combining
°5uthe two together with <tt>/</tt>. The reason for this is compatibility
°5uwith other Unix build systems which also support <tt>--libdir</tt> and
°5u<tt>--datadir</tt>. We would like users to be able to configure
°5u<tt>--libdir=/usr/lib64</tt> for example but because by default we
°5uwant to support installing multiple versions of packages and building
°5uthe same package for multiple compilers we append the libsubdir to
°5uget: <tt>/usr/lib64/$libname/$compiler</tt>.
°5u
°5uAn additional complication is the need to support relocatable packages
°5uon systems which support such things, like Windows.
type InstallDirTemplates = InstallDirs PathTemplate
defaultInstallDirs :: CompilerFlavor -> Bool -> Bool -> IO InstallDirTemplates
defaultInstallDirs' :: Bool -> CompilerFlavor -> Bool -> Bool -> IO InstallDirTemplates
combineInstallDirs :: (a -> b -> c) -> InstallDirs a -> InstallDirs b -> InstallDirs c

-- | Convert from abstract install directories to actual absolute ones by
°5usubstituting for all the variables in the abstract paths, to get real
°5uabsolute path.
absoluteInstallDirs :: PackageIdentifier -> UnitId -> CompilerInfo -> CopyDest -> Platform -> InstallDirs PathTemplate -> InstallDirs FilePath

-- | The location prefix for the <i>copy</i> command.
data CopyDest
NoCopyDest :: CopyDest
CopyTo :: FilePath -> CopyDest

-- | when using the ${pkgroot} as prefix. The CopyToDb will adjust the
°5upaths to be relative to the provided package database when copying /
°5uinstalling.
CopyToDb :: FilePath -> CopyDest

-- | Check which of the paths are relative to the installation $prefix.
°5u
°5uIf any of the paths are not relative, ie they are absolute paths, then
°5uit prevents us from making a relocatable package (also known as a
°5u"prefix independent" package).
prefixRelativeInstallDirs :: PackageIdentifier -> UnitId -> CompilerInfo -> Platform -> InstallDirTemplates -> InstallDirs (Maybe FilePath)

-- | Substitute the install dir templates into each other.
°5u
°5uTo prevent cyclic substitutions, only some variables are allowed in
°5uparticular dir templates. If out of scope vars are present, they are
°5unot substituted for. Checking for any remaining unsubstituted vars can
°5ube done as a subsequent operation.
°5u
°5uThe reason it is done this way is so that in
°5u<a>prefixRelativeInstallDirs</a> we can replace <a>prefix</a> with the
°5u<a>PrefixVar</a> and get resulting <a>PathTemplate</a>s that still
°5uhave the <a>PrefixVar</a> in them. Doing this makes it each to check
°5uwhich paths are relative to the $prefix.
substituteInstallDirTemplates :: PathTemplateEnv -> InstallDirTemplates -> InstallDirTemplates

-- | An abstract path, possibly containing variables that need to be
°5usubstituted for to get a real <a>FilePath</a>.
data PathTemplate
data PathTemplateVariable

-- | The <tt>$prefix</tt> path variable
PrefixVar :: PathTemplateVariable

-- | The <tt>$bindir</tt> path variable
BindirVar :: PathTemplateVariable

-- | The <tt>$libdir</tt> path variable
LibdirVar :: PathTemplateVariable

-- | The <tt>$libsubdir</tt> path variable
LibsubdirVar :: PathTemplateVariable

-- | The <tt>$dynlibdir</tt> path variable
DynlibdirVar :: PathTemplateVariable

-- | The <tt>$datadir</tt> path variable
DatadirVar :: PathTemplateVariable

-- | The <tt>$datasubdir</tt> path variable
DatasubdirVar :: PathTemplateVariable

-- | The <tt>$docdir</tt> path variable
DocdirVar :: PathTemplateVariable

-- | The <tt>$htmldir</tt> path variable
HtmldirVar :: PathTemplateVariable

-- | The <tt>$pkg</tt> package name path variable
PkgNameVar :: PathTemplateVariable

-- | The <tt>$version</tt> package version path variable
PkgVerVar :: PathTemplateVariable

-- | The <tt>$pkgid</tt> package Id path variable, eg <tt>foo-1.0</tt>
PkgIdVar :: PathTemplateVariable

-- | The <tt>$libname</tt> path variable
LibNameVar :: PathTemplateVariable

-- | The compiler name and version, eg <tt>ghc-6.6.1</tt>
CompilerVar :: PathTemplateVariable

-- | The operating system name, eg <tt>windows</tt> or <tt>linux</tt>
OSVar :: PathTemplateVariable

-- | The CPU architecture name, eg <tt>i386</tt> or <tt>x86_64</tt>
ArchVar :: PathTemplateVariable

-- | The Compiler's ABI identifier, $arch-$os-$compiler-$abitag
AbiVar :: PathTemplateVariable

-- | The optional ABI tag for the compiler
AbiTagVar :: PathTemplateVariable

-- | The executable name; used in shell wrappers
ExecutableNameVar :: PathTemplateVariable

-- | The name of the test suite being run
TestSuiteNameVar :: PathTemplateVariable

-- | The result of the test suite being run, eg <tt>pass</tt>,
°5u<tt>fail</tt>, or <tt>error</tt>.
TestSuiteResultVar :: PathTemplateVariable

-- | The name of the benchmark being run
BenchmarkNameVar :: PathTemplateVariable
type PathTemplateEnv = [(PathTemplateVariable, PathTemplate)]

-- | Convert a <a>FilePath</a> to a <a>PathTemplate</a> including any
°5utemplate vars.
toPathTemplate :: FilePath -> PathTemplate

-- | Convert back to a path, any remaining vars are included
fromPathTemplate :: PathTemplate -> FilePath
combinePathTemplate :: PathTemplate -> PathTemplate -> PathTemplate
substPathTemplate :: PathTemplateEnv -> PathTemplate -> PathTemplate

-- | The initial environment has all the static stuff but no paths
initialPathTemplateEnv :: PackageIdentifier -> UnitId -> CompilerInfo -> Platform -> PathTemplateEnv
platformTemplateEnv :: Platform -> PathTemplateEnv
compilerTemplateEnv :: CompilerInfo -> PathTemplateEnv
packageTemplateEnv :: PackageIdentifier -> UnitId -> PathTemplateEnv
abiTemplateEnv :: CompilerInfo -> Platform -> PathTemplateEnv
installDirsTemplateEnv :: InstallDirs PathTemplate -> PathTemplateEnv
instance GHC.Generics.Generic Distribution.Simple.InstallDirs.PathTemplate
instance GHC.Classes.Ord Distribution.Simple.InstallDirs.PathTemplate
instance GHC.Classes.Eq Distribution.Simple.InstallDirs.PathTemplate
instance GHC.Generics.Generic Distribution.Simple.InstallDirs.PathComponent
instance GHC.Classes.Ord Distribution.Simple.InstallDirs.PathComponent
instance GHC.Classes.Eq Distribution.Simple.InstallDirs.PathComponent
instance GHC.Generics.Generic Distribution.Simple.InstallDirs.PathTemplateVariable
instance GHC.Classes.Ord Distribution.Simple.InstallDirs.PathTemplateVariable
instance GHC.Classes.Eq Distribution.Simple.InstallDirs.PathTemplateVariable
instance GHC.Generics.Generic Distribution.Simple.InstallDirs.CopyDest
instance GHC.Show.Show Distribution.Simple.InstallDirs.CopyDest
instance GHC.Classes.Eq Distribution.Simple.InstallDirs.CopyDest
instance GHC.Generics.Generic (Distribution.Simple.InstallDirs.InstallDirs dir)
instance GHC.Base.Functor Distribution.Simple.InstallDirs.InstallDirs
instance GHC.Show.Show dir => GHC.Show.Show (Distribution.Simple.InstallDirs.InstallDirs dir)
instance GHC.Read.Read dir => GHC.Read.Read (Distribution.Simple.InstallDirs.InstallDirs dir)
instance GHC.Classes.Eq dir => GHC.Classes.Eq (Distribution.Simple.InstallDirs.InstallDirs dir)
instance Data.Binary.Class.Binary Distribution.Simple.InstallDirs.PathTemplate
instance GHC.Show.Show Distribution.Simple.InstallDirs.PathTemplate
instance GHC.Read.Read Distribution.Simple.InstallDirs.PathTemplate
instance Data.Binary.Class.Binary Distribution.Simple.InstallDirs.PathComponent
instance GHC.Show.Show Distribution.Simple.InstallDirs.PathComponent
instance GHC.Read.Read Distribution.Simple.InstallDirs.PathComponent
instance Data.Binary.Class.Binary Distribution.Simple.InstallDirs.PathTemplateVariable
instance GHC.Show.Show Distribution.Simple.InstallDirs.PathTemplateVariable
instance GHC.Read.Read Distribution.Simple.InstallDirs.PathTemplateVariable
instance Data.Binary.Class.Binary Distribution.Simple.InstallDirs.CopyDest
instance Data.Binary.Class.Binary dir => Data.Binary.Class.Binary (Distribution.Simple.InstallDirs.InstallDirs dir)
instance (GHC.Base.Semigroup dir, GHC.Base.Monoid dir) => GHC.Base.Monoid (Distribution.Simple.InstallDirs.InstallDirs dir)
instance GHC.Base.Semigroup dir => GHC.Base.Semigroup (Distribution.Simple.InstallDirs.InstallDirs dir)

module Distribution.Types.LegacyExeDependency

-- | Describes a legacy `build-tools`-style dependency on an executable
°5u
°5uIt is "legacy" because we do not know what the build-tool referred to.
°5uIt could refer to a pkg-config executable (PkgconfigName), or an
°5uinternal executable (UnqualComponentName). Thus the name is stringly
°5utyped.
data LegacyExeDependency
LegacyExeDependency :: String -> VersionRange -> LegacyExeDependency
instance Data.Data.Data Distribution.Types.LegacyExeDependency.LegacyExeDependency
instance GHC.Classes.Eq Distribution.Types.LegacyExeDependency.LegacyExeDependency
instance GHC.Show.Show Distribution.Types.LegacyExeDependency.LegacyExeDependency
instance GHC.Read.Read Distribution.Types.LegacyExeDependency.LegacyExeDependency
instance GHC.Generics.Generic Distribution.Types.LegacyExeDependency.LegacyExeDependency
instance Data.Binary.Class.Binary Distribution.Types.LegacyExeDependency.LegacyExeDependency
instance Control.DeepSeq.NFData Distribution.Types.LegacyExeDependency.LegacyExeDependency
instance Distribution.Pretty.Pretty Distribution.Types.LegacyExeDependency.LegacyExeDependency
instance Distribution.Parsec.Class.Parsec Distribution.Types.LegacyExeDependency.LegacyExeDependency
instance Distribution.Text.Text Distribution.Types.LegacyExeDependency.LegacyExeDependency

module Distribution.Types.BuildInfo
data BuildInfo
BuildInfo :: Bool -> [LegacyExeDependency] -> [ExeDependency] -> [String] -> [String] -> [String] -> [String] -> [String] -> [String] -> [PkgconfigDependency] -> [String] -> [String] -> [FilePath] -> [FilePath] -> [FilePath] -> [FilePath] -> [FilePath] -> [FilePath] -> [ModuleName] -> [ModuleName] -> [ModuleName] -> Maybe Language -> [Language] -> [Extension] -> [Extension] -> [Extension] -> [String] -> [String] -> [String] -> [String] -> [String] -> [FilePath] -> [FilePath] -> [FilePath] -> [(CompilerFlavor, [String])] -> [(CompilerFlavor, [String])] -> [(CompilerFlavor, [String])] -> [(CompilerFlavor, [String])] -> [(String, String)] -> [Dependency] -> [Mixin] -> BuildInfo

-- | component is buildable here
[buildable] :: BuildInfo -> Bool

-- | Tools needed to build this bit.
°5u
°5uThis is a legacy field that <a>buildToolDepends</a> larely supersedes.
°5u
°5uUnless use are very sure what you are doing, use the functions in
°5u<a>Distribution.Simple.BuildToolDepends</a> rather than accessing this
°5ufield directly.
[buildTools] :: BuildInfo -> [LegacyExeDependency]

-- | Haskell tools needed to build this bit
°5u
°5uThis field is better than <a>buildTools</a> because it allows one to
°5uprecisely specify an executable in a package.
°5u
°5uUnless use are very sure what you are doing, use the functions in
°5u<a>Distribution.Simple.BuildToolDepends</a> rather than accessing this
°5ufield directly.
[buildToolDepends] :: BuildInfo -> [ExeDependency]

-- | options for pre-processing Haskell code
[cppOptions] :: BuildInfo -> [String]

-- | options for assmebler
[asmOptions] :: BuildInfo -> [String]

-- | options for C-- compiler
[cmmOptions] :: BuildInfo -> [String]

-- | options for C compiler
[ccOptions] :: BuildInfo -> [String]

-- | options for C++ compiler
[cxxOptions] :: BuildInfo -> [String]

-- | options for linker
[ldOptions] :: BuildInfo -> [String]

-- | pkg-config packages that are used
[pkgconfigDepends] :: BuildInfo -> [PkgconfigDependency]

-- | support frameworks for Mac OS X
[frameworks] :: BuildInfo -> [String]

-- | extra locations to find frameworks.
[extraFrameworkDirs] :: BuildInfo -> [String]

-- | Assembly files.
[asmSources] :: BuildInfo -> [FilePath]

-- | C-- files.
[cmmSources] :: BuildInfo -> [FilePath]
[cSources] :: BuildInfo -> [FilePath]
[cxxSources] :: BuildInfo -> [FilePath]
[jsSources] :: BuildInfo -> [FilePath]

-- | where to look for the Haskell module hierarchy
[hsSourceDirs] :: BuildInfo -> [FilePath]

-- | non-exposed or non-main modules
[otherModules] :: BuildInfo -> [ModuleName]

-- | exposed modules that do not have a source file (e.g. <tt>GHC.Prim</tt>
°5ufrom <tt>ghc-prim</tt> package)
[virtualModules] :: BuildInfo -> [ModuleName]

-- | not present on sdist, Paths_* or user-generated with a custom Setup.hs
[autogenModules] :: BuildInfo -> [ModuleName]

-- | language used when not explicitly specified
[defaultLanguage] :: BuildInfo -> Maybe Language

-- | other languages used within the package
[otherLanguages] :: BuildInfo -> [Language]

-- | language extensions used by all modules
[defaultExtensions] :: BuildInfo -> [Extension]

-- | other language extensions used within the package
[otherExtensions] :: BuildInfo -> [Extension]

-- | the old extensions field, treated same as <a>defaultExtensions</a>
[oldExtensions] :: BuildInfo -> [Extension]

-- | what libraries to link with when compiling a program that uses your
°5upackage
[extraLibs] :: BuildInfo -> [String]

-- | if present, overrides extraLibs when package is loaded with GHCi.
[extraGHCiLibs] :: BuildInfo -> [String]

-- | if present, adds libs to hs-lirbaries, which become part of the
°5upackage. Example: the Cffi library shipping with the rts, alognside
°5uthe HSrts-1.0.a,.o,... Example 2: a library that is being built by a
°5uforeing tool (e.g. rust) and copied and registered together with this
°5ulibrary. The logic on how this library is built will have to be
°5uencoded in a custom Setup for now. Oherwise cabal would need to lear
°5uhow to call arbitary lirbary builders.
[extraBundledLibs] :: BuildInfo -> [String]

-- | Hidden Flag. This set of strings, will be appended to all lirbaries
°5uwhen copying. E.g. [libHS<a>name</a>_<a>flavour</a> | flavour &lt;-
°5uextraLibFlavours]. This should only be needed in very specific cases,
°5ue.g. the <tt>rts</tt> package, where there are multiple copies of
°5uslightly differently built libs.
[extraLibFlavours] :: BuildInfo -> [String]
[extraLibDirs] :: BuildInfo -> [String]

-- | directories to find .h files
[includeDirs] :: BuildInfo -> [FilePath]

-- | The .h files to be found in includeDirs
[includes] :: BuildInfo -> [FilePath]

-- | .h files to install with the package
[installIncludes] :: BuildInfo -> [FilePath]
[options] :: BuildInfo -> [(CompilerFlavor, [String])]
[profOptions] :: BuildInfo -> [(CompilerFlavor, [String])]
[sharedOptions] :: BuildInfo -> [(CompilerFlavor, [String])]
[staticOptions] :: BuildInfo -> [(CompilerFlavor, [String])]

-- | Custom fields starting with x-, stored in a simple assoc-list.
[customFieldsBI] :: BuildInfo -> [(String, String)]

-- | Dependencies specific to a library or executable target
[targetBuildDepends] :: BuildInfo -> [Dependency]
[mixins] :: BuildInfo -> [Mixin]
emptyBuildInfo :: BuildInfo

-- | The <a>Language</a>s used by this component
allLanguages :: BuildInfo -> [Language]

-- | The <a>Extension</a>s that are used somewhere by this component
allExtensions :: BuildInfo -> [Extension]

-- | The <tt>Extensions</tt> that are used by all modules in this component
usedExtensions :: BuildInfo -> [Extension]

-- | Whether any modules in this component use Template Haskell or Quasi
°5uQuotes
usesTemplateHaskellOrQQ :: BuildInfo -> Bool

-- | Select options for a particular Haskell compiler.
hcOptions :: CompilerFlavor -> BuildInfo -> [String]
hcProfOptions :: CompilerFlavor -> BuildInfo -> [String]
hcSharedOptions :: CompilerFlavor -> BuildInfo -> [String]
hcStaticOptions :: CompilerFlavor -> BuildInfo -> [String]
instance Data.Data.Data Distribution.Types.BuildInfo.BuildInfo
instance GHC.Classes.Eq Distribution.Types.BuildInfo.BuildInfo
instance GHC.Read.Read Distribution.Types.BuildInfo.BuildInfo
instance GHC.Show.Show Distribution.Types.BuildInfo.BuildInfo
instance GHC.Generics.Generic Distribution.Types.BuildInfo.BuildInfo
instance Data.Binary.Class.Binary Distribution.Types.BuildInfo.BuildInfo
instance Control.DeepSeq.NFData Distribution.Types.BuildInfo.BuildInfo
instance GHC.Base.Monoid Distribution.Types.BuildInfo.BuildInfo
instance GHC.Base.Semigroup Distribution.Types.BuildInfo.BuildInfo

module Distribution.Types.HookedBuildInfo

-- | <a>HookedBuildInfo</a> is mechanism that hooks can use to override the
°5u<a>BuildInfo</a>s inside packages. One example use-case (which is used
°5uin core libraries today) is as a way of passing flags which are
°5ucomputed by a configure script into Cabal. In this case, the autoconf
°5ubuild type adds hooks to read in a textual <a>HookedBuildInfo</a>
°5uformat prior to doing any operations.
°5u
°5uQuite honestly, this mechanism is a massive hack since we shouldn't be
°5uediting the <tt>PackageDescription</tt> data structure (it's easy to
°5uassume that this data structure shouldn't change and run into bugs,
°5usee for example 1c20a6328579af9e37677d507e2e9836ef70ab9d). But it's a
°5ubit convenient, because there isn't another data structure that allows
°5uadding extra <a>BuildInfo</a> style things.
°5u
°5uIn any case, a lot of care has to be taken to make sure the
°5u<a>HookedBuildInfo</a> is applied to the <tt>PackageDescription</tt>.
°5uIn general this process occurs in <a>Distribution.Simple</a>, which is
°5uresponsible for orchestrating the hooks mechanism. The general
°5ustrategy:
°5u
°5u<ol>
°5u<li>We run the pre-hook, which produces a <a>HookedBuildInfo</a>
°5u(e.g., in the Autoconf case, it reads it out from a file).</li>
°5u<li>We sanity-check the hooked build info with
°5u<tt>sanityCheckHookedBuildInfo</tt>.</li>
°5u<li>We update our <tt>PackageDescription</tt> (either freshly read or
°5ucached from <tt>LocalBuildInfo</tt>) with
°5u<tt>updatePackageDescription</tt>.</li>
°5u</ol>
°5u
°5uIn principle, we are also supposed to update the copy of the
°5u<tt>PackageDescription</tt> stored in <tt>LocalBuildInfo</tt> at
°5u<tt>localPkgDescr</tt>. Unfortunately, in practice, there are lots of
°5uCustom setup scripts which fail to update <tt>localPkgDescr</tt> so
°5uyou really shouldn't rely on it. It's not DEPRECATED because there are
°5ulegitimate uses for it, but... yeah. Sharp knife. See
°5u<a>https://github.com/haskell/cabal/issues/3606</a> for more
°5uinformation on the issue.
°5u
°5uIt is not well-specified whether or not a <a>HookedBuildInfo</a>
°5uapplied at configure time is persistent to the
°5u<tt>LocalBuildInfo</tt>. The fact that <a>HookedBuildInfo</a> is
°5upassed to <tt>confHook</tt> MIGHT SUGGEST that the
°5u<a>HookedBuildInfo</a> is applied at this time, but actually since
°5u9317b67e6122ab14e53f81b573bd0ecb388eca5a it has been ONLY used to
°5ucreate a modified package description that we check for problems: it
°5uis never actually saved to the LBI. Since <a>HookedBuildInfo</a> is
°5uapplied monoidally to the existing build infos (and it is not an
°5uidempotent monoid), it could break things to save it, since we are
°5uobligated to apply any new <a>HookedBuildInfo</a> and then we'd get
°5uthe effect twice. But this does mean we have to re-apply it every
°5utime. Hey, it's more flexibility.
type HookedBuildInfo = (Maybe BuildInfo, [(UnqualComponentName, BuildInfo)])
emptyHookedBuildInfo :: HookedBuildInfo

module Distribution.Types.BuildInfo.Lens
data BuildInfo

-- | Classy lenses for <a>BuildInfo</a>.
class HasBuildInfo a
buildInfo :: HasBuildInfo a => Lens' a BuildInfo
buildable :: HasBuildInfo a => Lens' a Bool
buildTools :: HasBuildInfo a => Lens' a [LegacyExeDependency]
buildToolDepends :: HasBuildInfo a => Lens' a [ExeDependency]
cppOptions :: HasBuildInfo a => Lens' a [String]
asmOptions :: HasBuildInfo a => Lens' a [String]
cmmOptions :: HasBuildInfo a => Lens' a [String]
ccOptions :: HasBuildInfo a => Lens' a [String]
cxxOptions :: HasBuildInfo a => Lens' a [String]
ldOptions :: HasBuildInfo a => Lens' a [String]
pkgconfigDepends :: HasBuildInfo a => Lens' a [PkgconfigDependency]
frameworks :: HasBuildInfo a => Lens' a [String]
extraFrameworkDirs :: HasBuildInfo a => Lens' a [String]
asmSources :: HasBuildInfo a => Lens' a [FilePath]
cmmSources :: HasBuildInfo a => Lens' a [FilePath]
cSources :: HasBuildInfo a => Lens' a [FilePath]
cxxSources :: HasBuildInfo a => Lens' a [FilePath]
jsSources :: HasBuildInfo a => Lens' a [FilePath]
hsSourceDirs :: HasBuildInfo a => Lens' a [FilePath]
otherModules :: HasBuildInfo a => Lens' a [ModuleName]
virtualModules :: HasBuildInfo a => Lens' a [ModuleName]
autogenModules :: HasBuildInfo a => Lens' a [ModuleName]
defaultLanguage :: HasBuildInfo a => Lens' a (Maybe Language)
otherLanguages :: HasBuildInfo a => Lens' a [Language]
defaultExtensions :: HasBuildInfo a => Lens' a [Extension]
otherExtensions :: HasBuildInfo a => Lens' a [Extension]
oldExtensions :: HasBuildInfo a => Lens' a [Extension]
extraLibs :: HasBuildInfo a => Lens' a [String]
extraGHCiLibs :: HasBuildInfo a => Lens' a [String]
extraBundledLibs :: HasBuildInfo a => Lens' a [String]
extraLibFlavours :: HasBuildInfo a => Lens' a [String]
extraLibDirs :: HasBuildInfo a => Lens' a [String]
includeDirs :: HasBuildInfo a => Lens' a [FilePath]
includes :: HasBuildInfo a => Lens' a [FilePath]
installIncludes :: HasBuildInfo a => Lens' a [FilePath]
options :: HasBuildInfo a => Lens' a [(CompilerFlavor, [String])]
profOptions :: HasBuildInfo a => Lens' a [(CompilerFlavor, [String])]
sharedOptions :: HasBuildInfo a => Lens' a [(CompilerFlavor, [String])]
staticOptions :: HasBuildInfo a => Lens' a [(CompilerFlavor, [String])]
customFieldsBI :: HasBuildInfo a => Lens' a [(String, String)]
targetBuildDepends :: HasBuildInfo a => Lens' a [Dependency]
mixins :: HasBuildInfo a => Lens' a [Mixin]
instance Distribution.Types.BuildInfo.Lens.HasBuildInfo Distribution.Types.BuildInfo.BuildInfo

module Distribution.Types.TestSuite

-- | A "test-suite" stanza in a cabal file.
data TestSuite
TestSuite :: UnqualComponentName -> TestSuiteInterface -> BuildInfo -> TestSuite
[testName] :: TestSuite -> UnqualComponentName
[testInterface] :: TestSuite -> TestSuiteInterface
[testBuildInfo] :: TestSuite -> BuildInfo
emptyTestSuite :: TestSuite
testType :: TestSuite -> TestType

-- | Get all the module names from a test suite.
testModules :: TestSuite -> [ModuleName]

-- | Get all the auto generated module names from a test suite. This are a
°5usubset of <a>testModules</a>.
testModulesAutogen :: TestSuite -> [ModuleName]
instance Data.Data.Data Distribution.Types.TestSuite.TestSuite
instance GHC.Classes.Eq Distribution.Types.TestSuite.TestSuite
instance GHC.Read.Read Distribution.Types.TestSuite.TestSuite
instance GHC.Show.Show Distribution.Types.TestSuite.TestSuite
instance GHC.Generics.Generic Distribution.Types.TestSuite.TestSuite
instance Distribution.Types.BuildInfo.Lens.HasBuildInfo Distribution.Types.TestSuite.TestSuite
instance Data.Binary.Class.Binary Distribution.Types.TestSuite.TestSuite
instance Control.DeepSeq.NFData Distribution.Types.TestSuite.TestSuite
instance GHC.Base.Monoid Distribution.Types.TestSuite.TestSuite
instance GHC.Base.Semigroup Distribution.Types.TestSuite.TestSuite

module Distribution.Types.TestSuite.Lens

-- | A "test-suite" stanza in a cabal file.
data TestSuite
testName :: Lens' TestSuite UnqualComponentName
testInterface :: Lens' TestSuite TestSuiteInterface
testBuildInfo :: Lens' TestSuite BuildInfo

module Distribution.Types.Library
data Library
Library :: Maybe UnqualComponentName -> [ModuleName] -> [ModuleReexport] -> [ModuleName] -> Bool -> BuildInfo -> Library
[libName] :: Library -> Maybe UnqualComponentName
[exposedModules] :: Library -> [ModuleName]
[reexportedModules] :: Library -> [ModuleReexport]

-- | What sigs need implementations?
[signatures] :: Library -> [ModuleName]

-- | Is the lib to be exposed by default?
[libExposed] :: Library -> Bool
[libBuildInfo] :: Library -> BuildInfo
emptyLibrary :: Library

-- | Get all the module names from the library (exposed and internal
°5umodules) which are explicitly listed in the package description which
°5uwould need to be compiled. (This does not include reexports, which do
°5unot need to be compiled.) This may not include all modules for which
°5uGHC generated interface files (i.e., implicit modules.)
explicitLibModules :: Library -> [ModuleName]

-- | Get all the auto generated module names from the library, exposed or
°5unot. This are a subset of <a>libModules</a>.
libModulesAutogen :: Library -> [ModuleName]

-- | Backwards-compatibility shim for <a>explicitLibModules</a>. In most
°5ucases, you actually want <tt>allLibModules</tt>, which returns all
°5umodules that will actually be compiled, as opposed to those which are
°5uexplicitly listed in the package description
°5u(<a>explicitLibModules</a>); unfortunately, the type signature for
°5u<tt>allLibModules</tt> is incompatible since we need a
°5u<tt>ComponentLocalBuildInfo</tt>.

-- | <i>Deprecated: If you want all modules that are built with a library,
°5uuse <tt>allLibModules</tt>. Otherwise, use <a>explicitLibModules</a>
°5ufor ONLY the modules explicitly mentioned in the package description.
°5uThis symbol will be removed in Cabal-3.0 (est. Oct 2018).</i>
libModules :: Library -> [ModuleName]
instance Data.Data.Data Distribution.Types.Library.Library
instance GHC.Read.Read Distribution.Types.Library.Library
instance GHC.Classes.Eq Distribution.Types.Library.Library
instance GHC.Show.Show Distribution.Types.Library.Library
instance GHC.Generics.Generic Distribution.Types.Library.Library
instance Distribution.Types.BuildInfo.Lens.HasBuildInfo Distribution.Types.Library.Library
instance Data.Binary.Class.Binary Distribution.Types.Library.Library
instance Control.DeepSeq.NFData Distribution.Types.Library.Library
instance GHC.Base.Monoid Distribution.Types.Library.Library
instance GHC.Base.Semigroup Distribution.Types.Library.Library

module Distribution.Types.Library.Lens
data Library
libName :: Lens' Library (Maybe UnqualComponentName)
exposedModules :: Lens' Library [ModuleName]
reexportedModules :: Lens' Library [ModuleReexport]
signatures :: Lens' Library [ModuleName]
libExposed :: Lens' Library Bool
libBuildInfo :: Lens' Library BuildInfo

module Distribution.Types.ForeignLib

-- | A foreign library stanza is like a library stanza, except that the
°5ubuilt code is intended for consumption by a non-Haskell client.
data ForeignLib
ForeignLib :: UnqualComponentName -> ForeignLibType -> [ForeignLibOption] -> BuildInfo -> Maybe LibVersionInfo -> Maybe Version -> [FilePath] -> ForeignLib

-- | Name of the foreign library
[foreignLibName] :: ForeignLib -> UnqualComponentName

-- | What kind of foreign library is this (static or dynamic).
[foreignLibType] :: ForeignLib -> ForeignLibType

-- | What options apply to this foreign library (e.g., are we merging in
°5uall foreign dependencies.)
[foreignLibOptions] :: ForeignLib -> [ForeignLibOption]

-- | Build information for this foreign library.
[foreignLibBuildInfo] :: ForeignLib -> BuildInfo

-- | Libtool-style version-info data to compute library version. Refer to
°5uthe libtool documentation on the current:revision:age versioning
°5uscheme.
[foreignLibVersionInfo] :: ForeignLib -> Maybe LibVersionInfo

-- | Linux library version
[foreignLibVersionLinux] :: ForeignLib -> Maybe Version

-- | (Windows-specific) module definition files
°5u
°5uThis is a list rather than a maybe field so that we can flatten the
°5ucondition trees (for instance, when creating an sdist)
[foreignLibModDefFile] :: ForeignLib -> [FilePath]

-- | An empty foreign library.
emptyForeignLib :: ForeignLib

-- | Modules defined by a foreign library.
foreignLibModules :: ForeignLib -> [ModuleName]

-- | Is the foreign library shared?
foreignLibIsShared :: ForeignLib -> Bool

-- | Get a version number for a foreign library. If we're on Linux, and a
°5uLinux version is specified, use that. If we're on Linux, and
°5ulibtool-style version-info is specified, translate that field into
°5uappropriate version numbers. Otherwise, this feature is unsupported so
°5uwe don't return any version data.
foreignLibVersion :: ForeignLib -> OS -> [Int]
data LibVersionInfo

-- | Construct <a>LibVersionInfo</a> from <tt>(current, revision, age)</tt>
°5unumbers.
°5u
°5uFor instance, <tt>mkLibVersionInfo (3,0,0)</tt> constructs a
°5u<a>LibVersionInfo</a> representing the version-info <tt>3:0:0</tt>.
°5u
°5uAll version components must be non-negative.
mkLibVersionInfo :: (Int, Int, Int) -> LibVersionInfo

-- | From a given <a>LibVersionInfo</a>, extract the <tt>(current,
°5urevision, age)</tt> numbers.
libVersionInfoCRA :: LibVersionInfo -> (Int, Int, Int)

-- | Given a version-info field, produce a <tt>major.minor.build</tt>
°5uversion
libVersionNumber :: LibVersionInfo -> (Int, Int, Int)

-- | Given a version-info field, return <tt>"major.minor.build"</tt> as a
°5u<a>String</a>
libVersionNumberShow :: LibVersionInfo -> String

-- | Return the <tt>major</tt> version of a version-info field.
libVersionMajor :: LibVersionInfo -> Int
instance Data.Data.Data Distribution.Types.ForeignLib.ForeignLib
instance GHC.Classes.Eq Distribution.Types.ForeignLib.ForeignLib
instance GHC.Read.Read Distribution.Types.ForeignLib.ForeignLib
instance GHC.Show.Show Distribution.Types.ForeignLib.ForeignLib
instance GHC.Generics.Generic Distribution.Types.ForeignLib.ForeignLib
instance GHC.Generics.Generic Distribution.Types.ForeignLib.LibVersionInfo
instance GHC.Classes.Eq Distribution.Types.ForeignLib.LibVersionInfo
instance Data.Data.Data Distribution.Types.ForeignLib.LibVersionInfo
instance Distribution.Types.BuildInfo.Lens.HasBuildInfo Distribution.Types.ForeignLib.ForeignLib
instance Data.Binary.Class.Binary Distribution.Types.ForeignLib.ForeignLib
instance Control.DeepSeq.NFData Distribution.Types.ForeignLib.ForeignLib
instance GHC.Base.Semigroup Distribution.Types.ForeignLib.ForeignLib
instance GHC.Base.Monoid Distribution.Types.ForeignLib.ForeignLib
instance GHC.Classes.Ord Distribution.Types.ForeignLib.LibVersionInfo
instance GHC.Show.Show Distribution.Types.ForeignLib.LibVersionInfo
instance GHC.Read.Read Distribution.Types.ForeignLib.LibVersionInfo
instance Data.Binary.Class.Binary Distribution.Types.ForeignLib.LibVersionInfo
instance Control.DeepSeq.NFData Distribution.Types.ForeignLib.LibVersionInfo
instance Distribution.Pretty.Pretty Distribution.Types.ForeignLib.LibVersionInfo
instance Distribution.Parsec.Class.Parsec Distribution.Types.ForeignLib.LibVersionInfo
instance Distribution.Text.Text Distribution.Types.ForeignLib.LibVersionInfo

module Distribution.Types.ForeignLib.Lens

-- | A foreign library stanza is like a library stanza, except that the
°5ubuilt code is intended for consumption by a non-Haskell client.
data ForeignLib
foreignLibName :: Lens' ForeignLib UnqualComponentName
foreignLibType :: Lens' ForeignLib ForeignLibType
foreignLibOptions :: Lens' ForeignLib [ForeignLibOption]
foreignLibBuildInfo :: Lens' ForeignLib BuildInfo
foreignLibVersionInfo :: Lens' ForeignLib (Maybe LibVersionInfo)
foreignLibVersionLinux :: Lens' ForeignLib (Maybe Version)
foreignLibModDefFile :: Lens' ForeignLib [FilePath]

module Distribution.Types.Executable
data Executable
Executable :: UnqualComponentName -> FilePath -> ExecutableScope -> BuildInfo -> Executable
[exeName] :: Executable -> UnqualComponentName
[modulePath] :: Executable -> FilePath
[exeScope] :: Executable -> ExecutableScope
[buildInfo] :: Executable -> BuildInfo
emptyExecutable :: Executable

-- | Get all the module names from an exe
exeModules :: Executable -> [ModuleName]

-- | Get all the auto generated module names from an exe This are a subset
°5uof <a>exeModules</a>.
exeModulesAutogen :: Executable -> [ModuleName]
instance Data.Data.Data Distribution.Types.Executable.Executable
instance GHC.Classes.Eq Distribution.Types.Executable.Executable
instance GHC.Read.Read Distribution.Types.Executable.Executable
instance GHC.Show.Show Distribution.Types.Executable.Executable
instance GHC.Generics.Generic Distribution.Types.Executable.Executable
instance Distribution.Types.BuildInfo.Lens.HasBuildInfo Distribution.Types.Executable.Executable
instance Data.Binary.Class.Binary Distribution.Types.Executable.Executable
instance Control.DeepSeq.NFData Distribution.Types.Executable.Executable
instance GHC.Base.Monoid Distribution.Types.Executable.Executable
instance GHC.Base.Semigroup Distribution.Types.Executable.Executable

module Distribution.Types.Executable.Lens
data Executable
exeName :: Lens' Executable UnqualComponentName
modulePath :: Lens' Executable String
exeScope :: Lens' Executable ExecutableScope

module Distribution.Types.Benchmark

-- | A "benchmark" stanza in a cabal file.
data Benchmark
Benchmark :: UnqualComponentName -> BenchmarkInterface -> BuildInfo -> Benchmark
[benchmarkName] :: Benchmark -> UnqualComponentName
[benchmarkInterface] :: Benchmark -> BenchmarkInterface
[benchmarkBuildInfo] :: Benchmark -> BuildInfo
emptyBenchmark :: Benchmark
benchmarkType :: Benchmark -> BenchmarkType

-- | Get all the module names from a benchmark.
benchmarkModules :: Benchmark -> [ModuleName]

-- | Get all the auto generated module names from a benchmark. This are a
°5usubset of <a>benchmarkModules</a>.
benchmarkModulesAutogen :: Benchmark -> [ModuleName]
instance Data.Data.Data Distribution.Types.Benchmark.Benchmark
instance GHC.Classes.Eq Distribution.Types.Benchmark.Benchmark
instance GHC.Read.Read Distribution.Types.Benchmark.Benchmark
instance GHC.Show.Show Distribution.Types.Benchmark.Benchmark
instance GHC.Generics.Generic Distribution.Types.Benchmark.Benchmark
instance Data.Binary.Class.Binary Distribution.Types.Benchmark.Benchmark
instance Control.DeepSeq.NFData Distribution.Types.Benchmark.Benchmark
instance Distribution.Types.BuildInfo.Lens.HasBuildInfo Distribution.Types.Benchmark.Benchmark
instance GHC.Base.Monoid Distribution.Types.Benchmark.Benchmark
instance GHC.Base.Semigroup Distribution.Types.Benchmark.Benchmark

module Distribution.Types.Component
data Component
CLib :: Library -> Component
CFLib :: ForeignLib -> Component
CExe :: Executable -> Component
CTest :: TestSuite -> Component
CBench :: Benchmark -> Component
foldComponent :: (Library -> a) -> (ForeignLib -> a) -> (Executable -> a) -> (TestSuite -> a) -> (Benchmark -> a) -> Component -> a
componentBuildInfo :: Component -> BuildInfo

-- | Is a component buildable (i.e., not marked with <tt>buildable:
°5uFalse</tt>)? See also this note in
°5u<a>Distribution.Types.ComponentRequestedSpec#buildable_vs_enabled_components</a>.
componentBuildable :: Component -> Bool
componentName :: Component -> ComponentName
partitionComponents :: [Component] -> ([Library], [ForeignLib], [Executable], [TestSuite], [Benchmark])
instance GHC.Read.Read Distribution.Types.Component.Component
instance GHC.Classes.Eq Distribution.Types.Component.Component
instance GHC.Show.Show Distribution.Types.Component.Component
instance GHC.Base.Semigroup Distribution.Types.Component.Component
instance Distribution.Types.BuildInfo.Lens.HasBuildInfo Distribution.Types.Component.Component

module Distribution.Types.ComponentRequestedSpec

-- | Describes what components are enabled by user-interaction. See also
°5uthis note in
°5u<a>Distribution.Types.ComponentRequestedSpec#buildable_vs_enabled_components</a>.
data ComponentRequestedSpec
ComponentRequestedSpec :: Bool -> Bool -> ComponentRequestedSpec
[testsRequested] :: ComponentRequestedSpec -> Bool
[benchmarksRequested] :: ComponentRequestedSpec -> Bool
OneComponentRequestedSpec :: ComponentName -> ComponentRequestedSpec

-- | A reason explaining why a component is disabled.
data ComponentDisabledReason
DisabledComponent :: ComponentDisabledReason
DisabledAllTests :: ComponentDisabledReason
DisabledAllBenchmarks :: ComponentDisabledReason
DisabledAllButOne :: String -> ComponentDisabledReason

-- | The default set of enabled components. Historically tests and
°5ubenchmarks are NOT enabled by default.
defaultComponentRequestedSpec :: ComponentRequestedSpec

-- | Is this component name enabled? See also this note in
°5u<a>Distribution.Types.ComponentRequestedSpec#buildable_vs_enabled_components</a>.
componentNameRequested :: ComponentRequestedSpec -> ComponentName -> Bool

-- | Is this component enabled? See also this note in
°5u<a>Distribution.Types.ComponentRequestedSpec#buildable_vs_enabled_components</a>.
componentEnabled :: ComponentRequestedSpec -> Component -> Bool

-- | Is this component disabled, and if so, why?
componentDisabledReason :: ComponentRequestedSpec -> Component -> Maybe ComponentDisabledReason
instance GHC.Classes.Eq Distribution.Types.ComponentRequestedSpec.ComponentRequestedSpec
instance GHC.Show.Show Distribution.Types.ComponentRequestedSpec.ComponentRequestedSpec
instance GHC.Read.Read Distribution.Types.ComponentRequestedSpec.ComponentRequestedSpec
instance GHC.Generics.Generic Distribution.Types.ComponentRequestedSpec.ComponentRequestedSpec
instance Data.Binary.Class.Binary Distribution.Types.ComponentRequestedSpec.ComponentRequestedSpec


-- | This defines the data structure for the <tt>.cabal</tt> file format.
°5uThere are several parts to this structure. It has top level info and
°5uthen <a>Library</a>, <a>Executable</a>, <a>TestSuite</a>, and
°5u<a>Benchmark</a> sections each of which have associated
°5u<a>BuildInfo</a> data that's used to build the library, exe, test, or
°5ubenchmark. To further complicate things there is both a
°5u<a>PackageDescription</a> and a <tt>GenericPackageDescription</tt>.
°5uThis distinction relates to cabal configurations. When we initially
°5uread a <tt>.cabal</tt> file we get a
°5u<tt>GenericPackageDescription</tt> which has all the conditional
°5usections. Before actually building a package we have to decide on each
°5uconditional. Once we've done that we get a <a>PackageDescription</a>.
°5uIt was done this way initially to avoid breaking too much stuff when
°5uthe feature was introduced. It could probably do with being
°5urationalised at some point to make it simpler.
module Distribution.Types.PackageDescription

-- | This data type is the internal representation of the file
°5u<tt>pkg.cabal</tt>. It contains two kinds of information about the
°5upackage: information which is needed for all packages, such as the
°5upackage name and version, and information which is needed for the
°5usimple build system only, such as the compiler options and library
°5uname.
data PackageDescription
PackageDescription :: Either Version VersionRange -> PackageIdentifier -> Either License License -> [FilePath] -> String -> String -> String -> String -> [(CompilerFlavor, VersionRange)] -> String -> String -> String -> [SourceRepo] -> String -> String -> String -> [(String, String)] -> [Dependency] -> Maybe BuildType -> Maybe SetupBuildInfo -> Maybe Library -> [Library] -> [Executable] -> [ForeignLib] -> [TestSuite] -> [Benchmark] -> [FilePath] -> FilePath -> [FilePath] -> [FilePath] -> [FilePath] -> PackageDescription

-- | The version of the Cabal spec that this package description uses. For
°5uhistorical reasons this is specified with a version range but only
°5uranges of the form <tt>&gt;= v</tt> make sense. We are in the process
°5uof transitioning to specifying just a single version, not a range. See
°5ualso <a>specVersion</a>.
[specVersionRaw] :: PackageDescription -> Either Version VersionRange
[package] :: PackageDescription -> PackageIdentifier
[licenseRaw] :: PackageDescription -> Either License License
[licenseFiles] :: PackageDescription -> [FilePath]
[copyright] :: PackageDescription -> String
[maintainer] :: PackageDescription -> String
[author] :: PackageDescription -> String
[stability] :: PackageDescription -> String
[testedWith] :: PackageDescription -> [(CompilerFlavor, VersionRange)]
[homepage] :: PackageDescription -> String
[pkgUrl] :: PackageDescription -> String
[bugReports] :: PackageDescription -> String
[sourceRepos] :: PackageDescription -> [SourceRepo]

-- | A one-line summary of this package
[synopsis] :: PackageDescription -> String

-- | A more verbose description of this package
[description] :: PackageDescription -> String
[category] :: PackageDescription -> String

-- | Custom fields starting with x-, stored in a simple assoc-list.
[customFieldsPD] :: PackageDescription -> [(String, String)]

-- | YOU PROBABLY DON'T WANT TO USE THIS FIELD. This field is special!
°5uDepending on how far along processing the PackageDescription we are,
°5uthe contents of this field are either nonsense, or the collected
°5udependencies of *all* the components in this package. buildDepends is
°5uinitialized by <tt>finalizePD</tt> and
°5u<tt>flattenPackageDescription</tt>; prior to that, dependency info is
°5ustored in the <tt>CondTree</tt> built around a
°5u<tt>GenericPackageDescription</tt>. When this resolution is done,
°5udependency info is written to the inner <a>BuildInfo</a> and this
°5ufield. This is all horrible, and #2066 tracks progress to get rid of
°5uthis field.
[buildDepends] :: PackageDescription -> [Dependency]

-- | The original <tt>build-type</tt> value as parsed from the
°5u<tt>.cabal</tt> file without defaulting. See also <a>buildType</a>.
[buildTypeRaw] :: PackageDescription -> Maybe BuildType
[setupBuildInfo] :: PackageDescription -> Maybe SetupBuildInfo
[library] :: PackageDescription -> Maybe Library
[subLibraries] :: PackageDescription -> [Library]
[executables] :: PackageDescription -> [Executable]
[foreignLibs] :: PackageDescription -> [ForeignLib]
[testSuites] :: PackageDescription -> [TestSuite]
[benchmarks] :: PackageDescription -> [Benchmark]
[dataFiles] :: PackageDescription -> [FilePath]
[dataDir] :: PackageDescription -> FilePath
[extraSrcFiles] :: PackageDescription -> [FilePath]
[extraTmpFiles] :: PackageDescription -> [FilePath]
[extraDocFiles] :: PackageDescription -> [FilePath]

-- | The version of the Cabal spec that this package should be interpreted
°5uagainst.
°5u
°5uHistorically we used a version range but we are switching to using a
°5usingle version. Currently we accept either. This function converts
°5uinto a single version by ignoring upper bounds in the version range.
specVersion :: PackageDescription -> Version

specVersion' :: Either Version VersionRange -> Version

-- | The SPDX <tt>LicenseExpression</tt> of the package.
license :: PackageDescription -> License

-- | See <a>license</a>.
license' :: Either License License -> License

-- | The range of versions of the Cabal tools that this package is intended
°5uto work with.
°5u
°5uThis function is deprecated and should not be used for new purposes,
°5uonly to support old packages that rely on the old interpretation.

-- | <i>Deprecated: Use specVersion instead. This symbol will be removed in
°5uCabal-3.0 (est. Oct 2018).</i>
descCabalVersion :: PackageDescription -> VersionRange

-- | The effective <tt>build-type</tt> after applying defaulting rules.
°5u
°5uThe original <tt>build-type</tt> value parsed is stored in the
°5u<a>buildTypeRaw</a> field. However, the <tt>build-type</tt> field is
°5uoptional and can therefore be empty in which case we need to compute
°5uthe <i>effective</i> <tt>build-type</tt>. This function implements the
°5ufollowing defaulting rules:
°5u
°5u<ul>
°5u<li>For <tt>cabal-version:2.0</tt> and below, default to the
°5u<tt>Custom</tt> build-type unconditionally.</li>
°5u<li>Otherwise, if a <tt>custom-setup</tt> stanza is defined, default
°5uto the <tt>Custom</tt> build-type; else default to <tt>Simple</tt>
°5ubuild-type.</li>
°5u</ul>
buildType :: PackageDescription -> BuildType
emptyPackageDescription :: PackageDescription

-- | Does this package have a buildable PUBLIC library?
hasPublicLib :: PackageDescription -> Bool

-- | Does this package have any libraries?
hasLibs :: PackageDescription -> Bool
allLibraries :: PackageDescription -> [Library]

-- | If the package description has a buildable library section, call the
°5ugiven function with the library build info as argument. You probably
°5uwant <tt>withLibLBI</tt> if you have a <tt>LocalBuildInfo</tt>, see
°5uthe note in
°5u<a>Distribution.Types.ComponentRequestedSpec#buildable_vs_enabled_components</a>
°5ufor more information.
withLib :: PackageDescription -> (Library -> IO ()) -> IO ()

-- | does this package have any executables?
hasExes :: PackageDescription -> Bool

-- | Perform the action on each buildable <a>Executable</a> in the package
°5udescription. You probably want <tt>withExeLBI</tt> if you have a
°5u<tt>LocalBuildInfo</tt>, see the note in
°5u<a>Distribution.Types.ComponentRequestedSpec#buildable_vs_enabled_components</a>
°5ufor more information.
withExe :: PackageDescription -> (Executable -> IO ()) -> IO ()

-- | Does this package have any test suites?
hasTests :: PackageDescription -> Bool

-- | Perform an action on each buildable <a>TestSuite</a> in a package. You
°5uprobably want <tt>withTestLBI</tt> if you have a
°5u<tt>LocalBuildInfo</tt>, see the note in
°5u<a>Distribution.Types.ComponentRequestedSpec#buildable_vs_enabled_components</a>
°5ufor more information.
withTest :: PackageDescription -> (TestSuite -> IO ()) -> IO ()

-- | Does this package have any benchmarks?
hasBenchmarks :: PackageDescription -> Bool

-- | Perform an action on each buildable <a>Benchmark</a> in a package. You
°5uprobably want <tt>withBenchLBI</tt> if you have a
°5u<tt>LocalBuildInfo</tt>, see the note in
°5u<a>Distribution.Types.ComponentRequestedSpec#buildable_vs_enabled_components</a>
°5ufor more information.
withBenchmark :: PackageDescription -> (Benchmark -> IO ()) -> IO ()

-- | Does this package have any foreign libraries?
hasForeignLibs :: PackageDescription -> Bool

-- | Perform the action on each buildable <a>ForeignLib</a> in the package
°5udescription.
withForeignLib :: PackageDescription -> (ForeignLib -> IO ()) -> IO ()

-- | The <a>BuildInfo</a> for the library (if there is one and it's
°5ubuildable), and all buildable executables, test suites and benchmarks.
°5uUseful for gathering dependencies.
allBuildInfo :: PackageDescription -> [BuildInfo]

-- | Return all of the <a>BuildInfo</a>s of enabled components, i.e., all
°5uof the ones that would be built if you run <tt>./Setup build</tt>.
enabledBuildInfos :: PackageDescription -> ComponentRequestedSpec -> [BuildInfo]
updatePackageDescription :: HookedBuildInfo -> PackageDescription -> PackageDescription

-- | All the components in the package.
pkgComponents :: PackageDescription -> [Component]

-- | A list of all components in the package that are buildable, i.e., were
°5unot marked with <tt>buildable: False</tt>. This does NOT indicate if
°5uwe are actually going to build the component, see
°5u<a>enabledComponents</a> instead.
pkgBuildableComponents :: PackageDescription -> [Component]

-- | A list of all components in the package that are enabled.
enabledComponents :: PackageDescription -> ComponentRequestedSpec -> [Component]
lookupComponent :: PackageDescription -> ComponentName -> Maybe Component
getComponent :: PackageDescription -> ComponentName -> Component
instance Data.Data.Data Distribution.Types.PackageDescription.PackageDescription
instance GHC.Classes.Eq Distribution.Types.PackageDescription.PackageDescription
instance GHC.Read.Read Distribution.Types.PackageDescription.PackageDescription
instance GHC.Show.Show Distribution.Types.PackageDescription.PackageDescription
instance GHC.Generics.Generic Distribution.Types.PackageDescription.PackageDescription
instance Data.Binary.Class.Binary Distribution.Types.PackageDescription.PackageDescription
instance Control.DeepSeq.NFData Distribution.Types.PackageDescription.PackageDescription
instance Distribution.Package.Package Distribution.Types.PackageDescription.PackageDescription

module Distribution.Types.PackageDescription.Lens

-- | This data type is the internal representation of the file
°5u<tt>pkg.cabal</tt>. It contains two kinds of information about the
°5upackage: information which is needed for all packages, such as the
°5upackage name and version, and information which is needed for the
°5usimple build system only, such as the compiler options and library
°5uname.
data PackageDescription
package :: Lens' PackageDescription PackageIdentifier
licenseRaw :: Lens' PackageDescription (Either License License)
licenseFiles :: Lens' PackageDescription [String]
copyright :: Lens' PackageDescription String
maintainer :: Lens' PackageDescription String
author :: Lens' PackageDescription String
stability :: Lens' PackageDescription String
testedWith :: Lens' PackageDescription [(CompilerFlavor, VersionRange)]
homepage :: Lens' PackageDescription String
pkgUrl :: Lens' PackageDescription String
bugReports :: Lens' PackageDescription String
sourceRepos :: Lens' PackageDescription [SourceRepo]
synopsis :: Lens' PackageDescription String
description :: Lens' PackageDescription String
category :: Lens' PackageDescription String
customFieldsPD :: Lens' PackageDescription [(String, String)]
buildDepends :: Lens' PackageDescription [Dependency]
specVersionRaw :: Lens' PackageDescription (Either Version VersionRange)
buildTypeRaw :: Lens' PackageDescription (Maybe BuildType)
setupBuildInfo :: Lens' PackageDescription (Maybe SetupBuildInfo)
library :: Lens' PackageDescription (Maybe Library)
subLibraries :: Lens' PackageDescription [Library]
executables :: Lens' PackageDescription [Executable]
foreignLibs :: Lens' PackageDescription [ForeignLib]
testSuites :: Lens' PackageDescription [TestSuite]
benchmarks :: Lens' PackageDescription [Benchmark]
dataFiles :: Lens' PackageDescription [FilePath]
dataDir :: Lens' PackageDescription FilePath
extraSrcFiles :: Lens' PackageDescription [String]
extraTmpFiles :: Lens' PackageDescription [String]
extraDocFiles :: Lens' PackageDescription [String]

module Distribution.Types.GenericPackageDescription
data GenericPackageDescription
GenericPackageDescription :: PackageDescription -> [Flag] -> Maybe (CondTree ConfVar [Dependency] Library) -> [(UnqualComponentName, CondTree ConfVar [Dependency] Library)] -> [(UnqualComponentName, CondTree ConfVar [Dependency] ForeignLib)] -> [(UnqualComponentName, CondTree ConfVar [Dependency] Executable)] -> [(UnqualComponentName, CondTree ConfVar [Dependency] TestSuite)] -> [(UnqualComponentName, CondTree ConfVar [Dependency] Benchmark)] -> GenericPackageDescription
[packageDescription] :: GenericPackageDescription -> PackageDescription
[genPackageFlags] :: GenericPackageDescription -> [Flag]
[condLibrary] :: GenericPackageDescription -> Maybe (CondTree ConfVar [Dependency] Library)
[condSubLibraries] :: GenericPackageDescription -> [(UnqualComponentName, CondTree ConfVar [Dependency] Library)]
[condForeignLibs] :: GenericPackageDescription -> [(UnqualComponentName, CondTree ConfVar [Dependency] ForeignLib)]
[condExecutables] :: GenericPackageDescription -> [(UnqualComponentName, CondTree ConfVar [Dependency] Executable)]
[condTestSuites] :: GenericPackageDescription -> [(UnqualComponentName, CondTree ConfVar [Dependency] TestSuite)]
[condBenchmarks] :: GenericPackageDescription -> [(UnqualComponentName, CondTree ConfVar [Dependency] Benchmark)]
emptyGenericPackageDescription :: GenericPackageDescription

-- | A flag can represent a feature to be included, or a way of linking a
°5utarget against its dependencies, or in fact whatever you can think of.
data Flag
MkFlag :: FlagName -> String -> Bool -> Bool -> Flag
[flagName] :: Flag -> FlagName
[flagDescription] :: Flag -> String
[flagDefault] :: Flag -> Bool
[flagManual] :: Flag -> Bool

-- | A <a>Flag</a> initialized with default parameters.
emptyFlag :: FlagName -> Flag

-- | A <a>FlagName</a> is the name of a user-defined configuration flag
°5u
°5uUse <a>mkFlagName</a> and <a>unFlagName</a> to convert from/to a
°5u<a>String</a>.
°5u
°5uThis type is opaque since <tt>Cabal-2.0</tt>
data FlagName

-- | Construct a <a>FlagName</a> from a <a>String</a>
°5u
°5u<a>mkFlagName</a> is the inverse to <a>unFlagName</a>
°5u
°5uNote: No validations are performed to ensure that the resulting
°5u<a>FlagName</a> is valid
mkFlagName :: String -> FlagName

-- | Convert <a>FlagName</a> to <a>String</a>
unFlagName :: FlagName -> String

-- | A <a>FlagAssignment</a> is a total or partial mapping of
°5u<a>FlagName</a>s to <a>Bool</a> flag values. It represents the flags
°5uchosen by the user or discovered during configuration. For example
°5u<tt>--flags=foo --flags=-bar</tt> becomes <tt>[("foo", True), ("bar",
°5uFalse)]</tt>
data FlagAssignment

-- | Construct a <a>FlagAssignment</a> from a list of flag/value pairs.
°5u
°5uIf duplicate flags occur in the input list, the later entries in the
°5ulist will take precedence.
mkFlagAssignment :: [(FlagName, Bool)] -> FlagAssignment

-- | Deconstruct a <a>FlagAssignment</a> into a list of flag/value pairs.
°5u
°5u<pre>
°5u<a>null</a> (<a>findDuplicateFlagAssignments</a> fa) ==&gt; (<a>mkFlagAssignment</a> . <a>unFlagAssignment</a>) fa == fa
°5u</pre>
unFlagAssignment :: FlagAssignment -> [(FlagName, Bool)]

-- | Lookup the value for a flag
°5u
°5uReturns <a>Nothing</a> if the flag isn't contained in the
°5u<a>FlagAssignment</a>.
lookupFlagAssignment :: FlagName -> FlagAssignment -> Maybe Bool

-- | Insert or update the boolean value of a flag.
°5u
°5uIf the flag is already present in the <tt>FlagAssigment</tt>, the
°5uvalue will be updated and the fact that multiple values have been
°5uprovided for that flag will be recorded so that a warning can be
°5ugenerated later on.
insertFlagAssignment :: FlagName -> Bool -> FlagAssignment -> FlagAssignment

-- | Remove all flag-assignments from the first <a>FlagAssignment</a> that
°5uare contained in the second <a>FlagAssignment</a>
°5u
°5uNB/TODO: This currently only removes flag assignments which also match
°5uthe value assignment! We should review the code which uses this
°5uoperation to figure out if this it's not enough to only compare the
°5uflagnames without the values.
diffFlagAssignment :: FlagAssignment -> FlagAssignment -> FlagAssignment

-- | Find the <a>FlagName</a>s that have been listed more than once.
findDuplicateFlagAssignments :: FlagAssignment -> [FlagName]

-- | Test whether <a>FlagAssignment</a> is empty.
nullFlagAssignment :: FlagAssignment -> Bool

-- | String representation of a flag-value pair.
showFlagValue :: (FlagName, Bool) -> String

-- | Pretty-prints a flag assignment.
dispFlagAssignment :: FlagAssignment -> Doc

-- | Parses a flag assignment.
parseFlagAssignment :: ReadP r FlagAssignment

-- | Parses a flag assignment.
parsecFlagAssignment :: ParsecParser FlagAssignment

-- | A <tt>ConfVar</tt> represents the variable type used.
data ConfVar
OS :: OS -> ConfVar
Arch :: Arch -> ConfVar
Flag :: FlagName -> ConfVar
Impl :: CompilerFlavor -> VersionRange -> ConfVar
instance GHC.Generics.Generic Distribution.Types.GenericPackageDescription.GenericPackageDescription
instance Data.Data.Data Distribution.Types.GenericPackageDescription.GenericPackageDescription
instance GHC.Classes.Eq Distribution.Types.GenericPackageDescription.GenericPackageDescription
instance GHC.Show.Show Distribution.Types.GenericPackageDescription.GenericPackageDescription
instance GHC.Generics.Generic Distribution.Types.GenericPackageDescription.ConfVar
instance Data.Data.Data Distribution.Types.GenericPackageDescription.ConfVar
instance GHC.Show.Show Distribution.Types.GenericPackageDescription.ConfVar
instance GHC.Classes.Eq Distribution.Types.GenericPackageDescription.ConfVar
instance Control.DeepSeq.NFData Distribution.Types.GenericPackageDescription.FlagAssignment
instance Data.Binary.Class.Binary Distribution.Types.GenericPackageDescription.FlagAssignment
instance GHC.Generics.Generic Distribution.Types.GenericPackageDescription.Flag
instance Data.Data.Data Distribution.Types.GenericPackageDescription.Flag
instance GHC.Classes.Eq Distribution.Types.GenericPackageDescription.Flag
instance GHC.Show.Show Distribution.Types.GenericPackageDescription.Flag
instance Control.DeepSeq.NFData Distribution.Types.GenericPackageDescription.FlagName
instance Data.Data.Data Distribution.Types.GenericPackageDescription.FlagName
instance GHC.Read.Read Distribution.Types.GenericPackageDescription.FlagName
instance GHC.Show.Show Distribution.Types.GenericPackageDescription.FlagName
instance GHC.Classes.Ord Distribution.Types.GenericPackageDescription.FlagName
instance GHC.Generics.Generic Distribution.Types.GenericPackageDescription.FlagName
instance GHC.Classes.Eq Distribution.Types.GenericPackageDescription.FlagName
instance Distribution.Package.Package Distribution.Types.GenericPackageDescription.GenericPackageDescription
instance Data.Binary.Class.Binary Distribution.Types.GenericPackageDescription.GenericPackageDescription
instance Control.DeepSeq.NFData Distribution.Types.GenericPackageDescription.GenericPackageDescription
instance Data.Binary.Class.Binary Distribution.Types.GenericPackageDescription.ConfVar
instance Control.DeepSeq.NFData Distribution.Types.GenericPackageDescription.ConfVar
instance GHC.Classes.Eq Distribution.Types.GenericPackageDescription.FlagAssignment
instance GHC.Classes.Ord Distribution.Types.GenericPackageDescription.FlagAssignment
instance GHC.Base.Semigroup Distribution.Types.GenericPackageDescription.FlagAssignment
instance GHC.Base.Monoid Distribution.Types.GenericPackageDescription.FlagAssignment
instance GHC.Read.Read Distribution.Types.GenericPackageDescription.FlagAssignment
instance GHC.Show.Show Distribution.Types.GenericPackageDescription.FlagAssignment
instance Data.Binary.Class.Binary Distribution.Types.GenericPackageDescription.Flag
instance Control.DeepSeq.NFData Distribution.Types.GenericPackageDescription.Flag
instance Data.String.IsString Distribution.Types.GenericPackageDescription.FlagName
instance Data.Binary.Class.Binary Distribution.Types.GenericPackageDescription.FlagName
instance Distribution.Pretty.Pretty Distribution.Types.GenericPackageDescription.FlagName
instance Distribution.Parsec.Class.Parsec Distribution.Types.GenericPackageDescription.FlagName
instance Distribution.Text.Text Distribution.Types.GenericPackageDescription.FlagName

module Distribution.Types.GenericPackageDescription.Lens
data GenericPackageDescription

-- | A flag can represent a feature to be included, or a way of linking a
°5utarget against its dependencies, or in fact whatever you can think of.
data Flag

-- | A <a>FlagName</a> is the name of a user-defined configuration flag
°5u
°5uUse <a>mkFlagName</a> and <a>unFlagName</a> to convert from/to a
°5u<a>String</a>.
°5u
°5uThis type is opaque since <tt>Cabal-2.0</tt>
data FlagName

-- | A <tt>ConfVar</tt> represents the variable type used.
data ConfVar
OS :: OS -> ConfVar
Arch :: Arch -> ConfVar
Flag :: FlagName -> ConfVar
Impl :: CompilerFlavor -> VersionRange -> ConfVar
condBenchmarks :: Lens' GenericPackageDescription [(UnqualComponentName, CondTree ConfVar [Dependency] Benchmark)]
condExecutables :: Lens' GenericPackageDescription [(UnqualComponentName, CondTree ConfVar [Dependency] Executable)]
condForeignLibs :: Lens' GenericPackageDescription [(UnqualComponentName, CondTree ConfVar [Dependency] ForeignLib)]
condLibrary :: Lens' GenericPackageDescription (Maybe (CondTree ConfVar [Dependency] Library))
condSubLibraries :: Lens' GenericPackageDescription [(UnqualComponentName, CondTree ConfVar [Dependency] Library)]
condTestSuites :: Lens' GenericPackageDescription [(UnqualComponentName, CondTree ConfVar [Dependency] TestSuite)]
genPackageFlags :: Lens' GenericPackageDescription [Flag]
packageDescription :: Lens' GenericPackageDescription PackageDescription
buildInfos :: Traversal' GenericPackageDescription BuildInfo
flagName :: Lens' Flag FlagName
flagDescription :: Lens' Flag String
flagDefault :: Lens' Flag Bool
flagManual :: Lens' Flag Bool
_OS :: Traversal' ConfVar OS
_Arch :: Traversal' ConfVar Arch
_Flag :: Traversal' ConfVar FlagName
_Impl :: Traversal' ConfVar (CompilerFlavor, VersionRange)

module Distribution.Types.Benchmark.Lens

-- | A "benchmark" stanza in a cabal file.
data Benchmark
benchmarkName :: Lens' Benchmark UnqualComponentName
benchmarkInterface :: Lens' Benchmark BenchmarkInterface
benchmarkBuildInfo :: Lens' Benchmark BuildInfo

module Distribution.Types.Lens


-- | Backwards compatibility reexport of everything you need to know about
°5u<tt>.cabal</tt> files.
module Distribution.PackageDescription

-- | This data type is the internal representation of the file
°5u<tt>pkg.cabal</tt>. It contains two kinds of information about the
°5upackage: information which is needed for all packages, such as the
°5upackage name and version, and information which is needed for the
°5usimple build system only, such as the compiler options and library
°5uname.
data PackageDescription
PackageDescription :: Either Version VersionRange -> PackageIdentifier -> Either License License -> [FilePath] -> String -> String -> String -> String -> [(CompilerFlavor, VersionRange)] -> String -> String -> String -> [SourceRepo] -> String -> String -> String -> [(String, String)] -> [Dependency] -> Maybe BuildType -> Maybe SetupBuildInfo -> Maybe Library -> [Library] -> [Executable] -> [ForeignLib] -> [TestSuite] -> [Benchmark] -> [FilePath] -> FilePath -> [FilePath] -> [FilePath] -> [FilePath] -> PackageDescription

-- | The version of the Cabal spec that this package description uses. For
°5uhistorical reasons this is specified with a version range but only
°5uranges of the form <tt>&gt;= v</tt> make sense. We are in the process
°5uof transitioning to specifying just a single version, not a range. See
°5ualso <a>specVersion</a>.
[specVersionRaw] :: PackageDescription -> Either Version VersionRange
[package] :: PackageDescription -> PackageIdentifier
[licenseRaw] :: PackageDescription -> Either License License
[licenseFiles] :: PackageDescription -> [FilePath]
[copyright] :: PackageDescription -> String
[maintainer] :: PackageDescription -> String
[author] :: PackageDescription -> String
[stability] :: PackageDescription -> String
[testedWith] :: PackageDescription -> [(CompilerFlavor, VersionRange)]
[homepage] :: PackageDescription -> String
[pkgUrl] :: PackageDescription -> String
[bugReports] :: PackageDescription -> String
[sourceRepos] :: PackageDescription -> [SourceRepo]

-- | A one-line summary of this package
[synopsis] :: PackageDescription -> String

-- | A more verbose description of this package
[description] :: PackageDescription -> String
[category] :: PackageDescription -> String

-- | Custom fields starting with x-, stored in a simple assoc-list.
[customFieldsPD] :: PackageDescription -> [(String, String)]

-- | YOU PROBABLY DON'T WANT TO USE THIS FIELD. This field is special!
°5uDepending on how far along processing the PackageDescription we are,
°5uthe contents of this field are either nonsense, or the collected
°5udependencies of *all* the components in this package. buildDepends is
°5uinitialized by <tt>finalizePD</tt> and
°5u<tt>flattenPackageDescription</tt>; prior to that, dependency info is
°5ustored in the <tt>CondTree</tt> built around a
°5u<tt>GenericPackageDescription</tt>. When this resolution is done,
°5udependency info is written to the inner <a>BuildInfo</a> and this
°5ufield. This is all horrible, and #2066 tracks progress to get rid of
°5uthis field.
[buildDepends] :: PackageDescription -> [Dependency]

-- | The original <tt>build-type</tt> value as parsed from the
°5u<tt>.cabal</tt> file without defaulting. See also <a>buildType</a>.
[buildTypeRaw] :: PackageDescription -> Maybe BuildType
[setupBuildInfo] :: PackageDescription -> Maybe SetupBuildInfo
[library] :: PackageDescription -> Maybe Library
[subLibraries] :: PackageDescription -> [Library]
[executables] :: PackageDescription -> [Executable]
[foreignLibs] :: PackageDescription -> [ForeignLib]
[testSuites] :: PackageDescription -> [TestSuite]
[benchmarks] :: PackageDescription -> [Benchmark]
[dataFiles] :: PackageDescription -> [FilePath]
[dataDir] :: PackageDescription -> FilePath
[extraSrcFiles] :: PackageDescription -> [FilePath]
[extraTmpFiles] :: PackageDescription -> [FilePath]
[extraDocFiles] :: PackageDescription -> [FilePath]
emptyPackageDescription :: PackageDescription

-- | The version of the Cabal spec that this package should be interpreted
°5uagainst.
°5u
°5uHistorically we used a version range but we are switching to using a
°5usingle version. Currently we accept either. This function converts
°5uinto a single version by ignoring upper bounds in the version range.
specVersion :: PackageDescription -> Version

-- | The effective <tt>build-type</tt> after applying defaulting rules.
°5u
°5uThe original <tt>build-type</tt> value parsed is stored in the
°5u<a>buildTypeRaw</a> field. However, the <tt>build-type</tt> field is
°5uoptional and can therefore be empty in which case we need to compute
°5uthe <i>effective</i> <tt>build-type</tt>. This function implements the
°5ufollowing defaulting rules:
°5u
°5u<ul>
°5u<li>For <tt>cabal-version:2.0</tt> and below, default to the
°5u<tt>Custom</tt> build-type unconditionally.</li>
°5u<li>Otherwise, if a <tt>custom-setup</tt> stanza is defined, default
°5uto the <tt>Custom</tt> build-type; else default to <tt>Simple</tt>
°5ubuild-type.</li>
°5u</ul>
buildType :: PackageDescription -> BuildType

-- | The SPDX <tt>LicenseExpression</tt> of the package.
license :: PackageDescription -> License

-- | The range of versions of the Cabal tools that this package is intended
°5uto work with.
°5u
°5uThis function is deprecated and should not be used for new purposes,
°5uonly to support old packages that rely on the old interpretation.

-- | <i>Deprecated: Use specVersion instead. This symbol will be removed in
°5uCabal-3.0 (est. Oct 2018).</i>
descCabalVersion :: PackageDescription -> VersionRange

-- | The type of build system used by this package.
data BuildType

-- | calls <tt>Distribution.Simple.defaultMain</tt>
Simple :: BuildType

-- | calls <tt>Distribution.Simple.defaultMainWithHooks
°5udefaultUserHooks</tt>, which invokes <tt>configure</tt> to generate
°5uadditional build information used by later phases.
Configure :: BuildType

-- | calls <tt>Distribution.Make.defaultMain</tt>
Make :: BuildType

-- | uses user-supplied <tt>Setup.hs</tt> or <tt>Setup.lhs</tt> (default)
Custom :: BuildType
knownBuildTypes :: [BuildType]
allLibraries :: PackageDescription -> [Library]

-- | Renaming applied to the modules provided by a package. The boolean
°5uindicates whether or not to also include all of the original names of
°5umodules. Thus, <tt>ModuleRenaming False []</tt> is "don't expose any
°5umodules, and <tt>ModuleRenaming True [(<a>Data.Bool</a>,
°5u<a>Bool</a>)]</tt> is, "expose all modules, but also expose
°5u<tt>Data.Bool</tt> as <tt>Bool</tt>". If a renaming is omitted you get
°5uthe <a>DefaultRenaming</a>.
°5u
°5u(NB: This is a list not a map so that we can preserve order.)
data ModuleRenaming

-- | A module renaming/thinning; e.g., <tt>(A as B, C as C)</tt> brings
°5u<tt>B</tt> and <tt>C</tt> into scope.
ModuleRenaming :: [(ModuleName, ModuleName)] -> ModuleRenaming

-- | The default renaming, bringing all exported modules into scope.
DefaultRenaming :: ModuleRenaming

-- | Hiding renaming, e.g., <tt>hiding (A, B)</tt>, bringing all exported
°5umodules into scope except the hidden ones.
HidingRenaming :: [ModuleName] -> ModuleRenaming

-- | The default renaming, if something is specified in
°5u<tt>build-depends</tt> only.
defaultRenaming :: ModuleRenaming
data Library
Library :: Maybe UnqualComponentName -> [ModuleName] -> [ModuleReexport] -> [ModuleName] -> Bool -> BuildInfo -> Library
[libName] :: Library -> Maybe UnqualComponentName
[exposedModules] :: Library -> [ModuleName]
[reexportedModules] :: Library -> [ModuleReexport]

-- | What sigs need implementations?
[signatures] :: Library -> [ModuleName]

-- | Is the lib to be exposed by default?
[libExposed] :: Library -> Bool
[libBuildInfo] :: Library -> BuildInfo
data ModuleReexport
ModuleReexport :: Maybe PackageName -> ModuleName -> ModuleName -> ModuleReexport
[moduleReexportOriginalPackage] :: ModuleReexport -> Maybe PackageName
[moduleReexportOriginalName] :: ModuleReexport -> ModuleName
[moduleReexportName] :: ModuleReexport -> ModuleName
emptyLibrary :: Library

-- | If the package description has a buildable library section, call the
°5ugiven function with the library build info as argument. You probably
°5uwant <tt>withLibLBI</tt> if you have a <tt>LocalBuildInfo</tt>, see
°5uthe note in
°5u<a>Distribution.Types.ComponentRequestedSpec#buildable_vs_enabled_components</a>
°5ufor more information.
withLib :: PackageDescription -> (Library -> IO ()) -> IO ()

-- | Does this package have a buildable PUBLIC library?
hasPublicLib :: PackageDescription -> Bool

-- | Does this package have any libraries?
hasLibs :: PackageDescription -> Bool

-- | Get all the module names from the library (exposed and internal
°5umodules) which are explicitly listed in the package description which
°5uwould need to be compiled. (This does not include reexports, which do
°5unot need to be compiled.) This may not include all modules for which
°5uGHC generated interface files (i.e., implicit modules.)
explicitLibModules :: Library -> [ModuleName]

-- | Get all the auto generated module names from the library, exposed or
°5unot. This are a subset of <a>libModules</a>.
libModulesAutogen :: Library -> [ModuleName]

-- | Backwards-compatibility shim for <a>explicitLibModules</a>. In most
°5ucases, you actually want <tt>allLibModules</tt>, which returns all
°5umodules that will actually be compiled, as opposed to those which are
°5uexplicitly listed in the package description
°5u(<a>explicitLibModules</a>); unfortunately, the type signature for
°5u<tt>allLibModules</tt> is incompatible since we need a
°5u<tt>ComponentLocalBuildInfo</tt>.

-- | <i>Deprecated: If you want all modules that are built with a library,
°5uuse <tt>allLibModules</tt>. Otherwise, use <a>explicitLibModules</a>
°5ufor ONLY the modules explicitly mentioned in the package description.
°5uThis symbol will be removed in Cabal-3.0 (est. Oct 2018).</i>
libModules :: Library -> [ModuleName]
data Executable
Executable :: UnqualComponentName -> FilePath -> ExecutableScope -> BuildInfo -> Executable
[exeName] :: Executable -> UnqualComponentName
[modulePath] :: Executable -> FilePath
[exeScope] :: Executable -> ExecutableScope
[buildInfo] :: Executable -> BuildInfo
emptyExecutable :: Executable

-- | Perform the action on each buildable <a>Executable</a> in the package
°5udescription. You probably want <tt>withExeLBI</tt> if you have a
°5u<tt>LocalBuildInfo</tt>, see the note in
°5u<a>Distribution.Types.ComponentRequestedSpec#buildable_vs_enabled_components</a>
°5ufor more information.
withExe :: PackageDescription -> (Executable -> IO ()) -> IO ()

-- | does this package have any executables?
hasExes :: PackageDescription -> Bool

-- | Get all the module names from an exe
exeModules :: Executable -> [ModuleName]

-- | Get all the auto generated module names from an exe This are a subset
°5uof <a>exeModules</a>.
exeModulesAutogen :: Executable -> [ModuleName]

-- | A "test-suite" stanza in a cabal file.
data TestSuite
TestSuite :: UnqualComponentName -> TestSuiteInterface -> BuildInfo -> TestSuite
[testName] :: TestSuite -> UnqualComponentName
[testInterface] :: TestSuite -> TestSuiteInterface
[testBuildInfo] :: TestSuite -> BuildInfo

-- | The test suite interfaces that are currently defined. Each test suite
°5umust specify which interface it supports.
°5u
°5uMore interfaces may be defined in future, either new revisions or
°5utotally new interfaces.
data TestSuiteInterface

-- | Test interface "exitcode-stdio-1.0". The test-suite takes the form of
°5uan executable. It returns a zero exit code for success, non-zero for
°5ufailure. The stdout and stderr channels may be logged. It takes no
°5ucommand line parameters and nothing on stdin.
TestSuiteExeV10 :: Version -> FilePath -> TestSuiteInterface

-- | Test interface "detailed-0.9". The test-suite takes the form of a
°5ulibrary containing a designated module that exports "tests :: [Test]".
TestSuiteLibV09 :: Version -> ModuleName -> TestSuiteInterface

-- | A test suite that does not conform to one of the above interfaces for
°5uthe given reason (e.g. unknown test type).
TestSuiteUnsupported :: TestType -> TestSuiteInterface

-- | The "test-type" field in the test suite stanza.
data TestType

-- | "type: exitcode-stdio-x.y"
TestTypeExe :: Version -> TestType

-- | "type: detailed-x.y"
TestTypeLib :: Version -> TestType

-- | Some unknown test type e.g. "type: foo"
TestTypeUnknown :: String -> Version -> TestType
testType :: TestSuite -> TestType
knownTestTypes :: [TestType]
emptyTestSuite :: TestSuite

-- | Does this package have any test suites?
hasTests :: PackageDescription -> Bool

-- | Perform an action on each buildable <a>TestSuite</a> in a package. You
°5uprobably want <tt>withTestLBI</tt> if you have a
°5u<tt>LocalBuildInfo</tt>, see the note in
°5u<a>Distribution.Types.ComponentRequestedSpec#buildable_vs_enabled_components</a>
°5ufor more information.
withTest :: PackageDescription -> (TestSuite -> IO ()) -> IO ()

-- | Get all the module names from a test suite.
testModules :: TestSuite -> [ModuleName]

-- | Get all the auto generated module names from a test suite. This are a
°5usubset of <a>testModules</a>.
testModulesAutogen :: TestSuite -> [ModuleName]

-- | A "benchmark" stanza in a cabal file.
data Benchmark
Benchmark :: UnqualComponentName -> BenchmarkInterface -> BuildInfo -> Benchmark
[benchmarkName] :: Benchmark -> UnqualComponentName
[benchmarkInterface] :: Benchmark -> BenchmarkInterface
[benchmarkBuildInfo] :: Benchmark -> BuildInfo

-- | The benchmark interfaces that are currently defined. Each benchmark
°5umust specify which interface it supports.
°5u
°5uMore interfaces may be defined in future, either new revisions or
°5utotally new interfaces.
data BenchmarkInterface

-- | Benchmark interface "exitcode-stdio-1.0". The benchmark takes the form
°5uof an executable. It returns a zero exit code for success, non-zero
°5ufor failure. The stdout and stderr channels may be logged. It takes no
°5ucommand line parameters and nothing on stdin.
BenchmarkExeV10 :: Version -> FilePath -> BenchmarkInterface

-- | A benchmark that does not conform to one of the above interfaces for
°5uthe given reason (e.g. unknown benchmark type).
BenchmarkUnsupported :: BenchmarkType -> BenchmarkInterface

-- | The "benchmark-type" field in the benchmark stanza.
data BenchmarkType

-- | "type: exitcode-stdio-x.y"
BenchmarkTypeExe :: Version -> BenchmarkType

-- | Some unknown benchmark type e.g. "type: foo"
BenchmarkTypeUnknown :: String -> Version -> BenchmarkType
benchmarkType :: Benchmark -> BenchmarkType
knownBenchmarkTypes :: [BenchmarkType]
emptyBenchmark :: Benchmark

-- | Does this package have any benchmarks?
hasBenchmarks :: PackageDescription -> Bool

-- | Perform an action on each buildable <a>Benchmark</a> in a package. You
°5uprobably want <tt>withBenchLBI</tt> if you have a
°5u<tt>LocalBuildInfo</tt>, see the note in
°5u<a>Distribution.Types.ComponentRequestedSpec#buildable_vs_enabled_components</a>
°5ufor more information.
withBenchmark :: PackageDescription -> (Benchmark -> IO ()) -> IO ()

-- | Get all the module names from a benchmark.
benchmarkModules :: Benchmark -> [ModuleName]

-- | Get all the auto generated module names from a benchmark. This are a
°5usubset of <a>benchmarkModules</a>.
benchmarkModulesAutogen :: Benchmark -> [ModuleName]
data BuildInfo
BuildInfo :: Bool -> [LegacyExeDependency] -> [ExeDependency] -> [String] -> [String] -> [String] -> [String] -> [String] -> [String] -> [PkgconfigDependency] -> [String] -> [String] -> [FilePath] -> [FilePath] -> [FilePath] -> [FilePath] -> [FilePath] -> [FilePath] -> [ModuleName] -> [ModuleName] -> [ModuleName] -> Maybe Language -> [Language] -> [Extension] -> [Extension] -> [Extension] -> [String] -> [String] -> [String] -> [String] -> [String] -> [FilePath] -> [FilePath] -> [FilePath] -> [(CompilerFlavor, [String])] -> [(CompilerFlavor, [String])] -> [(CompilerFlavor, [String])] -> [(CompilerFlavor, [String])] -> [(String, String)] -> [Dependency] -> [Mixin] -> BuildInfo

-- | component is buildable here
[buildable] :: BuildInfo -> Bool

-- | Tools needed to build this bit.
°5u
°5uThis is a legacy field that <a>buildToolDepends</a> larely supersedes.
°5u
°5uUnless use are very sure what you are doing, use the functions in
°5u<a>Distribution.Simple.BuildToolDepends</a> rather than accessing this
°5ufield directly.
[buildTools] :: BuildInfo -> [LegacyExeDependency]

-- | Haskell tools needed to build this bit
°5u
°5uThis field is better than <a>buildTools</a> because it allows one to
°5uprecisely specify an executable in a package.
°5u
°5uUnless use are very sure what you are doing, use the functions in
°5u<a>Distribution.Simple.BuildToolDepends</a> rather than accessing this
°5ufield directly.
[buildToolDepends] :: BuildInfo -> [ExeDependency]

-- | options for pre-processing Haskell code
[cppOptions] :: BuildInfo -> [String]

-- | options for assmebler
[asmOptions] :: BuildInfo -> [String]

-- | options for C-- compiler
[cmmOptions] :: BuildInfo -> [String]

-- | options for C compiler
[ccOptions] :: BuildInfo -> [String]

-- | options for C++ compiler
[cxxOptions] :: BuildInfo -> [String]

-- | options for linker
[ldOptions] :: BuildInfo -> [String]

-- | pkg-config packages that are used
[pkgconfigDepends] :: BuildInfo -> [PkgconfigDependency]

-- | support frameworks for Mac OS X
[frameworks] :: BuildInfo -> [String]

-- | extra locations to find frameworks.
[extraFrameworkDirs] :: BuildInfo -> [String]

-- | Assembly files.
[asmSources] :: BuildInfo -> [FilePath]

-- | C-- files.
[cmmSources] :: BuildInfo -> [FilePath]
[cSources] :: BuildInfo -> [FilePath]
[cxxSources] :: BuildInfo -> [FilePath]
[jsSources] :: BuildInfo -> [FilePath]

-- | where to look for the Haskell module hierarchy
[hsSourceDirs] :: BuildInfo -> [FilePath]

-- | non-exposed or non-main modules
[otherModules] :: BuildInfo -> [ModuleName]

-- | exposed modules that do not have a source file (e.g. <tt>GHC.Prim</tt>
°5ufrom <tt>ghc-prim</tt> package)
[virtualModules] :: BuildInfo -> [ModuleName]

-- | not present on sdist, Paths_* or user-generated with a custom Setup.hs
[autogenModules] :: BuildInfo -> [ModuleName]

-- | language used when not explicitly specified
[defaultLanguage] :: BuildInfo -> Maybe Language

-- | other languages used within the package
[otherLanguages] :: BuildInfo -> [Language]

-- | language extensions used by all modules
[defaultExtensions] :: BuildInfo -> [Extension]

-- | other language extensions used within the package
[otherExtensions] :: BuildInfo -> [Extension]

-- | the old extensions field, treated same as <a>defaultExtensions</a>
[oldExtensions] :: BuildInfo -> [Extension]

-- | what libraries to link with when compiling a program that uses your
°5upackage
[extraLibs] :: BuildInfo -> [String]

-- | if present, overrides extraLibs when package is loaded with GHCi.
[extraGHCiLibs] :: BuildInfo -> [String]

-- | if present, adds libs to hs-lirbaries, which become part of the
°5upackage. Example: the Cffi library shipping with the rts, alognside
°5uthe HSrts-1.0.a,.o,... Example 2: a library that is being built by a
°5uforeing tool (e.g. rust) and copied and registered together with this
°5ulibrary. The logic on how this library is built will have to be
°5uencoded in a custom Setup for now. Oherwise cabal would need to lear
°5uhow to call arbitary lirbary builders.
[extraBundledLibs] :: BuildInfo -> [String]

-- | Hidden Flag. This set of strings, will be appended to all lirbaries
°5uwhen copying. E.g. [libHS<a>name</a>_<a>flavour</a> | flavour &lt;-
°5uextraLibFlavours]. This should only be needed in very specific cases,
°5ue.g. the <tt>rts</tt> package, where there are multiple copies of
°5uslightly differently built libs.
[extraLibFlavours] :: BuildInfo -> [String]
[extraLibDirs] :: BuildInfo -> [String]

-- | directories to find .h files
[includeDirs] :: BuildInfo -> [FilePath]

-- | The .h files to be found in includeDirs
[includes] :: BuildInfo -> [FilePath]

-- | .h files to install with the package
[installIncludes] :: BuildInfo -> [FilePath]
[options] :: BuildInfo -> [(CompilerFlavor, [String])]
[profOptions] :: BuildInfo -> [(CompilerFlavor, [String])]
[sharedOptions] :: BuildInfo -> [(CompilerFlavor, [String])]
[staticOptions] :: BuildInfo -> [(CompilerFlavor, [String])]

-- | Custom fields starting with x-, stored in a simple assoc-list.
[customFieldsBI] :: BuildInfo -> [(String, String)]

-- | Dependencies specific to a library or executable target
[targetBuildDepends] :: BuildInfo -> [Dependency]
[mixins] :: BuildInfo -> [Mixin]
emptyBuildInfo :: BuildInfo

-- | The <a>BuildInfo</a> for the library (if there is one and it's
°5ubuildable), and all buildable executables, test suites and benchmarks.
°5uUseful for gathering dependencies.
allBuildInfo :: PackageDescription -> [BuildInfo]

-- | The <a>Language</a>s used by this component
allLanguages :: BuildInfo -> [Language]

-- | The <a>Extension</a>s that are used somewhere by this component
allExtensions :: BuildInfo -> [Extension]

-- | The <tt>Extensions</tt> that are used by all modules in this component
usedExtensions :: BuildInfo -> [Extension]

-- | Whether any modules in this component use Template Haskell or Quasi
°5uQuotes
usesTemplateHaskellOrQQ :: BuildInfo -> Bool

-- | Select options for a particular Haskell compiler.
hcOptions :: CompilerFlavor -> BuildInfo -> [String]
hcProfOptions :: CompilerFlavor -> BuildInfo -> [String]
hcSharedOptions :: CompilerFlavor -> BuildInfo -> [String]
hcStaticOptions :: CompilerFlavor -> BuildInfo -> [String]
data ComponentName
CLibName :: ComponentName
CSubLibName :: UnqualComponentName -> ComponentName
CFLibName :: UnqualComponentName -> ComponentName
CExeName :: UnqualComponentName -> ComponentName
CTestName :: UnqualComponentName -> ComponentName
CBenchName :: UnqualComponentName -> ComponentName
defaultLibName :: ComponentName

-- | <a>HookedBuildInfo</a> is mechanism that hooks can use to override the
°5u<a>BuildInfo</a>s inside packages. One example use-case (which is used
°5uin core libraries today) is as a way of passing flags which are
°5ucomputed by a configure script into Cabal. In this case, the autoconf
°5ubuild type adds hooks to read in a textual <a>HookedBuildInfo</a>
°5uformat prior to doing any operations.
°5u
°5uQuite honestly, this mechanism is a massive hack since we shouldn't be
°5uediting the <tt>PackageDescription</tt> data structure (it's easy to
°5uassume that this data structure shouldn't change and run into bugs,
°5usee for example 1c20a6328579af9e37677d507e2e9836ef70ab9d). But it's a
°5ubit convenient, because there isn't another data structure that allows
°5uadding extra <a>BuildInfo</a> style things.
°5u
°5uIn any case, a lot of care has to be taken to make sure the
°5u<a>HookedBuildInfo</a> is applied to the <tt>PackageDescription</tt>.
°5uIn general this process occurs in <a>Distribution.Simple</a>, which is
°5uresponsible for orchestrating the hooks mechanism. The general
°5ustrategy:
°5u
°5u<ol>
°5u<li>We run the pre-hook, which produces a <a>HookedBuildInfo</a>
°5u(e.g., in the Autoconf case, it reads it out from a file).</li>
°5u<li>We sanity-check the hooked build info with
°5u<tt>sanityCheckHookedBuildInfo</tt>.</li>
°5u<li>We update our <tt>PackageDescription</tt> (either freshly read or
°5ucached from <tt>LocalBuildInfo</tt>) with
°5u<tt>updatePackageDescription</tt>.</li>
°5u</ol>
°5u
°5uIn principle, we are also supposed to update the copy of the
°5u<tt>PackageDescription</tt> stored in <tt>LocalBuildInfo</tt> at
°5u<tt>localPkgDescr</tt>. Unfortunately, in practice, there are lots of
°5uCustom setup scripts which fail to update <tt>localPkgDescr</tt> so
°5uyou really shouldn't rely on it. It's not DEPRECATED because there are
°5ulegitimate uses for it, but... yeah. Sharp knife. See
°5u<a>https://github.com/haskell/cabal/issues/3606</a> for more
°5uinformation on the issue.
°5u
°5uIt is not well-specified whether or not a <a>HookedBuildInfo</a>
°5uapplied at configure time is persistent to the
°5u<tt>LocalBuildInfo</tt>. The fact that <a>HookedBuildInfo</a> is
°5upassed to <tt>confHook</tt> MIGHT SUGGEST that the
°5u<a>HookedBuildInfo</a> is applied at this time, but actually since
°5u9317b67e6122ab14e53f81b573bd0ecb388eca5a it has been ONLY used to
°5ucreate a modified package description that we check for problems: it
°5uis never actually saved to the LBI. Since <a>HookedBuildInfo</a> is
°5uapplied monoidally to the existing build infos (and it is not an
°5uidempotent monoid), it could break things to save it, since we are
°5uobligated to apply any new <a>HookedBuildInfo</a> and then we'd get
°5uthe effect twice. But this does mean we have to re-apply it every
°5utime. Hey, it's more flexibility.
type HookedBuildInfo = (Maybe BuildInfo, [(UnqualComponentName, BuildInfo)])
emptyHookedBuildInfo :: HookedBuildInfo
updatePackageDescription :: HookedBuildInfo -> PackageDescription -> PackageDescription
data GenericPackageDescription
GenericPackageDescription :: PackageDescription -> [Flag] -> Maybe (CondTree ConfVar [Dependency] Library) -> [(UnqualComponentName, CondTree ConfVar [Dependency] Library)] -> [(UnqualComponentName, CondTree ConfVar [Dependency] ForeignLib)] -> [(UnqualComponentName, CondTree ConfVar [Dependency] Executable)] -> [(UnqualComponentName, CondTree ConfVar [Dependency] TestSuite)] -> [(UnqualComponentName, CondTree ConfVar [Dependency] Benchmark)] -> GenericPackageDescription
[packageDescription] :: GenericPackageDescription -> PackageDescription
[genPackageFlags] :: GenericPackageDescription -> [Flag]
[condLibrary] :: GenericPackageDescription -> Maybe (CondTree ConfVar [Dependency] Library)
[condSubLibraries] :: GenericPackageDescription -> [(UnqualComponentName, CondTree ConfVar [Dependency] Library)]
[condForeignLibs] :: GenericPackageDescription -> [(UnqualComponentName, CondTree ConfVar [Dependency] ForeignLib)]
[condExecutables] :: GenericPackageDescription -> [(UnqualComponentName, CondTree ConfVar [Dependency] Executable)]
[condTestSuites] :: GenericPackageDescription -> [(UnqualComponentName, CondTree ConfVar [Dependency] TestSuite)]
[condBenchmarks] :: GenericPackageDescription -> [(UnqualComponentName, CondTree ConfVar [Dependency] Benchmark)]

-- | A flag can represent a feature to be included, or a way of linking a
°5utarget against its dependencies, or in fact whatever you can think of.
data Flag
MkFlag :: FlagName -> String -> Bool -> Bool -> Flag
[flagName] :: Flag -> FlagName
[flagDescription] :: Flag -> String
[flagDefault] :: Flag -> Bool
[flagManual] :: Flag -> Bool

-- | A <a>Flag</a> initialized with default parameters.
emptyFlag :: FlagName -> Flag

-- | A <a>FlagName</a> is the name of a user-defined configuration flag
°5u
°5uUse <a>mkFlagName</a> and <a>unFlagName</a> to convert from/to a
°5u<a>String</a>.
°5u
°5uThis type is opaque since <tt>Cabal-2.0</tt>
data FlagName

-- | Construct a <a>FlagName</a> from a <a>String</a>
°5u
°5u<a>mkFlagName</a> is the inverse to <a>unFlagName</a>
°5u
°5uNote: No validations are performed to ensure that the resulting
°5u<a>FlagName</a> is valid
mkFlagName :: String -> FlagName

-- | Convert <a>FlagName</a> to <a>String</a>
unFlagName :: FlagName -> String

-- | A <a>FlagAssignment</a> is a total or partial mapping of
°5u<a>FlagName</a>s to <a>Bool</a> flag values. It represents the flags
°5uchosen by the user or discovered during configuration. For example
°5u<tt>--flags=foo --flags=-bar</tt> becomes <tt>[("foo", True), ("bar",
°5uFalse)]</tt>
data FlagAssignment

-- | Construct a <a>FlagAssignment</a> from a list of flag/value pairs.
°5u
°5uIf duplicate flags occur in the input list, the later entries in the
°5ulist will take precedence.
mkFlagAssignment :: [(FlagName, Bool)] -> FlagAssignment

-- | Deconstruct a <a>FlagAssignment</a> into a list of flag/value pairs.
°5u
°5u<pre>
°5u<a>null</a> (<a>findDuplicateFlagAssignments</a> fa) ==&gt; (<a>mkFlagAssignment</a> . <a>unFlagAssignment</a>) fa == fa
°5u</pre>
unFlagAssignment :: FlagAssignment -> [(FlagName, Bool)]

-- | Test whether <a>FlagAssignment</a> is empty.
nullFlagAssignment :: FlagAssignment -> Bool

-- | String representation of a flag-value pair.
showFlagValue :: (FlagName, Bool) -> String

-- | Remove all flag-assignments from the first <a>FlagAssignment</a> that
°5uare contained in the second <a>FlagAssignment</a>
°5u
°5uNB/TODO: This currently only removes flag assignments which also match
°5uthe value assignment! We should review the code which uses this
°5uoperation to figure out if this it's not enough to only compare the
°5uflagnames without the values.
diffFlagAssignment :: FlagAssignment -> FlagAssignment -> FlagAssignment

-- | Lookup the value for a flag
°5u
°5uReturns <a>Nothing</a> if the flag isn't contained in the
°5u<a>FlagAssignment</a>.
lookupFlagAssignment :: FlagName -> FlagAssignment -> Maybe Bool

-- | Insert or update the boolean value of a flag.
°5u
°5uIf the flag is already present in the <tt>FlagAssigment</tt>, the
°5uvalue will be updated and the fact that multiple values have been
°5uprovided for that flag will be recorded so that a warning can be
°5ugenerated later on.
insertFlagAssignment :: FlagName -> Bool -> FlagAssignment -> FlagAssignment

-- | Pretty-prints a flag assignment.
dispFlagAssignment :: FlagAssignment -> Doc

-- | Parses a flag assignment.
parseFlagAssignment :: ReadP r FlagAssignment

-- | Parses a flag assignment.
parsecFlagAssignment :: ParsecParser FlagAssignment

-- | Find the <a>FlagName</a>s that have been listed more than once.
findDuplicateFlagAssignments :: FlagAssignment -> [FlagName]

-- | A <a>CondTree</a> is used to represent the conditional structure of a
°5uCabal file, reflecting a syntax element subject to constraints, and
°5uthen any number of sub-elements which may be enabled subject to some
°5ucondition. Both <tt>a</tt> and <tt>c</tt> are usually <a>Monoid</a>s.
°5u
°5uTo be more concrete, consider the following fragment of a
°5u<tt>Cabal</tt> file:
°5u
°5u<pre>
°5ubuild-depends: base &gt;= 4.0
°5uif flag(extra)
°5u    build-depends: base &gt;= 4.2
°5u</pre>
°5u
°5uOne way to represent this is to have <tt><a>CondTree</a>
°5u<tt>ConfVar</tt> [<tt>Dependency</tt>] <tt>BuildInfo</tt></tt>. Here,
°5u<a>condTreeData</a> represents the actual fields which are not behind
°5uany conditional, while <a>condTreeComponents</a> recursively records
°5uany further fields which are behind a conditional.
°5u<a>condTreeConstraints</a> records the constraints (in this case,
°5u<tt>base &gt;= 4.0</tt>) which would be applied if you use this
°5usyntax; in general, this is derived off of <tt>targetBuildInfo</tt>
°5u(perhaps a good refactoring would be to convert this into an opaque
°5utype, with a smart constructor that pre-computes the dependencies.)
data CondTree v c a
CondNode :: a -> c -> [CondBranch v c a] -> CondTree v c a
[condTreeData] :: CondTree v c a -> a
[condTreeConstraints] :: CondTree v c a -> c
[condTreeComponents] :: CondTree v c a -> [CondBranch v c a]

-- | A <tt>ConfVar</tt> represents the variable type used.
data ConfVar
OS :: OS -> ConfVar
Arch :: Arch -> ConfVar
Flag :: FlagName -> ConfVar
Impl :: CompilerFlavor -> VersionRange -> ConfVar

-- | A boolean expression parameterized over the variable type used.
data Condition c
Var :: c -> Condition c
Lit :: Bool -> Condition c
CNot :: (Condition c) -> Condition c
COr :: (Condition c) -> (Condition c) -> Condition c
CAnd :: (Condition c) -> (Condition c) -> Condition c

-- | Boolean negation of a <a>Condition</a> value.
cNot :: Condition a -> Condition a

-- | Boolean AND of two <tt>Condtion</tt> values.
cAnd :: Condition a -> Condition a -> Condition a

-- | Boolean OR of two <a>Condition</a> values.
cOr :: Eq v => Condition v -> Condition v -> Condition v

-- | Information about the source revision control system for a package.
°5u
°5uWhen specifying a repo it is useful to know the meaning or intention
°5uof the information as doing so enables automation. There are two
°5uobvious common purposes: one is to find the repo for the latest
°5udevelopment version, the other is to find the repo for this specific
°5urelease. The <tt>ReopKind</tt> specifies which one we mean (or another
°5ucustom one).
°5u
°5uA package can specify one or the other kind or both. Most will specify
°5ujust a head repo but some may want to specify a repo to reconstruct
°5uthe sources for this package release.
°5u
°5uThe required information is the <a>RepoType</a> which tells us if it's
°5uusing <a>Darcs</a>, <a>Git</a> for example. The <a>repoLocation</a>
°5uand other details are interpreted according to the repo type.
data SourceRepo
SourceRepo :: RepoKind -> Maybe RepoType -> Maybe String -> Maybe String -> Maybe String -> Maybe String -> Maybe FilePath -> SourceRepo

-- | The kind of repo. This field is required.
[repoKind] :: SourceRepo -> RepoKind

-- | The type of the source repository system for this repo, eg
°5u<a>Darcs</a> or <a>Git</a>. This field is required.
[repoType] :: SourceRepo -> Maybe RepoType

-- | The location of the repository. For most <a>RepoType</a>s this is a
°5uURL. This field is required.
[repoLocation] :: SourceRepo -> Maybe String

-- | <a>CVS</a> can put multiple "modules" on one server and requires a
°5umodule name in addition to the location to identify a particular repo.
°5uLogically this is part of the location but unfortunately has to be
°5uspecified separately. This field is required for the <a>CVS</a>
°5u<a>RepoType</a> and should not be given otherwise.
[repoModule] :: SourceRepo -> Maybe String

-- | The name or identifier of the branch, if any. Many source control
°5usystems have the notion of multiple branches in a repo that exist in
°5uthe same location. For example <a>Git</a> and <a>CVS</a> use this
°5uwhile systems like <a>Darcs</a> use different locations for different
°5ubranches. This field is optional but should be used if necessary to
°5uidentify the sources, especially for the <a>RepoThis</a> repo kind.
[repoBranch] :: SourceRepo -> Maybe String

-- | The tag identify a particular state of the repository. This should be
°5ugiven for the <a>RepoThis</a> repo kind and not for <a>RepoHead</a>
°5ukind.
[repoTag] :: SourceRepo -> Maybe String

-- | Some repositories contain multiple projects in different
°5usubdirectories This field specifies the subdirectory where this
°5upackages sources can be found, eg the subdirectory containing the
°5u<tt>.cabal</tt> file. It is interpreted relative to the root of the
°5urepository. This field is optional. If not given the default is "." ie
°5uno subdirectory.
[repoSubdir] :: SourceRepo -> Maybe FilePath

-- | What this repo info is for, what it represents.
data RepoKind

-- | The repository for the "head" or development version of the project.
°5uThis repo is where we should track the latest development activity or
°5uthe usual repo people should get to contribute patches.
RepoHead :: RepoKind

-- | The repository containing the sources for this exact package version
°5uor release. For this kind of repo a tag should be given to give enough
°5uinformation to re-create the exact sources.
RepoThis :: RepoKind
RepoKindUnknown :: String -> RepoKind

-- | An enumeration of common source control systems. The fields used in
°5uthe <a>SourceRepo</a> depend on the type of repo. The tools and
°5umethods used to obtain and track the repo depend on the repo type.
data RepoType
Darcs :: RepoType
Git :: RepoType
SVN :: RepoType
CVS :: RepoType
Mercurial :: RepoType
GnuArch :: RepoType
Bazaar :: RepoType
Monotone :: RepoType
OtherRepoType :: String -> RepoType
knownRepoTypes :: [RepoType]
emptySourceRepo :: RepoKind -> SourceRepo
data SetupBuildInfo
SetupBuildInfo :: [Dependency] -> Bool -> SetupBuildInfo
[setupDepends] :: SetupBuildInfo -> [Dependency]

-- | Is this a default 'custom-setup' section added by the cabal-install
°5ucode (as opposed to user-provided)? This field is only used
°5uinternally, and doesn't correspond to anything in the .cabal file. See
°5u#3199.
[defaultSetupDepends] :: SetupBuildInfo -> Bool


-- | This modules provides functions for working with both the legacy
°5u"build-tools" field, and its replacement, "build-tool-depends". Prefer
°5uusing the functions contained to access those fields directly.
module Distribution.Simple.BuildToolDepends

-- | Desugar a "build-tools" entry into proper a executable dependency if
°5upossible.
°5u
°5uAn entry can be so desguared in two cases:
°5u
°5u<ol>
°5u<li>The name in build-tools matches a locally defined executable. The
°5uexecutable dependency produced is on that exe in the current
°5upackage.</li>
°5u<li>The name in build-tools matches a hard-coded set of known tools.
°5uFor now, the executable dependency produced is one an executable in a
°5upackage of the same, but the hard-coding could just as well be
°5uper-key.</li>
°5u</ol>
°5u
°5uThe first cases matches first.
desugarBuildTool :: PackageDescription -> LegacyExeDependency -> Maybe ExeDependency

-- | Get everything from "build-tool-depends", along with entries from
°5u"build-tools" that we know how to desugar.
°5u
°5uThis should almost always be used instead of just accessing the
°5u<a>buildToolDepends</a> field directly.
getAllToolDependencies :: PackageDescription -> BuildInfo -> [ExeDependency]

-- | Does the given executable dependency map to this current package?
°5u
°5uThis is a tiny function, but used in a number of places.
°5u
°5uThis function is only sound to call on <a>BuildInfo</a>s from the
°5ugiven package description. This is because it just filters the package
°5unames of each dependency, and does not check whether version bounds in
°5ufact exclude the current package, or the referenced components in fact
°5uexist in the current package.
°5u
°5uThis is OK because when a package is loaded, it is checked (in
°5u<a>Check</a>) that dependencies matching internal components do indeed
°5uhave version bounds accepting the current package, and any depended-on
°5ucomponent in the current package actually exists. In fact this check
°5uis performed by gathering the internal tool dependencies of each
°5ucomponent of the package according to this module, and ensuring those
°5uproperties on each so-gathered dependency.
°5u
°5uversion bounds and components of the package are unchecked. This is
°5ubecause we sanitize exe deps so that the matching name implies these
°5uother conditions.
isInternal :: PackageDescription -> ExeDependency -> Bool

-- | Get internal "build-tool-depends", along with internal "build-tools"
°5u
°5uThis is a tiny function, but used in a number of places. The same
°5urestrictions that apply to <a>isInternal</a> also apply to this
°5ufunction.
getAllInternalToolDependencies :: PackageDescription -> BuildInfo -> [UnqualComponentName]

module Distribution.Types.ExposedModule
data ExposedModule
ExposedModule :: ModuleName -> Maybe OpenModule -> ExposedModule
[exposedName] :: ExposedModule -> ModuleName
[exposedReexport] :: ExposedModule -> Maybe OpenModule
instance GHC.Show.Show Distribution.Types.ExposedModule.ExposedModule
instance GHC.Read.Read Distribution.Types.ExposedModule.ExposedModule
instance GHC.Generics.Generic Distribution.Types.ExposedModule.ExposedModule
instance GHC.Classes.Eq Distribution.Types.ExposedModule.ExposedModule
instance Distribution.Pretty.Pretty Distribution.Types.ExposedModule.ExposedModule
instance Distribution.Parsec.Class.Parsec Distribution.Types.ExposedModule.ExposedModule
instance Distribution.Text.Text Distribution.Types.ExposedModule.ExposedModule
instance Data.Binary.Class.Binary Distribution.Types.ExposedModule.ExposedModule
instance Control.DeepSeq.NFData Distribution.Types.ExposedModule.ExposedModule

module Distribution.Types.InstalledPackageInfo
data InstalledPackageInfo
InstalledPackageInfo :: PackageId -> Maybe UnqualComponentName -> ComponentId -> UnitId -> [(ModuleName, OpenModule)] -> String -> Either License License -> String -> String -> String -> String -> String -> String -> String -> String -> String -> AbiHash -> Bool -> Bool -> [ExposedModule] -> [ModuleName] -> Bool -> [FilePath] -> [FilePath] -> [FilePath] -> FilePath -> [String] -> [String] -> [String] -> [FilePath] -> [String] -> [UnitId] -> [AbiDependency] -> [String] -> [String] -> [FilePath] -> [String] -> [FilePath] -> [FilePath] -> Maybe FilePath -> InstalledPackageInfo
[sourcePackageId] :: InstalledPackageInfo -> PackageId
[sourceLibName] :: InstalledPackageInfo -> Maybe UnqualComponentName
[installedComponentId_] :: InstalledPackageInfo -> ComponentId
[installedUnitId] :: InstalledPackageInfo -> UnitId
[instantiatedWith] :: InstalledPackageInfo -> [(ModuleName, OpenModule)]
[compatPackageKey] :: InstalledPackageInfo -> String
[license] :: InstalledPackageInfo -> Either License License
[copyright] :: InstalledPackageInfo -> String
[maintainer] :: InstalledPackageInfo -> String
[author] :: InstalledPackageInfo -> String
[stability] :: InstalledPackageInfo -> String
[homepage] :: InstalledPackageInfo -> String
[pkgUrl] :: InstalledPackageInfo -> String
[synopsis] :: InstalledPackageInfo -> String
[description] :: InstalledPackageInfo -> String
[category] :: InstalledPackageInfo -> String
[abiHash] :: InstalledPackageInfo -> AbiHash
[indefinite] :: InstalledPackageInfo -> Bool
[exposed] :: InstalledPackageInfo -> Bool
[exposedModules] :: InstalledPackageInfo -> [ExposedModule]
[hiddenModules] :: InstalledPackageInfo -> [ModuleName]
[trusted] :: InstalledPackageInfo -> Bool
[importDirs] :: InstalledPackageInfo -> [FilePath]
[libraryDirs] :: InstalledPackageInfo -> [FilePath]

-- | overrides <a>libraryDirs</a>
[libraryDynDirs] :: InstalledPackageInfo -> [FilePath]
[dataDir] :: InstalledPackageInfo -> FilePath
[hsLibraries] :: InstalledPackageInfo -> [String]
[extraLibraries] :: InstalledPackageInfo -> [String]
[extraGHCiLibraries] :: InstalledPackageInfo -> [String]
[includeDirs] :: InstalledPackageInfo -> [FilePath]
[includes] :: InstalledPackageInfo -> [String]
[depends] :: InstalledPackageInfo -> [UnitId]
[abiDepends] :: InstalledPackageInfo -> [AbiDependency]
[ccOptions] :: InstalledPackageInfo -> [String]
[ldOptions] :: InstalledPackageInfo -> [String]
[frameworkDirs] :: InstalledPackageInfo -> [FilePath]
[frameworks] :: InstalledPackageInfo -> [String]
[haddockInterfaces] :: InstalledPackageInfo -> [FilePath]
[haddockHTMLs] :: InstalledPackageInfo -> [FilePath]
[pkgRoot] :: InstalledPackageInfo -> Maybe FilePath
emptyInstalledPackageInfo :: InstalledPackageInfo
mungedPackageId :: InstalledPackageInfo -> MungedPackageId

-- | Returns the munged package name, which we write into <tt>name</tt> for
°5ucompatibility with old versions of GHC.
mungedPackageName :: InstalledPackageInfo -> MungedPackageName

-- | An ABI dependency is a dependency on a library which also records the
°5uABI hash (<tt>abiHash</tt>) of the library it depends on.
°5u
°5uThe primary utility of this is to enable an extra sanity when GHC
°5uloads libraries: it can check if the dependency has a matching ABI and
°5uif not, refuse to load this library. This information is critical if
°5uwe are shadowing libraries; differences in the ABI hash let us know
°5uwhat packages get shadowed by the new version of a package.
data AbiDependency
AbiDependency :: UnitId -> AbiHash -> AbiDependency
[depUnitId] :: AbiDependency -> UnitId
[depAbiHash] :: AbiDependency -> AbiHash
data ExposedModule
ExposedModule :: ModuleName -> Maybe OpenModule -> ExposedModule
[exposedName] :: ExposedModule -> ModuleName
[exposedReexport] :: ExposedModule -> Maybe OpenModule
instance GHC.Show.Show Distribution.Types.InstalledPackageInfo.InstalledPackageInfo
instance GHC.Read.Read Distribution.Types.InstalledPackageInfo.InstalledPackageInfo
instance GHC.Generics.Generic Distribution.Types.InstalledPackageInfo.InstalledPackageInfo
instance GHC.Classes.Eq Distribution.Types.InstalledPackageInfo.InstalledPackageInfo
instance Data.Binary.Class.Binary Distribution.Types.InstalledPackageInfo.InstalledPackageInfo
instance Control.DeepSeq.NFData Distribution.Types.InstalledPackageInfo.InstalledPackageInfo
instance Distribution.Package.HasMungedPackageId Distribution.Types.InstalledPackageInfo.InstalledPackageInfo
instance Distribution.Package.Package Distribution.Types.InstalledPackageInfo.InstalledPackageInfo
instance Distribution.Package.HasUnitId Distribution.Types.InstalledPackageInfo.InstalledPackageInfo
instance Distribution.Package.PackageInstalled Distribution.Types.InstalledPackageInfo.InstalledPackageInfo
instance Distribution.Compat.Graph.IsNode Distribution.Types.InstalledPackageInfo.InstalledPackageInfo

module Distribution.Types.InstalledPackageInfo.Lens
data InstalledPackageInfo
sourcePackageId :: Lens' InstalledPackageInfo PackageIdentifier
installedUnitId :: Lens' InstalledPackageInfo UnitId
installedComponentId_ :: Lens' InstalledPackageInfo ComponentId
instantiatedWith :: Lens' InstalledPackageInfo [(ModuleName, OpenModule)]
sourceLibName :: Lens' InstalledPackageInfo (Maybe UnqualComponentName)
compatPackageKey :: Lens' InstalledPackageInfo String
license :: Lens' InstalledPackageInfo (Either License License)
copyright :: Lens' InstalledPackageInfo String
maintainer :: Lens' InstalledPackageInfo String
author :: Lens' InstalledPackageInfo String
stability :: Lens' InstalledPackageInfo String
homepage :: Lens' InstalledPackageInfo String
pkgUrl :: Lens' InstalledPackageInfo String
synopsis :: Lens' InstalledPackageInfo String
description :: Lens' InstalledPackageInfo String
category :: Lens' InstalledPackageInfo String
abiHash :: Lens' InstalledPackageInfo AbiHash
indefinite :: Lens' InstalledPackageInfo Bool
exposed :: Lens' InstalledPackageInfo Bool
exposedModules :: Lens' InstalledPackageInfo [ExposedModule]
hiddenModules :: Lens' InstalledPackageInfo [ModuleName]
trusted :: Lens' InstalledPackageInfo Bool
importDirs :: Lens' InstalledPackageInfo [FilePath]
libraryDirs :: Lens' InstalledPackageInfo [FilePath]
libraryDynDirs :: Lens' InstalledPackageInfo [FilePath]
dataDir :: Lens' InstalledPackageInfo FilePath
hsLibraries :: Lens' InstalledPackageInfo [String]
extraLibraries :: Lens' InstalledPackageInfo [String]
extraGHCiLibraries :: Lens' InstalledPackageInfo [String]
includeDirs :: Lens' InstalledPackageInfo [FilePath]
includes :: Lens' InstalledPackageInfo [String]
depends :: Lens' InstalledPackageInfo [UnitId]
abiDepends :: Lens' InstalledPackageInfo [AbiDependency]
ccOptions :: Lens' InstalledPackageInfo [String]
ldOptions :: Lens' InstalledPackageInfo [String]
frameworkDirs :: Lens' InstalledPackageInfo [FilePath]
frameworks :: Lens' InstalledPackageInfo [String]
haddockInterfaces :: Lens' InstalledPackageInfo [FilePath]
haddockHTMLs :: Lens' InstalledPackageInfo [FilePath]
pkgRoot :: Lens' InstalledPackageInfo (Maybe FilePath)


-- | A large and somewhat miscellaneous collection of utility functions
°5uused throughout the rest of the Cabal lib and in other tools that use
°5uthe Cabal lib like <tt>cabal-install</tt>. It has a very simple set of
°5ulogging actions. It has low level functions for running programs, a
°5ubunch of wrappers for various directory and file functions that do
°5uextra logging.
module Distribution.Simple.Utils
cabalVersion :: Version

-- | <i>Deprecated: Messages thrown with die can't be controlled with
°5uVerbosity; use die' instead, or dieNoVerbosity if Verbosity truly is
°5unot available</i>
die :: String -> IO a

-- | <i>Deprecated: Messages thrown with dieWithLocation can't be
°5ucontrolled with Verbosity; use dieWithLocation' instead</i>
dieWithLocation :: FilePath -> Maybe Int -> String -> IO a
dieNoVerbosity :: String -> IO a
die' :: Verbosity -> String -> IO a
dieWithLocation' :: Verbosity -> FilePath -> Maybe Int -> String -> IO a
dieNoWrap :: Verbosity -> String -> IO a
topHandler :: IO a -> IO a
topHandlerWith :: forall a. (SomeException -> IO a) -> IO a -> IO a

-- | Non fatal conditions that may be indicative of an error or problem.
°5u
°5uWe display these at the <a>normal</a> verbosity level.
warn :: Verbosity -> String -> IO ()

-- | Useful status messages.
°5u
°5uWe display these at the <a>normal</a> verbosity level.
°5u
°5uThis is for the ordinary helpful status messages that users see. Just
°5uenough information to know that things are working but not floods of
°5udetail.
notice :: Verbosity -> String -> IO ()

-- | Display a message at <a>normal</a> verbosity level, but without
°5uwrapping.
noticeNoWrap :: Verbosity -> String -> IO ()

-- | Pretty-print a <a>Doc</a> status message at <a>normal</a> verbosity
°5ulevel. Use this if you need fancy formatting.
noticeDoc :: Verbosity -> Doc -> IO ()

-- | Display a "setup status message". Prefer using setupMessage' if
°5upossible.
setupMessage :: Verbosity -> String -> PackageIdentifier -> IO ()

-- | More detail on the operation of some action.
°5u
°5uWe display these messages when the verbosity level is <a>verbose</a>
info :: Verbosity -> String -> IO ()
infoNoWrap :: Verbosity -> String -> IO ()

-- | Detailed internal debugging information
°5u
°5uWe display these messages when the verbosity level is <a>deafening</a>
debug :: Verbosity -> String -> IO ()

-- | A variant of <a>debug</a> that doesn't perform the automatic line
°5uwrapping. Produces better output in some cases.
debugNoWrap :: Verbosity -> String -> IO ()

-- | Perform an IO action, catching any IO exceptions and printing an error
°5uif one occurs.
chattyTry :: String -> IO () -> IO ()

-- | Given a block of IO code that may raise an exception, annotate it with
°5uthe metadata from the current scope. Use this as close to external
°5ucode that raises IO exceptions as possible, since this function
°5uunconditionally wraps the error message with a trace (so it is NOT
°5uidempotent.)
annotateIO :: Verbosity -> IO a -> IO a
printRawCommandAndArgs :: Verbosity -> FilePath -> [String] -> IO ()
printRawCommandAndArgsAndEnv :: Verbosity -> FilePath -> [String] -> Maybe FilePath -> Maybe [(String, String)] -> IO ()

-- | Run an IO computation, returning <tt>e</tt> if it raises a "file does
°5unot exist" error.
handleDoesNotExist :: a -> NoCallStackIO a -> NoCallStackIO a
rawSystemExit :: Verbosity -> FilePath -> [String] -> IO ()
rawSystemExitCode :: Verbosity -> FilePath -> [String] -> IO ExitCode
rawSystemExitWithEnv :: Verbosity -> FilePath -> [String] -> [(String, String)] -> IO ()

-- | Run a command and return its output.
°5u
°5uThe output is assumed to be text in the locale encoding.
rawSystemStdout :: Verbosity -> FilePath -> [String] -> IO String

-- | Run a command and return its output, errors and exit status.
°5uOptionally also supply some input. Also provides control over whether
°5uthe binary/text mode of the input and output.
rawSystemStdInOut :: Verbosity -> FilePath -> [String] -> Maybe FilePath -> Maybe [(String, String)] -> Maybe IOData -> IODataMode -> IO (IOData, String, ExitCode)
rawSystemIOWithEnv :: Verbosity -> FilePath -> [String] -> Maybe FilePath -> Maybe [(String, String)] -> Maybe Handle -> Maybe Handle -> Maybe Handle -> IO ExitCode
createProcessWithEnv :: Verbosity -> FilePath -> [String] -> Maybe FilePath -> Maybe [(String, String)] -> StdStream -> StdStream -> StdStream -> IO (Maybe Handle, Maybe Handle, Maybe Handle, ProcessHandle)
maybeExit :: IO ExitCode -> IO ()

-- | Like the Unix xargs program. Useful for when we've got very long
°5ucommand lines that might overflow an OS limit on command line length
°5uand so you need to invoke a command multiple times to get all the args
°5uin.
°5u
°5uUse it with either of the rawSystem variants above. For example:
°5u
°5u<pre>
°5uxargs (32*1024) (rawSystemExit verbosity) prog fixedArgs bigArgs
°5u</pre>
xargs :: Int -> ([String] -> IO ()) -> [String] -> [String] -> IO ()

-- | Look for a program on the path.

-- | <i>Deprecated: No longer used within Cabal, try
°5ufindProgramOnSearchPath</i>
findProgramLocation :: Verbosity -> FilePath -> IO (Maybe FilePath)

-- | Look for a program and try to find it's version number. It can accept
°5ueither an absolute path or the name of a program binary, in which case
°5uwe will look for the program on the path.
findProgramVersion :: String -> (String -> String) -> Verbosity -> FilePath -> IO (Maybe Version)

-- | Represents either textual or binary data passed via I/O functions
°5uwhich support binary/text mode
data IOData

-- | How Text gets encoded is usually locale-dependent.
IODataText :: String -> IOData

-- | Raw binary which gets read/written in binary mode.
IODataBinary :: ByteString -> IOData
data IODataMode
IODataModeText :: IODataMode
IODataModeBinary :: IODataMode

-- | <i>Deprecated: Use findModuleFiles and copyFiles or
°5uinstallOrdinaryFiles</i>
smartCopySources :: Verbosity -> [FilePath] -> FilePath -> [ModuleName] -> [String] -> IO ()

-- | Same as <tt>createDirectoryIfMissing</tt> but logs at higher verbosity
°5ulevels.
createDirectoryIfMissingVerbose :: Verbosity -> Bool -> FilePath -> IO ()

-- | Copies a file without copying file permissions. The target file is
°5ucreated with default permissions. Any existing target file is
°5ureplaced.
°5u
°5uAt higher verbosity levels it logs an info message.
copyFileVerbose :: Verbosity -> FilePath -> FilePath -> IO ()

-- | <i>Deprecated: You probably want installDirectoryContents instead</i>
copyDirectoryRecursiveVerbose :: Verbosity -> FilePath -> FilePath -> IO ()

-- | Copies a bunch of files to a target directory, preserving the
°5udirectory structure in the target location. The target directories are
°5ucreated if they do not exist.
°5u
°5uThe files are identified by a pair of base directory and a path
°5urelative to that base. It is only the relative part that is preserved
°5uin the destination.
°5u
°5uFor example:
°5u
°5u<pre>
°5ucopyFiles normal "dist/src"
°5u   [("", "src/Foo.hs"), ("dist/build/", "src/Bar.hs")]
°5u</pre>
°5u
°5uThis would copy "src/Foo.hs" to "dist/src/src/Foo.hs" and copy
°5u"dist/build/src/Bar.hs" to "dist/src/src/Bar.hs".
°5u
°5uThis operation is not atomic. Any IO failure during the copy
°5u(including any missing source files) leaves the target in an unknown
°5ustate so it is best to use it with a freshly created directory so that
°5uit can be simply deleted if anything goes wrong.
copyFiles :: Verbosity -> FilePath -> [(FilePath, FilePath)] -> IO ()

-- | Given a relative path to a file, copy it to the given directory,
°5upreserving the relative path and creating the parent directories if
°5uneeded.
copyFileTo :: Verbosity -> FilePath -> FilePath -> IO ()

-- | Install an ordinary file. This is like a file copy but the permissions
°5uare set appropriately for an installed file. On Unix it is
°5u"-rw-r--r--" while on Windows it uses the default permissions for the
°5utarget directory.
installOrdinaryFile :: Verbosity -> FilePath -> FilePath -> IO ()

-- | Install an executable file. This is like a file copy but the
°5upermissions are set appropriately for an installed file. On Unix it is
°5u"-rwxr-xr-x" while on Windows it uses the default permissions for the
°5utarget directory.
installExecutableFile :: Verbosity -> FilePath -> FilePath -> IO ()

-- | Install a file that may or not be executable, preserving permissions.
installMaybeExecutableFile :: Verbosity -> FilePath -> FilePath -> IO ()

-- | This is like <a>copyFiles</a> but uses <a>installOrdinaryFile</a>.
installOrdinaryFiles :: Verbosity -> FilePath -> [(FilePath, FilePath)] -> IO ()

-- | This is like <a>copyFiles</a> but uses <a>installExecutableFile</a>.
installExecutableFiles :: Verbosity -> FilePath -> [(FilePath, FilePath)] -> IO ()

-- | This is like <a>copyFiles</a> but uses
°5u<a>installMaybeExecutableFile</a>.
installMaybeExecutableFiles :: Verbosity -> FilePath -> [(FilePath, FilePath)] -> IO ()

-- | This installs all the files in a directory to a target location,
°5upreserving the directory layout. All the files are assumed to be
°5uordinary rather than executable files.
installDirectoryContents :: Verbosity -> FilePath -> FilePath -> IO ()

-- | Recursively copy the contents of one directory to another path.
copyDirectoryRecursive :: Verbosity -> FilePath -> FilePath -> IO ()

-- | Like <a>doesFileExist</a>, but also checks that the file is
°5uexecutable.
doesExecutableExist :: FilePath -> NoCallStackIO Bool
setFileOrdinary :: FilePath -> NoCallStackIO ()
setFileExecutable :: FilePath -> NoCallStackIO ()

-- | The path name that represents the current directory. In Unix, it's
°5u<tt>"."</tt>, but this is system-specific. (E.g. AmigaOS uses the
°5uempty string <tt>""</tt> for the current directory.)
currentDir :: FilePath
shortRelativePath :: FilePath -> FilePath -> FilePath

-- | Drop the extension if it's one of <a>exeExtensions</a>, or return the
°5upath unchanged.
dropExeExtension :: FilePath -> FilePath

-- | List of possible executable file extensions on the current platform.
exeExtensions :: [String]

-- | Find a file by looking in a search path. The file path must match
°5uexactly.
findFile :: [FilePath] -> FilePath -> IO FilePath
findFirstFile :: (a -> FilePath) -> [a] -> NoCallStackIO (Maybe a)

-- | Find a file by looking in a search path with one of a list of possible
°5ufile extensions. The file base name should be given and it will be
°5utried with each of the extensions in each element of the search path.
findFileWithExtension :: [String] -> [FilePath] -> FilePath -> NoCallStackIO (Maybe FilePath)

-- | Like <a>findFileWithExtension</a> but returns which element of the
°5usearch path the file was found in, and the file path relative to that
°5ubase directory.
findFileWithExtension' :: [String] -> [FilePath] -> FilePath -> NoCallStackIO (Maybe (FilePath, FilePath))
findAllFilesWithExtension :: [String] -> [FilePath] -> FilePath -> NoCallStackIO [FilePath]

-- | Find the file corresponding to a Haskell module name.
°5u
°5uThis is similar to <a>findFileWithExtension'</a> but specialised to a
°5umodule name. The function fails if the file corresponding to the
°5umodule is missing.
findModuleFile :: [FilePath] -> [String] -> ModuleName -> IO (FilePath, FilePath)

-- | Finds the files corresponding to a list of Haskell module names.
°5u
°5uAs <a>findModuleFile</a> but for a list of module names.
findModuleFiles :: [FilePath] -> [String] -> [ModuleName] -> IO [(FilePath, FilePath)]

-- | List all the files in a directory and all subdirectories.
°5u
°5uThe order places files in sub-directories after all the files in their
°5uparent directories. The list is generated lazily so is not well
°5udefined if the source directory structure changes before the list is
°5uused.
getDirectoryContentsRecursive :: FilePath -> IO [FilePath]

-- | Is this directory in the system search path?
isInSearchPath :: FilePath -> NoCallStackIO Bool
addLibraryPath :: OS -> [FilePath] -> [(String, String)] -> [(String, String)]
matchFileGlob :: FilePath -> IO [FilePath]
matchDirFileGlob :: FilePath -> FilePath -> IO [FilePath]
parseFileGlob :: FilePath -> Maybe FileGlob
data FileGlob

-- | No glob at all, just an ordinary file
NoGlob :: FilePath -> FileGlob

-- | dir prefix and extension, like <tt>"foo/bar/*.baz"</tt> corresponds to
°5u<tt>FileGlob "foo/bar" ".baz"</tt>
FileGlob :: FilePath -> String -> FileGlob

-- | Compare the modification times of two files to see if the first is
°5unewer than the second. The first file must exist but the second need
°5unot. The expected use case is when the second file is generated using
°5uthe first. In this use case, if the result is True then the second
°5ufile is out of date.
moreRecentFile :: FilePath -> FilePath -> NoCallStackIO Bool

-- | Like <a>moreRecentFile</a>, but also checks that the first file
°5uexists.
existsAndIsMoreRecentThan :: FilePath -> FilePath -> NoCallStackIO Bool

-- | Advanced options for <a>withTempFile</a> and <a>withTempDirectory</a>.
data TempFileOptions
TempFileOptions :: Bool -> TempFileOptions

-- | Keep temporary files?
[optKeepTempFiles] :: TempFileOptions -> Bool
defaultTempFileOptions :: TempFileOptions

-- | Use a temporary filename that doesn't already exist.
withTempFile :: FilePath -> String -> (FilePath -> Handle -> IO a) -> IO a

-- | A version of <a>withTempFile</a> that additionally takes a
°5u<a>TempFileOptions</a> argument.
withTempFileEx :: TempFileOptions -> FilePath -> String -> (FilePath -> Handle -> IO a) -> IO a

-- | Create and use a temporary directory.
°5u
°5uCreates a new temporary directory inside the given directory, making
°5uuse of the template. The temp directory is deleted after use. For
°5uexample:
°5u
°5u<pre>
°5uwithTempDirectory verbosity "src" "sdist." $ \tmpDir -&gt; do ...
°5u</pre>
°5u
°5uThe <tt>tmpDir</tt> will be a new subdirectory of the given directory,
°5ue.g. <tt>src/sdist.342</tt>.
withTempDirectory :: Verbosity -> FilePath -> String -> (FilePath -> IO a) -> IO a

-- | A version of <a>withTempDirectory</a> that additionally takes a
°5u<a>TempFileOptions</a> argument.
withTempDirectoryEx :: Verbosity -> TempFileOptions -> FilePath -> String -> (FilePath -> IO a) -> IO a

-- | Package description file (<i>pkgname</i><tt>.cabal</tt>)
defaultPackageDesc :: Verbosity -> IO FilePath

-- | Find a package description file in the given directory. Looks for
°5u<tt>.cabal</tt> files.
findPackageDesc :: FilePath -> NoCallStackIO (Either String FilePath)

-- | Like <a>findPackageDesc</a>, but calls <a>die</a> in case of error.
tryFindPackageDesc :: FilePath -> IO FilePath

-- | Optional auxiliary package information file
°5u(<i>pkgname</i><tt>.buildinfo</tt>)
defaultHookedPackageDesc :: IO (Maybe FilePath)

-- | Find auxiliary package information in the given directory. Looks for
°5u<tt>.buildinfo</tt> files.
findHookedPackageDesc :: FilePath -> IO (Maybe FilePath)

-- | Gets the contents of a file, but guarantee that it gets closed.
°5u
°5uThe file is read lazily but if it is not fully consumed by the action
°5uthen the remaining input is truncated and the file is closed.
withFileContents :: FilePath -> (String -> NoCallStackIO a) -> NoCallStackIO a

-- | Writes a file atomically.
°5u
°5uThe file is either written successfully or an IO exception is raised
°5uand the original file is left unchanged.
°5u
°5uOn windows it is not possible to delete a file that is open by a
°5uprocess. This case will give an IO exception but the atomic property
°5uis not affected.
writeFileAtomic :: FilePath -> ByteString -> NoCallStackIO ()

-- | <i>Deprecated: Use rewriteFileEx so that Verbosity is respected</i>
rewriteFile :: FilePath -> String -> IO ()

-- | Write a file but only if it would have new content. If we would be
°5uwriting the same as the existing content then leave the file as is so
°5uthat we do not update the file's modification time.
°5u
°5uNB: the file is assumed to be ASCII-encoded.
rewriteFileEx :: Verbosity -> FilePath -> String -> IO ()

-- | Decode <a>String</a> from UTF8-encoded <a>ByteString</a>
°5u
°5uInvalid data in the UTF8 stream (this includes code-points
°5u<tt>U+D800</tt> through <tt>U+DFFF</tt>) will be decoded as the
°5ureplacement character (<tt>U+FFFD</tt>).
fromUTF8BS :: ByteString -> String

-- | Variant of <a>fromUTF8BS</a> for lazy <a>ByteString</a>s
fromUTF8LBS :: ByteString -> String

-- | Encode <a>String</a> to to UTF8-encoded <a>ByteString</a>
°5u
°5uCode-points in the <tt>U+D800</tt>-<tt>U+DFFF</tt> range will be
°5uencoded as the replacement character (i.e. <tt>U+FFFD</tt>).
toUTF8BS :: String -> ByteString

-- | Variant of <a>toUTF8BS</a> for lazy <a>ByteString</a>s
toUTF8LBS :: String -> ByteString

-- | Reads a UTF8 encoded text file as a Unicode String
°5u
°5uReads lazily using ordinary <a>readFile</a>.
readUTF8File :: FilePath -> NoCallStackIO String

-- | Reads a UTF8 encoded text file as a Unicode String
°5u
°5uSame behaviour as <a>withFileContents</a>.
withUTF8FileContents :: FilePath -> (String -> IO a) -> IO a

-- | Writes a Unicode String as a UTF8 encoded text file.
°5u
°5uUses <a>writeFileAtomic</a>, so provides the same guarantees.
writeUTF8File :: FilePath -> String -> NoCallStackIO ()

-- | Fix different systems silly line ending conventions
normaliseLineEndings :: String -> String

-- | Ignore a Unicode byte order mark (BOM) at the beginning of the input
ignoreBOM :: String -> String

-- | <tt>dropWhileEndLE p</tt> is equivalent to <tt>reverse . dropWhile p .
°5ureverse</tt>, but quite a bit faster. The difference between
°5u"Data.List.dropWhileEnd" and this version is that the one in
°5u<a>Data.List</a> is strict in elements, but spine-lazy, while this one
°5uis spine-strict but lazy in elements. That's what <tt>LE</tt> stands
°5ufor - "lazy in elements".
°5u
°5uExample:
°5u
°5u<pre>
°5u&gt;&gt;&gt; tail $ Data.List.dropWhileEnd (&lt;3) [undefined, 5, 4, 3, 2, 1]
°5u*** Exception: Prelude.undefined
°5u...
°5u</pre>
°5u
°5u<pre>
°5u&gt;&gt;&gt; tail $ dropWhileEndLE (&lt;3) [undefined, 5, 4, 3, 2, 1]
°5u[5,4,3]
°5u</pre>
°5u
°5u<pre>
°5u&gt;&gt;&gt; take 3 $ Data.List.dropWhileEnd (&lt;3) [5, 4, 3, 2, 1, undefined]
°5u[5,4,3]
°5u</pre>
°5u
°5u<pre>
°5u&gt;&gt;&gt; take 3 $ dropWhileEndLE (&lt;3) [5, 4, 3, 2, 1, undefined]
°5u*** Exception: Prelude.undefined
°5u...
°5u</pre>
dropWhileEndLE :: (a -> Bool) -> [a] -> [a]

-- | <tt>takeWhileEndLE p</tt> is equivalent to <tt>reverse . takeWhile p .
°5ureverse</tt>, but is usually faster (as well as being easier to read).
takeWhileEndLE :: (a -> Bool) -> [a] -> [a]
equating :: Eq a => (b -> a) -> b -> b -> Bool

-- | <pre>
°5ucomparing p x y = compare (p x) (p y)
°5u</pre>
°5u
°5uUseful combinator for use in conjunction with the <tt>xxxBy</tt>
°5ufamily of functions from <a>Data.List</a>, for example:
°5u
°5u<pre>
°5u... sortBy (comparing fst) ...
°5u</pre>
comparing :: Ord a => b -> a -> b -> b -> Ordering

-- | The <a>isInfixOf</a> function takes two lists and returns <a>True</a>
°5uiff the first list is contained, wholly and intact, anywhere within
°5uthe second.
°5u
°5u<pre>
°5u&gt;&gt;&gt; isInfixOf "Haskell" "I really like Haskell."
°5uTrue
°5u</pre>
°5u
°5u<pre>
°5u&gt;&gt;&gt; isInfixOf "Ial" "I really like Haskell."
°5uFalse
°5u</pre>
isInfixOf :: Eq a => [a] -> [a] -> Bool

-- | <a>intercalate</a> <tt>xs xss</tt> is equivalent to <tt>(<a>concat</a>
°5u(<a>intersperse</a> xs xss))</tt>. It inserts the list <tt>xs</tt> in
°5ubetween the lists in <tt>xss</tt> and concatenates the result.
°5u
°5u<pre>
°5u&gt;&gt;&gt; intercalate ", " ["Lorem", "ipsum", "dolor"]
°5u"Lorem, ipsum, dolor"
°5u</pre>
intercalate :: () => [a] -> [[a]] -> [a]

-- | Lower case string
°5u
°5u<pre>
°5u&gt;&gt;&gt; lowercase "Foobar"
°5u"foobar"
°5u</pre>
lowercase :: String -> String

-- | Like "Data.List.union", but has <tt>O(n log n)</tt> complexity instead
°5uof <tt>O(n^2)</tt>.
listUnion :: (Ord a) => [a] -> [a] -> [a]

-- | A right-biased version of <a>listUnion</a>.
°5u
°5uExample:
°5u
°5u<pre>
°5u&gt;&gt;&gt; listUnion [1,2,3,4,3] [2,1,1]
°5u[1,2,3,4,3]
°5u</pre>
°5u
°5u<pre>
°5u&gt;&gt;&gt; listUnionRight [1,2,3,4,3] [2,1,1]
°5u[4,3,2,1,1]
°5u</pre>
listUnionRight :: (Ord a) => [a] -> [a] -> [a]

-- | Like <a>nub</a>, but has <tt>O(n log n)</tt> complexity instead of
°5u<tt>O(n^2)</tt>. Code for <a>ordNub</a> and <a>listUnion</a> taken
°5ufrom Niklas Hambüchen's <a>ordnub</a> package.
ordNub :: Ord a => [a] -> [a]

-- | Like <a>ordNub</a> and <a>nubBy</a>. Selects a key for each element
°5uand takes the nub based on that key.
ordNubBy :: Ord b => (a -> b) -> [a] -> [a]

-- | A right-biased version of <a>ordNub</a>.
°5u
°5uExample:
°5u
°5u<pre>
°5u&gt;&gt;&gt; ordNub [1,2,1] :: [Int]
°5u[1,2]
°5u</pre>
°5u
°5u<pre>
°5u&gt;&gt;&gt; ordNubRight [1,2,1] :: [Int]
°5u[2,1]
°5u</pre>
ordNubRight :: (Ord a) => [a] -> [a]

-- | A total variant of <a>tail</a>.
safeTail :: [a] -> [a]
unintersperse :: Char -> String -> [String]

-- | Wraps text to the default line width. Existing newlines are preserved.
wrapText :: String -> String

-- | Wraps a list of words to a list of lines of words of a particular
°5uwidth.
wrapLine :: Int -> [String] -> [[String]]

-- | <a>isAbsoluteOnAnyPlatform</a> and <a>isRelativeOnAnyPlatform</a> are
°5ulike <a>isAbsolute</a> and <a>isRelative</a> but have platform
°5uindependent heuristics. The System.FilePath exists in two versions,
°5uWindows and Posix. The two versions don't agree on what is a relative
°5upath and we don't know if we're given Windows or Posix paths. This
°5uresults in false positives when running on Posix and inspecting
°5uWindows paths, like the hackage server does.
°5uSystem.FilePath.Posix.isAbsolute "C:\hello" == False
°5uSystem.FilePath.Windows.isAbsolute "/hello" == False This means that
°5uwe would treat paths that start with "/" to be absolute. On Posix they
°5uare indeed absolute, while on Windows they are not.
°5u
°5uThe portable versions should be used when we might deal with paths
°5uthat are from another OS than the host OS. For example, the Hackage
°5uServer deals with both Windows and Posix paths while performing the
°5uPackageDescription checks. In contrast, when we run 'cabal configure'
°5uwe do expect the paths to be correct for our OS and we should not have
°5uto use the platform independent heuristics.
isAbsoluteOnAnyPlatform :: FilePath -> Bool

-- | <pre>
°5uisRelativeOnAnyPlatform = not . <a>isAbsoluteOnAnyPlatform</a>
°5u</pre>
isRelativeOnAnyPlatform :: FilePath -> Bool
instance GHC.Classes.Eq Distribution.Simple.Utils.TraceWhen

module Distribution.Utils.NubList

-- | NubList : A de-duplicated list that maintains the original order.
data NubList a

-- | Smart constructor for the NubList type.
toNubList :: Ord a => [a] -> NubList a
fromNubList :: NubList a -> [a]

-- | Lift a function over lists to a function over NubLists.
overNubList :: Ord a => ([a] -> [a]) -> NubList a -> NubList a

-- | NubListR : A right-biased version of <a>NubList</a>. That is
°5u<tt>toNubListR ["-XNoFoo", "-XFoo", "-XNoFoo"]</tt> will result in
°5u<tt>["-XFoo", "-XNoFoo"]</tt>, unlike the normal <a>NubList</a>, which
°5uis left-biased. Built on top of <a>ordNubRight</a> and
°5u<a>listUnionRight</a>.
data NubListR a

-- | Smart constructor for the NubListR type.
toNubListR :: Ord a => [a] -> NubListR a
fromNubListR :: NubListR a -> [a]

-- | Lift a function over lists to a function over NubListRs.
overNubListR :: Ord a => ([a] -> [a]) -> NubListR a -> NubListR a
instance GHC.Classes.Eq a => GHC.Classes.Eq (Distribution.Utils.NubList.NubListR a)
instance GHC.Classes.Eq a => GHC.Classes.Eq (Distribution.Utils.NubList.NubList a)
instance GHC.Classes.Ord a => GHC.Base.Monoid (Distribution.Utils.NubList.NubListR a)
instance GHC.Classes.Ord a => GHC.Base.Semigroup (Distribution.Utils.NubList.NubListR a)
instance GHC.Show.Show a => GHC.Show.Show (Distribution.Utils.NubList.NubListR a)
instance (GHC.Classes.Ord a, GHC.Read.Read a) => GHC.Read.Read (Distribution.Utils.NubList.NubListR a)
instance GHC.Classes.Ord a => GHC.Base.Monoid (Distribution.Utils.NubList.NubList a)
instance GHC.Classes.Ord a => GHC.Base.Semigroup (Distribution.Utils.NubList.NubList a)
instance GHC.Show.Show a => GHC.Show.Show (Distribution.Utils.NubList.NubList a)
instance (GHC.Classes.Ord a, GHC.Read.Read a) => GHC.Read.Read (Distribution.Utils.NubList.NubList a)
instance (GHC.Classes.Ord a, Data.Binary.Class.Binary a) => Data.Binary.Class.Binary (Distribution.Utils.NubList.NubList a)

module Distribution.Utils.LogProgress

-- | The <a>Progress</a> monad with specialized logging and error messages.
data LogProgress a

-- | Run <a>LogProgress</a>, outputting traces according to
°5u<a>Verbosity</a>, <a>die</a> if there is an error.
runLogProgress :: Verbosity -> LogProgress a -> NoCallStackIO a

-- | Output a warning trace message in <a>LogProgress</a>.
warnProgress :: Doc -> LogProgress ()

-- | Output an informational trace message in <a>LogProgress</a>.
infoProgress :: Doc -> LogProgress ()

-- | Fail the computation with an error message.
dieProgress :: Doc -> LogProgress a

-- | Add a message to the error/warning context.
addProgressCtx :: CtxMsg -> LogProgress a -> LogProgress a
instance GHC.Base.Functor Distribution.Utils.LogProgress.LogProgress
instance GHC.Base.Applicative Distribution.Utils.LogProgress.LogProgress
instance GHC.Base.Monad Distribution.Utils.LogProgress.LogProgress


-- | Created : 23 July 2017
module Distribution.Simple.Program.ResponseFile
withResponseFile :: Verbosity -> TempFileOptions -> FilePath -> FilePath -> Maybe TextEncoding -> [String] -> (FilePath -> IO a) -> IO a


-- | A somewhat extended notion of the normal program search path concept.
°5u
°5uUsually when finding executables we just want to look in the usual
°5uplaces using the OS's usual method for doing so. In Haskell the normal
°5uOS-specific method is captured by <a>findExecutable</a>. On all common
°5uOSs that makes use of a <tt>PATH</tt> environment variable, (though on
°5uWindows it is not just the <tt>PATH</tt>).
°5u
°5uHowever it is sometimes useful to be able to look in additional
°5ulocations without having to change the process-global <tt>PATH</tt>
°5uenvironment variable. So we need an extension of the usual
°5u<a>findExecutable</a> that can look in additional locations, either
°5ubefore, after or instead of the normal OS locations.
module Distribution.Simple.Program.Find

-- | A search path to use when locating executables. This is analogous to
°5uthe unix <tt>$PATH</tt> or win32 <tt>%PATH%</tt> but with the ability
°5uto use the system default method for finding executables
°5u(<a>findExecutable</a> which on unix is simply looking on the
°5u<tt>$PATH</tt> but on win32 is a bit more complicated).
°5u
°5uThe default to use is <tt>[ProgSearchPathDefault]</tt> but you can add
°5uextra dirs either before, after or instead of the default, e.g. here
°5uwe add an extra dir to search after the usual ones.
°5u
°5u<pre>
°5u['ProgramSearchPathDefault', 'ProgramSearchPathDir' dir]
°5u</pre>
type ProgramSearchPath = [ProgramSearchPathEntry]
data ProgramSearchPathEntry

-- | A specific dir
ProgramSearchPathDir :: FilePath -> ProgramSearchPathEntry

-- | The system default
ProgramSearchPathDefault :: ProgramSearchPathEntry
defaultProgramSearchPath :: ProgramSearchPath
findProgramOnSearchPath :: Verbosity -> ProgramSearchPath -> FilePath -> IO (Maybe (FilePath, [FilePath]))

-- | Interpret a <a>ProgramSearchPath</a> to construct a new <tt>$PATH</tt>
°5uenv var. Note that this is close but not perfect because on Windows
°5uthe search algorithm looks at more than just the <tt>%PATH%</tt>.
programSearchPathAsPATHVar :: ProgramSearchPath -> NoCallStackIO String

-- | Get the system search path. On Unix systems this is just the
°5u<tt>$PATH</tt> env var, but on windows it's a bit more complicated.
getSystemSearchPath :: NoCallStackIO [FilePath]
instance GHC.Generics.Generic Distribution.Simple.Program.Find.ProgramSearchPathEntry
instance GHC.Classes.Eq Distribution.Simple.Program.Find.ProgramSearchPathEntry
instance Data.Binary.Class.Binary Distribution.Simple.Program.Find.ProgramSearchPathEntry


-- | This provides an abstraction which deals with configuring and running
°5uprograms. A <a>Program</a> is a static notion of a known program. A
°5u<a>ConfiguredProgram</a> is a <a>Program</a> that has been found on
°5uthe current machine and is ready to be run (possibly with some
°5uuser-supplied default args). Configuring a program involves finding
°5uits location and if necessary finding its version. There's reasonable
°5udefault behavior for trying to find "foo" in PATH, being able to
°5uoverride its location, etc.
module Distribution.Simple.Program.Types

-- | Represents a program which can be configured.
°5u
°5uNote: rather than constructing this directly, start with
°5u<a>simpleProgram</a> and override any extra fields.
data Program
Program :: String -> Verbosity -> ProgramSearchPath -> IO (Maybe (FilePath, [FilePath])) -> Verbosity -> FilePath -> IO (Maybe Version) -> Verbosity -> ConfiguredProgram -> IO ConfiguredProgram -> Program

-- | The simple name of the program, eg. ghc
[programName] :: Program -> String

-- | A function to search for the program if its location was not specified
°5uby the user. Usually this will just be a call to
°5u<a>findProgramOnSearchPath</a>.
°5u
°5uIt is supplied with the prevailing search path which will typically
°5ujust be used as-is, but can be extended or ignored as needed.
°5u
°5uFor the purpose of change monitoring, in addition to the location
°5uwhere the program was found, it returns all the other places that were
°5utried.
[programFindLocation] :: Program -> Verbosity -> ProgramSearchPath -> IO (Maybe (FilePath, [FilePath]))

-- | Try to find the version of the program. For many programs this is not
°5upossible or is not necessary so it's OK to return Nothing.
[programFindVersion] :: Program -> Verbosity -> FilePath -> IO (Maybe Version)

-- | A function to do any additional configuration after we have located
°5uthe program (and perhaps identified its version). For example it could
°5uadd args, or environment vars.
[programPostConf] :: Program -> Verbosity -> ConfiguredProgram -> IO ConfiguredProgram

-- | A search path to use when locating executables. This is analogous to
°5uthe unix <tt>$PATH</tt> or win32 <tt>%PATH%</tt> but with the ability
°5uto use the system default method for finding executables
°5u(<a>findExecutable</a> which on unix is simply looking on the
°5u<tt>$PATH</tt> but on win32 is a bit more complicated).
°5u
°5uThe default to use is <tt>[ProgSearchPathDefault]</tt> but you can add
°5uextra dirs either before, after or instead of the default, e.g. here
°5uwe add an extra dir to search after the usual ones.
°5u
°5u<pre>
°5u['ProgramSearchPathDefault', 'ProgramSearchPathDir' dir]
°5u</pre>
type ProgramSearchPath = [ProgramSearchPathEntry]
data ProgramSearchPathEntry

-- | A specific dir
ProgramSearchPathDir :: FilePath -> ProgramSearchPathEntry

-- | The system default
ProgramSearchPathDefault :: ProgramSearchPathEntry

-- | Make a simple named program.
°5u
°5uBy default we'll just search for it in the path and not try to find
°5uthe version name. You can override these behaviours if necessary, eg:
°5u
°5u<pre>
°5u(simpleProgram "foo") { programFindLocation = ... , programFindVersion ... }
°5u</pre>
simpleProgram :: String -> Program

-- | Represents a program which has been configured and is thus ready to be
°5urun.
°5u
°5uThese are usually made by configuring a <a>Program</a>, but if you
°5uhave to construct one directly then start with
°5u<a>simpleConfiguredProgram</a> and override any extra fields.
data ConfiguredProgram
ConfiguredProgram :: String -> Maybe Version -> [String] -> [String] -> [(String, Maybe String)] -> Map String String -> ProgramLocation -> [FilePath] -> ConfiguredProgram

-- | Just the name again
[programId] :: ConfiguredProgram -> String

-- | The version of this program, if it is known.
[programVersion] :: ConfiguredProgram -> Maybe Version

-- | Default command-line args for this program. These flags will appear
°5ufirst on the command line, so they can be overridden by subsequent
°5uflags.
[programDefaultArgs] :: ConfiguredProgram -> [String]

-- | Override command-line args for this program. These flags will appear
°5ulast on the command line, so they override all earlier flags.
[programOverrideArgs] :: ConfiguredProgram -> [String]

-- | Override environment variables for this program. These env vars will
°5uextend/override the prevailing environment of the current to form the
°5uenvironment for the new process.
[programOverrideEnv] :: ConfiguredProgram -> [(String, Maybe String)]

-- | A key-value map listing various properties of the program, useful for
°5ufeature detection. Populated during the configuration step, key names
°5udepend on the specific program.
[programProperties] :: ConfiguredProgram -> Map String String

-- | Location of the program. eg. <tt>/usr/bin/ghc-6.4</tt>
[programLocation] :: ConfiguredProgram -> ProgramLocation

-- | In addition to the <a>programLocation</a> where the program was found,
°5uthese are additional locations that were looked at. The combination of
°5uths found location and these not-found locations can be used to
°5umonitor to detect when the re-configuring the program might give a
°5udifferent result (e.g. found in a different location).
[programMonitorFiles] :: ConfiguredProgram -> [FilePath]

-- | The full path of a configured program.
programPath :: ConfiguredProgram -> FilePath

-- | Suppress any extra arguments added by the user.
suppressOverrideArgs :: ConfiguredProgram -> ConfiguredProgram
type ProgArg = String

-- | Where a program was found. Also tells us whether it's specified by
°5uuser or not. This includes not just the path, but the program as well.
data ProgramLocation

-- | The user gave the path to this program, eg.
°5u--ghc-path=/usr/bin/ghc-6.6
UserSpecified :: FilePath -> ProgramLocation
[locationPath] :: ProgramLocation -> FilePath

-- | The program was found automatically.
FoundOnSystem :: FilePath -> ProgramLocation
[locationPath] :: ProgramLocation -> FilePath

-- | Make a simple <a>ConfiguredProgram</a>.
°5u
°5u<pre>
°5usimpleConfiguredProgram "foo" (FoundOnSystem path)
°5u</pre>
simpleConfiguredProgram :: String -> ProgramLocation -> ConfiguredProgram
instance GHC.Show.Show Distribution.Simple.Program.Types.ConfiguredProgram
instance GHC.Read.Read Distribution.Simple.Program.Types.ConfiguredProgram
instance GHC.Generics.Generic Distribution.Simple.Program.Types.ConfiguredProgram
instance GHC.Classes.Eq Distribution.Simple.Program.Types.ConfiguredProgram
instance GHC.Show.Show Distribution.Simple.Program.Types.ProgramLocation
instance GHC.Read.Read Distribution.Simple.Program.Types.ProgramLocation
instance GHC.Generics.Generic Distribution.Simple.Program.Types.ProgramLocation
instance GHC.Classes.Eq Distribution.Simple.Program.Types.ProgramLocation
instance GHC.Show.Show Distribution.Simple.Program.Types.Program
instance Data.Binary.Class.Binary Distribution.Simple.Program.Types.ConfiguredProgram
instance Data.Binary.Class.Binary Distribution.Simple.Program.Types.ProgramLocation


-- | This module provides a data type for program invocations and functions
°5uto run them.
module Distribution.Simple.Program.Run

-- | Represents a specific invocation of a specific program.
°5u
°5uThis is used as an intermediate type between deciding how to call a
°5uprogram and actually doing it. This provides the opportunity to the
°5ucaller to adjust how the program will be called. These invocations can
°5ueither be run directly or turned into shell or batch scripts.
data ProgramInvocation
ProgramInvocation :: FilePath -> [String] -> [(String, Maybe String)] -> [FilePath] -> Maybe FilePath -> Maybe String -> IOEncoding -> IOEncoding -> ProgramInvocation
[progInvokePath] :: ProgramInvocation -> FilePath
[progInvokeArgs] :: ProgramInvocation -> [String]
[progInvokeEnv] :: ProgramInvocation -> [(String, Maybe String)]
[progInvokePathEnv] :: ProgramInvocation -> [FilePath]
[progInvokeCwd] :: ProgramInvocation -> Maybe FilePath
[progInvokeInput] :: ProgramInvocation -> Maybe String
[progInvokeInputEncoding] :: ProgramInvocation -> IOEncoding
[progInvokeOutputEncoding] :: ProgramInvocation -> IOEncoding
data IOEncoding
IOEncodingText :: IOEncoding
IOEncodingUTF8 :: IOEncoding
emptyProgramInvocation :: ProgramInvocation
simpleProgramInvocation :: FilePath -> [String] -> ProgramInvocation
programInvocation :: ConfiguredProgram -> [String] -> ProgramInvocation

-- | Like the unix xargs program. Useful for when we've got very long
°5ucommand lines that might overflow an OS limit on command line length
°5uand so you need to invoke a command multiple times to get all the args
°5uin.
°5u
°5uIt takes four template invocations corresponding to the simple,
°5uinitial, middle and last invocations. If the number of args given is
°5usmall enough that we can get away with just a single invocation then
°5uthe simple one is used:
°5u
°5u<pre>
°5u$ simple args
°5u</pre>
°5u
°5uIf the number of args given means that we need to use multiple
°5uinvocations then the templates for the initial, middle and last
°5uinvocations are used:
°5u
°5u<pre>
°5u$ initial args_0
°5u$ middle  args_1
°5u$ middle  args_2
°5u  ...
°5u$ final   args_n
°5u</pre>
multiStageProgramInvocation :: ProgramInvocation -> (ProgramInvocation, ProgramInvocation, ProgramInvocation) -> [String] -> [ProgramInvocation]
runProgramInvocation :: Verbosity -> ProgramInvocation -> IO ()
getProgramInvocationOutput :: Verbosity -> ProgramInvocation -> IO String
getProgramInvocationOutputAndErrors :: Verbosity -> ProgramInvocation -> IO (String, String, ExitCode)

-- | Return the current environment extended with the given overrides. If
°5uan entry is specified twice in <tt>overrides</tt>, the second entry
°5utakes precedence.
getEffectiveEnvironment :: [(String, Maybe String)] -> NoCallStackIO (Maybe [(String, String)])


-- | This module provides an library interface to the <tt>hc-pkg</tt>
°5uprogram. Currently only GHC and LHC have hc-pkg programs.
module Distribution.Simple.Program.Script

-- | Generate a system script, either POSIX shell script or Windows batch
°5ufile as appropriate for the given system.
invocationAsSystemScript :: OS -> ProgramInvocation -> String

-- | Generate a POSIX shell script that invokes a program.
invocationAsShellScript :: ProgramInvocation -> String

-- | Generate a Windows batch file that invokes a program.
invocationAsBatchFile :: ProgramInvocation -> String


-- | This module provides an library interface to the <tt>hpc</tt> program.
module Distribution.Simple.Program.Hpc

-- | Invoke hpc with the given parameters.
°5u
°5uPrior to HPC version 0.7 (packaged with GHC 7.8), hpc did not handle
°5umultiple .mix paths correctly, so we print a warning, and only pass it
°5uthe first path in the list. This means that e.g. test suites that
°5uimport their library as a dependency can still work, but those that
°5uinclude the library modules directly (in other-modules) don't.
markup :: ConfiguredProgram -> Version -> Verbosity -> FilePath -> [FilePath] -> FilePath -> [ModuleName] -> IO ()
union :: ConfiguredProgram -> Verbosity -> [FilePath] -> FilePath -> [ModuleName] -> IO ()


-- | The module defines all the known built-in <a>Program</a>s.
°5u
°5uWhere possible we try to find their version numbers.
module Distribution.Simple.Program.Builtin

-- | The default list of programs. These programs are typically used
°5uinternally to Cabal.
builtinPrograms :: [Program]
ghcProgram :: Program
ghcPkgProgram :: Program
runghcProgram :: Program
ghcjsProgram :: Program
ghcjsPkgProgram :: Program
lhcProgram :: Program
lhcPkgProgram :: Program
hmakeProgram :: Program
jhcProgram :: Program
haskellSuiteProgram :: Program
haskellSuitePkgProgram :: Program
uhcProgram :: Program
gccProgram :: Program
arProgram :: Program
stripProgram :: Program
happyProgram :: Program
alexProgram :: Program
hsc2hsProgram :: Program
c2hsProgram :: Program
cpphsProgram :: Program
hscolourProgram :: Program
doctestProgram :: Program
haddockProgram :: Program
greencardProgram :: Program
ldProgram :: Program
tarProgram :: Program
cppProgram :: Program
pkgConfigProgram :: Program
hpcProgram :: Program


-- | This provides a <a>ProgramDb</a> type which holds configured and
°5unot-yet configured programs. It is the parameter to lots of actions
°5uelsewhere in Cabal that need to look up and run programs. If we had a
°5uCabal monad, the <a>ProgramDb</a> would probably be a reader or state
°5ucomponent of it.
°5u
°5uOne nice thing about using it is that any program that is registered
°5uwith Cabal will get some "configure" and ".cabal" helpers like
°5u--with-foo-args --foo-path= and extra-foo-args.
°5u
°5uThere's also a hook for adding programs in a Setup.lhs script. See
°5uhookedPrograms in <a>UserHooks</a>. This gives a hook user the ability
°5uto get the above flags and such so that they don't have to write all
°5uthe PATH logic inside Setup.lhs.
module Distribution.Simple.Program.Db

-- | The configuration is a collection of information about programs. It
°5ucontains information both about configured programs and also about
°5uprograms that we are yet to configure.
°5u
°5uThe idea is that we start from a collection of unconfigured programs
°5uand one by one we try to configure them at which point we move them
°5uinto the configured collection. For unconfigured programs we record
°5unot just the <a>Program</a> but also any user-provided arguments and
°5ulocation for the program.
data ProgramDb
emptyProgramDb :: ProgramDb
defaultProgramDb :: ProgramDb

-- | The 'Read'\/'Show' and <a>Binary</a> instances do not preserve all the
°5uunconfigured <tt>Programs</tt> because <a>Program</a> is not in
°5u'Read'\/'Show' because it contains functions. So to fully restore a
°5udeserialised <a>ProgramDb</a> use this function to add back all the
°5uknown <a>Program</a>s.
°5u
°5u<ul>
°5u<li>It does not add the default programs, but you probably want them,
°5uuse <a>builtinPrograms</a> in addition to any extra you might
°5uneed.</li>
°5u</ul>
restoreProgramDb :: [Program] -> ProgramDb -> ProgramDb

-- | Add a known program that we may configure later
addKnownProgram :: Program -> ProgramDb -> ProgramDb
addKnownPrograms :: [Program] -> ProgramDb -> ProgramDb
lookupKnownProgram :: String -> ProgramDb -> Maybe Program
knownPrograms :: ProgramDb -> [(Program, Maybe ConfiguredProgram)]

-- | Get the current <a>ProgramSearchPath</a> used by the <a>ProgramDb</a>.
°5uThis is the default list of locations where programs are looked for
°5uwhen configuring them. This can be overridden for specific programs
°5u(with <a>userSpecifyPath</a>), and specific known programs can modify
°5uor ignore this search path in their own configuration code.
getProgramSearchPath :: ProgramDb -> ProgramSearchPath

-- | Change the current <a>ProgramSearchPath</a> used by the
°5u<a>ProgramDb</a>. This will affect programs that are configured from
°5uhere on, so you should usually set it before configuring any programs.
setProgramSearchPath :: ProgramSearchPath -> ProgramDb -> ProgramDb

-- | Modify the current <a>ProgramSearchPath</a> used by the
°5u<a>ProgramDb</a>. This will affect programs that are configured from
°5uhere on, so you should usually modify it before configuring any
°5uprograms.
modifyProgramSearchPath :: (ProgramSearchPath -> ProgramSearchPath) -> ProgramDb -> ProgramDb

-- | User-specify this path. Basically override any path information for
°5uthis program in the configuration. If it's not a known program ignore
°5uit.
userSpecifyPath :: String -> FilePath -> ProgramDb -> ProgramDb

-- | Like <a>userSpecifyPath</a> but for a list of progs and their paths.
userSpecifyPaths :: [(String, FilePath)] -> ProgramDb -> ProgramDb
userMaybeSpecifyPath :: String -> Maybe FilePath -> ProgramDb -> ProgramDb

-- | User-specify the arguments for this program. Basically override any
°5uargs information for this program in the configuration. If it's not a
°5uknown program, ignore it..
userSpecifyArgs :: String -> [ProgArg] -> ProgramDb -> ProgramDb

-- | Like <a>userSpecifyPath</a> but for a list of progs and their args.
userSpecifyArgss :: [(String, [ProgArg])] -> ProgramDb -> ProgramDb

-- | Get any extra args that have been previously specified for a program.
userSpecifiedArgs :: Program -> ProgramDb -> [ProgArg]

-- | Try to find a configured program
lookupProgram :: Program -> ProgramDb -> Maybe ConfiguredProgram

-- | Update a configured program in the database.
updateProgram :: ConfiguredProgram -> ProgramDb -> ProgramDb

-- | List all configured programs.
configuredPrograms :: ProgramDb -> [ConfiguredProgram]

-- | Try to configure a specific program. If the program is already
°5uincluded in the collection of unconfigured programs then we use any
°5uuser-supplied location and arguments. If the program gets configured
°5usuccessfully it gets added to the configured collection.
°5u
°5uNote that it is not a failure if the program cannot be configured.
°5uIt's only a failure if the user supplied a location and the program
°5ucould not be found at that location.
°5u
°5uThe reason for it not being a failure at this stage is that we don't
°5uknow up front all the programs we will need, so we try to configure
°5uthem all. To verify that a program was actually successfully
°5uconfigured use <a>requireProgram</a>.
configureProgram :: Verbosity -> Program -> ProgramDb -> IO ProgramDb

-- | Try to configure all the known programs that have not yet been
°5uconfigured.
configureAllKnownPrograms :: Verbosity -> ProgramDb -> IO ProgramDb

-- | Unconfigure a program. This is basically a hack and you shouldn't use
°5uit, but it can be handy for making sure a <a>requireProgram</a>
°5uactually reconfigures.
unconfigureProgram :: String -> ProgramDb -> ProgramDb

-- | Check that a program is configured and available to be run.
°5u
°5uAdditionally check that the program version number is suitable and
°5ureturn it. For example you could require <a>AnyVersion</a> or
°5u<tt><a>orLaterVersion</a> (<a>Version</a> [1,0] [])</tt>
°5u
°5uIt returns the configured program, its version number and a possibly
°5uupdated <a>ProgramDb</a>. If the program could not be configured or
°5uthe version is unsuitable, it returns an error value.
lookupProgramVersion :: Verbosity -> Program -> VersionRange -> ProgramDb -> IO (Either String (ConfiguredProgram, Version, ProgramDb))

-- | reconfigure a bunch of programs given new user-specified args. It
°5utakes the same inputs as <a>userSpecifyPath</a> and
°5u<a>userSpecifyArgs</a> and for all progs with a new path it calls
°5u<a>configureProgram</a>.
reconfigurePrograms :: Verbosity -> [(String, FilePath)] -> [(String, [ProgArg])] -> ProgramDb -> IO ProgramDb

-- | Check that a program is configured and available to be run.
°5u
°5uIt raises an exception if the program could not be configured,
°5uotherwise it returns the configured program.
requireProgram :: Verbosity -> Program -> ProgramDb -> IO (ConfiguredProgram, ProgramDb)

-- | Like <a>lookupProgramVersion</a>, but raises an exception in case of
°5uerror instead of returning 'Left errMsg'.
requireProgramVersion :: Verbosity -> Program -> VersionRange -> ProgramDb -> IO (ConfiguredProgram, Version, ProgramDb)
instance GHC.Show.Show Distribution.Simple.Program.Db.ProgramDb
instance GHC.Read.Read Distribution.Simple.Program.Db.ProgramDb
instance Data.Binary.Class.Binary Distribution.Simple.Program.Db.ProgramDb


-- | This provides an abstraction which deals with configuring and running
°5uprograms. A <a>Program</a> is a static notion of a known program. A
°5u<a>ConfiguredProgram</a> is a <a>Program</a> that has been found on
°5uthe current machine and is ready to be run (possibly with some
°5uuser-supplied default args). Configuring a program involves finding
°5uits location and if necessary finding its version. There is also a
°5u<a>ProgramDb</a> type which holds configured and not-yet configured
°5uprograms. It is the parameter to lots of actions elsewhere in Cabal
°5uthat need to look up and run programs. If we had a Cabal monad, the
°5u<a>ProgramDb</a> would probably be a reader or state component of it.
°5u
°5uThe module also defines all the known built-in <a>Program</a>s and the
°5u<a>defaultProgramDb</a> which contains them all.
°5u
°5uOne nice thing about using it is that any program that is registered
°5uwith Cabal will get some "configure" and ".cabal" helpers like
°5u--with-foo-args --foo-path= and extra-foo-args.
°5u
°5uThere's also good default behavior for trying to find "foo" in PATH,
°5ubeing able to override its location, etc.
°5u
°5uThere's also a hook for adding programs in a Setup.lhs script. See
°5uhookedPrograms in <a>UserHooks</a>. This gives a hook user the ability
°5uto get the above flags and such so that they don't have to write all
°5uthe PATH logic inside Setup.lhs.
module Distribution.Simple.Program

-- | Represents a program which can be configured.
°5u
°5uNote: rather than constructing this directly, start with
°5u<a>simpleProgram</a> and override any extra fields.
data Program
Program :: String -> Verbosity -> ProgramSearchPath -> IO (Maybe (FilePath, [FilePath])) -> Verbosity -> FilePath -> IO (Maybe Version) -> Verbosity -> ConfiguredProgram -> IO ConfiguredProgram -> Program

-- | The simple name of the program, eg. ghc
[programName] :: Program -> String

-- | A function to search for the program if its location was not specified
°5uby the user. Usually this will just be a call to
°5u<a>findProgramOnSearchPath</a>.
°5u
°5uIt is supplied with the prevailing search path which will typically
°5ujust be used as-is, but can be extended or ignored as needed.
°5u
°5uFor the purpose of change monitoring, in addition to the location
°5uwhere the program was found, it returns all the other places that were
°5utried.
[programFindLocation] :: Program -> Verbosity -> ProgramSearchPath -> IO (Maybe (FilePath, [FilePath]))

-- | Try to find the version of the program. For many programs this is not
°5upossible or is not necessary so it's OK to return Nothing.
[programFindVersion] :: Program -> Verbosity -> FilePath -> IO (Maybe Version)

-- | A function to do any additional configuration after we have located
°5uthe program (and perhaps identified its version). For example it could
°5uadd args, or environment vars.
[programPostConf] :: Program -> Verbosity -> ConfiguredProgram -> IO ConfiguredProgram

-- | A search path to use when locating executables. This is analogous to
°5uthe unix <tt>$PATH</tt> or win32 <tt>%PATH%</tt> but with the ability
°5uto use the system default method for finding executables
°5u(<a>findExecutable</a> which on unix is simply looking on the
°5u<tt>$PATH</tt> but on win32 is a bit more complicated).
°5u
°5uThe default to use is <tt>[ProgSearchPathDefault]</tt> but you can add
°5uextra dirs either before, after or instead of the default, e.g. here
°5uwe add an extra dir to search after the usual ones.
°5u
°5u<pre>
°5u['ProgramSearchPathDefault', 'ProgramSearchPathDir' dir]
°5u</pre>
type ProgramSearchPath = [ProgramSearchPathEntry]
data ProgramSearchPathEntry

-- | A specific dir
ProgramSearchPathDir :: FilePath -> ProgramSearchPathEntry

-- | The system default
ProgramSearchPathDefault :: ProgramSearchPathEntry

-- | Make a simple named program.
°5u
°5uBy default we'll just search for it in the path and not try to find
°5uthe version name. You can override these behaviours if necessary, eg:
°5u
°5u<pre>
°5u(simpleProgram "foo") { programFindLocation = ... , programFindVersion ... }
°5u</pre>
simpleProgram :: String -> Program
findProgramOnSearchPath :: Verbosity -> ProgramSearchPath -> FilePath -> IO (Maybe (FilePath, [FilePath]))
defaultProgramSearchPath :: ProgramSearchPath

-- | Look for a program and try to find it's version number. It can accept
°5ueither an absolute path or the name of a program binary, in which case
°5uwe will look for the program on the path.
findProgramVersion :: String -> (String -> String) -> Verbosity -> FilePath -> IO (Maybe Version)

-- | Represents a program which has been configured and is thus ready to be
°5urun.
°5u
°5uThese are usually made by configuring a <a>Program</a>, but if you
°5uhave to construct one directly then start with
°5u<a>simpleConfiguredProgram</a> and override any extra fields.
data ConfiguredProgram
ConfiguredProgram :: String -> Maybe Version -> [String] -> [String] -> [(String, Maybe String)] -> Map String String -> ProgramLocation -> [FilePath] -> ConfiguredProgram

-- | Just the name again
[programId] :: ConfiguredProgram -> String

-- | The version of this program, if it is known.
[programVersion] :: ConfiguredProgram -> Maybe Version

-- | Default command-line args for this program. These flags will appear
°5ufirst on the command line, so they can be overridden by subsequent
°5uflags.
[programDefaultArgs] :: ConfiguredProgram -> [String]

-- | Override command-line args for this program. These flags will appear
°5ulast on the command line, so they override all earlier flags.
[programOverrideArgs] :: ConfiguredProgram -> [String]

-- | Override environment variables for this program. These env vars will
°5uextend/override the prevailing environment of the current to form the
°5uenvironment for the new process.
[programOverrideEnv] :: ConfiguredProgram -> [(String, Maybe String)]

-- | A key-value map listing various properties of the program, useful for
°5ufeature detection. Populated during the configuration step, key names
°5udepend on the specific program.
[programProperties] :: ConfiguredProgram -> Map String String

-- | Location of the program. eg. <tt>/usr/bin/ghc-6.4</tt>
[programLocation] :: ConfiguredProgram -> ProgramLocation

-- | In addition to the <a>programLocation</a> where the program was found,
°5uthese are additional locations that were looked at. The combination of
°5uths found location and these not-found locations can be used to
°5umonitor to detect when the re-configuring the program might give a
°5udifferent result (e.g. found in a different location).
[programMonitorFiles] :: ConfiguredProgram -> [FilePath]

-- | The full path of a configured program.
programPath :: ConfiguredProgram -> FilePath
type ProgArg = String

-- | Where a program was found. Also tells us whether it's specified by
°5uuser or not. This includes not just the path, but the program as well.
data ProgramLocation

-- | The user gave the path to this program, eg.
°5u--ghc-path=/usr/bin/ghc-6.6
UserSpecified :: FilePath -> ProgramLocation
[locationPath] :: ProgramLocation -> FilePath

-- | The program was found automatically.
FoundOnSystem :: FilePath -> ProgramLocation
[locationPath] :: ProgramLocation -> FilePath

-- | Runs the given configured program.
runProgram :: Verbosity -> ConfiguredProgram -> [ProgArg] -> IO ()

-- | Runs the given configured program and gets the output.
getProgramOutput :: Verbosity -> ConfiguredProgram -> [ProgArg] -> IO String

-- | Suppress any extra arguments added by the user.
suppressOverrideArgs :: ConfiguredProgram -> ConfiguredProgram

-- | Represents a specific invocation of a specific program.
°5u
°5uThis is used as an intermediate type between deciding how to call a
°5uprogram and actually doing it. This provides the opportunity to the
°5ucaller to adjust how the program will be called. These invocations can
°5ueither be run directly or turned into shell or batch scripts.
data ProgramInvocation
ProgramInvocation :: FilePath -> [String] -> [(String, Maybe String)] -> [FilePath] -> Maybe FilePath -> Maybe String -> IOEncoding -> IOEncoding -> ProgramInvocation
[progInvokePath] :: ProgramInvocation -> FilePath
[progInvokeArgs] :: ProgramInvocation -> [String]
[progInvokeEnv] :: ProgramInvocation -> [(String, Maybe String)]
[progInvokePathEnv] :: ProgramInvocation -> [FilePath]
[progInvokeCwd] :: ProgramInvocation -> Maybe FilePath
[progInvokeInput] :: ProgramInvocation -> Maybe String
[progInvokeInputEncoding] :: ProgramInvocation -> IOEncoding
[progInvokeOutputEncoding] :: ProgramInvocation -> IOEncoding
emptyProgramInvocation :: ProgramInvocation
simpleProgramInvocation :: FilePath -> [String] -> ProgramInvocation
programInvocation :: ConfiguredProgram -> [String] -> ProgramInvocation
runProgramInvocation :: Verbosity -> ProgramInvocation -> IO ()
getProgramInvocationOutput :: Verbosity -> ProgramInvocation -> IO String

-- | The default list of programs. These programs are typically used
°5uinternally to Cabal.
builtinPrograms :: [Program]

-- | The configuration is a collection of information about programs. It
°5ucontains information both about configured programs and also about
°5uprograms that we are yet to configure.
°5u
°5uThe idea is that we start from a collection of unconfigured programs
°5uand one by one we try to configure them at which point we move them
°5uinto the configured collection. For unconfigured programs we record
°5unot just the <a>Program</a> but also any user-provided arguments and
°5ulocation for the program.
data ProgramDb
defaultProgramDb :: ProgramDb
emptyProgramDb :: ProgramDb

-- | The 'Read'\/'Show' and <a>Binary</a> instances do not preserve all the
°5uunconfigured <tt>Programs</tt> because <a>Program</a> is not in
°5u'Read'\/'Show' because it contains functions. So to fully restore a
°5udeserialised <a>ProgramDb</a> use this function to add back all the
°5uknown <a>Program</a>s.
°5u
°5u<ul>
°5u<li>It does not add the default programs, but you probably want them,
°5uuse <a>builtinPrograms</a> in addition to any extra you might
°5uneed.</li>
°5u</ul>
restoreProgramDb :: [Program] -> ProgramDb -> ProgramDb

-- | Add a known program that we may configure later
addKnownProgram :: Program -> ProgramDb -> ProgramDb
addKnownPrograms :: [Program] -> ProgramDb -> ProgramDb
lookupKnownProgram :: String -> ProgramDb -> Maybe Program
knownPrograms :: ProgramDb -> [(Program, Maybe ConfiguredProgram)]

-- | Get the current <a>ProgramSearchPath</a> used by the <a>ProgramDb</a>.
°5uThis is the default list of locations where programs are looked for
°5uwhen configuring them. This can be overridden for specific programs
°5u(with <a>userSpecifyPath</a>), and specific known programs can modify
°5uor ignore this search path in their own configuration code.
getProgramSearchPath :: ProgramDb -> ProgramSearchPath

-- | Change the current <a>ProgramSearchPath</a> used by the
°5u<a>ProgramDb</a>. This will affect programs that are configured from
°5uhere on, so you should usually set it before configuring any programs.
setProgramSearchPath :: ProgramSearchPath -> ProgramDb -> ProgramDb

-- | User-specify this path. Basically override any path information for
°5uthis program in the configuration. If it's not a known program ignore
°5uit.
userSpecifyPath :: String -> FilePath -> ProgramDb -> ProgramDb

-- | Like <a>userSpecifyPath</a> but for a list of progs and their paths.
userSpecifyPaths :: [(String, FilePath)] -> ProgramDb -> ProgramDb
userMaybeSpecifyPath :: String -> Maybe FilePath -> ProgramDb -> ProgramDb

-- | User-specify the arguments for this program. Basically override any
°5uargs information for this program in the configuration. If it's not a
°5uknown program, ignore it..
userSpecifyArgs :: String -> [ProgArg] -> ProgramDb -> ProgramDb

-- | Like <a>userSpecifyPath</a> but for a list of progs and their args.
userSpecifyArgss :: [(String, [ProgArg])] -> ProgramDb -> ProgramDb

-- | Get any extra args that have been previously specified for a program.
userSpecifiedArgs :: Program -> ProgramDb -> [ProgArg]

-- | Try to find a configured program
lookupProgram :: Program -> ProgramDb -> Maybe ConfiguredProgram

-- | Check that a program is configured and available to be run.
°5u
°5uAdditionally check that the program version number is suitable and
°5ureturn it. For example you could require <a>AnyVersion</a> or
°5u<tt><a>orLaterVersion</a> (<a>Version</a> [1,0] [])</tt>
°5u
°5uIt returns the configured program, its version number and a possibly
°5uupdated <a>ProgramDb</a>. If the program could not be configured or
°5uthe version is unsuitable, it returns an error value.
lookupProgramVersion :: Verbosity -> Program -> VersionRange -> ProgramDb -> IO (Either String (ConfiguredProgram, Version, ProgramDb))

-- | Update a configured program in the database.
updateProgram :: ConfiguredProgram -> ProgramDb -> ProgramDb

-- | Try to configure a specific program. If the program is already
°5uincluded in the collection of unconfigured programs then we use any
°5uuser-supplied location and arguments. If the program gets configured
°5usuccessfully it gets added to the configured collection.
°5u
°5uNote that it is not a failure if the program cannot be configured.
°5uIt's only a failure if the user supplied a location and the program
°5ucould not be found at that location.
°5u
°5uThe reason for it not being a failure at this stage is that we don't
°5uknow up front all the programs we will need, so we try to configure
°5uthem all. To verify that a program was actually successfully
°5uconfigured use <a>requireProgram</a>.
configureProgram :: Verbosity -> Program -> ProgramDb -> IO ProgramDb

-- | Try to configure all the known programs that have not yet been
°5uconfigured.
configureAllKnownPrograms :: Verbosity -> ProgramDb -> IO ProgramDb

-- | reconfigure a bunch of programs given new user-specified args. It
°5utakes the same inputs as <a>userSpecifyPath</a> and
°5u<a>userSpecifyArgs</a> and for all progs with a new path it calls
°5u<a>configureProgram</a>.
reconfigurePrograms :: Verbosity -> [(String, FilePath)] -> [(String, [ProgArg])] -> ProgramDb -> IO ProgramDb

-- | Check that a program is configured and available to be run.
°5u
°5uIt raises an exception if the program could not be configured,
°5uotherwise it returns the configured program.
requireProgram :: Verbosity -> Program -> ProgramDb -> IO (ConfiguredProgram, ProgramDb)

-- | Like <a>lookupProgramVersion</a>, but raises an exception in case of
°5uerror instead of returning 'Left errMsg'.
requireProgramVersion :: Verbosity -> Program -> VersionRange -> ProgramDb -> IO (ConfiguredProgram, Version, ProgramDb)

-- | Looks up the given program in the program database and runs it.
runDbProgram :: Verbosity -> Program -> ProgramDb -> [ProgArg] -> IO ()

-- | Looks up the given program in the program database and runs it.
getDbProgramOutput :: Verbosity -> Program -> ProgramDb -> [ProgArg] -> IO String
ghcProgram :: Program
ghcPkgProgram :: Program
ghcjsProgram :: Program
ghcjsPkgProgram :: Program
lhcProgram :: Program
lhcPkgProgram :: Program
hmakeProgram :: Program
jhcProgram :: Program
uhcProgram :: Program
gccProgram :: Program
arProgram :: Program
stripProgram :: Program
happyProgram :: Program
alexProgram :: Program
hsc2hsProgram :: Program
c2hsProgram :: Program
cpphsProgram :: Program
hscolourProgram :: Program
doctestProgram :: Program
haddockProgram :: Program
greencardProgram :: Program
ldProgram :: Program
tarProgram :: Program
cppProgram :: Program
pkgConfigProgram :: Program
hpcProgram :: Program

-- | <i>Deprecated: use ProgramDb instead. This symbol will be removed in
°5uCabal-3.0 (est. Oct 2018).</i>
type ProgramConfiguration = ProgramDb

-- | <i>Deprecated: use emptyProgramDb instead. This symbol will be removed
°5uin Cabal-3.0 (est. Oct 2018).</i>
emptyProgramConfiguration :: ProgramConfiguration

-- | <i>Deprecated: use defaultProgramDb instead. This symbol will be
°5uremoved in Cabal-3.0 (est. Oct 2018).</i>
defaultProgramConfiguration :: ProgramConfiguration

-- | <i>Deprecated: use restoreProgramDb instead. This symbol will be
°5uremoved in Cabal-3.0 (est. Oct 2018).</i>
restoreProgramConfiguration :: [Program] -> ProgramConfiguration -> ProgramConfiguration

-- | <i>Deprecated: use runProgram instead. This symbol will be removed in
°5uCabal-3.0 (est. Oct 2018).</i>
rawSystemProgram :: Verbosity -> ConfiguredProgram -> [ProgArg] -> IO ()

-- | <i>Deprecated: use getProgramOutput instead. This symbol will be
°5uremoved in Cabal-3.0 (est. Oct 2018).</i>
rawSystemProgramStdout :: Verbosity -> ConfiguredProgram -> [ProgArg] -> IO String

-- | <i>Deprecated: use runDbProgram instead. This symbol will be removed
°5uin Cabal-3.0 (est. Oct 2018).</i>
rawSystemProgramConf :: Verbosity -> Program -> ProgramConfiguration -> [ProgArg] -> IO ()

-- | <i>Deprecated: use getDbProgramOutput instead. This symbol will be
°5uremoved in Cabal-3.0 (est. Oct 2018).</i>
rawSystemProgramStdoutConf :: Verbosity -> Program -> ProgramConfiguration -> [ProgArg] -> IO String

-- | <i>Deprecated: use findProgramOnSearchPath instead. This symbol will
°5ube removed in Cabal-3.0 (est. Oct 2018).</i>
findProgramOnPath :: String -> Verbosity -> IO (Maybe FilePath)

-- | Look for a program on the path.

-- | <i>Deprecated: No longer used within Cabal, try
°5ufindProgramOnSearchPath</i>
findProgramLocation :: Verbosity -> FilePath -> IO (Maybe FilePath)


-- | This module provides an library interface to the <tt>strip</tt>
°5uprogram.
module Distribution.Simple.Program.Strip
stripLib :: Verbosity -> Platform -> ProgramDb -> FilePath -> IO ()
stripExe :: Verbosity -> Platform -> ProgramDb -> FilePath -> IO ()


-- | This should be a much more sophisticated abstraction than it is.
°5uCurrently it's just a bit of data about the compiler, like its flavour
°5uand name and version. The reason it's just data is because currently
°5uit has to be in <a>Read</a> and <a>Show</a> so it can be saved along
°5uwith the <tt>LocalBuildInfo</tt>. The only interesting bit of info it
°5ucontains is a mapping between language extensions and compiler command
°5uline flags. This module also defines a <a>PackageDB</a> type which is
°5uused to refer to package databases. Most compilers only know about a
°5usingle global package collection but GHC has a global and per-user one
°5uand it lets you create arbitrary other package databases. We do not
°5uyet fully support this latter feature.
module Distribution.Simple.Compiler
data Compiler
Compiler :: CompilerId -> AbiTag -> [CompilerId] -> [(Language, Flag)] -> [(Extension, Maybe Flag)] -> Map String String -> Compiler

-- | Compiler flavour and version.
[compilerId] :: Compiler -> CompilerId

-- | Tag for distinguishing incompatible ABI's on the same architecture/os.
[compilerAbiTag] :: Compiler -> AbiTag

-- | Other implementations that this compiler claims to be compatible with.
[compilerCompat] :: Compiler -> [CompilerId]

-- | Supported language standards.
[compilerLanguages] :: Compiler -> [(Language, Flag)]

-- | Supported extensions.
[compilerExtensions] :: Compiler -> [(Extension, Maybe Flag)]

-- | A key-value map for properties not covered by the above fields.
[compilerProperties] :: Compiler -> Map String String
showCompilerId :: Compiler -> String
showCompilerIdWithAbi :: Compiler -> String
compilerFlavor :: Compiler -> CompilerFlavor
compilerVersion :: Compiler -> Version

-- | Is this compiler compatible with the compiler flavour we're interested
°5uin?
°5u
°5uFor example this checks if the compiler is actually GHC or is another
°5ucompiler that claims to be compatible with some version of GHC, e.g.
°5uGHCJS.
°5u
°5u<pre>
°5uif compilerCompatFlavor GHC compiler then ... else ...
°5u</pre>
compilerCompatFlavor :: CompilerFlavor -> Compiler -> Bool

-- | Is this compiler compatible with the compiler flavour we're interested
°5uin, and if so what version does it claim to be compatible with.
°5u
°5uFor example this checks if the compiler is actually GHC-7.x or is
°5uanother compiler that claims to be compatible with some GHC-7.x
°5uversion.
°5u
°5u<pre>
°5ucase compilerCompatVersion GHC compiler of
°5u  Just (Version (7:_)) -&gt; ...
°5u  _                    -&gt; ...
°5u</pre>
compilerCompatVersion :: CompilerFlavor -> Compiler -> Maybe Version
compilerInfo :: Compiler -> CompilerInfo

-- | Some compilers have a notion of a database of available packages. For
°5usome there is just one global db of packages, other compilers support
°5ua per-user or an arbitrary db specified at some location in the file
°5usystem. This can be used to build isloated environments of packages,
°5ufor example to build a collection of related packages without
°5uinstalling them globally.
data PackageDB
GlobalPackageDB :: PackageDB
UserPackageDB :: PackageDB
SpecificPackageDB :: FilePath -> PackageDB

-- | We typically get packages from several databases, and stack them
°5utogether. This type lets us be explicit about that stacking. For
°5uexample typical stacks include:
°5u
°5u<pre>
°5u[GlobalPackageDB]
°5u[GlobalPackageDB, UserPackageDB]
°5u[GlobalPackageDB, SpecificPackageDB "package.conf.inplace"]
°5u</pre>
°5u
°5uNote that the <a>GlobalPackageDB</a> is invariably at the bottom since
°5uit contains the rts, base and other special compiler-specific
°5upackages.
°5u
°5uWe are not restricted to using just the above combinations. In
°5uparticular we can use several custom package dbs and the user package
°5udb together.
°5u
°5uWhen it comes to writing, the top most (last) package is used.
type PackageDBStack = [PackageDB]

-- | Return the package that we should register into. This is the package
°5udb at the top of the stack.
registrationPackageDB :: PackageDBStack -> PackageDB

-- | Make package paths absolute
absolutePackageDBPaths :: PackageDBStack -> NoCallStackIO PackageDBStack
absolutePackageDBPath :: PackageDB -> NoCallStackIO PackageDB

-- | Some compilers support optimising. Some have different levels. For
°5ucompilers that do not the level is just capped to the level they do
°5usupport.
data OptimisationLevel
NoOptimisation :: OptimisationLevel
NormalOptimisation :: OptimisationLevel
MaximumOptimisation :: OptimisationLevel
flagToOptimisationLevel :: Maybe String -> OptimisationLevel

-- | Some compilers support emitting debug info. Some have different
°5ulevels. For compilers that do not the level is just capped to the
°5ulevel they do support.
data DebugInfoLevel
NoDebugInfo :: DebugInfoLevel
MinimalDebugInfo :: DebugInfoLevel
NormalDebugInfo :: DebugInfoLevel
MaximalDebugInfo :: DebugInfoLevel
flagToDebugInfoLevel :: Maybe String -> DebugInfoLevel
type Flag = String
languageToFlags :: Compiler -> Maybe Language -> [Flag]
unsupportedLanguages :: Compiler -> [Language] -> [Language]

-- | For the given compiler, return the flags for the supported extensions.
extensionsToFlags :: Compiler -> [Extension] -> [Flag]

-- | For the given compiler, return the extensions it does not support.
unsupportedExtensions :: Compiler -> [Extension] -> [Extension]

-- | Does this compiler support parallel --make mode?
parmakeSupported :: Compiler -> Bool

-- | Does this compiler support reexported-modules?
reexportedModulesSupported :: Compiler -> Bool

-- | Does this compiler support thinning/renaming on package flags?
renamingPackageFlagsSupported :: Compiler -> Bool

-- | Does this compiler have unified IPIDs (so no package keys)
unifiedIPIDRequired :: Compiler -> Bool

-- | Does this compiler support package keys?
packageKeySupported :: Compiler -> Bool

-- | Does this compiler support unit IDs?
unitIdSupported :: Compiler -> Bool

-- | Does this compiler support Haskell program coverage?
coverageSupported :: Compiler -> Bool

-- | Does this compiler support profiling?
profilingSupported :: Compiler -> Bool

-- | Does this compiler support Backpack?
backpackSupported :: Compiler -> Bool

-- | Does this compiler's "ar" command supports response file arguments
°5u(i.e. @file-style arguments).
arResponseFilesSupported :: Compiler -> Bool

-- | Does this compiler support a package database entry with:
°5u"dynamic-library-dirs"?
libraryDynDirSupported :: Compiler -> Bool

-- | Some compilers (notably GHC) support profiling and can instrument
°5uprograms so the system can account costs to different functions. There
°5uare different levels of detail that can be used for this accounting.
°5uFor compilers that do not support this notion or the particular detail
°5ulevels, this is either ignored or just capped to some similar level
°5uthey do support.
data ProfDetailLevel
ProfDetailNone :: ProfDetailLevel
ProfDetailDefault :: ProfDetailLevel
ProfDetailExportedFunctions :: ProfDetailLevel
ProfDetailToplevelFunctions :: ProfDetailLevel
ProfDetailAllFunctions :: ProfDetailLevel
ProfDetailOther :: String -> ProfDetailLevel
knownProfDetailLevels :: [(String, [String], ProfDetailLevel)]
flagToProfDetailLevel :: String -> ProfDetailLevel
showProfDetailLevel :: ProfDetailLevel -> String
instance GHC.Show.Show Distribution.Simple.Compiler.ProfDetailLevel
instance GHC.Read.Read Distribution.Simple.Compiler.ProfDetailLevel
instance GHC.Generics.Generic Distribution.Simple.Compiler.ProfDetailLevel
instance GHC.Classes.Eq Distribution.Simple.Compiler.ProfDetailLevel
instance GHC.Read.Read Distribution.Simple.Compiler.Compiler
instance GHC.Show.Show Distribution.Simple.Compiler.Compiler
instance GHC.Generics.Generic Distribution.Simple.Compiler.Compiler
instance GHC.Classes.Eq Distribution.Simple.Compiler.Compiler
instance GHC.Show.Show Distribution.Simple.Compiler.DebugInfoLevel
instance GHC.Read.Read Distribution.Simple.Compiler.DebugInfoLevel
instance GHC.Generics.Generic Distribution.Simple.Compiler.DebugInfoLevel
instance GHC.Classes.Eq Distribution.Simple.Compiler.DebugInfoLevel
instance GHC.Enum.Enum Distribution.Simple.Compiler.DebugInfoLevel
instance GHC.Enum.Bounded Distribution.Simple.Compiler.DebugInfoLevel
instance GHC.Show.Show Distribution.Simple.Compiler.OptimisationLevel
instance GHC.Read.Read Distribution.Simple.Compiler.OptimisationLevel
instance GHC.Generics.Generic Distribution.Simple.Compiler.OptimisationLevel
instance GHC.Classes.Eq Distribution.Simple.Compiler.OptimisationLevel
instance GHC.Enum.Enum Distribution.Simple.Compiler.OptimisationLevel
instance GHC.Enum.Bounded Distribution.Simple.Compiler.OptimisationLevel
instance GHC.Read.Read Distribution.Simple.Compiler.PackageDB
instance GHC.Show.Show Distribution.Simple.Compiler.PackageDB
instance GHC.Classes.Ord Distribution.Simple.Compiler.PackageDB
instance GHC.Generics.Generic Distribution.Simple.Compiler.PackageDB
instance GHC.Classes.Eq Distribution.Simple.Compiler.PackageDB
instance Data.Binary.Class.Binary Distribution.Simple.Compiler.ProfDetailLevel
instance Data.Binary.Class.Binary Distribution.Simple.Compiler.Compiler
instance Data.Binary.Class.Binary Distribution.Simple.Compiler.DebugInfoLevel
instance Data.Binary.Class.Binary Distribution.Simple.Compiler.OptimisationLevel
instance Data.Binary.Class.Binary Distribution.Simple.Compiler.PackageDB


-- | This is to do with command line handling. The Cabal command line is
°5uorganised into a number of named sub-commands (much like darcs). The
°5u<a>CommandUI</a> abstraction represents one of these sub-commands,
°5uwith a name, description, a set of flags. Commands can be associated
°5uwith actions and run. It handles some common stuff automatically, like
°5uthe <tt>--help</tt> and command line completion flags. It is designed
°5uto allow other tools make derived commands. This feature is used
°5uheavily in <tt>cabal-install</tt>.
module Distribution.Simple.Command
data CommandUI flags
CommandUI :: String -> String -> String -> String -> Maybe (String -> String) -> Maybe (String -> String) -> flags -> ShowOrParseArgs -> [OptionField flags] -> CommandUI flags

-- | The name of the command as it would be entered on the command line.
°5uFor example <tt>"build"</tt>.
[commandName] :: CommandUI flags -> String

-- | A short, one line description of the command to use in help texts.
[commandSynopsis] :: CommandUI flags -> String

-- | A function that maps a program name to a usage summary for this
°5ucommand.
[commandUsage] :: CommandUI flags -> String -> String

-- | Additional explanation of the command to use in help texts.
[commandDescription] :: CommandUI flags -> Maybe (String -> String)

-- | Post-Usage notes and examples in help texts
[commandNotes] :: CommandUI flags -> Maybe (String -> String)

-- | Initial / empty flags
[commandDefaultFlags] :: CommandUI flags -> flags

-- | All the Option fields for this command
[commandOptions] :: CommandUI flags -> ShowOrParseArgs -> [OptionField flags]

-- | Show flags in the standard long option command line format
commandShowOptions :: CommandUI flags -> flags -> [String]
data CommandParse flags
CommandHelp :: (String -> String) -> CommandParse flags
CommandList :: [String] -> CommandParse flags
CommandErrors :: [String] -> CommandParse flags
CommandReadyToGo :: flags -> CommandParse flags

-- | Parse a bunch of command line arguments
commandParseArgs :: CommandUI flags -> Bool -> [String] -> CommandParse (flags -> flags, [String])

-- | Helper function for creating globalCommand description
getNormalCommandDescriptions :: [Command action] -> [(String, String)]
helpCommandUI :: CommandUI ()
data ShowOrParseArgs
ShowArgs :: ShowOrParseArgs
ParseArgs :: ShowOrParseArgs

-- | Default "usage" documentation text for commands.
usageDefault :: String -> String -> String

-- | Create "usage" documentation from a list of parameter configurations.
usageAlternatives :: String -> [String] -> String -> String

-- | Make a Command from standard <tt>GetOpt</tt> options.
mkCommandUI :: String -> String -> [String] -> flags -> (ShowOrParseArgs -> [OptionField flags]) -> CommandUI flags

-- | Mark command as hidden. Hidden commands don't show up in the 'progname
°5uhelp' or 'progname --help' output.
hiddenCommand :: Command action -> Command action
data Command action
commandAddAction :: CommandUI flags -> (flags -> [String] -> action) -> Command action

-- | Utility function, many commands do not accept additional flags. This
°5uaction fails with a helpful error message if the user supplies any
°5uextra.
noExtraFlags :: [String] -> IO ()
data CommandType
NormalCommand :: CommandType
HiddenCommand :: CommandType

-- | wraps a <tt>CommandUI</tt> together with a function that turns it into
°5ua <tt>Command</tt>. By hiding the type of flags for the UI allows
°5uconstruction of a list of all UIs at the top level of the program.
°5uThat list can then be used for generation of manual page as well as
°5ufor executing the selected command.
data CommandSpec action
CommandSpec :: (CommandUI flags) -> (CommandUI flags -> Command action) -> CommandType -> CommandSpec action
commandFromSpec :: CommandSpec a -> Command a
commandsRun :: CommandUI a -> [Command action] -> [String] -> CommandParse (a, CommandParse action)

-- | We usually have a data type for storing configuration values, where
°5uevery field stores a configuration option, and the user sets the value
°5ueither via command line flags or a configuration file. An individual
°5uOptionField models such a field, and we usually build a list of
°5uoptions associated to a configuration data type.
data OptionField a
OptionField :: Name -> [OptDescr a] -> OptionField a
[optionName] :: OptionField a -> Name
[optionDescr] :: OptionField a -> [OptDescr a]
type Name = String

-- | Create an option taking a single OptDescr. No explicit Name is given
°5ufor the Option, the name is the first LFlag given.
option :: SFlags -> LFlags -> Description -> get -> set -> MkOptDescr get set a -> OptionField a

-- | Create an option taking several OptDescrs. You will have to give the
°5uflags and description individually to the OptDescr constructor.
multiOption :: Name -> get -> set -> [get -> set -> OptDescr a] -> OptionField a
liftOption :: (b -> a) -> (a -> (b -> b)) -> OptionField a -> OptionField b

-- | to view as a FieldDescr, we sort the list of interfaces (Req &gt; Bool
°5u&gt; Choice &gt; Opt) and consider only the first one.
viewAsFieldDescr :: OptionField a -> FieldDescr a

-- | An OptionField takes one or more OptDescrs, describing the command
°5uline interface for the field.
data OptDescr a
ReqArg :: Description -> OptFlags -> ArgPlaceHolder -> (ReadE (a -> a)) -> (a -> [String]) -> OptDescr a
OptArg :: Description -> OptFlags -> ArgPlaceHolder -> (ReadE (a -> a)) -> (a -> a) -> (a -> [Maybe String]) -> OptDescr a
ChoiceOpt :: [(Description, OptFlags, a -> a, a -> Bool)] -> OptDescr a
BoolOpt :: Description -> OptFlags -> OptFlags -> (Bool -> a -> a) -> (a -> Maybe Bool) -> OptDescr a
type Description = String

-- | Short command line option strings
type SFlags = [Char]

-- | Long command line option strings
type LFlags = [String]
type OptFlags = (SFlags, LFlags)
type ArgPlaceHolder = String
type MkOptDescr get set a = SFlags -> LFlags -> Description -> get -> set -> OptDescr a

-- | Create a string-valued command line interface.
reqArg :: Monoid b => ArgPlaceHolder -> ReadE b -> (b -> [String]) -> MkOptDescr (a -> b) (b -> a -> a) a

-- | (String -&gt; a) variant of "reqArg"
reqArg' :: Monoid b => ArgPlaceHolder -> (String -> b) -> (b -> [String]) -> MkOptDescr (a -> b) (b -> a -> a) a

-- | Create a string-valued command line interface with a default value.
optArg :: Monoid b => ArgPlaceHolder -> ReadE b -> b -> (b -> [Maybe String]) -> MkOptDescr (a -> b) (b -> a -> a) a

-- | (String -&gt; a) variant of "optArg"
optArg' :: Monoid b => ArgPlaceHolder -> (Maybe String -> b) -> (b -> [Maybe String]) -> MkOptDescr (a -> b) (b -> a -> a) a
noArg :: (Eq b) => b -> MkOptDescr (a -> b) (b -> a -> a) a
boolOpt :: (b -> Maybe Bool) -> (Bool -> b) -> SFlags -> SFlags -> MkOptDescr (a -> b) (b -> a -> a) a
boolOpt' :: (b -> Maybe Bool) -> (Bool -> b) -> OptFlags -> OptFlags -> MkOptDescr (a -> b) (b -> a -> a) a

-- | create a Choice option
choiceOpt :: Eq b => [(b, OptFlags, Description)] -> MkOptDescr (a -> b) (b -> a -> a) a

-- | create a Choice option out of an enumeration type. As long flags, the
°5uShow output is used. As short flags, the first character which does
°5unot conflict with a previous one is used.
choiceOptFromEnum :: (Bounded b, Enum b, Show b, Eq b) => MkOptDescr (a -> b) (b -> a -> a) a
instance GHC.Base.Functor Distribution.Simple.Command.CommandParse


-- | This is a big module, but not very complicated. The code is very
°5uregular and repetitive. It defines the command line interface for all
°5uthe Cabal commands. For each command (like <tt>configure</tt>,
°5u<tt>build</tt> etc) it defines a type that holds all the flags, the
°5udefault set of flags and a <a>CommandUI</a> that maps command line
°5uflags to and from the corresponding flags type.
°5u
°5uAll the flags types are instances of <a>Monoid</a>, see
°5u<a>http://www.haskell.org/pipermail/cabal-devel/2007-December/001509.html</a>
°5ufor an explanation.
°5u
°5uThe types defined here get used in the front end and especially in
°5u<tt>cabal-install</tt> which has to do quite a bit of manipulating
°5usets of command line flags.
°5u
°5uThis is actually relatively nice, it works quite well. The main change
°5uit needs is to unify it with the code for managing sets of fields that
°5ucan be read and written from files. This would allow us to save
°5uconfigure flags in config files.
module Distribution.Simple.Setup

-- | Flags that apply at the top level, not to any sub-command.
data GlobalFlags
GlobalFlags :: Flag Bool -> Flag Bool -> GlobalFlags
[globalVersion] :: GlobalFlags -> Flag Bool
[globalNumericVersion] :: GlobalFlags -> Flag Bool
emptyGlobalFlags :: GlobalFlags
defaultGlobalFlags :: GlobalFlags
globalCommand :: [Command action] -> CommandUI GlobalFlags

-- | Flags to <tt>configure</tt> command.
°5u
°5uIMPORTANT: every time a new flag is added, <a>filterConfigureFlags</a>
°5ushould be updated. IMPORTANT: every time a new flag is added, it
°5ushould be added to the Eq instance
data ConfigFlags
ConfigFlags :: [String] -> Last' ProgramDb -> [(String, FilePath)] -> [(String, [String])] -> NubList FilePath -> Flag CompilerFlavor -> Flag FilePath -> Flag FilePath -> Flag Bool -> Flag Bool -> Flag Bool -> Flag Bool -> Flag Bool -> Flag Bool -> Flag Bool -> Flag ProfDetailLevel -> Flag ProfDetailLevel -> [String] -> Flag OptimisationLevel -> Flag PathTemplate -> Flag PathTemplate -> InstallDirs (Flag PathTemplate) -> Flag FilePath -> [FilePath] -> [FilePath] -> [FilePath] -> Flag String -> Flag ComponentId -> Flag Bool -> Flag FilePath -> Flag FilePath -> Flag Verbosity -> Flag Bool -> [Maybe PackageDB] -> Flag Bool -> Flag Bool -> Flag Bool -> Flag Bool -> Flag Bool -> [Dependency] -> [(PackageName, ComponentId)] -> [(ModuleName, Module)] -> FlagAssignment -> Flag Bool -> Flag Bool -> Flag Bool -> Flag Bool -> Flag Bool -> Flag String -> Flag Bool -> Flag DebugInfoLevel -> Flag Bool -> ConfigFlags
[configArgs] :: ConfigFlags -> [String]

-- | All programs that <tt>cabal</tt> may run
[configPrograms_] :: ConfigFlags -> Last' ProgramDb

-- | user specified programs paths
[configProgramPaths] :: ConfigFlags -> [(String, FilePath)]

-- | user specified programs args
[configProgramArgs] :: ConfigFlags -> [(String, [String])]

-- | Extend the $PATH
[configProgramPathExtra] :: ConfigFlags -> NubList FilePath

-- | The "flavor" of the compiler, such as GHC or JHC.
[configHcFlavor] :: ConfigFlags -> Flag CompilerFlavor

-- | given compiler location
[configHcPath] :: ConfigFlags -> Flag FilePath

-- | given hc-pkg location
[configHcPkg] :: ConfigFlags -> Flag FilePath

-- | Enable vanilla library
[configVanillaLib] :: ConfigFlags -> Flag Bool

-- | Enable profiling in the library
[configProfLib] :: ConfigFlags -> Flag Bool

-- | Build shared library
[configSharedLib] :: ConfigFlags -> Flag Bool

-- | Build static library
[configStaticLib] :: ConfigFlags -> Flag Bool

-- | Enable dynamic linking of the executables.
[configDynExe] :: ConfigFlags -> Flag Bool

-- | Enable profiling in the executables.
[configProfExe] :: ConfigFlags -> Flag Bool

-- | Enable profiling in the library and executables.
[configProf] :: ConfigFlags -> Flag Bool

-- | Profiling detail level in the library and executables.
[configProfDetail] :: ConfigFlags -> Flag ProfDetailLevel

-- | Profiling detail level in the library
[configProfLibDetail] :: ConfigFlags -> Flag ProfDetailLevel

-- | Extra arguments to <tt>configure</tt>
[configConfigureArgs] :: ConfigFlags -> [String]

-- | Enable optimization.
[configOptimization] :: ConfigFlags -> Flag OptimisationLevel

-- | Installed executable prefix.
[configProgPrefix] :: ConfigFlags -> Flag PathTemplate

-- | Installed executable suffix.
[configProgSuffix] :: ConfigFlags -> Flag PathTemplate

-- | Installation paths
[configInstallDirs] :: ConfigFlags -> InstallDirs (Flag PathTemplate)
[configScratchDir] :: ConfigFlags -> Flag FilePath

-- | path to search for extra libraries
[configExtraLibDirs] :: ConfigFlags -> [FilePath]

-- | path to search for extra frameworks (OS X only)
[configExtraFrameworkDirs] :: ConfigFlags -> [FilePath]

-- | path to search for header files
[configExtraIncludeDirs] :: ConfigFlags -> [FilePath]

-- | explicit IPID to be used
[configIPID] :: ConfigFlags -> Flag String

-- | explicit CID to be used
[configCID] :: ConfigFlags -> Flag ComponentId

-- | be as deterministic as possible (e.g., invariant over GHC, database,
°5uetc). Used by the test suite
[configDeterministic] :: ConfigFlags -> Flag Bool

-- | "dist" prefix
[configDistPref] :: ConfigFlags -> Flag FilePath

-- | Cabal file to use
[configCabalFilePath] :: ConfigFlags -> Flag FilePath

-- | verbosity level
[configVerbosity] :: ConfigFlags -> Flag Verbosity

-- | The --user/--global flag
[configUserInstall] :: ConfigFlags -> Flag Bool

-- | Which package DBs to use
[configPackageDBs] :: ConfigFlags -> [Maybe PackageDB]

-- | Enable compiling library for GHCi
[configGHCiLib] :: ConfigFlags -> Flag Bool

-- | Enable -split-sections with GHC
[configSplitSections] :: ConfigFlags -> Flag Bool

-- | Enable -split-objs with GHC
[configSplitObjs] :: ConfigFlags -> Flag Bool

-- | Enable executable stripping
[configStripExes] :: ConfigFlags -> Flag Bool

-- | Enable library stripping
[configStripLibs] :: ConfigFlags -> Flag Bool

-- | Additional constraints for dependencies.
[configConstraints] :: ConfigFlags -> [Dependency]

-- | The packages depended on.
[configDependencies] :: ConfigFlags -> [(PackageName, ComponentId)]

-- | The requested Backpack instantiation. If empty, either this package
°5udoes not use Backpack, or we just want to typecheck the indefinite
°5upackage.
[configInstantiateWith] :: ConfigFlags -> [(ModuleName, Module)]
[configConfigurationsFlags] :: ConfigFlags -> FlagAssignment

-- | Enable test suite compilation
[configTests] :: ConfigFlags -> Flag Bool

-- | Enable benchmark compilation
[configBenchmarks] :: ConfigFlags -> Flag Bool

-- | Enable program coverage
[configCoverage] :: ConfigFlags -> Flag Bool

-- | Enable program coverage (deprecated)
[configLibCoverage] :: ConfigFlags -> Flag Bool

-- | All direct dependencies and flags are provided on the command line by
°5uthe user via the '--dependency' and '--flags' options.
[configExactConfiguration] :: ConfigFlags -> Flag Bool

-- | Halt and show an error message indicating an error in flag assignment
[configFlagError] :: ConfigFlags -> Flag String

-- | Enable relocatable package built
[configRelocatable] :: ConfigFlags -> Flag Bool

-- | Emit debug info.
[configDebugInfo] :: ConfigFlags -> Flag DebugInfoLevel

-- | Whether to use response files at all. They're used for such tools as
°5uhaddock, or or ld.
[configUseResponseFiles] :: ConfigFlags -> Flag Bool
emptyConfigFlags :: ConfigFlags
defaultConfigFlags :: ProgramDb -> ConfigFlags
configureCommand :: ProgramDb -> CommandUI ConfigFlags

-- | More convenient version of <a>configPrograms</a>. Results in an
°5u<a>error</a> if internal invariant is violated.
configPrograms :: WithCallStack (ConfigFlags -> ProgramDb)
configAbsolutePaths :: ConfigFlags -> NoCallStackIO ConfigFlags
readPackageDbList :: String -> [Maybe PackageDB]
showPackageDbList :: [Maybe PackageDB] -> [String]

-- | Flags to <tt>copy</tt>: (destdir, copy-prefix (backwards compat),
°5uverbosity)
data CopyFlags
CopyFlags :: Flag CopyDest -> Flag FilePath -> Flag Verbosity -> [String] -> CopyFlags
[copyDest] :: CopyFlags -> Flag CopyDest
[copyDistPref] :: CopyFlags -> Flag FilePath
[copyVerbosity] :: CopyFlags -> Flag Verbosity
[copyArgs] :: CopyFlags -> [String]
emptyCopyFlags :: CopyFlags
defaultCopyFlags :: CopyFlags
copyCommand :: CommandUI CopyFlags

-- | Flags to <tt>install</tt>: (package db, verbosity)
data InstallFlags
InstallFlags :: Flag PackageDB -> Flag CopyDest -> Flag FilePath -> Flag Bool -> Flag Bool -> Flag Verbosity -> InstallFlags
[installPackageDB] :: InstallFlags -> Flag PackageDB
[installDest] :: InstallFlags -> Flag CopyDest
[installDistPref] :: InstallFlags -> Flag FilePath
[installUseWrapper] :: InstallFlags -> Flag Bool
[installInPlace] :: InstallFlags -> Flag Bool
[installVerbosity] :: InstallFlags -> Flag Verbosity
emptyInstallFlags :: InstallFlags
defaultInstallFlags :: InstallFlags
installCommand :: CommandUI InstallFlags
data DoctestFlags
DoctestFlags :: [(String, FilePath)] -> [(String, [String])] -> Flag FilePath -> Flag Verbosity -> DoctestFlags
[doctestProgramPaths] :: DoctestFlags -> [(String, FilePath)]
[doctestProgramArgs] :: DoctestFlags -> [(String, [String])]
[doctestDistPref] :: DoctestFlags -> Flag FilePath
[doctestVerbosity] :: DoctestFlags -> Flag Verbosity
emptyDoctestFlags :: DoctestFlags
defaultDoctestFlags :: DoctestFlags
doctestCommand :: CommandUI DoctestFlags

-- | When we build haddock documentation, there are two cases:
°5u
°5u<ol>
°5u<li>We build haddocks only for the current development version,
°5uintended for local use and not for distribution. In this case, we
°5ustore the generated documentation in
°5u<tt><a>dist</a><i>doc</i>html/<a>name</a></tt>.</li>
°5u<li>We build haddocks for intended for uploading them to hackage. In
°5uthis case, we need to follow the layout that hackage expects from
°5udocumentation tarballs, and we might also want to use different flags
°5uthan for development builds, so in this case we store the generated
°5udocumentation in
°5u<tt><a>dist</a><i>doc</i>html/<a>id</a>-docs</tt>.</li>
°5u</ol>
data HaddockTarget
ForHackage :: HaddockTarget
ForDevelopment :: HaddockTarget
data HaddockFlags
HaddockFlags :: [(String, FilePath)] -> [(String, [String])] -> Flag Bool -> Flag Bool -> Flag String -> Flag HaddockTarget -> Flag Bool -> Flag Bool -> Flag Bool -> Flag Bool -> Flag Bool -> Flag FilePath -> Flag Bool -> Flag FilePath -> Flag PathTemplate -> Flag FilePath -> Flag Bool -> Flag Verbosity -> HaddockFlags
[haddockProgramPaths] :: HaddockFlags -> [(String, FilePath)]
[haddockProgramArgs] :: HaddockFlags -> [(String, [String])]
[haddockHoogle] :: HaddockFlags -> Flag Bool
[haddockHtml] :: HaddockFlags -> Flag Bool
[haddockHtmlLocation] :: HaddockFlags -> Flag String
[haddockForHackage] :: HaddockFlags -> Flag HaddockTarget
[haddockExecutables] :: HaddockFlags -> Flag Bool
[haddockTestSuites] :: HaddockFlags -> Flag Bool
[haddockBenchmarks] :: HaddockFlags -> Flag Bool
[haddockForeignLibs] :: HaddockFlags -> Flag Bool
[haddockInternal] :: HaddockFlags -> Flag Bool
[haddockCss] :: HaddockFlags -> Flag FilePath
[haddockHscolour] :: HaddockFlags -> Flag Bool
[haddockHscolourCss] :: HaddockFlags -> Flag FilePath
[haddockContents] :: HaddockFlags -> Flag PathTemplate
[haddockDistPref] :: HaddockFlags -> Flag FilePath
[haddockKeepTempFiles] :: HaddockFlags -> Flag Bool
[haddockVerbosity] :: HaddockFlags -> Flag Verbosity
emptyHaddockFlags :: HaddockFlags
defaultHaddockFlags :: HaddockFlags
haddockCommand :: CommandUI HaddockFlags
data HscolourFlags
HscolourFlags :: Flag FilePath -> Flag Bool -> Flag Bool -> Flag Bool -> Flag Bool -> Flag FilePath -> Flag Verbosity -> HscolourFlags
[hscolourCSS] :: HscolourFlags -> Flag FilePath
[hscolourExecutables] :: HscolourFlags -> Flag Bool
[hscolourTestSuites] :: HscolourFlags -> Flag Bool
[hscolourBenchmarks] :: HscolourFlags -> Flag Bool
[hscolourForeignLibs] :: HscolourFlags -> Flag Bool
[hscolourDistPref] :: HscolourFlags -> Flag FilePath
[hscolourVerbosity] :: HscolourFlags -> Flag Verbosity
emptyHscolourFlags :: HscolourFlags
defaultHscolourFlags :: HscolourFlags
hscolourCommand :: CommandUI HscolourFlags
data BuildFlags
BuildFlags :: [(String, FilePath)] -> [(String, [String])] -> Flag FilePath -> Flag Verbosity -> Flag (Maybe Int) -> [String] -> BuildFlags
[buildProgramPaths] :: BuildFlags -> [(String, FilePath)]
[buildProgramArgs] :: BuildFlags -> [(String, [String])]
[buildDistPref] :: BuildFlags -> Flag FilePath
[buildVerbosity] :: BuildFlags -> Flag Verbosity
[buildNumJobs] :: BuildFlags -> Flag (Maybe Int)
[buildArgs] :: BuildFlags -> [String]
emptyBuildFlags :: BuildFlags
defaultBuildFlags :: BuildFlags
buildCommand :: ProgramDb -> CommandUI BuildFlags

-- | <i>Deprecated: Use buildVerbosity instead</i>
buildVerbose :: BuildFlags -> Verbosity
data ReplFlags
ReplFlags :: [(String, FilePath)] -> [(String, [String])] -> Flag FilePath -> Flag Verbosity -> Flag Bool -> ReplFlags
[replProgramPaths] :: ReplFlags -> [(String, FilePath)]
[replProgramArgs] :: ReplFlags -> [(String, [String])]
[replDistPref] :: ReplFlags -> Flag FilePath
[replVerbosity] :: ReplFlags -> Flag Verbosity
[replReload] :: ReplFlags -> Flag Bool
defaultReplFlags :: ReplFlags
replCommand :: ProgramDb -> CommandUI ReplFlags
data CleanFlags
CleanFlags :: Flag Bool -> Flag FilePath -> Flag Verbosity -> CleanFlags
[cleanSaveConf] :: CleanFlags -> Flag Bool
[cleanDistPref] :: CleanFlags -> Flag FilePath
[cleanVerbosity] :: CleanFlags -> Flag Verbosity
emptyCleanFlags :: CleanFlags
defaultCleanFlags :: CleanFlags
cleanCommand :: CommandUI CleanFlags

-- | Flags to <tt>register</tt> and <tt>unregister</tt>: (user package,
°5ugen-script, in-place, verbosity)
data RegisterFlags
RegisterFlags :: Flag PackageDB -> Flag Bool -> Flag (Maybe FilePath) -> Flag Bool -> Flag FilePath -> Flag Bool -> Flag Verbosity -> [String] -> RegisterFlags
[regPackageDB] :: RegisterFlags -> Flag PackageDB
[regGenScript] :: RegisterFlags -> Flag Bool
[regGenPkgConf] :: RegisterFlags -> Flag (Maybe FilePath)
[regInPlace] :: RegisterFlags -> Flag Bool
[regDistPref] :: RegisterFlags -> Flag FilePath
[regPrintId] :: RegisterFlags -> Flag Bool
[regVerbosity] :: RegisterFlags -> Flag Verbosity
[regArgs] :: RegisterFlags -> [String]
emptyRegisterFlags :: RegisterFlags
defaultRegisterFlags :: RegisterFlags
registerCommand :: CommandUI RegisterFlags
unregisterCommand :: CommandUI RegisterFlags

-- | Flags to <tt>sdist</tt>: (snapshot, verbosity)
data SDistFlags
SDistFlags :: Flag Bool -> Flag FilePath -> Flag FilePath -> Flag FilePath -> Flag Verbosity -> SDistFlags
[sDistSnapshot] :: SDistFlags -> Flag Bool
[sDistDirectory] :: SDistFlags -> Flag FilePath
[sDistDistPref] :: SDistFlags -> Flag FilePath
[sDistListSources] :: SDistFlags -> Flag FilePath
[sDistVerbosity] :: SDistFlags -> Flag Verbosity
emptySDistFlags :: SDistFlags
defaultSDistFlags :: SDistFlags
sdistCommand :: CommandUI SDistFlags
data TestFlags
TestFlags :: Flag FilePath -> Flag Verbosity -> Flag PathTemplate -> Flag PathTemplate -> Flag TestShowDetails -> Flag Bool -> [PathTemplate] -> TestFlags
[testDistPref] :: TestFlags -> Flag FilePath
[testVerbosity] :: TestFlags -> Flag Verbosity
[testHumanLog] :: TestFlags -> Flag PathTemplate
[testMachineLog] :: TestFlags -> Flag PathTemplate
[testShowDetails] :: TestFlags -> Flag TestShowDetails
[testKeepTix] :: TestFlags -> Flag Bool
[testOptions] :: TestFlags -> [PathTemplate]
emptyTestFlags :: TestFlags
defaultTestFlags :: TestFlags
testCommand :: CommandUI TestFlags
data TestShowDetails
Never :: TestShowDetails
Failures :: TestShowDetails
Always :: TestShowDetails
Streaming :: TestShowDetails
Direct :: TestShowDetails
data BenchmarkFlags
BenchmarkFlags :: Flag FilePath -> Flag Verbosity -> [PathTemplate] -> BenchmarkFlags
[benchmarkDistPref] :: BenchmarkFlags -> Flag FilePath
[benchmarkVerbosity] :: BenchmarkFlags -> Flag Verbosity
[benchmarkOptions] :: BenchmarkFlags -> [PathTemplate]
emptyBenchmarkFlags :: BenchmarkFlags
defaultBenchmarkFlags :: BenchmarkFlags
benchmarkCommand :: CommandUI BenchmarkFlags

-- | The location prefix for the <i>copy</i> command.
data CopyDest
NoCopyDest :: CopyDest
CopyTo :: FilePath -> CopyDest

-- | when using the ${pkgroot} as prefix. The CopyToDb will adjust the
°5upaths to be relative to the provided package database when copying /
°5uinstalling.
CopyToDb :: FilePath -> CopyDest

-- | Arguments to pass to a <tt>configure</tt> script, e.g. generated by
°5u<tt>autoconf</tt>.
configureArgs :: Bool -> ConfigFlags -> [String]
configureOptions :: ShowOrParseArgs -> [OptionField ConfigFlags]
configureCCompiler :: Verbosity -> ProgramDb -> IO (FilePath, [String])
configureLinker :: Verbosity -> ProgramDb -> IO (FilePath, [String])
buildOptions :: ProgramDb -> ShowOrParseArgs -> [OptionField BuildFlags]
haddockOptions :: ShowOrParseArgs -> [OptionField HaddockFlags]
installDirsOptions :: [OptionField (InstallDirs (Flag PathTemplate))]

-- | For each known program <tt>PROG</tt> in <tt>progDb</tt>, produce a
°5u<tt>PROG-options</tt> <a>OptionField</a>.
programDbOptions :: ProgramDb -> ShowOrParseArgs -> (flags -> [(String, [String])]) -> ([(String, [String])] -> (flags -> flags)) -> [OptionField flags]

-- | Like <a>programDbPaths</a>, but allows to customise the option name.
programDbPaths' :: (String -> String) -> ProgramDb -> ShowOrParseArgs -> (flags -> [(String, FilePath)]) -> ([(String, FilePath)] -> (flags -> flags)) -> [OptionField flags]

-- | For each known program <tt>PROG</tt> in <tt>progDb</tt>, produce a
°5u<tt>PROG-options</tt> <a>OptionField</a>.

-- | <i>Deprecated: Use programDbOptions instead</i>
programConfigurationOptions :: ProgramDb -> ShowOrParseArgs -> (flags -> [(String, [String])]) -> ([(String, [String])] -> (flags -> flags)) -> [OptionField flags]

-- | Like <a>programDbPaths</a>, but allows to customise the option name.

-- | <i>Deprecated: Use programDbPaths' instead</i>
programConfigurationPaths' :: (String -> String) -> ProgramDb -> ShowOrParseArgs -> (flags -> [(String, FilePath)]) -> ([(String, FilePath)] -> (flags -> flags)) -> [OptionField flags]

-- | Helper function to split a string into a list of arguments. It's
°5usupposed to handle quoted things sensibly, eg:
°5u
°5u<pre>
°5usplitArgs "--foo=\"C:/Program Files/Bar/" --baz"
°5u  = ["--foo=C:/Program Files/Bar", "--baz"]
°5u</pre>
°5u
°5u<pre>
°5usplitArgs "\"-DMSGSTR=\\\"foo bar\\\"\" --baz"
°5u  = ["-DMSGSTR=\"foo bar\"","--baz"]
°5u</pre>
splitArgs :: String -> [String]
defaultDistPref :: FilePath
optionDistPref :: (flags -> Flag FilePath) -> (Flag FilePath -> flags -> flags) -> ShowOrParseArgs -> OptionField flags

-- | All flags are monoids, they come in two flavours:
°5u
°5u<ol>
°5u<li>list flags eg</li>
°5u</ol>
°5u
°5u<pre>
°5u--ghc-option=foo --ghc-option=bar
°5u</pre>
°5u
°5ugives us all the values ["foo", "bar"]
°5u
°5u<ol>
°5u<li>singular value flags, eg:</li>
°5u</ol>
°5u
°5u<pre>
°5u--enable-foo --disable-foo
°5u</pre>
°5u
°5ugives us Just False So this Flag type is for the latter singular kind
°5uof flag. Its monoid instance gives us the behaviour where it starts
°5uout as <a>NoFlag</a> and later flags override earlier ones.
data Flag a
Flag :: a -> Flag a
NoFlag :: Flag a
toFlag :: a -> Flag a
fromFlag :: WithCallStack (Flag a -> a)
fromFlagOrDefault :: a -> Flag a -> a
flagToMaybe :: Flag a -> Maybe a
flagToList :: Flag a -> [a]
maybeToFlag :: Maybe a -> Flag a

-- | Types that represent boolean flags.
class BooleanFlag a
asBool :: BooleanFlag a => a -> Bool
boolOpt :: SFlags -> SFlags -> MkOptDescr (a -> Flag Bool) (Flag Bool -> a -> a) a
boolOpt' :: OptFlags -> OptFlags -> MkOptDescr (a -> Flag Bool) (Flag Bool -> a -> a) a
trueArg :: MkOptDescr (a -> Flag Bool) (Flag Bool -> a -> a) a
falseArg :: MkOptDescr (a -> Flag Bool) (Flag Bool -> a -> a) a
optionVerbosity :: (flags -> Flag Verbosity) -> (Flag Verbosity -> flags -> flags) -> OptionField flags
optionNumJobs :: (flags -> Flag (Maybe Int)) -> (Flag (Maybe Int) -> flags -> flags) -> OptionField flags
readPToMaybe :: ReadP a a -> String -> Maybe a
instance GHC.Generics.Generic Distribution.Simple.Setup.BenchmarkFlags
instance GHC.Generics.Generic Distribution.Simple.Setup.TestFlags
instance GHC.Show.Show Distribution.Simple.Setup.TestShowDetails
instance GHC.Enum.Bounded Distribution.Simple.Setup.TestShowDetails
instance GHC.Enum.Enum Distribution.Simple.Setup.TestShowDetails
instance GHC.Classes.Ord Distribution.Simple.Setup.TestShowDetails
instance GHC.Classes.Eq Distribution.Simple.Setup.TestShowDetails
instance GHC.Generics.Generic Distribution.Simple.Setup.ReplFlags
instance GHC.Show.Show Distribution.Simple.Setup.ReplFlags
instance GHC.Generics.Generic Distribution.Simple.Setup.BuildFlags
instance GHC.Show.Show Distribution.Simple.Setup.BuildFlags
instance GHC.Read.Read Distribution.Simple.Setup.BuildFlags
instance GHC.Generics.Generic Distribution.Simple.Setup.CleanFlags
instance GHC.Show.Show Distribution.Simple.Setup.CleanFlags
instance GHC.Generics.Generic Distribution.Simple.Setup.HaddockFlags
instance GHC.Show.Show Distribution.Simple.Setup.HaddockFlags
instance GHC.Generics.Generic Distribution.Simple.Setup.HaddockTarget
instance GHC.Show.Show Distribution.Simple.Setup.HaddockTarget
instance GHC.Classes.Eq Distribution.Simple.Setup.HaddockTarget
instance GHC.Generics.Generic Distribution.Simple.Setup.DoctestFlags
instance GHC.Show.Show Distribution.Simple.Setup.DoctestFlags
instance GHC.Generics.Generic Distribution.Simple.Setup.HscolourFlags
instance GHC.Show.Show Distribution.Simple.Setup.HscolourFlags
instance GHC.Generics.Generic Distribution.Simple.Setup.RegisterFlags
instance GHC.Show.Show Distribution.Simple.Setup.RegisterFlags
instance GHC.Generics.Generic Distribution.Simple.Setup.SDistFlags
instance GHC.Show.Show Distribution.Simple.Setup.SDistFlags
instance GHC.Generics.Generic Distribution.Simple.Setup.InstallFlags
instance GHC.Show.Show Distribution.Simple.Setup.InstallFlags
instance GHC.Generics.Generic Distribution.Simple.Setup.CopyFlags
instance GHC.Show.Show Distribution.Simple.Setup.CopyFlags
instance GHC.Show.Show Distribution.Simple.Setup.ConfigFlags
instance GHC.Read.Read Distribution.Simple.Setup.ConfigFlags
instance GHC.Generics.Generic Distribution.Simple.Setup.ConfigFlags
instance GHC.Generics.Generic Distribution.Simple.Setup.GlobalFlags
instance GHC.Read.Read a => GHC.Read.Read (Distribution.Simple.Setup.Flag a)
instance GHC.Show.Show a => GHC.Show.Show (Distribution.Simple.Setup.Flag a)
instance GHC.Generics.Generic (Distribution.Simple.Setup.Flag a)
instance GHC.Classes.Eq a => GHC.Classes.Eq (Distribution.Simple.Setup.Flag a)
instance GHC.Base.Monoid Distribution.Simple.Setup.BenchmarkFlags
instance GHC.Base.Semigroup Distribution.Simple.Setup.BenchmarkFlags
instance GHC.Base.Monoid Distribution.Simple.Setup.TestFlags
instance GHC.Base.Semigroup Distribution.Simple.Setup.TestFlags
instance Distribution.Pretty.Pretty Distribution.Simple.Setup.TestShowDetails
instance Distribution.Parsec.Class.Parsec Distribution.Simple.Setup.TestShowDetails
instance Distribution.Text.Text Distribution.Simple.Setup.TestShowDetails
instance GHC.Base.Monoid Distribution.Simple.Setup.TestShowDetails
instance GHC.Base.Semigroup Distribution.Simple.Setup.TestShowDetails
instance GHC.Base.Monoid Distribution.Simple.Setup.ReplFlags
instance GHC.Base.Semigroup Distribution.Simple.Setup.ReplFlags
instance GHC.Base.Monoid Distribution.Simple.Setup.BuildFlags
instance GHC.Base.Semigroup Distribution.Simple.Setup.BuildFlags
instance GHC.Base.Monoid Distribution.Simple.Setup.CleanFlags
instance GHC.Base.Semigroup Distribution.Simple.Setup.CleanFlags
instance GHC.Base.Monoid Distribution.Simple.Setup.HaddockFlags
instance GHC.Base.Semigroup Distribution.Simple.Setup.HaddockFlags
instance Data.Binary.Class.Binary Distribution.Simple.Setup.HaddockTarget
instance Distribution.Text.Text Distribution.Simple.Setup.HaddockTarget
instance GHC.Base.Monoid Distribution.Simple.Setup.DoctestFlags
instance GHC.Base.Semigroup Distribution.Simple.Setup.DoctestFlags
instance GHC.Base.Monoid Distribution.Simple.Setup.HscolourFlags
instance GHC.Base.Semigroup Distribution.Simple.Setup.HscolourFlags
instance GHC.Base.Monoid Distribution.Simple.Setup.RegisterFlags
instance GHC.Base.Semigroup Distribution.Simple.Setup.RegisterFlags
instance GHC.Base.Monoid Distribution.Simple.Setup.SDistFlags
instance GHC.Base.Semigroup Distribution.Simple.Setup.SDistFlags
instance GHC.Base.Monoid Distribution.Simple.Setup.InstallFlags
instance GHC.Base.Semigroup Distribution.Simple.Setup.InstallFlags
instance GHC.Base.Monoid Distribution.Simple.Setup.CopyFlags
instance GHC.Base.Semigroup Distribution.Simple.Setup.CopyFlags
instance Data.Binary.Class.Binary Distribution.Simple.Setup.ConfigFlags
instance GHC.Classes.Eq Distribution.Simple.Setup.ConfigFlags
instance GHC.Base.Monoid Distribution.Simple.Setup.ConfigFlags
instance GHC.Base.Semigroup Distribution.Simple.Setup.ConfigFlags
instance GHC.Base.Monoid Distribution.Simple.Setup.GlobalFlags
instance GHC.Base.Semigroup Distribution.Simple.Setup.GlobalFlags
instance Distribution.Simple.Setup.BooleanFlag GHC.Types.Bool
instance Data.Binary.Class.Binary a => Data.Binary.Class.Binary (Distribution.Simple.Setup.Flag a)
instance GHC.Base.Functor Distribution.Simple.Setup.Flag
instance GHC.Base.Monoid (Distribution.Simple.Setup.Flag a)
instance GHC.Base.Semigroup (Distribution.Simple.Setup.Flag a)
instance GHC.Enum.Bounded a => GHC.Enum.Bounded (Distribution.Simple.Setup.Flag a)
instance GHC.Enum.Enum a => GHC.Enum.Enum (Distribution.Simple.Setup.Flag a)

module Distribution.Simple.Program.GHC

-- | A structured set of GHC options/flags
data GhcOptions
GhcOptions :: Flag GhcMode -> NubListR String -> NubListR String -> NubListR FilePath -> NubListR ModuleName -> Flag FilePath -> Flag FilePath -> Flag Bool -> NubListR FilePath -> Flag String -> Flag ComponentId -> [(ModuleName, OpenModule)] -> Flag Bool -> PackageDBStack -> NubListR (OpenUnitId, ModuleRenaming) -> Flag Bool -> Flag Bool -> Flag Bool -> NubListR FilePath -> NubListR FilePath -> NubListR String -> NubListR String -> NubListR String -> Flag Bool -> Flag Bool -> NubListR FilePath -> NubListR String -> NubListR String -> NubListR String -> NubListR FilePath -> NubListR FilePath -> NubListR FilePath -> Flag Language -> NubListR Extension -> Map Extension (Maybe Flag) -> Flag GhcOptimisation -> Flag DebugInfoLevel -> Flag Bool -> Flag GhcProfAuto -> Flag Bool -> Flag Bool -> Flag (Maybe Int) -> Flag FilePath -> NubListR FilePath -> Flag String -> Flag String -> Flag String -> Flag String -> Flag FilePath -> Flag FilePath -> Flag FilePath -> Flag FilePath -> Flag GhcDynLinkMode -> Flag Bool -> Flag Bool -> Flag Bool -> Flag String -> NubListR FilePath -> Flag Verbosity -> NubListR FilePath -> Flag Bool -> GhcOptions

-- | The major mode for the ghc invocation.
[ghcOptMode] :: GhcOptions -> Flag GhcMode

-- | Any extra options to pass directly to ghc. These go at the end and
°5uhence override other stuff.
[ghcOptExtra] :: GhcOptions -> NubListR String

-- | Extra default flags to pass directly to ghc. These go at the beginning
°5uand so can be overridden by other stuff.
[ghcOptExtraDefault] :: GhcOptions -> NubListR String

-- | The main input files; could be .hs, .hi, .c, .o, depending on mode.
[ghcOptInputFiles] :: GhcOptions -> NubListR FilePath

-- | The names of input Haskell modules, mainly for <tt>--make</tt> mode.
[ghcOptInputModules] :: GhcOptions -> NubListR ModuleName

-- | Location for output file; the <tt>ghc -o</tt> flag.
[ghcOptOutputFile] :: GhcOptions -> Flag FilePath

-- | Location for dynamic output file in <a>GhcStaticAndDynamic</a> mode;
°5uthe <tt>ghc -dyno</tt> flag.
[ghcOptOutputDynFile] :: GhcOptions -> Flag FilePath

-- | Start with an empty search path for Haskell source files; the <tt>ghc
°5u-i</tt> flag (<tt>-i</tt> on its own with no path argument).
[ghcOptSourcePathClear] :: GhcOptions -> Flag Bool

-- | Search path for Haskell source files; the <tt>ghc -i</tt> flag.
[ghcOptSourcePath] :: GhcOptions -> NubListR FilePath

-- | The unit ID the modules will belong to; the <tt>ghc -this-unit-id</tt>
°5uflag (or <tt>-this-package-key</tt> or <tt>-package-name</tt> on older
°5uversions of GHC). This is a <a>String</a> because we assume you've
°5ualready figured out what the correct format for this string is (we
°5uneed to handle backwards compatibility.)
[ghcOptThisUnitId] :: GhcOptions -> Flag String

-- | GHC doesn't make any assumptions about the format of definite unit
°5uids, so when we are instantiating a package it needs to be told
°5uexplicitly what the component being instantiated is. This only gets
°5uset when <a>ghcOptInstantiatedWith</a> is non-empty
[ghcOptThisComponentId] :: GhcOptions -> Flag ComponentId

-- | How the requirements of the package being compiled are to be filled.
°5uWhen typechecking an indefinite package, the <a>OpenModule</a> is
°5ualways a <a>OpenModuleVar</a>; otherwise, it specifies the installed
°5umodule that instantiates a package.
[ghcOptInstantiatedWith] :: GhcOptions -> [(ModuleName, OpenModule)]

-- | No code? (But we turn on interface writing
[ghcOptNoCode] :: GhcOptions -> Flag Bool

-- | GHC package databases to use, the <tt>ghc -package-conf</tt> flag.
[ghcOptPackageDBs] :: GhcOptions -> PackageDBStack

-- | The GHC packages to bring into scope when compiling, the <tt>ghc
°5u-package-id</tt> flags.
[ghcOptPackages] :: GhcOptions -> NubListR (OpenUnitId, ModuleRenaming)

-- | Start with a clean package set; the <tt>ghc -hide-all-packages</tt>
°5uflag
[ghcOptHideAllPackages] :: GhcOptions -> Flag Bool

-- | Warn about modules, not listed in command line
[ghcOptWarnMissingHomeModules] :: GhcOptions -> Flag Bool

-- | Don't automatically link in Haskell98 etc; the <tt>ghc
°5u-no-auto-link-packages</tt> flag.
[ghcOptNoAutoLinkPackages] :: GhcOptions -> Flag Bool

-- | Names of libraries to link in; the <tt>ghc -l</tt> flag.
[ghcOptLinkLibs] :: GhcOptions -> NubListR FilePath

-- | Search path for libraries to link in; the <tt>ghc -L</tt> flag.
[ghcOptLinkLibPath] :: GhcOptions -> NubListR FilePath

-- | Options to pass through to the linker; the <tt>ghc -optl</tt> flag.
[ghcOptLinkOptions] :: GhcOptions -> NubListR String

-- | OSX only: frameworks to link in; the <tt>ghc -framework</tt> flag.
[ghcOptLinkFrameworks] :: GhcOptions -> NubListR String

-- | OSX only: Search path for frameworks to link in; the <tt>ghc
°5u-framework-path</tt> flag.
[ghcOptLinkFrameworkDirs] :: GhcOptions -> NubListR String

-- | Don't do the link step, useful in make mode; the <tt>ghc -no-link</tt>
°5uflag.
[ghcOptNoLink] :: GhcOptions -> Flag Bool

-- | Don't link in the normal RTS <tt>main</tt> entry point; the <tt>ghc
°5u-no-hs-main</tt> flag.
[ghcOptLinkNoHsMain] :: GhcOptions -> Flag Bool

-- | Module definition files (Windows specific)
[ghcOptLinkModDefFiles] :: GhcOptions -> NubListR FilePath

-- | Options to pass through to the C compiler; the <tt>ghc -optc</tt>
°5uflag.
[ghcOptCcOptions] :: GhcOptions -> NubListR String

-- | Options to pass through to the C++ compiler.
[ghcOptCxxOptions] :: GhcOptions -> NubListR String

-- | Options to pass through to CPP; the <tt>ghc -optP</tt> flag.
[ghcOptCppOptions] :: GhcOptions -> NubListR String

-- | Search path for CPP includes like header files; the <tt>ghc -I</tt>
°5uflag.
[ghcOptCppIncludePath] :: GhcOptions -> NubListR FilePath

-- | Extra header files to include at CPP stage; the <tt>ghc
°5u-optP-include</tt> flag.
[ghcOptCppIncludes] :: GhcOptions -> NubListR FilePath

-- | Extra header files to include for old-style FFI; the <tt>ghc
°5u-#include</tt> flag.
[ghcOptFfiIncludes] :: GhcOptions -> NubListR FilePath

-- | The base language; the <tt>ghc -XHaskell98</tt> or
°5u<tt>-XHaskell2010</tt> flag.
[ghcOptLanguage] :: GhcOptions -> Flag Language

-- | The language extensions; the <tt>ghc -X</tt> flag.
[ghcOptExtensions] :: GhcOptions -> NubListR Extension

-- | A GHC version-dependent mapping of extensions to flags. This must be
°5uset to be able to make use of the <a>ghcOptExtensions</a>.
[ghcOptExtensionMap] :: GhcOptions -> Map Extension (Maybe Flag)

-- | What optimisation level to use; the <tt>ghc -O</tt> flag.
[ghcOptOptimisation] :: GhcOptions -> Flag GhcOptimisation

-- | Emit debug info; the <tt>ghc -g</tt> flag.
[ghcOptDebugInfo] :: GhcOptions -> Flag DebugInfoLevel

-- | Compile in profiling mode; the <tt>ghc -prof</tt> flag.
[ghcOptProfilingMode] :: GhcOptions -> Flag Bool

-- | Automatically add profiling cost centers; the <tt>ghc
°5u-fprof-auto*</tt> flags.
[ghcOptProfilingAuto] :: GhcOptions -> Flag GhcProfAuto

-- | Use the "split sections" feature; the <tt>ghc -split-sections</tt>
°5uflag.
[ghcOptSplitSections] :: GhcOptions -> Flag Bool

-- | Use the "split object files" feature; the <tt>ghc -split-objs</tt>
°5uflag.
[ghcOptSplitObjs] :: GhcOptions -> Flag Bool

-- | Run N jobs simultaneously (if possible).
[ghcOptNumJobs] :: GhcOptions -> Flag (Maybe Int)

-- | Enable coverage analysis; the <tt>ghc -fhpc -hpcdir</tt> flags.
[ghcOptHPCDir] :: GhcOptions -> Flag FilePath

-- | Extra GHCi startup scripts; the <tt>-ghci-script</tt> flag
[ghcOptGHCiScripts] :: GhcOptions -> NubListR FilePath
[ghcOptHiSuffix] :: GhcOptions -> Flag String
[ghcOptObjSuffix] :: GhcOptions -> Flag String

-- | only in <a>GhcStaticAndDynamic</a> mode
[ghcOptDynHiSuffix] :: GhcOptions -> Flag String

-- | only in <a>GhcStaticAndDynamic</a> mode
[ghcOptDynObjSuffix] :: GhcOptions -> Flag String
[ghcOptHiDir] :: GhcOptions -> Flag FilePath
[ghcOptObjDir] :: GhcOptions -> Flag FilePath
[ghcOptOutputDir] :: GhcOptions -> Flag FilePath
[ghcOptStubDir] :: GhcOptions -> Flag FilePath
[ghcOptDynLinkMode] :: GhcOptions -> Flag GhcDynLinkMode
[ghcOptStaticLib] :: GhcOptions -> Flag Bool
[ghcOptShared] :: GhcOptions -> Flag Bool
[ghcOptFPic] :: GhcOptions -> Flag Bool
[ghcOptDylibName] :: GhcOptions -> Flag String
[ghcOptRPaths] :: GhcOptions -> NubListR FilePath

-- | Get GHC to be quiet or verbose with what it's doing; the <tt>ghc
°5u-v</tt> flag.
[ghcOptVerbosity] :: GhcOptions -> Flag Verbosity

-- | Put the extra folders in the PATH environment variable we invoke GHC
°5uwith
[ghcOptExtraPath] :: GhcOptions -> NubListR FilePath

-- | Let GHC know that it is Cabal that's calling it. Modifies some of the
°5uGHC error messages.
[ghcOptCabal] :: GhcOptions -> Flag Bool
data GhcMode

-- | <pre>
°5ughc -c
°5u</pre>
GhcModeCompile :: GhcMode

-- | <pre>
°5ughc
°5u</pre>
GhcModeLink :: GhcMode

-- | <pre>
°5ughc --make
°5u</pre>
GhcModeMake :: GhcMode

-- | <tt>ghci</tt> / <tt>ghc --interactive</tt>
GhcModeInteractive :: GhcMode

-- | <tt>ghc --abi-hash</tt> | GhcModeDepAnalysis -- ^ <tt>ghc -M</tt> |
°5uGhcModeEvaluate -- ^ <tt>ghc -e</tt>
GhcModeAbiHash :: GhcMode
data GhcOptimisation

-- | <pre>
°5u-O0
°5u</pre>
GhcNoOptimisation :: GhcOptimisation

-- | <pre>
°5u-O
°5u</pre>
GhcNormalOptimisation :: GhcOptimisation

-- | <pre>
°5u-O2
°5u</pre>
GhcMaximumOptimisation :: GhcOptimisation

-- | e.g. <tt>-Odph</tt>
GhcSpecialOptimisation :: String -> GhcOptimisation
data GhcDynLinkMode

-- | <pre>
°5u-static
°5u</pre>
GhcStaticOnly :: GhcDynLinkMode

-- | <pre>
°5u-dynamic
°5u</pre>
GhcDynamicOnly :: GhcDynLinkMode

-- | <pre>
°5u-static -dynamic-too
°5u</pre>
GhcStaticAndDynamic :: GhcDynLinkMode
data GhcProfAuto

-- | <pre>
°5u-fprof-auto
°5u</pre>
GhcProfAutoAll :: GhcProfAuto

-- | <pre>
°5u-fprof-auto-top
°5u</pre>
GhcProfAutoToplevel :: GhcProfAuto

-- | <pre>
°5u-fprof-auto-exported
°5u</pre>
GhcProfAutoExported :: GhcProfAuto
ghcInvocation :: ConfiguredProgram -> Compiler -> Platform -> GhcOptions -> ProgramInvocation
renderGhcOptions :: Compiler -> Platform -> GhcOptions -> [String]
runGHC :: Verbosity -> ConfiguredProgram -> Compiler -> Platform -> GhcOptions -> IO ()

-- | GHC &gt;= 7.6 uses the '-package-db' flag. See
°5u<a>https://ghc.haskell.org/trac/ghc/ticket/5977</a>.
packageDbArgsDb :: PackageDBStack -> [String]
instance GHC.Generics.Generic Distribution.Simple.Program.GHC.GhcOptions
instance GHC.Show.Show Distribution.Simple.Program.GHC.GhcOptions
instance GHC.Classes.Eq Distribution.Simple.Program.GHC.GhcProfAuto
instance GHC.Show.Show Distribution.Simple.Program.GHC.GhcProfAuto
instance GHC.Classes.Eq Distribution.Simple.Program.GHC.GhcDynLinkMode
instance GHC.Show.Show Distribution.Simple.Program.GHC.GhcDynLinkMode
instance GHC.Classes.Eq Distribution.Simple.Program.GHC.GhcOptimisation
instance GHC.Show.Show Distribution.Simple.Program.GHC.GhcOptimisation
instance GHC.Classes.Eq Distribution.Simple.Program.GHC.GhcMode
instance GHC.Show.Show Distribution.Simple.Program.GHC.GhcMode
instance GHC.Base.Monoid Distribution.Simple.Program.GHC.GhcOptions
instance GHC.Base.Semigroup Distribution.Simple.Program.GHC.GhcOptions

module Distribution.Parsec.ConfVar

-- | Parse <tt><a>Condition</a> <a>ConfVar</a></tt> from section arguments
°5uprovided by parsec based outline parser.
parseConditionConfVar :: [SectionArg Position] -> ParseResult (Condition ConfVar)


-- | This is about the cabal configurations feature. It exports
°5u<a>finalizePD</a> and <a>flattenPackageDescription</a> which are
°5ufunctions for converting <a>GenericPackageDescription</a>s down to
°5u<a>PackageDescription</a>s. It has code for working with the tree of
°5uconditions and resolving or flattening conditions.
module Distribution.PackageDescription.Configuration

-- | Create a package description with all configurations resolved.
°5u
°5uThis function takes a <a>GenericPackageDescription</a> and several
°5uenvironment parameters and tries to generate <a>PackageDescription</a>
°5uby finding a flag assignment that result in satisfiable dependencies.
°5u
°5uIt takes as inputs a not necessarily complete specifications of flags
°5uassignments, an optional package index as well as platform parameters.
°5uIf some flags are not assigned explicitly, this function will try to
°5upick an assignment that causes this function to succeed. The package
°5uindex is optional since on some platforms we cannot determine which
°5upackages have been installed before. When no package index is
°5usupplied, every dependency is assumed to be satisfiable, therefore all
°5unot explicitly assigned flags will get their default values.
°5u
°5uThis function will fail if it cannot find a flag assignment that leads
°5uto satisfiable dependencies. (It will not try alternative assignments
°5ufor explicitly specified flags.) In case of failure it will return the
°5umissing dependencies that it encountered when trying different flag
°5uassignments. On success, it will return the package description and
°5uthe full flag assignment chosen.
°5u
°5uNote that this drops any stanzas which have <tt>buildable: False</tt>.
°5uWhile this is arguably the right thing to do, it means we give bad
°5uerror messages in some situations, see #3858.
finalizePD :: FlagAssignment -> ComponentRequestedSpec -> (Dependency -> Bool) -> Platform -> CompilerInfo -> [Dependency] -> GenericPackageDescription -> Either [Dependency] (PackageDescription, FlagAssignment)

-- | <i>Deprecated: This function now always assumes tests and benchmarks
°5uare disabled; use finalizePD with ComponentRequestedSpec to specify
°5usomething more specific. This symbol will be removed in Cabal-3.0
°5u(est. Oct 2018).</i>
finalizePackageDescription :: FlagAssignment -> (Dependency -> Bool) -> Platform -> CompilerInfo -> [Dependency] -> GenericPackageDescription -> Either [Dependency] (PackageDescription, FlagAssignment)

-- | Flatten a generic package description by ignoring all conditions and
°5ujust join the field descriptors into on package description. Note,
°5uhowever, that this may lead to inconsistent field values, since all
°5uvalues are joined into one field, which may not be possible in the
°5uoriginal package description, due to the use of exclusive choices (if
°5u... else ...).
°5u
°5uTODO: One particularly tricky case is defaulting. In the original
°5upackage description, e.g., the source directory might either be the
°5udefault or a certain, explicitly set path. Since defaults are filled
°5uin only after the package has been resolved and when no explicit value
°5uhas been set, the default path will be missing from the package
°5udescription returned by this function.
flattenPackageDescription :: GenericPackageDescription -> PackageDescription

-- | Parse a configuration condition from a string.
parseCondition :: ReadP r (Condition ConfVar)
freeVars :: CondTree ConfVar c a -> [FlagName]

-- | Extract the condition matched by the given predicate from a cond tree.
°5u
°5uWe use this mainly for extracting buildable conditions (see the Note
°5uabove), but the function is in fact more general.
extractCondition :: Eq v => (a -> Bool) -> CondTree v c a -> Condition v

-- | Extract conditions matched by the given predicate from all cond trees
°5uin a <a>GenericPackageDescription</a>.
extractConditions :: (BuildInfo -> Bool) -> GenericPackageDescription -> [Condition ConfVar]

-- | Transforms a <a>CondTree</a> by putting the input under the "then"
°5ubranch of a conditional that is True when Buildable is True. If
°5u<a>addBuildableCondition</a> can determine that Buildable is always
°5uTrue, it returns the input unchanged. If Buildable is always False, it
°5ureturns the empty <a>CondTree</a>.
addBuildableCondition :: (Eq v, Monoid a, Monoid c) => (a -> BuildInfo) -> CondTree v c a -> CondTree v c a
mapCondTree :: (a -> b) -> (c -> d) -> (Condition v -> Condition w) -> CondTree v c a -> CondTree w d b
mapTreeData :: (a -> b) -> CondTree v c a -> CondTree v c b
mapTreeConds :: (Condition v -> Condition w) -> CondTree v c a -> CondTree w c a
mapTreeConstrs :: (c -> d) -> CondTree v c a -> CondTree v d a
transformAllBuildInfos :: (BuildInfo -> BuildInfo) -> (SetupBuildInfo -> SetupBuildInfo) -> GenericPackageDescription -> GenericPackageDescription

-- | Walk a <a>GenericPackageDescription</a> and apply <tt>f</tt> to all
°5unested <tt>build-depends</tt> fields.
transformAllBuildDepends :: (Dependency -> Dependency) -> GenericPackageDescription -> GenericPackageDescription
instance GHC.Show.Show Distribution.PackageDescription.Configuration.PDTagged
instance GHC.Base.Monoid Distribution.PackageDescription.Configuration.PDTagged
instance GHC.Base.Semigroup Distribution.PackageDescription.Configuration.PDTagged
instance GHC.Base.Semigroup d => GHC.Base.Monoid (Distribution.PackageDescription.Configuration.DepTestRslt d)
instance GHC.Base.Semigroup d => GHC.Base.Semigroup (Distribution.PackageDescription.Configuration.DepTestRslt d)


-- | This defined parsers and partial pretty printers for the
°5u<tt>.cabal</tt> format. Some of the complexity in this module is due
°5uto the fact that we have to be backwards compatible with old
°5u<tt>.cabal</tt> files, so there's code to translate into the newer
°5ustructure.
module Distribution.PackageDescription.Parse

-- | Parse the given package file.
readGenericPackageDescription :: Verbosity -> FilePath -> IO GenericPackageDescription

-- | Parses the given file into a <a>GenericPackageDescription</a>.
°5u
°5uIn Cabal 1.2 the syntax for package descriptions was changed to a
°5uformat with sections and possibly indented property descriptions.
parseGenericPackageDescription :: String -> ParseResult GenericPackageDescription

-- | <i>Deprecated: Use readGenericPackageDescription, old name is
°5umisleading.</i>
readPackageDescription :: Verbosity -> FilePath -> IO GenericPackageDescription

-- | <i>Deprecated: Use parseGenericPackageDescription, old name is
°5umisleading</i>
parsePackageDescription :: String -> ParseResult GenericPackageDescription
data ParseResult a
ParseFailed :: PError -> ParseResult a
ParseOk :: [PWarning] -> a -> ParseResult a

-- | Field descriptor. The parameter <tt>a</tt> parameterizes over where
°5uthe field's value is stored in.
data FieldDescr a
FieldDescr :: String -> a -> Doc -> LineNo -> String -> a -> ParseResult a -> FieldDescr a
[fieldName] :: FieldDescr a -> String
[fieldGet] :: FieldDescr a -> a -> Doc

-- | <tt>fieldSet n str x</tt> Parses the field value from the given input
°5ustring <tt>str</tt> and stores the result in <tt>x</tt> if the parse
°5uwas successful. Otherwise, reports an error on line number <tt>n</tt>.
[fieldSet] :: FieldDescr a -> LineNo -> String -> a -> ParseResult a
type LineNo = Int

-- | An intermediate type just used for parsing the test-suite stanza.
°5uAfter validation it is converted into the proper <a>TestSuite</a>
°5utype.
data TestSuiteStanza
TestSuiteStanza :: Maybe TestType -> Maybe FilePath -> Maybe ModuleName -> BuildInfo -> TestSuiteStanza
[testStanzaTestType] :: TestSuiteStanza -> Maybe TestType
[testStanzaMainIs] :: TestSuiteStanza -> Maybe FilePath
[testStanzaTestModule] :: TestSuiteStanza -> Maybe ModuleName
[testStanzaBuildInfo] :: TestSuiteStanza -> BuildInfo

-- | An intermediate type just used for parsing the benchmark stanza. After
°5uvalidation it is converted into the proper <a>Benchmark</a> type.
data BenchmarkStanza
BenchmarkStanza :: Maybe BenchmarkType -> Maybe FilePath -> Maybe ModuleName -> BuildInfo -> BenchmarkStanza
[benchmarkStanzaBenchmarkType] :: BenchmarkStanza -> Maybe BenchmarkType
[benchmarkStanzaMainIs] :: BenchmarkStanza -> Maybe FilePath
[benchmarkStanzaBenchmarkModule] :: BenchmarkStanza -> Maybe ModuleName
[benchmarkStanzaBuildInfo] :: BenchmarkStanza -> BuildInfo
readHookedBuildInfo :: Verbosity -> FilePath -> IO HookedBuildInfo
parseHookedBuildInfo :: String -> ParseResult HookedBuildInfo
pkgDescrFieldDescrs :: [FieldDescr PackageDescription]
libFieldDescrs :: [FieldDescr Library]
foreignLibFieldDescrs :: [FieldDescr ForeignLib]
executableFieldDescrs :: [FieldDescr Executable]
binfoFieldDescrs :: [FieldDescr BuildInfo]
sourceRepoFieldDescrs :: [FieldDescr SourceRepo]
testSuiteFieldDescrs :: [FieldDescr TestSuiteStanza]
benchmarkFieldDescrs :: [FieldDescr BenchmarkStanza]
flagFieldDescrs :: [FieldDescr Flag]
instance GHC.Base.Functor f => GHC.Base.Functor (Distribution.PackageDescription.Parse.StT s f)
instance GHC.Base.Monad m => GHC.Base.Applicative (Distribution.PackageDescription.Parse.StT s m)
instance GHC.Base.Monad m => GHC.Base.Monad (Distribution.PackageDescription.Parse.StT s m)


-- | This is an alternative build system that delegates everything to the
°5u<tt>make</tt> program. All the commands just end up calling
°5u<tt>make</tt> with appropriate arguments. The intention was to allow
°5upreexisting packages that used makefiles to be wrapped into Cabal
°5upackages. In practice essentially all such packages were converted
°5uover to the "Simple" build system instead. Consequently this module is
°5unot used much and it certainly only sees cursory maintenance and no
°5utesting. Perhaps at some point we should stop pretending that it
°5uworks.
°5u
°5uUses the parsed command-line from <a>Distribution.Simple.Setup</a> in
°5uorder to build Haskell tools using a back-end build system based on
°5umake. Obviously we assume that there is a configure script, and that
°5uafter the ConfigCmd has been run, there is a Makefile. Further
°5uassumptions:
°5u
°5u<ul>
°5u<li><i>ConfigCmd</i> We assume the configure script accepts
°5u<tt>--with-hc</tt>, <tt>--with-hc-pkg</tt>, <tt>--prefix</tt>,
°5u<tt>--bindir</tt>, <tt>--libdir</tt>, <tt>--libexecdir</tt>,
°5u<tt>--datadir</tt>.</li>
°5u<li><i>BuildCmd</i> We assume that the default Makefile target will
°5ubuild everything.</li>
°5u<li><i>InstallCmd</i> We assume there is an <tt>install</tt> target.
°5uNote that we assume that this does *not* register the package!</li>
°5u<li><i>CopyCmd</i> We assume there is a <tt>copy</tt> target, and a
°5uvariable <tt>$(destdir)</tt>. The <tt>copy</tt> target should probably
°5ujust invoke <tt>make install</tt> recursively (e.g. <tt>$(MAKE)
°5uinstall prefix=$(destdir)/$(prefix) bindir=$(destdir)/$(bindir)</tt>.
°5uThe reason we can't invoke <tt>make install</tt> directly here is that
°5uwe don't know the value of <tt>$(prefix)</tt>.</li>
°5u<li><i>SDistCmd</i> We assume there is a <tt>dist</tt> target.</li>
°5u<li><i>RegisterCmd</i> We assume there is a <tt>register</tt> target
°5uand a variable <tt>$(user)</tt>.</li>
°5u<li><i>UnregisterCmd</i> We assume there is an <tt>unregister</tt>
°5utarget.</li>
°5u<li><i>HaddockCmd</i> We assume there is a <tt>docs</tt> or
°5u<tt>doc</tt> target.</li>
°5u</ul>
module Distribution.Make

-- | Indicates the license under which a package's source code is released.
°5uVersions of the licenses not listed here will be rejected by Hackage
°5uand cause <tt>cabal check</tt> to issue a warning.
data License

-- | GNU General Public License, <a>version 2</a> or <a>version 3</a>.
GPL :: (Maybe Version) -> License

-- | <a>GNU Affero General Public License, version 3</a>.
AGPL :: (Maybe Version) -> License

-- | GNU Lesser General Public License, <a>version 2.1</a> or <a>version
°5u3</a>.
LGPL :: (Maybe Version) -> License

-- | <a>2-clause BSD license</a>.
BSD2 :: License

-- | <a>3-clause BSD license</a>.
BSD3 :: License

-- | <a>4-clause BSD license</a>. This license has not been approved by the
°5uOSI and is incompatible with the GNU GPL. It is provided for
°5uhistorical reasons and should be avoided.
BSD4 :: License

-- | <a>MIT license</a>.
MIT :: License

-- | <a>ISC license</a>
ISC :: License

-- | <a>Mozilla Public License, version 2.0</a>.
MPL :: Version -> License

-- | <a>Apache License, version 2.0</a>.
Apache :: (Maybe Version) -> License

-- | The author of a package disclaims any copyright to its source code and
°5udedicates it to the public domain. This is not a software license.
°5uPlease note that it is not possible to dedicate works to the public
°5udomain in every jurisdiction, nor is a work that is in the public
°5udomain in one jurisdiction necessarily in the public domain elsewhere.
PublicDomain :: License

-- | Explicitly 'All Rights Reserved', eg for proprietary software. The
°5upackage may not be legally modified or redistributed by anyone but the
°5urightsholder.
AllRightsReserved :: License

-- | No license specified which legally defaults to 'All Rights Reserved'.
°5uThe package may not be legally modified or redistributed by anyone but
°5uthe rightsholder.
UnspecifiedLicense :: License

-- | Any other software license.
OtherLicense :: License

-- | Indicates an erroneous license name.
UnknownLicense :: String -> License

-- | A <a>Version</a> represents the version of a software entity.
°5u
°5uInstances of <a>Eq</a> and <a>Ord</a> are provided, which gives exact
°5uequality and lexicographic ordering of the version number components
°5u(i.e. 2.1 &gt; 2.0, 1.2.3 &gt; 1.2.2, etc.).
°5u
°5uThis type is opaque and distinct from the <a>Version</a> type in
°5u<a>Data.Version</a> since <tt>Cabal-2.0</tt>. The difference extends
°5uto the <a>Binary</a> instance using a different (and more compact)
°5uencoding.
data Version
defaultMain :: IO ()
defaultMainArgs :: [String] -> IO ()

-- | <i>Deprecated: it ignores its PackageDescription arg</i>
defaultMainNoRead :: PackageDescription -> IO ()

module Distribution.FieldGrammar.Pretty
data PrettyFieldGrammar s a

-- | We can use <a>PrettyFieldGrammar</a> to pp print the <tt>s</tt>.
°5u
°5u<i>Note:</i> there is not trailing <tt>($+$ text "")</tt>.
prettyFieldGrammar :: PrettyFieldGrammar s a -> s -> Doc
instance GHC.Base.Functor (Distribution.FieldGrammar.Pretty.PrettyFieldGrammar s)
instance GHC.Base.Applicative (Distribution.FieldGrammar.Pretty.PrettyFieldGrammar s)
instance Distribution.FieldGrammar.Class.FieldGrammar Distribution.FieldGrammar.Pretty.PrettyFieldGrammar


-- | This module provides a <tt>FieldGrammarParser</tt>, one way to parse
°5u<tt>.cabal</tt> -like files.
°5u
°5uFields can be specified multiple times in the .cabal files. The order
°5uof such entries is important, but the mutual ordering of different
°5ufields is not.Also conditional sections are considered after
°5unon-conditional data. The example of this silent-commutation quirk is
°5uthe fact that
°5u
°5u<pre>
°5ubuildable: True
°5uif os(linux)
°5u  buildable: False
°5u</pre>
°5u
°5uand
°5u
°5u<pre>
°5uif os(linux)
°5u  buildable: False
°5ubuildable: True
°5u</pre>
°5u
°5ubehave the same! This is the limitation of
°5u<tt>GeneralPackageDescription</tt> structure.
°5u
°5uSo we transform the list of fields <tt>[<a>Field</a> ann]</tt> into a
°5umap of grouped ordinary fields and a list of lists of sections:
°5u<tt><a>Fields</a> ann = <a>Map</a> <a>FieldName</a>
°5u[<a>NamelessField</a> ann]</tt> and <tt>[[<a>Section</a> ann]]</tt>.
°5u
°5uWe need list of list of sections, because we need to distinguish
°5usituations where there are fields in between. For example
°5u
°5u<pre>
°5uif flag(bytestring-lt-0_10_4)
°5u  build-depends: bytestring &lt; 0.10.4
°5u
°5udefault-language: Haskell2020
°5u
°5uelse
°5u  build-depends: bytestring &gt;= 0.10.4
°5u</pre>
°5u
°5uis obviously invalid specification.
°5u
°5uWe can parse <a>Fields</a> like we parse <tt>aeson</tt> objects, yet
°5uwe use slighly higher-level API, so we can process unspecified fields,
°5uto report unknown fields and save custom <tt>x-fields</tt>.
module Distribution.FieldGrammar.Parsec
data ParsecFieldGrammar s a
parseFieldGrammar :: CabalSpecVersion -> Fields Position -> ParsecFieldGrammar s a -> ParseResult a
fieldGrammarKnownFieldList :: ParsecFieldGrammar s a -> [FieldName]
type Fields ann = Map FieldName [NamelessField ann]

-- | Single field, without name, but with its annotation.
data NamelessField ann
MkNamelessField :: !ann -> [FieldLine ann] -> NamelessField ann
namelessFieldAnn :: NamelessField ann -> ann

-- | The <a>Section</a> constructor of <a>Field</a>.
data Section ann
MkSection :: !(Name ann) -> [SectionArg ann] -> [Field ann] -> Section ann
runFieldParser :: Position -> ParsecParser a -> CabalSpecVersion -> [FieldLine Position] -> ParseResult a
runFieldParser' :: Position -> ParsecParser a -> CabalSpecVersion -> String -> ParseResult a
instance GHC.Base.Functor (Distribution.FieldGrammar.Parsec.ParsecFieldGrammar s)
instance GHC.Base.Functor Distribution.FieldGrammar.Parsec.Section
instance GHC.Show.Show ann => GHC.Show.Show (Distribution.FieldGrammar.Parsec.Section ann)
instance GHC.Classes.Eq ann => GHC.Classes.Eq (Distribution.FieldGrammar.Parsec.Section ann)
instance GHC.Base.Functor Distribution.FieldGrammar.Parsec.NamelessField
instance GHC.Show.Show ann => GHC.Show.Show (Distribution.FieldGrammar.Parsec.NamelessField ann)
instance GHC.Classes.Eq ann => GHC.Classes.Eq (Distribution.FieldGrammar.Parsec.NamelessField ann)
instance GHC.Base.Applicative (Distribution.FieldGrammar.Parsec.ParsecFieldGrammar s)
instance Distribution.FieldGrammar.Class.FieldGrammar Distribution.FieldGrammar.Parsec.ParsecFieldGrammar


-- | This module provides a way to specify a grammar of <tt>.cabal</tt>
°5u-like files.
module Distribution.FieldGrammar

-- | <a>FieldGrammar</a> is parametrised by
°5u
°5u<ul>
°5u<li><tt>s</tt> which is a structure we are parsing. We need this to
°5uprovide prettyprinter functionality</li>
°5u<li><tt>a</tt> type of the field.</li>
°5u</ul>
°5u
°5u<i>Note:</i> We'd like to have <tt>forall s. Applicative (f s)</tt>
°5ucontext.
class FieldGrammar g

-- | Unfocus, zoom out, <i>blur</i> <a>FieldGrammar</a>.
blurFieldGrammar :: FieldGrammar g => ALens' a b -> g b c -> g a c

-- | Field which should be defined, exactly once.
uniqueFieldAla :: (FieldGrammar g, Parsec b, Pretty b, Newtype b a) => FieldName -> (a -> b) -> ALens' s a -> g s a

-- | Boolean field with a default value.
booleanFieldDef :: FieldGrammar g => FieldName -> ALens' s Bool -> Bool -> g s Bool

-- | Optional field.
optionalFieldAla :: (FieldGrammar g, Parsec b, Pretty b, Newtype b a) => FieldName -> (a -> b) -> ALens' s (Maybe a) -> g s (Maybe a)

-- | Optional field with default value.
optionalFieldDefAla :: (FieldGrammar g, Parsec b, Pretty b, Newtype b a, Eq a) => FieldName -> (a -> b) -> ALens' s a -> a -> g s a

-- | Monoidal field.
°5u
°5uValues are combined with <a>mappend</a>.
°5u
°5u<i>Note:</i> <a>optionalFieldAla</a> is a <tt>monoidalField</tt> with
°5u<tt>Last</tt> monoid.
monoidalFieldAla :: (FieldGrammar g, Parsec b, Pretty b, Monoid a, Newtype b a) => FieldName -> (a -> b) -> ALens' s a -> g s a

-- | Parser matching all fields with a name starting with a prefix.
prefixedFields :: FieldGrammar g => FieldName -> ALens' s [(String, String)] -> g s [(String, String)]

-- | Known field, which we don't parse, neither pretty print.
knownField :: FieldGrammar g => FieldName -> g s ()

-- | Field which is parsed but not pretty printed.
hiddenField :: FieldGrammar g => g s a -> g s a

-- | Deprecated since
deprecatedSince :: FieldGrammar g => [Int] -> String -> g s a -> g s a

-- | Annotate field with since spec-version.
availableSince :: FieldGrammar g => [Int] -> a -> g s a -> g s a

-- | Field which can be defined at most once.
uniqueField :: (FieldGrammar g, Parsec a, Pretty a) => FieldName -> ALens' s a -> g s a

-- | Field which can be defined at most once.
optionalField :: (FieldGrammar g, Parsec a, Pretty a) => FieldName -> ALens' s (Maybe a) -> g s (Maybe a)

-- | Optional field with default value.
optionalFieldDef :: (FieldGrammar g, Functor (g s), Parsec a, Pretty a, Eq a) => FieldName -> ALens' s a -> a -> g s a

-- | Field which can be define multiple times, and the results are
°5u<tt>mappend</tt>ed.
monoidalField :: (FieldGrammar g, Parsec a, Pretty a, Monoid a) => FieldName -> ALens' s a -> g s a

-- | Deprecated field. If found, warning is issued.
°5u
°5u<i>Note:</i> also it's not pretty printed!
deprecatedField' :: FieldGrammar g => String -> g s a -> g s a
data ParsecFieldGrammar s a
type ParsecFieldGrammar' a = ParsecFieldGrammar a a
parseFieldGrammar :: CabalSpecVersion -> Fields Position -> ParsecFieldGrammar s a -> ParseResult a
fieldGrammarKnownFieldList :: ParsecFieldGrammar s a -> [FieldName]
data PrettyFieldGrammar s a
type PrettyFieldGrammar' a = PrettyFieldGrammar a a

-- | We can use <a>PrettyFieldGrammar</a> to pp print the <tt>s</tt>.
°5u
°5u<i>Note:</i> there is not trailing <tt>($+$ text "")</tt>.
prettyFieldGrammar :: PrettyFieldGrammar s a -> s -> Doc

-- | Reverse function application which binds tighter than <a>&lt;$&gt;</a>
°5uand <a>&lt;*&gt;</a>. Useful for refining grammar specification.
°5u
°5u<pre>
°5u&lt;*&gt; <a>monoidalFieldAla</a> "extensions"           (alaList' FSep MQuoted)       oldExtensions
°5u    ^^^ <a>deprecatedSince</a> [1,12] "Please use 'default-extensions' or 'other-extensions' fields."
°5u</pre>
(^^^) :: a -> (a -> b) -> b
infixl 5 ^^^

-- | The <a>Section</a> constructor of <a>Field</a>.
data Section ann
MkSection :: !(Name ann) -> [SectionArg ann] -> [Field ann] -> Section ann
type Fields ann = Map FieldName [NamelessField ann]

-- | Partition field list into field map and groups of sections.
partitionFields :: [Field ann] -> (Fields ann, [[Section ann]])

-- | Take all fields from the front.
takeFields :: [Field ann] -> (Fields ann, [Field ann])
runFieldParser :: Position -> ParsecParser a -> CabalSpecVersion -> [FieldLine Position] -> ParseResult a
runFieldParser' :: Position -> ParsecParser a -> CabalSpecVersion -> String -> ParseResult a


-- | <a>GenericPackageDescription</a> Field descriptions
module Distribution.PackageDescription.FieldGrammar
packageDescriptionFieldGrammar :: (FieldGrammar g, Applicative (g PackageDescription), Applicative (g PackageIdentifier)) => g PackageDescription PackageDescription
libraryFieldGrammar :: (FieldGrammar g, Applicative (g Library), Applicative (g BuildInfo)) => Maybe UnqualComponentName -> g Library Library
foreignLibFieldGrammar :: (FieldGrammar g, Applicative (g ForeignLib), Applicative (g BuildInfo)) => UnqualComponentName -> g ForeignLib ForeignLib
executableFieldGrammar :: (FieldGrammar g, Applicative (g Executable), Applicative (g BuildInfo)) => UnqualComponentName -> g Executable Executable

-- | An intermediate type just used for parsing the test-suite stanza.
°5uAfter validation it is converted into the proper <a>TestSuite</a>
°5utype.
data TestSuiteStanza
TestSuiteStanza :: Maybe TestType -> Maybe FilePath -> Maybe ModuleName -> BuildInfo -> TestSuiteStanza
[_testStanzaTestType] :: TestSuiteStanza -> Maybe TestType
[_testStanzaMainIs] :: TestSuiteStanza -> Maybe FilePath
[_testStanzaTestModule] :: TestSuiteStanza -> Maybe ModuleName
[_testStanzaBuildInfo] :: TestSuiteStanza -> BuildInfo
testSuiteFieldGrammar :: (FieldGrammar g, Applicative (g TestSuiteStanza), Applicative (g BuildInfo)) => g TestSuiteStanza TestSuiteStanza
validateTestSuite :: Position -> TestSuiteStanza -> ParseResult TestSuite
unvalidateTestSuite :: TestSuite -> TestSuiteStanza
testStanzaTestType :: Lens' TestSuiteStanza (Maybe TestType)
testStanzaMainIs :: Lens' TestSuiteStanza (Maybe FilePath)
testStanzaTestModule :: Lens' TestSuiteStanza (Maybe ModuleName)
testStanzaBuildInfo :: Lens' TestSuiteStanza BuildInfo

-- | An intermediate type just used for parsing the benchmark stanza. After
°5uvalidation it is converted into the proper <a>Benchmark</a> type.
data BenchmarkStanza
BenchmarkStanza :: Maybe BenchmarkType -> Maybe FilePath -> Maybe ModuleName -> BuildInfo -> BenchmarkStanza
[_benchmarkStanzaBenchmarkType] :: BenchmarkStanza -> Maybe BenchmarkType
[_benchmarkStanzaMainIs] :: BenchmarkStanza -> Maybe FilePath
[_benchmarkStanzaBenchmarkModule] :: BenchmarkStanza -> Maybe ModuleName
[_benchmarkStanzaBuildInfo] :: BenchmarkStanza -> BuildInfo
benchmarkFieldGrammar :: (FieldGrammar g, Applicative (g BenchmarkStanza), Applicative (g BuildInfo)) => g BenchmarkStanza BenchmarkStanza
validateBenchmark :: Position -> BenchmarkStanza -> ParseResult Benchmark
unvalidateBenchmark :: Benchmark -> BenchmarkStanza
benchmarkStanzaBenchmarkType :: Lens' BenchmarkStanza (Maybe BenchmarkType)
benchmarkStanzaMainIs :: Lens' BenchmarkStanza (Maybe FilePath)
benchmarkStanzaBenchmarkModule :: Lens' BenchmarkStanza (Maybe ModuleName)
benchmarkStanzaBuildInfo :: Lens' BenchmarkStanza BuildInfo
flagFieldGrammar :: (FieldGrammar g, Applicative (g Flag)) => FlagName -> g Flag Flag
sourceRepoFieldGrammar :: (FieldGrammar g, Applicative (g SourceRepo)) => RepoKind -> g SourceRepo SourceRepo
setupBInfoFieldGrammar :: (FieldGrammar g, Functor (g SetupBuildInfo)) => Bool -> g SetupBuildInfo SetupBuildInfo
buildInfoFieldGrammar :: (FieldGrammar g, Applicative (g BuildInfo)) => g BuildInfo BuildInfo
instance Distribution.Types.BuildInfo.Lens.HasBuildInfo Distribution.PackageDescription.FieldGrammar.BenchmarkStanza
instance Distribution.Types.BuildInfo.Lens.HasBuildInfo Distribution.PackageDescription.FieldGrammar.TestSuiteStanza


-- | Pretty printing for cabal files
module Distribution.PackageDescription.PrettyPrint

-- | Writes a .cabal file from a generic package description
writeGenericPackageDescription :: FilePath -> GenericPackageDescription -> NoCallStackIO ()

-- | Writes a generic package description to a string
showGenericPackageDescription :: GenericPackageDescription -> String

writePackageDescription :: FilePath -> PackageDescription -> NoCallStackIO ()

showPackageDescription :: PackageDescription -> String

writeHookedBuildInfo :: FilePath -> HookedBuildInfo -> NoCallStackIO ()

showHookedBuildInfo :: HookedBuildInfo -> String


-- | This defined parsers and partial pretty printers for the
°5u<tt>.cabal</tt> format.
module Distribution.PackageDescription.Parsec

-- | Parse the given package file.
readGenericPackageDescription :: Verbosity -> FilePath -> IO GenericPackageDescription

-- | Parses the given file into a <a>GenericPackageDescription</a>.
°5u
°5uIn Cabal 1.2 the syntax for package descriptions was changed to a
°5uformat with sections and possibly indented property descriptions.
parseGenericPackageDescription :: ByteString -> ParseResult GenericPackageDescription

-- | <a>Maybe</a> variant of <a>parseGenericPackageDescription</a>
parseGenericPackageDescriptionMaybe :: ByteString -> Maybe GenericPackageDescription

-- | A monad with failure and accumulating errors and warnings.
data ParseResult a

-- | Destruct a <a>ParseResult</a> into the emitted warnings and either a
°5usuccessful value or list of errors and possibly recovered a
°5uspec-version declaration.
runParseResult :: ParseResult a -> ([PWarning], Either (Maybe Version, [PError]) a)

-- | Quickly scan new-style spec-version
°5u
°5uA new-style spec-version declaration begins the .cabal file and follow
°5uthe following case-insensitive grammar (expressed in RFC5234 ABNF):
°5u
°5u<pre>
°5unewstyle-spec-version-decl = "cabal-version" *WS ":" *WS newstyle-pec-version *WS
°5u
°5uspec-version               = NUM "." NUM [ "." NUM ]
°5u
°5uNUM    = DIGIT0 / DIGITP 1*DIGIT0
°5uDIGIT0 = %x30-39
°5uDIGITP = %x31-39
°5uWS = %20
°5u</pre>
scanSpecVersion :: ByteString -> Maybe Version
readHookedBuildInfo :: Verbosity -> FilePath -> IO HookedBuildInfo
parseHookedBuildInfo :: ByteString -> ParseResult HookedBuildInfo
instance GHC.Show.Show Distribution.PackageDescription.Parsec.Syntax
instance GHC.Classes.Eq Distribution.PackageDescription.Parsec.Syntax
instance Distribution.PackageDescription.Parsec.FromBuildInfo Distribution.Types.BuildInfo.BuildInfo
instance Distribution.PackageDescription.Parsec.FromBuildInfo Distribution.Types.Library.Library
instance Distribution.PackageDescription.Parsec.FromBuildInfo Distribution.Types.ForeignLib.ForeignLib
instance Distribution.PackageDescription.Parsec.FromBuildInfo Distribution.Types.Executable.Executable
instance Distribution.PackageDescription.Parsec.FromBuildInfo Distribution.PackageDescription.FieldGrammar.TestSuiteStanza
instance Distribution.PackageDescription.Parsec.FromBuildInfo Distribution.PackageDescription.FieldGrammar.BenchmarkStanza

module Distribution.FieldGrammar.FieldDescrs

-- | A collection field parsers and pretty-printers.
data FieldDescrs s a

-- | Lookup a field value pretty-printer.
fieldDescrPretty :: FieldDescrs s a -> String -> Maybe (s -> Doc)

-- | Lookup a field value parser.
fieldDescrParse :: CabalParsing m => FieldDescrs s a -> String -> Maybe (s -> m s)
instance GHC.Base.Functor (Distribution.FieldGrammar.FieldDescrs.FieldDescrs s)
instance GHC.Base.Applicative (Distribution.FieldGrammar.FieldDescrs.FieldDescrs s)
instance Distribution.FieldGrammar.Class.FieldGrammar Distribution.FieldGrammar.FieldDescrs.FieldDescrs

module Distribution.Types.InstalledPackageInfo.FieldGrammar
ipiFieldGrammar :: (FieldGrammar g, Applicative (g InstalledPackageInfo), Applicative (g Basic)) => g InstalledPackageInfo InstalledPackageInfo
instance Distribution.Compat.Newtype.Newtype Distribution.Types.InstalledPackageInfo.FieldGrammar.SpecLicenseLenient (Data.Either.Either Distribution.SPDX.License.License Distribution.License.License)
instance Distribution.Parsec.Class.Parsec Distribution.Types.InstalledPackageInfo.FieldGrammar.SpecLicenseLenient
instance Distribution.Pretty.Pretty Distribution.Types.InstalledPackageInfo.FieldGrammar.SpecLicenseLenient
instance Distribution.Compat.Newtype.Newtype Distribution.Types.InstalledPackageInfo.FieldGrammar.InstWith [(Distribution.ModuleName.ModuleName, Distribution.Backpack.OpenModule)]
instance Distribution.Pretty.Pretty Distribution.Types.InstalledPackageInfo.FieldGrammar.InstWith
instance Distribution.Parsec.Class.Parsec Distribution.Types.InstalledPackageInfo.FieldGrammar.InstWith
instance Distribution.Compat.Newtype.Newtype Distribution.Types.InstalledPackageInfo.FieldGrammar.CompatPackageKey GHC.Base.String
instance Distribution.Pretty.Pretty Distribution.Types.InstalledPackageInfo.FieldGrammar.CompatPackageKey
instance Distribution.Parsec.Class.Parsec Distribution.Types.InstalledPackageInfo.FieldGrammar.CompatPackageKey
instance Distribution.Compat.Newtype.Newtype Distribution.Types.InstalledPackageInfo.FieldGrammar.ExposedModules [Distribution.Types.ExposedModule.ExposedModule]
instance Distribution.Parsec.Class.Parsec Distribution.Types.InstalledPackageInfo.FieldGrammar.ExposedModules
instance Distribution.Pretty.Pretty Distribution.Types.InstalledPackageInfo.FieldGrammar.ExposedModules


-- | This is the information about an <i>installed</i> package that is
°5ucommunicated to the <tt>ghc-pkg</tt> program in order to register a
°5upackage. <tt>ghc-pkg</tt> now consumes this package format (as of
°5uversion 6.4). This is specific to GHC at the moment.
°5u
°5uThe <tt>.cabal</tt> file format is for describing a package that is
°5unot yet installed. It has a lot of flexibility, like conditionals and
°5udependency ranges. As such, that format is not at all suitable for
°5udescribing a package that has already been built and installed. By the
°5utime we get to that stage, we have resolved all conditionals and
°5uresolved dependency version constraints to exact versions of dependent
°5upackages. So, this module defines the <a>InstalledPackageInfo</a> data
°5ustructure that contains all the info we keep about an installed
°5upackage. There is a parser and pretty printer. The textual format is
°5urather simpler than the <tt>.cabal</tt> format: there are no sections,
°5ufor example.
module Distribution.InstalledPackageInfo
data InstalledPackageInfo
InstalledPackageInfo :: PackageId -> Maybe UnqualComponentName -> ComponentId -> UnitId -> [(ModuleName, OpenModule)] -> String -> Either License License -> String -> String -> String -> String -> String -> String -> String -> String -> String -> AbiHash -> Bool -> Bool -> [ExposedModule] -> [ModuleName] -> Bool -> [FilePath] -> [FilePath] -> [FilePath] -> FilePath -> [String] -> [String] -> [String] -> [FilePath] -> [String] -> [UnitId] -> [AbiDependency] -> [String] -> [String] -> [FilePath] -> [String] -> [FilePath] -> [FilePath] -> Maybe FilePath -> InstalledPackageInfo
[sourcePackageId] :: InstalledPackageInfo -> PackageId
[sourceLibName] :: InstalledPackageInfo -> Maybe UnqualComponentName
[installedComponentId_] :: InstalledPackageInfo -> ComponentId
[installedUnitId] :: InstalledPackageInfo -> UnitId
[instantiatedWith] :: InstalledPackageInfo -> [(ModuleName, OpenModule)]
[compatPackageKey] :: InstalledPackageInfo -> String
[license] :: InstalledPackageInfo -> Either License License
[copyright] :: InstalledPackageInfo -> String
[maintainer] :: InstalledPackageInfo -> String
[author] :: InstalledPackageInfo -> String
[stability] :: InstalledPackageInfo -> String
[homepage] :: InstalledPackageInfo -> String
[pkgUrl] :: InstalledPackageInfo -> String
[synopsis] :: InstalledPackageInfo -> String
[description] :: InstalledPackageInfo -> String
[category] :: InstalledPackageInfo -> String
[abiHash] :: InstalledPackageInfo -> AbiHash
[indefinite] :: InstalledPackageInfo -> Bool
[exposed] :: InstalledPackageInfo -> Bool
[exposedModules] :: InstalledPackageInfo -> [ExposedModule]
[hiddenModules] :: InstalledPackageInfo -> [ModuleName]
[trusted] :: InstalledPackageInfo -> Bool
[importDirs] :: InstalledPackageInfo -> [FilePath]
[libraryDirs] :: InstalledPackageInfo -> [FilePath]

-- | overrides <a>libraryDirs</a>
[libraryDynDirs] :: InstalledPackageInfo -> [FilePath]
[dataDir] :: InstalledPackageInfo -> FilePath
[hsLibraries] :: InstalledPackageInfo -> [String]
[extraLibraries] :: InstalledPackageInfo -> [String]
[extraGHCiLibraries] :: InstalledPackageInfo -> [String]
[includeDirs] :: InstalledPackageInfo -> [FilePath]
[includes] :: InstalledPackageInfo -> [String]
[depends] :: InstalledPackageInfo -> [UnitId]
[abiDepends] :: InstalledPackageInfo -> [AbiDependency]
[ccOptions] :: InstalledPackageInfo -> [String]
[ldOptions] :: InstalledPackageInfo -> [String]
[frameworkDirs] :: InstalledPackageInfo -> [FilePath]
[frameworks] :: InstalledPackageInfo -> [String]
[haddockInterfaces] :: InstalledPackageInfo -> [FilePath]
[haddockHTMLs] :: InstalledPackageInfo -> [FilePath]
[pkgRoot] :: InstalledPackageInfo -> Maybe FilePath

-- | Backwards compatibility with Cabal pre-1.24.
°5u
°5uThis type synonym is slightly awful because in cabal-install we define
°5uan <a>InstalledPackageId</a> but it's a ComponentId, not a UnitId!

-- | <i>Deprecated: Use installedUnitId instead</i>
installedPackageId :: InstalledPackageInfo -> UnitId
installedComponentId :: InstalledPackageInfo -> ComponentId

-- | Get the indefinite unit identity representing this package. This IS
°5uNOT guaranteed to give you a substitution; for instantiated packages
°5uyou will get <tt>DefiniteUnitId (installedUnitId ipi)</tt>. For
°5uindefinite libraries, however, you will correctly get an
°5u<tt>OpenUnitId</tt> with the appropriate <a>OpenModuleSubst</a>.
installedOpenUnitId :: InstalledPackageInfo -> OpenUnitId
sourceComponentName :: InstalledPackageInfo -> ComponentName

-- | Returns the set of module names which need to be filled for an
°5uindefinite package, or the empty set if the package is definite.
requiredSignatures :: InstalledPackageInfo -> Set ModuleName
data ExposedModule
ExposedModule :: ModuleName -> Maybe OpenModule -> ExposedModule
[exposedName] :: ExposedModule -> ModuleName
[exposedReexport] :: ExposedModule -> Maybe OpenModule

-- | An ABI dependency is a dependency on a library which also records the
°5uABI hash (<tt>abiHash</tt>) of the library it depends on.
°5u
°5uThe primary utility of this is to enable an extra sanity when GHC
°5uloads libraries: it can check if the dependency has a matching ABI and
°5uif not, refuse to load this library. This information is critical if
°5uwe are shadowing libraries; differences in the ABI hash let us know
°5uwhat packages get shadowed by the new version of a package.
data AbiDependency
AbiDependency :: UnitId -> AbiHash -> AbiDependency
[depUnitId] :: AbiDependency -> UnitId
[depAbiHash] :: AbiDependency -> AbiHash
data ParseResult a
ParseFailed :: PError -> ParseResult a
ParseOk :: [PWarning] -> a -> ParseResult a
data PError
AmbiguousParse :: String -> LineNo -> PError
NoParse :: String -> LineNo -> PError
TabsError :: LineNo -> PError
FromString :: String -> (Maybe LineNo) -> PError
data PWarning
emptyInstalledPackageInfo :: InstalledPackageInfo
parseInstalledPackageInfo :: String -> ParseResult InstalledPackageInfo

-- | Pretty print <a>InstalledPackageInfo</a>.
°5u
°5u<tt>pkgRoot</tt> isn't printed, as ghc-pkg prints it manually (as
°5uGHC-8.4).
showInstalledPackageInfo :: InstalledPackageInfo -> String

-- | The variant of <a>showInstalledPackageInfo</a> which outputs
°5u<tt>pkgroot</tt> field too.
showFullInstalledPackageInfo :: InstalledPackageInfo -> String

-- | <pre>
°5u&gt;&gt;&gt; let ipi = emptyInstalledPackageInfo { maintainer = "Tester" }
°5u
°5u&gt;&gt;&gt; fmap ($ ipi) $ showInstalledPackageInfoField "maintainer"
°5uJust "maintainer: Tester"
°5u</pre>
showInstalledPackageInfoField :: String -> Maybe (InstalledPackageInfo -> String)
showSimpleInstalledPackageInfoField :: String -> Maybe (InstalledPackageInfo -> String)

module Distribution.Types.ComponentLocalBuildInfo

-- | The first five fields are common across all algebraic variants.
data ComponentLocalBuildInfo
LibComponentLocalBuildInfo :: ComponentName -> ComponentId -> UnitId -> Bool -> [(ModuleName, OpenModule)] -> [(UnitId, MungedPackageId)] -> [(OpenUnitId, ModuleRenaming)] -> [UnitId] -> [UnitId] -> String -> MungedPackageName -> [ExposedModule] -> Bool -> ComponentLocalBuildInfo

-- | It would be very convenient to store the literal Library here, but if
°5uwe do that, it will get serialized (via the Binary) instance twice. So
°5uinstead we just provide the ComponentName, which can be used to find
°5uthe Component in the PackageDescription. NB: eventually, this will NOT
°5uuniquely identify the ComponentLocalBuildInfo.
[componentLocalName] :: ComponentLocalBuildInfo -> ComponentName

-- | The computed <a>ComponentId</a> of this component.
[componentComponentId] :: ComponentLocalBuildInfo -> ComponentId

-- | The computed <a>UnitId</a> which uniquely identifies this component.
°5uMight be hashed.
[componentUnitId] :: ComponentLocalBuildInfo -> UnitId

-- | Is this an indefinite component (i.e. has unfilled holes)?
[componentIsIndefinite_] :: ComponentLocalBuildInfo -> Bool

-- | How the component was instantiated
[componentInstantiatedWith] :: ComponentLocalBuildInfo -> [(ModuleName, OpenModule)]

-- | Resolved internal and external package dependencies for this
°5ucomponent. The <a>BuildInfo</a> specifies a set of build dependencies
°5uthat must be satisfied in terms of version ranges. This field fixes
°5uthose dependencies to the specific versions available on this machine
°5ufor this compiler.
[componentPackageDeps] :: ComponentLocalBuildInfo -> [(UnitId, MungedPackageId)]

-- | The set of packages that are brought into scope during compilation,
°5uincluding a <a>ModuleRenaming</a> which may used to hide or rename
°5umodules. This is what gets translated into <tt>-package-id</tt>
°5uarguments. This is a modernized version of
°5u<a>componentPackageDeps</a>, which is kept around for BC purposes.
[componentIncludes] :: ComponentLocalBuildInfo -> [(OpenUnitId, ModuleRenaming)]
[componentExeDeps] :: ComponentLocalBuildInfo -> [UnitId]

-- | The internal dependencies which induce a graph on the
°5u<a>ComponentLocalBuildInfo</a> of this package. This does NOT coincide
°5uwith <a>componentPackageDeps</a> because it ALSO records 'build-tool'
°5udependencies on executables. Maybe one day <tt>cabal-install</tt> will
°5ualso handle these correctly too!
[componentInternalDeps] :: ComponentLocalBuildInfo -> [UnitId]

-- | Compatibility "package key" that we pass to older versions of GHC.
[componentCompatPackageKey] :: ComponentLocalBuildInfo -> String

-- | Compatibility "package name" that we register this component as.
[componentCompatPackageName] :: ComponentLocalBuildInfo -> MungedPackageName

-- | A list of exposed modules (either defined in this component, or
°5ureexported from another component.)
[componentExposedModules] :: ComponentLocalBuildInfo -> [ExposedModule]

-- | Convenience field, specifying whether or not this is the "public
°5ulibrary" that has the same name as the package.
[componentIsPublic] :: ComponentLocalBuildInfo -> Bool
FLibComponentLocalBuildInfo :: ComponentName -> ComponentId -> UnitId -> [(UnitId, MungedPackageId)] -> [(OpenUnitId, ModuleRenaming)] -> [UnitId] -> [UnitId] -> ComponentLocalBuildInfo

-- | It would be very convenient to store the literal Library here, but if
°5uwe do that, it will get serialized (via the Binary) instance twice. So
°5uinstead we just provide the ComponentName, which can be used to find
°5uthe Component in the PackageDescription. NB: eventually, this will NOT
°5uuniquely identify the ComponentLocalBuildInfo.
[componentLocalName] :: ComponentLocalBuildInfo -> ComponentName

-- | The computed <a>ComponentId</a> of this component.
[componentComponentId] :: ComponentLocalBuildInfo -> ComponentId

-- | The computed <a>UnitId</a> which uniquely identifies this component.
°5uMight be hashed.
[componentUnitId] :: ComponentLocalBuildInfo -> UnitId

-- | Resolved internal and external package dependencies for this
°5ucomponent. The <a>BuildInfo</a> specifies a set of build dependencies
°5uthat must be satisfied in terms of version ranges. This field fixes
°5uthose dependencies to the specific versions available on this machine
°5ufor this compiler.
[componentPackageDeps] :: ComponentLocalBuildInfo -> [(UnitId, MungedPackageId)]

-- | The set of packages that are brought into scope during compilation,
°5uincluding a <a>ModuleRenaming</a> which may used to hide or rename
°5umodules. This is what gets translated into <tt>-package-id</tt>
°5uarguments. This is a modernized version of
°5u<a>componentPackageDeps</a>, which is kept around for BC purposes.
[componentIncludes] :: ComponentLocalBuildInfo -> [(OpenUnitId, ModuleRenaming)]
[componentExeDeps] :: ComponentLocalBuildInfo -> [UnitId]

-- | The internal dependencies which induce a graph on the
°5u<a>ComponentLocalBuildInfo</a> of this package. This does NOT coincide
°5uwith <a>componentPackageDeps</a> because it ALSO records 'build-tool'
°5udependencies on executables. Maybe one day <tt>cabal-install</tt> will
°5ualso handle these correctly too!
[componentInternalDeps] :: ComponentLocalBuildInfo -> [UnitId]
ExeComponentLocalBuildInfo :: ComponentName -> ComponentId -> UnitId -> [(UnitId, MungedPackageId)] -> [(OpenUnitId, ModuleRenaming)] -> [UnitId] -> [UnitId] -> ComponentLocalBuildInfo

-- | It would be very convenient to store the literal Library here, but if
°5uwe do that, it will get serialized (via the Binary) instance twice. So
°5uinstead we just provide the ComponentName, which can be used to find
°5uthe Component in the PackageDescription. NB: eventually, this will NOT
°5uuniquely identify the ComponentLocalBuildInfo.
[componentLocalName] :: ComponentLocalBuildInfo -> ComponentName

-- | The computed <a>ComponentId</a> of this component.
[componentComponentId] :: ComponentLocalBuildInfo -> ComponentId

-- | The computed <a>UnitId</a> which uniquely identifies this component.
°5uMight be hashed.
[componentUnitId] :: ComponentLocalBuildInfo -> UnitId

-- | Resolved internal and external package dependencies for this
°5ucomponent. The <a>BuildInfo</a> specifies a set of build dependencies
°5uthat must be satisfied in terms of version ranges. This field fixes
°5uthose dependencies to the specific versions available on this machine
°5ufor this compiler.
[componentPackageDeps] :: ComponentLocalBuildInfo -> [(UnitId, MungedPackageId)]

-- | The set of packages that are brought into scope during compilation,
°5uincluding a <a>ModuleRenaming</a> which may used to hide or rename
°5umodules. This is what gets translated into <tt>-package-id</tt>
°5uarguments. This is a modernized version of
°5u<a>componentPackageDeps</a>, which is kept around for BC purposes.
[componentIncludes] :: ComponentLocalBuildInfo -> [(OpenUnitId, ModuleRenaming)]
[componentExeDeps] :: ComponentLocalBuildInfo -> [UnitId]

-- | The internal dependencies which induce a graph on the
°5u<a>ComponentLocalBuildInfo</a> of this package. This does NOT coincide
°5uwith <a>componentPackageDeps</a> because it ALSO records 'build-tool'
°5udependencies on executables. Maybe one day <tt>cabal-install</tt> will
°5ualso handle these correctly too!
[componentInternalDeps] :: ComponentLocalBuildInfo -> [UnitId]
TestComponentLocalBuildInfo :: ComponentName -> ComponentId -> UnitId -> [(UnitId, MungedPackageId)] -> [(OpenUnitId, ModuleRenaming)] -> [UnitId] -> [UnitId] -> ComponentLocalBuildInfo

-- | It would be very convenient to store the literal Library here, but if
°5uwe do that, it will get serialized (via the Binary) instance twice. So
°5uinstead we just provide the ComponentName, which can be used to find
°5uthe Component in the PackageDescription. NB: eventually, this will NOT
°5uuniquely identify the ComponentLocalBuildInfo.
[componentLocalName] :: ComponentLocalBuildInfo -> ComponentName

-- | The computed <a>ComponentId</a> of this component.
[componentComponentId] :: ComponentLocalBuildInfo -> ComponentId

-- | The computed <a>UnitId</a> which uniquely identifies this component.
°5uMight be hashed.
[componentUnitId] :: ComponentLocalBuildInfo -> UnitId

-- | Resolved internal and external package dependencies for this
°5ucomponent. The <a>BuildInfo</a> specifies a set of build dependencies
°5uthat must be satisfied in terms of version ranges. This field fixes
°5uthose dependencies to the specific versions available on this machine
°5ufor this compiler.
[componentPackageDeps] :: ComponentLocalBuildInfo -> [(UnitId, MungedPackageId)]

-- | The set of packages that are brought into scope during compilation,
°5uincluding a <a>ModuleRenaming</a> which may used to hide or rename
°5umodules. This is what gets translated into <tt>-package-id</tt>
°5uarguments. This is a modernized version of
°5u<a>componentPackageDeps</a>, which is kept around for BC purposes.
[componentIncludes] :: ComponentLocalBuildInfo -> [(OpenUnitId, ModuleRenaming)]
[componentExeDeps] :: ComponentLocalBuildInfo -> [UnitId]

-- | The internal dependencies which induce a graph on the
°5u<a>ComponentLocalBuildInfo</a> of this package. This does NOT coincide
°5uwith <a>componentPackageDeps</a> because it ALSO records 'build-tool'
°5udependencies on executables. Maybe one day <tt>cabal-install</tt> will
°5ualso handle these correctly too!
[componentInternalDeps] :: ComponentLocalBuildInfo -> [UnitId]
BenchComponentLocalBuildInfo :: ComponentName -> ComponentId -> UnitId -> [(UnitId, MungedPackageId)] -> [(OpenUnitId, ModuleRenaming)] -> [UnitId] -> [UnitId] -> ComponentLocalBuildInfo

-- | It would be very convenient to store the literal Library here, but if
°5uwe do that, it will get serialized (via the Binary) instance twice. So
°5uinstead we just provide the ComponentName, which can be used to find
°5uthe Component in the PackageDescription. NB: eventually, this will NOT
°5uuniquely identify the ComponentLocalBuildInfo.
[componentLocalName] :: ComponentLocalBuildInfo -> ComponentName

-- | The computed <a>ComponentId</a> of this component.
[componentComponentId] :: ComponentLocalBuildInfo -> ComponentId

-- | The computed <a>UnitId</a> which uniquely identifies this component.
°5uMight be hashed.
[componentUnitId] :: ComponentLocalBuildInfo -> UnitId

-- | Resolved internal and external package dependencies for this
°5ucomponent. The <a>BuildInfo</a> specifies a set of build dependencies
°5uthat must be satisfied in terms of version ranges. This field fixes
°5uthose dependencies to the specific versions available on this machine
°5ufor this compiler.
[componentPackageDeps] :: ComponentLocalBuildInfo -> [(UnitId, MungedPackageId)]

-- | The set of packages that are brought into scope during compilation,
°5uincluding a <a>ModuleRenaming</a> which may used to hide or rename
°5umodules. This is what gets translated into <tt>-package-id</tt>
°5uarguments. This is a modernized version of
°5u<a>componentPackageDeps</a>, which is kept around for BC purposes.
[componentIncludes] :: ComponentLocalBuildInfo -> [(OpenUnitId, ModuleRenaming)]
[componentExeDeps] :: ComponentLocalBuildInfo -> [UnitId]

-- | The internal dependencies which induce a graph on the
°5u<a>ComponentLocalBuildInfo</a> of this package. This does NOT coincide
°5uwith <a>componentPackageDeps</a> because it ALSO records 'build-tool'
°5udependencies on executables. Maybe one day <tt>cabal-install</tt> will
°5ualso handle these correctly too!
[componentInternalDeps] :: ComponentLocalBuildInfo -> [UnitId]
componentIsIndefinite :: ComponentLocalBuildInfo -> Bool
maybeComponentInstantiatedWith :: ComponentLocalBuildInfo -> Maybe [(ModuleName, OpenModule)]
instance GHC.Show.Show Distribution.Types.ComponentLocalBuildInfo.ComponentLocalBuildInfo
instance GHC.Read.Read Distribution.Types.ComponentLocalBuildInfo.ComponentLocalBuildInfo
instance GHC.Generics.Generic Distribution.Types.ComponentLocalBuildInfo.ComponentLocalBuildInfo
instance Data.Binary.Class.Binary Distribution.Types.ComponentLocalBuildInfo.ComponentLocalBuildInfo
instance Distribution.Compat.Graph.IsNode Distribution.Types.ComponentLocalBuildInfo.ComponentLocalBuildInfo

module Distribution.Types.TargetInfo

-- | The <a>TargetInfo</a> contains all the information necessary to build
°5ua specific target (e.g., component<i>module</i>file) in a package. In
°5uprinciple, one can get the <a>Component</a> from a
°5u<a>ComponentLocalBuildInfo</a> and <tt>LocalBuildInfo</tt>, but it is
°5umuch more convenient to have the component in hand.
data TargetInfo
TargetInfo :: ComponentLocalBuildInfo -> Component -> TargetInfo
[targetCLBI] :: TargetInfo -> ComponentLocalBuildInfo
[targetComponent] :: TargetInfo -> Component
instance Distribution.Compat.Graph.IsNode Distribution.Types.TargetInfo.TargetInfo


-- | This module provides an library interface to the <tt>hc-pkg</tt>
°5uprogram. Currently only GHC, GHCJS and LHC have hc-pkg programs.
module Distribution.Simple.Program.HcPkg

-- | Information about the features and capabilities of an <tt>hc-pkg</tt>
°5uprogram.
data HcPkgInfo
HcPkgInfo :: ConfiguredProgram -> Bool -> Bool -> Bool -> Bool -> Bool -> Bool -> Bool -> Bool -> HcPkgInfo
[hcPkgProgram] :: HcPkgInfo -> ConfiguredProgram

-- | no package DB stack supported
[noPkgDbStack] :: HcPkgInfo -> Bool

-- | hc-pkg does not support verbosity flags
[noVerboseFlag] :: HcPkgInfo -> Bool

-- | use package-conf option instead of package-db
[flagPackageConf] :: HcPkgInfo -> Bool

-- | supports directory style package databases
[supportsDirDbs] :: HcPkgInfo -> Bool

-- | requires directory style package databases
[requiresDirDbs] :: HcPkgInfo -> Bool

-- | supports --enable-multi-instance flag
[nativeMultiInstance] :: HcPkgInfo -> Bool

-- | supports multi-instance via recache
[recacheMultiInstance] :: HcPkgInfo -> Bool

-- | supports --force-files or equivalent
[suppressFilesCheck] :: HcPkgInfo -> Bool

-- | Additional variations in the behaviour for <a>register</a>.
data RegisterOptions
RegisterOptions :: Bool -> Bool -> Bool -> RegisterOptions

-- | Allows re-registering / overwriting an existing package
[registerAllowOverwrite] :: RegisterOptions -> Bool

-- | Insist on the ability to register multiple instances of a single
°5uversion of a single package. This will fail if the <tt>hc-pkg</tt>
°5udoes not support it, see <a>nativeMultiInstance</a> and
°5u<a>recacheMultiInstance</a>.
[registerMultiInstance] :: RegisterOptions -> Bool

-- | Require that no checks are performed on the existence of package files
°5umentioned in the registration info. This must be used if registering
°5uprior to putting the files in their final place. This will fail if the
°5u<tt>hc-pkg</tt> does not support it, see <a>suppressFilesCheck</a>.
[registerSuppressFilesCheck] :: RegisterOptions -> Bool

-- | Defaults are <tt>True</tt>, <tt>False</tt> and <tt>False</tt>
defaultRegisterOptions :: RegisterOptions

-- | Call <tt>hc-pkg</tt> to initialise a package database at the location
°5u{path}.
°5u
°5u<pre>
°5uhc-pkg init {path}
°5u</pre>
init :: HcPkgInfo -> Verbosity -> Bool -> FilePath -> IO ()

-- | Run <tt>hc-pkg</tt> using a given package DB stack, directly
°5uforwarding the provided command-line arguments to it.
invoke :: HcPkgInfo -> Verbosity -> PackageDBStack -> [String] -> IO ()

-- | Call <tt>hc-pkg</tt> to register a package.
°5u
°5u<pre>
°5uhc-pkg register {filename | -} [--user | --global | --package-db]
°5u</pre>
register :: HcPkgInfo -> Verbosity -> PackageDBStack -> InstalledPackageInfo -> RegisterOptions -> IO ()

-- | Call <tt>hc-pkg</tt> to unregister a package
°5u
°5u<pre>
°5uhc-pkg unregister [pkgid] [--user | --global | --package-db]
°5u</pre>
unregister :: HcPkgInfo -> Verbosity -> PackageDB -> PackageId -> IO ()

-- | Call <tt>hc-pkg</tt> to recache the registered packages.
°5u
°5u<pre>
°5uhc-pkg recache [--user | --global | --package-db]
°5u</pre>
recache :: HcPkgInfo -> Verbosity -> PackageDB -> IO ()

-- | Call <tt>hc-pkg</tt> to expose a package.
°5u
°5u<pre>
°5uhc-pkg expose [pkgid] [--user | --global | --package-db]
°5u</pre>
expose :: HcPkgInfo -> Verbosity -> PackageDB -> PackageId -> IO ()

-- | Call <tt>hc-pkg</tt> to hide a package.
°5u
°5u<pre>
°5uhc-pkg hide [pkgid] [--user | --global | --package-db]
°5u</pre>
hide :: HcPkgInfo -> Verbosity -> PackageDB -> PackageId -> IO ()

-- | Call <tt>hc-pkg</tt> to get all the details of all the packages in the
°5ugiven package database.
dump :: HcPkgInfo -> Verbosity -> PackageDB -> IO [InstalledPackageInfo]

-- | Call <tt>hc-pkg</tt> to retrieve a specific package
°5u
°5u<pre>
°5uhc-pkg describe [pkgid] [--user | --global | --package-db]
°5u</pre>
describe :: HcPkgInfo -> Verbosity -> PackageDBStack -> PackageId -> IO [InstalledPackageInfo]

-- | Call <tt>hc-pkg</tt> to get the source package Id of all the packages
°5uin the given package database.
°5u
°5uThis is much less information than with <a>dump</a>, but also rather
°5uquicker. Note in particular that it does not include the
°5u<a>UnitId</a>, just the source <a>PackageId</a> which is not
°5unecessarily unique in any package db.
list :: HcPkgInfo -> Verbosity -> PackageDB -> IO [PackageId]
initInvocation :: HcPkgInfo -> Verbosity -> FilePath -> ProgramInvocation
registerInvocation :: HcPkgInfo -> Verbosity -> PackageDBStack -> InstalledPackageInfo -> RegisterOptions -> ProgramInvocation
unregisterInvocation :: HcPkgInfo -> Verbosity -> PackageDB -> PackageId -> ProgramInvocation
recacheInvocation :: HcPkgInfo -> Verbosity -> PackageDB -> ProgramInvocation
exposeInvocation :: HcPkgInfo -> Verbosity -> PackageDB -> PackageId -> ProgramInvocation
hideInvocation :: HcPkgInfo -> Verbosity -> PackageDB -> PackageId -> ProgramInvocation
dumpInvocation :: HcPkgInfo -> Verbosity -> PackageDB -> ProgramInvocation
describeInvocation :: HcPkgInfo -> Verbosity -> PackageDBStack -> PackageId -> ProgramInvocation
listInvocation :: HcPkgInfo -> Verbosity -> PackageDB -> ProgramInvocation


-- | An index of packages whose primary key is <a>UnitId</a>. Public
°5ulibraries are additionally indexed by <a>PackageName</a> and
°5u<a>Version</a>. Technically, these are an index of *units* (so we
°5ushould eventually rename it to <tt>UnitIndex</tt>); but in the absence
°5uof internal libraries or Backpack each unit is equivalent to a
°5upackage.
°5u
°5uWhile <a>PackageIndex</a> is parametric over what it actually records,
°5uit is in fact only ever instantiated with a single element: The
°5u<a>InstalledPackageIndex</a> (defined here) contains a graph of
°5u<tt>InstalledPackageInfo</tt>s representing the packages in a package
°5udatabase stack. It is used in a variety of ways:
°5u
°5u<ul>
°5u<li>The primary use to let Cabal access the same installed package
°5udatabase which is used by GHC during compilation. For example, this
°5udata structure is used by 'ghc-pkg' and <tt>Cabal</tt> to do
°5uconsistency checks on the database (are the references closed).</li>
°5u<li>Given a set of dependencies, we can compute the transitive closure
°5uof dependencies. This is to check if the versions of packages are
°5uconsistent, and also needed by multiple tools (Haddock must be
°5uexplicitly told about the every transitive package to do cross-package
°5ulinking; preprocessors must know about the include paths of all
°5utransitive dependencies.)</li>
°5u</ul>
°5u
°5uThis <a>PackageIndex</a> is NOT to be confused with
°5u<a>PackageIndex</a>, which indexes packages only by <a>PackageName</a>
°5u(this makes it suitable for indexing source packages, for which we
°5udon't know <a>UnitId</a>s.)
module Distribution.Simple.PackageIndex

-- | The default package index which contains
°5u<tt>InstalledPackageInfo</tt>. Normally use this.
type InstalledPackageIndex = PackageIndex InstalledPackageInfo

-- | The collection of information about packages from one or more
°5u<tt>PackageDB</tt>s. These packages generally should have an instance
°5uof <a>PackageInstalled</a>
°5u
°5uPackages are uniquely identified in by their <a>UnitId</a>, they can
°5ualso be efficiently looked up by package name or by name and version.
data PackageIndex a

-- | Build an index out of a bunch of packages.
°5u
°5uIf there are duplicates by <a>UnitId</a> then later ones mask earlier
°5uones.
fromList :: [InstalledPackageInfo] -> InstalledPackageIndex

-- | Merge two indexes.
°5u
°5uPackages from the second mask packages from the first if they have the
°5uexact same <a>UnitId</a>.
°5u
°5uFor packages with the same source <a>PackageId</a>, packages from the
°5usecond are "preferred" over those from the first. Being preferred
°5umeans they are top result when we do a lookup by source
°5u<a>PackageId</a>. This is the mechanism we use to prefer user packages
°5uover global packages.
merge :: InstalledPackageIndex -> InstalledPackageIndex -> InstalledPackageIndex

-- | Inserts a single package into the index.
°5u
°5uThis is equivalent to (but slightly quicker than) using <a>mappend</a>
°5uor <a>merge</a> with a singleton index.
insert :: InstalledPackageInfo -> InstalledPackageIndex -> InstalledPackageIndex

-- | Removes a single installed package from the index.
deleteUnitId :: UnitId -> InstalledPackageIndex -> InstalledPackageIndex

-- | Removes all packages with this source <a>PackageId</a> from the index.
deleteSourcePackageId :: PackageId -> InstalledPackageIndex -> InstalledPackageIndex

-- | Removes all packages with this (case-sensitive) name from the index.
°5u
°5uNB: Does NOT delete internal libraries from this package.
deletePackageName :: PackageName -> InstalledPackageIndex -> InstalledPackageIndex

-- | Does a lookup by unit identifier.
°5u
°5uSince multiple package DBs mask each other by <a>UnitId</a>, then we
°5uget back at most one package.
lookupUnitId :: PackageIndex a -> UnitId -> Maybe a

-- | Does a lookup by component identifier. In the absence of Backpack,
°5uthis is just a <a>lookupUnitId</a>.
lookupComponentId :: PackageIndex a -> ComponentId -> Maybe a

-- | Does a lookup by source package id (name &amp; version).
°5u
°5uThere can be multiple installed packages with the same source
°5u<a>PackageId</a> but different <a>UnitId</a>. They are returned in
°5uorder of preference, with the most preferred first.
lookupSourcePackageId :: PackageIndex a -> PackageId -> [a]

-- | Convenient alias of <a>lookupSourcePackageId</a>, but assuming only
°5uone package per package ID.
lookupPackageId :: PackageIndex a -> PackageId -> Maybe a

-- | Does a lookup by source package name.
lookupPackageName :: PackageIndex a -> PackageName -> [(Version, [a])]

-- | Does a lookup by source package name and a range of versions.
°5u
°5uWe get back any number of versions of the specified package name, all
°5usatisfying the version range constraint.
°5u
°5uThis does NOT work for internal dependencies, DO NOT use this function
°5uon those; use <a>lookupInternalDependency</a> instead.
°5u
°5uINVARIANT: List of eligible <a>InstalledPackageInfo</a> is non-empty.
lookupDependency :: InstalledPackageIndex -> Dependency -> [(Version, [InstalledPackageInfo])]

-- | Does a lookup by source package name and a range of versions.
°5u
°5uWe get back any number of versions of the specified package name, all
°5usatisfying the version range constraint.
°5u
°5uINVARIANT: List of eligible <a>InstalledPackageInfo</a> is non-empty.
lookupInternalDependency :: InstalledPackageIndex -> Dependency -> Maybe UnqualComponentName -> [(Version, [InstalledPackageInfo])]

-- | Does a case-insensitive search by package name.
°5u
°5uIf there is only one package that compares case-insensitively to this
°5uname then the search is unambiguous and we get back all versions of
°5uthat package. If several match case-insensitively but one matches
°5uexactly then it is also unambiguous.
°5u
°5uIf however several match case-insensitively and none match exactly
°5uthen we have an ambiguous result, and we get back all the versions of
°5uall the packages. The list of ambiguous results is split by exact
°5upackage name. So it is a non-empty list of non-empty lists.
searchByName :: PackageIndex a -> String -> SearchResult [a]
data SearchResult a
None :: SearchResult a
Unambiguous :: a -> SearchResult a
Ambiguous :: [a] -> SearchResult a

-- | Does a case-insensitive substring search by package name.
°5u
°5uThat is, all packages that contain the given string in their name.
searchByNameSubstring :: PackageIndex a -> String -> [a]

-- | Get all the packages from the index.
allPackages :: PackageIndex a -> [a]

-- | Get all the packages from the index.
°5u
°5uThey are grouped by package name (case-sensitively).
°5u
°5u(Doesn't include private libraries.)
allPackagesByName :: PackageIndex a -> [(PackageName, [a])]

-- | Get all the packages from the index.
°5u
°5uThey are grouped by source package id (package name and version).
°5u
°5u(Doesn't include private libraries)
allPackagesBySourcePackageId :: HasUnitId a => PackageIndex a -> [(PackageId, [a])]

-- | Get all the packages from the index.
°5u
°5uThey are grouped by source package id and library name.
°5u
°5uThis DOES include internal libraries.
allPackagesBySourcePackageIdAndLibName :: HasUnitId a => PackageIndex a -> [((PackageId, Maybe UnqualComponentName), [a])]

-- | All packages that have immediate dependencies that are not in the
°5uindex.
°5u
°5uReturns such packages along with the dependencies that they're
°5umissing.
brokenPackages :: PackageInstalled a => PackageIndex a -> [(a, [UnitId])]

-- | Tries to take the transitive closure of the package dependencies.
°5u
°5uIf the transitive closure is complete then it returns that subset of
°5uthe index. Otherwise it returns the broken packages as in
°5u<a>brokenPackages</a>.
°5u
°5u<ul>
°5u<li>Note that if the result is <tt>Right []</tt> it is because at
°5uleast one of the original given <a>PackageId</a>s do not occur in the
°5uindex.</li>
°5u</ul>
dependencyClosure :: InstalledPackageIndex -> [UnitId] -> Either (InstalledPackageIndex) [(InstalledPackageInfo, [UnitId])]

-- | Takes the transitive closure of the packages reverse dependencies.
°5u
°5u<ul>
°5u<li>The given <a>PackageId</a>s must be in the index.</li>
°5u</ul>
reverseDependencyClosure :: PackageInstalled a => PackageIndex a -> [UnitId] -> [a]
topologicalOrder :: PackageInstalled a => PackageIndex a -> [a]
reverseTopologicalOrder :: PackageInstalled a => PackageIndex a -> [a]

-- | Given a package index where we assume we want to use all the packages
°5u(use <a>dependencyClosure</a> if you need to get such a index subset)
°5ufind out if the dependencies within it use consistent versions of each
°5upackage. Return all cases where multiple packages depend on different
°5uversions of some other package.
°5u
°5uEach element in the result is a package name along with the packages
°5uthat depend on it and the versions they require. These are guaranteed
°5uto be distinct.
dependencyInconsistencies :: InstalledPackageIndex -> [(DepUniqueKey, [(UnitId, [InstalledPackageInfo])])]

-- | Find if there are any cycles in the dependency graph. If there are no
°5ucycles the result is <tt>[]</tt>.
°5u
°5uThis actually computes the strongly connected components. So it gives
°5uus a list of groups of packages where within each group they all
°5udepend on each other, directly or indirectly.
dependencyCycles :: PackageInstalled a => PackageIndex a -> [[a]]

-- | Builds a graph of the package dependencies.
°5u
°5uDependencies on other packages that are not in the index are
°5udiscarded. You can check if there are any such dependencies with
°5u<a>brokenPackages</a>.
dependencyGraph :: PackageInstalled a => PackageIndex a -> (Graph, Vertex -> a, UnitId -> Maybe Vertex)

-- | A rough approximation of GHC's module finder, takes a
°5u<a>InstalledPackageIndex</a> and turns it into a map from module names
°5uto their source packages. It's used to initialize the
°5u<tt>build-deps</tt> field in <tt>cabal init</tt>.
moduleNameIndex :: InstalledPackageIndex -> Map ModuleName [InstalledPackageInfo]

-- | Backwards compatibility wrapper for Cabal pre-1.24.

-- | <i>Deprecated: Use deleteUnitId instead. This symbol will be removed
°5uin Cabal-3.0 (est. Oct 2018).</i>
deleteInstalledPackageId :: UnitId -> InstalledPackageIndex -> InstalledPackageIndex

-- | Backwards compatibility for Cabal pre-1.24.

-- | <i>Deprecated: Use lookupUnitId instead. This symbol will be removed
°5uin Cabal-3.0 (est. Oct 2018).</i>
lookupInstalledPackageId :: PackageIndex a -> UnitId -> Maybe a
instance GHC.Read.Read a => GHC.Read.Read (Distribution.Simple.PackageIndex.PackageIndex a)
instance GHC.Show.Show a => GHC.Show.Show (Distribution.Simple.PackageIndex.PackageIndex a)
instance GHC.Generics.Generic (Distribution.Simple.PackageIndex.PackageIndex a)
instance GHC.Classes.Eq a => GHC.Classes.Eq (Distribution.Simple.PackageIndex.PackageIndex a)
instance Data.Binary.Class.Binary a => Data.Binary.Class.Binary (Distribution.Simple.PackageIndex.PackageIndex a)
instance GHC.Base.Monoid (Distribution.Simple.PackageIndex.PackageIndex Distribution.Types.InstalledPackageInfo.InstalledPackageInfo)
instance GHC.Base.Semigroup (Distribution.Simple.PackageIndex.PackageIndex Distribution.Types.InstalledPackageInfo.InstalledPackageInfo)

module Distribution.Types.LocalBuildInfo

-- | Data cached after configuration step. See also <a>ConfigFlags</a>.
data LocalBuildInfo
LocalBuildInfo :: ConfigFlags -> FlagAssignment -> ComponentRequestedSpec -> [String] -> InstallDirTemplates -> Compiler -> Platform -> FilePath -> Graph ComponentLocalBuildInfo -> Map ComponentName [ComponentLocalBuildInfo] -> InstalledPackageIndex -> Maybe FilePath -> PackageDescription -> ProgramDb -> PackageDBStack -> Bool -> Bool -> Bool -> Bool -> Bool -> Bool -> ProfDetailLevel -> ProfDetailLevel -> OptimisationLevel -> DebugInfoLevel -> Bool -> Bool -> Bool -> Bool -> Bool -> Bool -> Bool -> PathTemplate -> PathTemplate -> Bool -> LocalBuildInfo

-- | Options passed to the configuration step. Needed to re-run
°5uconfiguration when .cabal is out of date
[configFlags] :: LocalBuildInfo -> ConfigFlags

-- | The final set of flags which were picked for this package
[flagAssignment] :: LocalBuildInfo -> FlagAssignment

-- | What components were enabled during configuration, and why.
[componentEnabledSpec] :: LocalBuildInfo -> ComponentRequestedSpec

-- | Extra args on the command line for the configuration step. Needed to
°5ure-run configuration when .cabal is out of date
[extraConfigArgs] :: LocalBuildInfo -> [String]

-- | The installation directories for the various different kinds of files
°5uTODO: inplaceDirTemplates :: InstallDirs FilePath
[installDirTemplates] :: LocalBuildInfo -> InstallDirTemplates

-- | The compiler we're building with
[compiler] :: LocalBuildInfo -> Compiler

-- | The platform we're building for
[hostPlatform] :: LocalBuildInfo -> Platform

-- | Where to build the package.
[buildDir] :: LocalBuildInfo -> FilePath

-- | All the components to build, ordered by topological sort, and with
°5utheir INTERNAL dependencies over the intrapackage dependency graph.
°5uTODO: this is assumed to be short; otherwise we want some sort of
°5uordered map.
[componentGraph] :: LocalBuildInfo -> Graph ComponentLocalBuildInfo

-- | A map from component name to all matching components. These coincide
°5uwith <a>componentGraph</a>
[componentNameMap] :: LocalBuildInfo -> Map ComponentName [ComponentLocalBuildInfo]

-- | All the info about the installed packages that the current package
°5udepends on (directly or indirectly). The copy saved on disk does NOT
°5uinclude internal dependencies (because we just don't have enough
°5uinformation at this point to have an <tt>InstalledPackageInfo</tt> for
°5uan internal dep), but we will often update it with the internal
°5udependencies; see for example <a>build</a>. (This admonition doesn't
°5uapply for per-component builds.)
[installedPkgs] :: LocalBuildInfo -> InstalledPackageIndex

-- | the filename containing the .cabal file, if available
[pkgDescrFile] :: LocalBuildInfo -> Maybe FilePath

-- | WARNING WARNING WARNING Be VERY careful about using this function; we
°5uhaven't deprecated it but using it could introduce subtle bugs related
°5uto <a>HookedBuildInfo</a>.
°5u
°5uIn principle, this is supposed to contain the resolved package
°5udescription, that does not contain any conditionals. However, it MAY
°5uNOT contain the description wtih a <a>HookedBuildInfo</a> applied to
°5uit; see <a>HookedBuildInfo</a> for the whole sordid saga. As much as
°5upossible, Cabal library should avoid using this parameter.
[localPkgDescr] :: LocalBuildInfo -> PackageDescription

-- | Location and args for all programs
[withPrograms] :: LocalBuildInfo -> ProgramDb

-- | What package database to use, global/user
[withPackageDB] :: LocalBuildInfo -> PackageDBStack

-- | Whether to build normal libs.
[withVanillaLib] :: LocalBuildInfo -> Bool

-- | Whether to build profiling versions of libs.
[withProfLib] :: LocalBuildInfo -> Bool

-- | Whether to build shared versions of libs.
[withSharedLib] :: LocalBuildInfo -> Bool

-- | Whether to build static versions of libs (with all other libs rolled
°5uin)
[withStaticLib] :: LocalBuildInfo -> Bool

-- | Whether to link executables dynamically
[withDynExe] :: LocalBuildInfo -> Bool

-- | Whether to build executables for profiling.
[withProfExe] :: LocalBuildInfo -> Bool

-- | Level of automatic profile detail.
[withProfLibDetail] :: LocalBuildInfo -> ProfDetailLevel

-- | Level of automatic profile detail.
[withProfExeDetail] :: LocalBuildInfo -> ProfDetailLevel

-- | Whether to build with optimization (if available).
[withOptimization] :: LocalBuildInfo -> OptimisationLevel

-- | Whether to emit debug info (if available).
[withDebugInfo] :: LocalBuildInfo -> DebugInfoLevel

-- | Whether to build libs suitable for use with GHCi.
[withGHCiLib] :: LocalBuildInfo -> Bool

-- | Use -split-sections with GHC, if available
[splitSections] :: LocalBuildInfo -> Bool

-- | Use -split-objs with GHC, if available
[splitObjs] :: LocalBuildInfo -> Bool

-- | Whether to strip executables during install
[stripExes] :: LocalBuildInfo -> Bool

-- | Whether to strip libraries during install
[stripLibs] :: LocalBuildInfo -> Bool

-- | Whether to enable executable program coverage
[exeCoverage] :: LocalBuildInfo -> Bool

-- | Whether to enable library program coverage
[libCoverage] :: LocalBuildInfo -> Bool

-- | Prefix to be prepended to installed executables
[progPrefix] :: LocalBuildInfo -> PathTemplate

-- | Suffix to be appended to installed executables
[progSuffix] :: LocalBuildInfo -> PathTemplate
[relocatable] :: LocalBuildInfo -> Bool

-- | Extract the <a>ComponentId</a> from the public library component of a
°5u<a>LocalBuildInfo</a> if it exists, or make a fake component ID based
°5uon the package ID.
localComponentId :: LocalBuildInfo -> ComponentId

-- | Extract the <a>UnitId</a> from the library component of a
°5u<a>LocalBuildInfo</a> if it exists, or make a fake unit ID based on
°5uthe package ID.
localUnitId :: LocalBuildInfo -> UnitId

-- | Extract the compatibility package key from the public library
°5ucomponent of a <a>LocalBuildInfo</a> if it exists, or make a fake
°5upackage key based on the package ID.
localCompatPackageKey :: LocalBuildInfo -> String

-- | Extract the <a>PackageIdentifier</a> of a <a>LocalBuildInfo</a>. This
°5uis a "safe" use of <a>localPkgDescr</a>
localPackage :: LocalBuildInfo -> PackageId

-- | Return all <a>ComponentLocalBuildInfo</a>s associated with
°5u<a>ComponentName</a>. In the presence of Backpack there may be more
°5uthan one!
componentNameCLBIs :: LocalBuildInfo -> ComponentName -> [ComponentLocalBuildInfo]

-- | Return all <a>TargetInfo</a>s associated with <a>ComponentName</a>. In
°5uthe presence of Backpack there may be more than one! Has a prime
°5ubecause it takes a <a>PackageDescription</a> argument which may
°5udisagree with <a>localPkgDescr</a> in <a>LocalBuildInfo</a>.
componentNameTargets' :: PackageDescription -> LocalBuildInfo -> ComponentName -> [TargetInfo]
unitIdTarget' :: PackageDescription -> LocalBuildInfo -> UnitId -> Maybe TargetInfo

-- | Return the list of default <a>TargetInfo</a>s associated with a
°5uconfigured package, in the order they need to be built. Has a prime
°5ubecause it takes a <a>PackageDescription</a> argument which may
°5udisagree with <a>localPkgDescr</a> in <a>LocalBuildInfo</a>.
allTargetsInBuildOrder' :: PackageDescription -> LocalBuildInfo -> [TargetInfo]

-- | Execute <tt>f</tt> for every <a>TargetInfo</a> in the package,
°5urespecting the build dependency order. (TODO: We should use Shake!)
°5uHas a prime because it takes a <a>PackageDescription</a> argument
°5uwhich may disagree with <a>localPkgDescr</a> in <a>LocalBuildInfo</a>.
withAllTargetsInBuildOrder' :: PackageDescription -> LocalBuildInfo -> (TargetInfo -> IO ()) -> IO ()

-- | Return the list of all targets needed to build the <tt>uids</tt>, in
°5uthe order they need to be built. Has a prime because it takes a
°5u<a>PackageDescription</a> argument which may disagree with
°5u<a>localPkgDescr</a> in <a>LocalBuildInfo</a>.
neededTargetsInBuildOrder' :: PackageDescription -> LocalBuildInfo -> [UnitId] -> [TargetInfo]

-- | Execute <tt>f</tt> for every <a>TargetInfo</a> needed to build
°5u<tt>uid</tt>s, respecting the build dependency order. Has a prime
°5ubecause it takes a <a>PackageDescription</a> argument which may
°5udisagree with <a>localPkgDescr</a> in <a>LocalBuildInfo</a>.
withNeededTargetsInBuildOrder' :: PackageDescription -> LocalBuildInfo -> [UnitId] -> (TargetInfo -> IO ()) -> IO ()

-- | Is coverage enabled for test suites? In practice, this requires
°5ulibrary and executable profiling to be enabled.
testCoverage :: LocalBuildInfo -> Bool

-- | <i>Warning: By using this function, you may be introducing a bug where
°5uyou retrieve a <tt>Component</tt> which does not have
°5u<a>HookedBuildInfo</a> applied to it. See the documentation for
°5u<a>HookedBuildInfo</a> for an explanation of the issue. If you have a
°5u<tt>PakcageDescription</tt> handy (NOT from the
°5u<a>LocalBuildInfo</a>), try using the primed version of the function,
°5uwhich takes it as an extra argument.</i>
componentNameTargets :: LocalBuildInfo -> ComponentName -> [TargetInfo]

-- | <i>Warning: By using this function, you may be introducing a bug where
°5uyou retrieve a <tt>Component</tt> which does not have
°5u<a>HookedBuildInfo</a> applied to it. See the documentation for
°5u<a>HookedBuildInfo</a> for an explanation of the issue. If you have a
°5u<tt>PakcageDescription</tt> handy (NOT from the
°5u<a>LocalBuildInfo</a>), try using the primed version of the function,
°5uwhich takes it as an extra argument.</i>
unitIdTarget :: LocalBuildInfo -> UnitId -> Maybe TargetInfo

-- | <i>Warning: By using this function, you may be introducing a bug where
°5uyou retrieve a <tt>Component</tt> which does not have
°5u<a>HookedBuildInfo</a> applied to it. See the documentation for
°5u<a>HookedBuildInfo</a> for an explanation of the issue. If you have a
°5u<tt>PakcageDescription</tt> handy (NOT from the
°5u<a>LocalBuildInfo</a>), try using the primed version of the function,
°5uwhich takes it as an extra argument.</i>
allTargetsInBuildOrder :: LocalBuildInfo -> [TargetInfo]

-- | <i>Warning: By using this function, you may be introducing a bug where
°5uyou retrieve a <tt>Component</tt> which does not have
°5u<a>HookedBuildInfo</a> applied to it. See the documentation for
°5u<a>HookedBuildInfo</a> for an explanation of the issue. If you have a
°5u<tt>PakcageDescription</tt> handy (NOT from the
°5u<a>LocalBuildInfo</a>), try using the primed version of the function,
°5uwhich takes it as an extra argument.</i>
withAllTargetsInBuildOrder :: LocalBuildInfo -> (TargetInfo -> IO ()) -> IO ()

-- | <i>Warning: By using this function, you may be introducing a bug where
°5uyou retrieve a <tt>Component</tt> which does not have
°5u<a>HookedBuildInfo</a> applied to it. See the documentation for
°5u<a>HookedBuildInfo</a> for an explanation of the issue. If you have a
°5u<tt>PakcageDescription</tt> handy (NOT from the
°5u<a>LocalBuildInfo</a>), try using the primed version of the function,
°5uwhich takes it as an extra argument.</i>
neededTargetsInBuildOrder :: LocalBuildInfo -> [UnitId] -> [TargetInfo]

-- | <i>Warning: By using this function, you may be introducing a bug where
°5uyou retrieve a <tt>Component</tt> which does not have
°5u<a>HookedBuildInfo</a> applied to it. See the documentation for
°5u<a>HookedBuildInfo</a> for an explanation of the issue. If you have a
°5u<tt>PakcageDescription</tt> handy (NOT from the
°5u<a>LocalBuildInfo</a>), try using the primed version of the function,
°5uwhich takes it as an extra argument.</i>
withNeededTargetsInBuildOrder :: LocalBuildInfo -> [UnitId] -> (TargetInfo -> IO ()) -> IO ()

-- | <i>Deprecated: Use <a>componentGraph</a> instead; you can get a list
°5uof <a>ComponentLocalBuildInfo</a> with <a>toList</a>. There's not a
°5ugood way to get the list of <a>ComponentName</a>s the
°5u<a>ComponentLocalBuildInfo</a> depends on because this query doesn't
°5umake sense; the graph is indexed by <a>UnitId</a> not
°5u<a>ComponentName</a>. Given a <a>UnitId</a> you can lookup the
°5u<a>ComponentLocalBuildInfo</a> (<tt>getCLBI</tt>) and then get the
°5u<a>ComponentName</a> ('componentLocalName]). To be removed in Cabal
°5u3.0</i>
componentsConfigs :: LocalBuildInfo -> [(ComponentName, ComponentLocalBuildInfo, [ComponentName])]

-- | External package dependencies for the package as a whole. This is the
°5uunion of the individual <a>componentPackageDeps</a>, less any internal
°5udeps.

-- | <i>Deprecated: You almost certainly don't want this function, which
°5uagglomerates the dependencies of ALL enabled components. If you're
°5uusing this to write out information on your dependencies, read off the
°5udependencies directly from the actual component in question. To be
°5uremoved in Cabal 3.0</i>
externalPackageDeps :: LocalBuildInfo -> [(UnitId, MungedPackageId)]
instance GHC.Show.Show Distribution.Types.LocalBuildInfo.LocalBuildInfo
instance GHC.Read.Read Distribution.Types.LocalBuildInfo.LocalBuildInfo
instance GHC.Generics.Generic Distribution.Types.LocalBuildInfo.LocalBuildInfo
instance Data.Binary.Class.Binary Distribution.Types.LocalBuildInfo.LocalBuildInfo


-- | Once a package has been configured we have resolved conditionals and
°5udependencies, configured the compiler and other needed external
°5uprograms. The <a>LocalBuildInfo</a> is used to hold all this
°5uinformation. It holds the install dirs, the compiler, the exact
°5upackage dependencies, the configured programs, the package database to
°5uuse and a bunch of miscellaneous configure flags. It gets saved and
°5ureloaded from a file (<tt>dist/setup-config</tt>). It gets passed in
°5uto very many subsequent build actions.
module Distribution.Simple.LocalBuildInfo

-- | Data cached after configuration step. See also <a>ConfigFlags</a>.
data LocalBuildInfo
LocalBuildInfo :: ConfigFlags -> FlagAssignment -> ComponentRequestedSpec -> [String] -> InstallDirTemplates -> Compiler -> Platform -> FilePath -> Graph ComponentLocalBuildInfo -> Map ComponentName [ComponentLocalBuildInfo] -> InstalledPackageIndex -> Maybe FilePath -> PackageDescription -> ProgramDb -> PackageDBStack -> Bool -> Bool -> Bool -> Bool -> Bool -> Bool -> ProfDetailLevel -> ProfDetailLevel -> OptimisationLevel -> DebugInfoLevel -> Bool -> Bool -> Bool -> Bool -> Bool -> Bool -> Bool -> PathTemplate -> PathTemplate -> Bool -> LocalBuildInfo

-- | Options passed to the configuration step. Needed to re-run
°5uconfiguration when .cabal is out of date
[configFlags] :: LocalBuildInfo -> ConfigFlags

-- | The final set of flags which were picked for this package
[flagAssignment] :: LocalBuildInfo -> FlagAssignment

-- | What components were enabled during configuration, and why.
[componentEnabledSpec] :: LocalBuildInfo -> ComponentRequestedSpec

-- | Extra args on the command line for the configuration step. Needed to
°5ure-run configuration when .cabal is out of date
[extraConfigArgs] :: LocalBuildInfo -> [String]

-- | The installation directories for the various different kinds of files
°5uTODO: inplaceDirTemplates :: InstallDirs FilePath
[installDirTemplates] :: LocalBuildInfo -> InstallDirTemplates

-- | The compiler we're building with
[compiler] :: LocalBuildInfo -> Compiler

-- | The platform we're building for
[hostPlatform] :: LocalBuildInfo -> Platform

-- | Where to build the package.
[buildDir] :: LocalBuildInfo -> FilePath

-- | All the components to build, ordered by topological sort, and with
°5utheir INTERNAL dependencies over the intrapackage dependency graph.
°5uTODO: this is assumed to be short; otherwise we want some sort of
°5uordered map.
[componentGraph] :: LocalBuildInfo -> Graph ComponentLocalBuildInfo

-- | A map from component name to all matching components. These coincide
°5uwith <a>componentGraph</a>
[componentNameMap] :: LocalBuildInfo -> Map ComponentName [ComponentLocalBuildInfo]

-- | All the info about the installed packages that the current package
°5udepends on (directly or indirectly). The copy saved on disk does NOT
°5uinclude internal dependencies (because we just don't have enough
°5uinformation at this point to have an <tt>InstalledPackageInfo</tt> for
°5uan internal dep), but we will often update it with the internal
°5udependencies; see for example <a>build</a>. (This admonition doesn't
°5uapply for per-component builds.)
[installedPkgs] :: LocalBuildInfo -> InstalledPackageIndex

-- | the filename containing the .cabal file, if available
[pkgDescrFile] :: LocalBuildInfo -> Maybe FilePath

-- | WARNING WARNING WARNING Be VERY careful about using this function; we
°5uhaven't deprecated it but using it could introduce subtle bugs related
°5uto <a>HookedBuildInfo</a>.
°5u
°5uIn principle, this is supposed to contain the resolved package
°5udescription, that does not contain any conditionals. However, it MAY
°5uNOT contain the description wtih a <a>HookedBuildInfo</a> applied to
°5uit; see <a>HookedBuildInfo</a> for the whole sordid saga. As much as
°5upossible, Cabal library should avoid using this parameter.
[localPkgDescr] :: LocalBuildInfo -> PackageDescription

-- | Location and args for all programs
[withPrograms] :: LocalBuildInfo -> ProgramDb

-- | What package database to use, global/user
[withPackageDB] :: LocalBuildInfo -> PackageDBStack

-- | Whether to build normal libs.
[withVanillaLib] :: LocalBuildInfo -> Bool

-- | Whether to build profiling versions of libs.
[withProfLib] :: LocalBuildInfo -> Bool

-- | Whether to build shared versions of libs.
[withSharedLib] :: LocalBuildInfo -> Bool

-- | Whether to build static versions of libs (with all other libs rolled
°5uin)
[withStaticLib] :: LocalBuildInfo -> Bool

-- | Whether to link executables dynamically
[withDynExe] :: LocalBuildInfo -> Bool

-- | Whether to build executables for profiling.
[withProfExe] :: LocalBuildInfo -> Bool

-- | Level of automatic profile detail.
[withProfLibDetail] :: LocalBuildInfo -> ProfDetailLevel

-- | Level of automatic profile detail.
[withProfExeDetail] :: LocalBuildInfo -> ProfDetailLevel

-- | Whether to build with optimization (if available).
[withOptimization] :: LocalBuildInfo -> OptimisationLevel

-- | Whether to emit debug info (if available).
[withDebugInfo] :: LocalBuildInfo -> DebugInfoLevel

-- | Whether to build libs suitable for use with GHCi.
[withGHCiLib] :: LocalBuildInfo -> Bool

-- | Use -split-sections with GHC, if available
[splitSections] :: LocalBuildInfo -> Bool

-- | Use -split-objs with GHC, if available
[splitObjs] :: LocalBuildInfo -> Bool

-- | Whether to strip executables during install
[stripExes] :: LocalBuildInfo -> Bool

-- | Whether to strip libraries during install
[stripLibs] :: LocalBuildInfo -> Bool

-- | Whether to enable executable program coverage
[exeCoverage] :: LocalBuildInfo -> Bool

-- | Whether to enable library program coverage
[libCoverage] :: LocalBuildInfo -> Bool

-- | Prefix to be prepended to installed executables
[progPrefix] :: LocalBuildInfo -> PathTemplate

-- | Suffix to be appended to installed executables
[progSuffix] :: LocalBuildInfo -> PathTemplate
[relocatable] :: LocalBuildInfo -> Bool

-- | External package dependencies for the package as a whole. This is the
°5uunion of the individual <a>componentPackageDeps</a>, less any internal
°5udeps.

-- | <i>Deprecated: You almost certainly don't want this function, which
°5uagglomerates the dependencies of ALL enabled components. If you're
°5uusing this to write out information on your dependencies, read off the
°5udependencies directly from the actual component in question. To be
°5uremoved in Cabal 3.0</i>
externalPackageDeps :: LocalBuildInfo -> [(UnitId, MungedPackageId)]

-- | Extract the <a>ComponentId</a> from the public library component of a
°5u<a>LocalBuildInfo</a> if it exists, or make a fake component ID based
°5uon the package ID.
localComponentId :: LocalBuildInfo -> ComponentId

-- | Extract the <a>UnitId</a> from the library component of a
°5u<a>LocalBuildInfo</a> if it exists, or make a fake unit ID based on
°5uthe package ID.
localUnitId :: LocalBuildInfo -> UnitId

-- | Extract the compatibility package key from the public library
°5ucomponent of a <a>LocalBuildInfo</a> if it exists, or make a fake
°5upackage key based on the package ID.
localCompatPackageKey :: LocalBuildInfo -> String
data Component
CLib :: Library -> Component
CFLib :: ForeignLib -> Component
CExe :: Executable -> Component
CTest :: TestSuite -> Component
CBench :: Benchmark -> Component
data ComponentName
CLibName :: ComponentName
CSubLibName :: UnqualComponentName -> ComponentName
CFLibName :: UnqualComponentName -> ComponentName
CExeName :: UnqualComponentName -> ComponentName
CTestName :: UnqualComponentName -> ComponentName
CBenchName :: UnqualComponentName -> ComponentName
defaultLibName :: ComponentName
showComponentName :: ComponentName -> String

-- | This gets the underlying unqualified component name. In fact, it is
°5uguaranteed to uniquely identify a component, returning
°5u<tt>Nothing</tt> if the <a>ComponentName</a> was for the public
°5ulibrary.
componentNameString :: ComponentName -> Maybe UnqualComponentName

-- | The first five fields are common across all algebraic variants.
data ComponentLocalBuildInfo
LibComponentLocalBuildInfo :: ComponentName -> ComponentId -> UnitId -> Bool -> [(ModuleName, OpenModule)] -> [(UnitId, MungedPackageId)] -> [(OpenUnitId, ModuleRenaming)] -> [UnitId] -> [UnitId] -> String -> MungedPackageName -> [ExposedModule] -> Bool -> ComponentLocalBuildInfo

-- | It would be very convenient to store the literal Library here, but if
°5uwe do that, it will get serialized (via the Binary) instance twice. So
°5uinstead we just provide the ComponentName, which can be used to find
°5uthe Component in the PackageDescription. NB: eventually, this will NOT
°5uuniquely identify the ComponentLocalBuildInfo.
[componentLocalName] :: ComponentLocalBuildInfo -> ComponentName

-- | The computed <a>ComponentId</a> of this component.
[componentComponentId] :: ComponentLocalBuildInfo -> ComponentId

-- | The computed <a>UnitId</a> which uniquely identifies this component.
°5uMight be hashed.
[componentUnitId] :: ComponentLocalBuildInfo -> UnitId

-- | Is this an indefinite component (i.e. has unfilled holes)?
[componentIsIndefinite_] :: ComponentLocalBuildInfo -> Bool

-- | How the component was instantiated
[componentInstantiatedWith] :: ComponentLocalBuildInfo -> [(ModuleName, OpenModule)]

-- | Resolved internal and external package dependencies for this
°5ucomponent. The <a>BuildInfo</a> specifies a set of build dependencies
°5uthat must be satisfied in terms of version ranges. This field fixes
°5uthose dependencies to the specific versions available on this machine
°5ufor this compiler.
[componentPackageDeps] :: ComponentLocalBuildInfo -> [(UnitId, MungedPackageId)]

-- | The set of packages that are brought into scope during compilation,
°5uincluding a <a>ModuleRenaming</a> which may used to hide or rename
°5umodules. This is what gets translated into <tt>-package-id</tt>
°5uarguments. This is a modernized version of
°5u<a>componentPackageDeps</a>, which is kept around for BC purposes.
[componentIncludes] :: ComponentLocalBuildInfo -> [(OpenUnitId, ModuleRenaming)]
[componentExeDeps] :: ComponentLocalBuildInfo -> [UnitId]

-- | The internal dependencies which induce a graph on the
°5u<a>ComponentLocalBuildInfo</a> of this package. This does NOT coincide
°5uwith <a>componentPackageDeps</a> because it ALSO records 'build-tool'
°5udependencies on executables. Maybe one day <tt>cabal-install</tt> will
°5ualso handle these correctly too!
[componentInternalDeps] :: ComponentLocalBuildInfo -> [UnitId]

-- | Compatibility "package key" that we pass to older versions of GHC.
[componentCompatPackageKey] :: ComponentLocalBuildInfo -> String

-- | Compatibility "package name" that we register this component as.
[componentCompatPackageName] :: ComponentLocalBuildInfo -> MungedPackageName

-- | A list of exposed modules (either defined in this component, or
°5ureexported from another component.)
[componentExposedModules] :: ComponentLocalBuildInfo -> [ExposedModule]

-- | Convenience field, specifying whether or not this is the "public
°5ulibrary" that has the same name as the package.
[componentIsPublic] :: ComponentLocalBuildInfo -> Bool
FLibComponentLocalBuildInfo :: ComponentName -> ComponentId -> UnitId -> [(UnitId, MungedPackageId)] -> [(OpenUnitId, ModuleRenaming)] -> [UnitId] -> [UnitId] -> ComponentLocalBuildInfo

-- | It would be very convenient to store the literal Library here, but if
°5uwe do that, it will get serialized (via the Binary) instance twice. So
°5uinstead we just provide the ComponentName, which can be used to find
°5uthe Component in the PackageDescription. NB: eventually, this will NOT
°5uuniquely identify the ComponentLocalBuildInfo.
[componentLocalName] :: ComponentLocalBuildInfo -> ComponentName

-- | The computed <a>ComponentId</a> of this component.
[componentComponentId] :: ComponentLocalBuildInfo -> ComponentId

-- | The computed <a>UnitId</a> which uniquely identifies this component.
°5uMight be hashed.
[componentUnitId] :: ComponentLocalBuildInfo -> UnitId

-- | Resolved internal and external package dependencies for this
°5ucomponent. The <a>BuildInfo</a> specifies a set of build dependencies
°5uthat must be satisfied in terms of version ranges. This field fixes
°5uthose dependencies to the specific versions available on this machine
°5ufor this compiler.
[componentPackageDeps] :: ComponentLocalBuildInfo -> [(UnitId, MungedPackageId)]

-- | The set of packages that are brought into scope during compilation,
°5uincluding a <a>ModuleRenaming</a> which may used to hide or rename
°5umodules. This is what gets translated into <tt>-package-id</tt>
°5uarguments. This is a modernized version of
°5u<a>componentPackageDeps</a>, which is kept around for BC purposes.
[componentIncludes] :: ComponentLocalBuildInfo -> [(OpenUnitId, ModuleRenaming)]
[componentExeDeps] :: ComponentLocalBuildInfo -> [UnitId]

-- | The internal dependencies which induce a graph on the
°5u<a>ComponentLocalBuildInfo</a> of this package. This does NOT coincide
°5uwith <a>componentPackageDeps</a> because it ALSO records 'build-tool'
°5udependencies on executables. Maybe one day <tt>cabal-install</tt> will
°5ualso handle these correctly too!
[componentInternalDeps] :: ComponentLocalBuildInfo -> [UnitId]
ExeComponentLocalBuildInfo :: ComponentName -> ComponentId -> UnitId -> [(UnitId, MungedPackageId)] -> [(OpenUnitId, ModuleRenaming)] -> [UnitId] -> [UnitId] -> ComponentLocalBuildInfo

-- | It would be very convenient to store the literal Library here, but if
°5uwe do that, it will get serialized (via the Binary) instance twice. So
°5uinstead we just provide the ComponentName, which can be used to find
°5uthe Component in the PackageDescription. NB: eventually, this will NOT
°5uuniquely identify the ComponentLocalBuildInfo.
[componentLocalName] :: ComponentLocalBuildInfo -> ComponentName

-- | The computed <a>ComponentId</a> of this component.
[componentComponentId] :: ComponentLocalBuildInfo -> ComponentId

-- | The computed <a>UnitId</a> which uniquely identifies this component.
°5uMight be hashed.
[componentUnitId] :: ComponentLocalBuildInfo -> UnitId

-- | Resolved internal and external package dependencies for this
°5ucomponent. The <a>BuildInfo</a> specifies a set of build dependencies
°5uthat must be satisfied in terms of version ranges. This field fixes
°5uthose dependencies to the specific versions available on this machine
°5ufor this compiler.
[componentPackageDeps] :: ComponentLocalBuildInfo -> [(UnitId, MungedPackageId)]

-- | The set of packages that are brought into scope during compilation,
°5uincluding a <a>ModuleRenaming</a> which may used to hide or rename
°5umodules. This is what gets translated into <tt>-package-id</tt>
°5uarguments. This is a modernized version of
°5u<a>componentPackageDeps</a>, which is kept around for BC purposes.
[componentIncludes] :: ComponentLocalBuildInfo -> [(OpenUnitId, ModuleRenaming)]
[componentExeDeps] :: ComponentLocalBuildInfo -> [UnitId]

-- | The internal dependencies which induce a graph on the
°5u<a>ComponentLocalBuildInfo</a> of this package. This does NOT coincide
°5uwith <a>componentPackageDeps</a> because it ALSO records 'build-tool'
°5udependencies on executables. Maybe one day <tt>cabal-install</tt> will
°5ualso handle these correctly too!
[componentInternalDeps] :: ComponentLocalBuildInfo -> [UnitId]
TestComponentLocalBuildInfo :: ComponentName -> ComponentId -> UnitId -> [(UnitId, MungedPackageId)] -> [(OpenUnitId, ModuleRenaming)] -> [UnitId] -> [UnitId] -> ComponentLocalBuildInfo

-- | It would be very convenient to store the literal Library here, but if
°5uwe do that, it will get serialized (via the Binary) instance twice. So
°5uinstead we just provide the ComponentName, which can be used to find
°5uthe Component in the PackageDescription. NB: eventually, this will NOT
°5uuniquely identify the ComponentLocalBuildInfo.
[componentLocalName] :: ComponentLocalBuildInfo -> ComponentName

-- | The computed <a>ComponentId</a> of this component.
[componentComponentId] :: ComponentLocalBuildInfo -> ComponentId

-- | The computed <a>UnitId</a> which uniquely identifies this component.
°5uMight be hashed.
[componentUnitId] :: ComponentLocalBuildInfo -> UnitId

-- | Resolved internal and external package dependencies for this
°5ucomponent. The <a>BuildInfo</a> specifies a set of build dependencies
°5uthat must be satisfied in terms of version ranges. This field fixes
°5uthose dependencies to the specific versions available on this machine
°5ufor this compiler.
[componentPackageDeps] :: ComponentLocalBuildInfo -> [(UnitId, MungedPackageId)]

-- | The set of packages that are brought into scope during compilation,
°5uincluding a <a>ModuleRenaming</a> which may used to hide or rename
°5umodules. This is what gets translated into <tt>-package-id</tt>
°5uarguments. This is a modernized version of
°5u<a>componentPackageDeps</a>, which is kept around for BC purposes.
[componentIncludes] :: ComponentLocalBuildInfo -> [(OpenUnitId, ModuleRenaming)]
[componentExeDeps] :: ComponentLocalBuildInfo -> [UnitId]

-- | The internal dependencies which induce a graph on the
°5u<a>ComponentLocalBuildInfo</a> of this package. This does NOT coincide
°5uwith <a>componentPackageDeps</a> because it ALSO records 'build-tool'
°5udependencies on executables. Maybe one day <tt>cabal-install</tt> will
°5ualso handle these correctly too!
[componentInternalDeps] :: ComponentLocalBuildInfo -> [UnitId]
BenchComponentLocalBuildInfo :: ComponentName -> ComponentId -> UnitId -> [(UnitId, MungedPackageId)] -> [(OpenUnitId, ModuleRenaming)] -> [UnitId] -> [UnitId] -> ComponentLocalBuildInfo

-- | It would be very convenient to store the literal Library here, but if
°5uwe do that, it will get serialized (via the Binary) instance twice. So
°5uinstead we just provide the ComponentName, which can be used to find
°5uthe Component in the PackageDescription. NB: eventually, this will NOT
°5uuniquely identify the ComponentLocalBuildInfo.
[componentLocalName] :: ComponentLocalBuildInfo -> ComponentName

-- | The computed <a>ComponentId</a> of this component.
[componentComponentId] :: ComponentLocalBuildInfo -> ComponentId

-- | The computed <a>UnitId</a> which uniquely identifies this component.
°5uMight be hashed.
[componentUnitId] :: ComponentLocalBuildInfo -> UnitId

-- | Resolved internal and external package dependencies for this
°5ucomponent. The <a>BuildInfo</a> specifies a set of build dependencies
°5uthat must be satisfied in terms of version ranges. This field fixes
°5uthose dependencies to the specific versions available on this machine
°5ufor this compiler.
[componentPackageDeps] :: ComponentLocalBuildInfo -> [(UnitId, MungedPackageId)]

-- | The set of packages that are brought into scope during compilation,
°5uincluding a <a>ModuleRenaming</a> which may used to hide or rename
°5umodules. This is what gets translated into <tt>-package-id</tt>
°5uarguments. This is a modernized version of
°5u<a>componentPackageDeps</a>, which is kept around for BC purposes.
[componentIncludes] :: ComponentLocalBuildInfo -> [(OpenUnitId, ModuleRenaming)]
[componentExeDeps] :: ComponentLocalBuildInfo -> [UnitId]

-- | The internal dependencies which induce a graph on the
°5u<a>ComponentLocalBuildInfo</a> of this package. This does NOT coincide
°5uwith <a>componentPackageDeps</a> because it ALSO records 'build-tool'
°5udependencies on executables. Maybe one day <tt>cabal-install</tt> will
°5ualso handle these correctly too!
[componentInternalDeps] :: ComponentLocalBuildInfo -> [UnitId]
componentBuildDir :: LocalBuildInfo -> ComponentLocalBuildInfo -> FilePath
foldComponent :: (Library -> a) -> (ForeignLib -> a) -> (Executable -> a) -> (TestSuite -> a) -> (Benchmark -> a) -> Component -> a
componentName :: Component -> ComponentName
componentBuildInfo :: Component -> BuildInfo

-- | Is a component buildable (i.e., not marked with <tt>buildable:
°5uFalse</tt>)? See also this note in
°5u<a>Distribution.Types.ComponentRequestedSpec#buildable_vs_enabled_components</a>.
componentBuildable :: Component -> Bool

-- | All the components in the package.
pkgComponents :: PackageDescription -> [Component]

-- | A list of all components in the package that are buildable, i.e., were
°5unot marked with <tt>buildable: False</tt>. This does NOT indicate if
°5uwe are actually going to build the component, see
°5u<a>enabledComponents</a> instead.
pkgBuildableComponents :: PackageDescription -> [Component]
lookupComponent :: PackageDescription -> ComponentName -> Maybe Component
getComponent :: PackageDescription -> ComponentName -> Component

-- | <i>Deprecated: This function is not well-defined, because a
°5u<a>ComponentName</a> does not uniquely identify a
°5u<a>ComponentLocalBuildInfo</a>. If you have a <a>TargetInfo</a>, you
°5ushould use <a>targetCLBI</a> to get the
°5u<a>ComponentLocalBuildInfo</a>. Otherwise, use
°5u<a>componentNameTargets</a> to get all possible
°5u<a>ComponentLocalBuildInfo</a>s. This will be removed in Cabal
°5u2.2.</i>
getComponentLocalBuildInfo :: LocalBuildInfo -> ComponentName -> ComponentLocalBuildInfo
allComponentsInBuildOrder :: LocalBuildInfo -> [ComponentLocalBuildInfo]

-- | <i>Deprecated: You've got <a>TargetInfo</a> right? Use
°5u<a>neededTargetsInBuildOrder</a> on the <a>UnitId</a>s you can
°5u<tt>nodeKey</tt> out.</i>
componentsInBuildOrder :: LocalBuildInfo -> [ComponentName] -> [ComponentLocalBuildInfo]

-- | Determine the directories containing the dynamic libraries of the
°5utransitive dependencies of the component we are building.
°5u
°5uWhen wanted, and possible, returns paths relative to the installDirs
°5u<a>prefix</a>
depLibraryPaths :: Bool -> Bool -> LocalBuildInfo -> ComponentLocalBuildInfo -> NoCallStackIO [FilePath]

-- | Get all module names that needed to be built by GHC; i.e., all of
°5uthese <a>ModuleName</a>s have interface files associated with them
°5uthat need to be installed.
allLibModules :: Library -> ComponentLocalBuildInfo -> [ModuleName]

-- | Perform the action on each buildable <a>Library</a> or
°5u<a>Executable</a> (Component) in the PackageDescription, subject to
°5uthe build order specified by the <tt>compBuildOrder</tt> field of the
°5ugiven <a>LocalBuildInfo</a>
withAllComponentsInBuildOrder :: PackageDescription -> LocalBuildInfo -> (Component -> ComponentLocalBuildInfo -> IO ()) -> IO ()

-- | <i>Deprecated: You have got a <a>TargetInfo</a> right? Use
°5u<a>withNeededTargetsInBuildOrder</a> on the <a>UnitId</a>s you can
°5u<tt>nodeKey</tt> out.</i>
withComponentsInBuildOrder :: PackageDescription -> LocalBuildInfo -> [ComponentName] -> (Component -> ComponentLocalBuildInfo -> IO ()) -> IO ()

-- | <i>Deprecated: Use withAllComponentsInBuildOrder</i>
withComponentsLBI :: PackageDescription -> LocalBuildInfo -> (Component -> ComponentLocalBuildInfo -> IO ()) -> IO ()

-- | Perform the action on each enabled <a>library</a> in the package
°5udescription with the <a>ComponentLocalBuildInfo</a>.
withLibLBI :: PackageDescription -> LocalBuildInfo -> (Library -> ComponentLocalBuildInfo -> IO ()) -> IO ()

-- | Perform the action on each enabled <a>Executable</a> in the package
°5udescription. Extended version of <a>withExe</a> that also gives
°5ucorresponding build info.
withExeLBI :: PackageDescription -> LocalBuildInfo -> (Executable -> ComponentLocalBuildInfo -> IO ()) -> IO ()

-- | Perform the action on each enabled <a>Benchmark</a> in the package
°5udescription.
withBenchLBI :: PackageDescription -> LocalBuildInfo -> (Benchmark -> ComponentLocalBuildInfo -> IO ()) -> IO ()
withTestLBI :: PackageDescription -> LocalBuildInfo -> (TestSuite -> ComponentLocalBuildInfo -> IO ()) -> IO ()
enabledTestLBIs :: PackageDescription -> LocalBuildInfo -> [(TestSuite, ComponentLocalBuildInfo)]
enabledBenchLBIs :: PackageDescription -> LocalBuildInfo -> [(Benchmark, ComponentLocalBuildInfo)]
type PathTemplateEnv = [(PathTemplateVariable, PathTemplate)]
data PathTemplateVariable

-- | The <tt>$prefix</tt> path variable
PrefixVar :: PathTemplateVariable

-- | The <tt>$bindir</tt> path variable
BindirVar :: PathTemplateVariable

-- | The <tt>$libdir</tt> path variable
LibdirVar :: PathTemplateVariable

-- | The <tt>$libsubdir</tt> path variable
LibsubdirVar :: PathTemplateVariable

-- | The <tt>$dynlibdir</tt> path variable
DynlibdirVar :: PathTemplateVariable

-- | The <tt>$datadir</tt> path variable
DatadirVar :: PathTemplateVariable

-- | The <tt>$datasubdir</tt> path variable
DatasubdirVar :: PathTemplateVariable

-- | The <tt>$docdir</tt> path variable
DocdirVar :: PathTemplateVariable

-- | The <tt>$htmldir</tt> path variable
HtmldirVar :: PathTemplateVariable

-- | The <tt>$pkg</tt> package name path variable
PkgNameVar :: PathTemplateVariable

-- | The <tt>$version</tt> package version path variable
PkgVerVar :: PathTemplateVariable

-- | The <tt>$pkgid</tt> package Id path variable, eg <tt>foo-1.0</tt>
PkgIdVar :: PathTemplateVariable

-- | The <tt>$libname</tt> path variable
LibNameVar :: PathTemplateVariable

-- | The compiler name and version, eg <tt>ghc-6.6.1</tt>
CompilerVar :: PathTemplateVariable

-- | The operating system name, eg <tt>windows</tt> or <tt>linux</tt>
OSVar :: PathTemplateVariable

-- | The CPU architecture name, eg <tt>i386</tt> or <tt>x86_64</tt>
ArchVar :: PathTemplateVariable

-- | The Compiler's ABI identifier, $arch-$os-$compiler-$abitag
AbiVar :: PathTemplateVariable

-- | The optional ABI tag for the compiler
AbiTagVar :: PathTemplateVariable

-- | The executable name; used in shell wrappers
ExecutableNameVar :: PathTemplateVariable

-- | The name of the test suite being run
TestSuiteNameVar :: PathTemplateVariable

-- | The result of the test suite being run, eg <tt>pass</tt>,
°5u<tt>fail</tt>, or <tt>error</tt>.
TestSuiteResultVar :: PathTemplateVariable

-- | The name of the benchmark being run
BenchmarkNameVar :: PathTemplateVariable

-- | An abstract path, possibly containing variables that need to be
°5usubstituted for to get a real <a>FilePath</a>.
data PathTemplate

-- | The location prefix for the <i>copy</i> command.
data CopyDest
NoCopyDest :: CopyDest
CopyTo :: FilePath -> CopyDest

-- | when using the ${pkgroot} as prefix. The CopyToDb will adjust the
°5upaths to be relative to the provided package database when copying /
°5uinstalling.
CopyToDb :: FilePath -> CopyDest

-- | The installation directories in terms of <a>PathTemplate</a>s that
°5ucontain variables.
°5u
°5uThe defaults for most of the directories are relative to each other,
°5uin particular they are all relative to a single prefix. This makes it
°5uconvenient for the user to override the default installation directory
°5uby only having to specify --prefix=... rather than overriding each
°5uindividually. This is done by allowing $-style variables in the dirs.
°5uThese are expanded by textual substitution (see
°5u<a>substPathTemplate</a>).
°5u
°5uA few of these installation directories are split into two components,
°5uthe dir and subdir. The full installation path is formed by combining
°5uthe two together with <tt>/</tt>. The reason for this is compatibility
°5uwith other Unix build systems which also support <tt>--libdir</tt> and
°5u<tt>--datadir</tt>. We would like users to be able to configure
°5u<tt>--libdir=/usr/lib64</tt> for example but because by default we
°5uwant to support installing multiple versions of packages and building
°5uthe same package for multiple compilers we append the libsubdir to
°5uget: <tt>/usr/lib64/$libname/$compiler</tt>.
°5u
°5uAn additional complication is the need to support relocatable packages
°5uon systems which support such things, like Windows.
type InstallDirTemplates = InstallDirs PathTemplate

-- | The directories where we will install files for packages.
°5u
°5uWe have several different directories for different types of files
°5usince many systems have conventions whereby different types of files
°5uin a package are installed in different directories. This is
°5uparticularly the case on Unix style systems.
data InstallDirs dir
InstallDirs :: dir -> dir -> dir -> dir -> dir -> dir -> dir -> dir -> dir -> dir -> dir -> dir -> dir -> dir -> dir -> dir -> InstallDirs dir
[prefix] :: InstallDirs dir -> dir
[bindir] :: InstallDirs dir -> dir
[libdir] :: InstallDirs dir -> dir
[libsubdir] :: InstallDirs dir -> dir
[dynlibdir] :: InstallDirs dir -> dir

-- | foreign libraries
[flibdir] :: InstallDirs dir -> dir
[libexecdir] :: InstallDirs dir -> dir
[libexecsubdir] :: InstallDirs dir -> dir
[includedir] :: InstallDirs dir -> dir
[datadir] :: InstallDirs dir -> dir
[datasubdir] :: InstallDirs dir -> dir
[docdir] :: InstallDirs dir -> dir
[mandir] :: InstallDirs dir -> dir
[htmldir] :: InstallDirs dir -> dir
[haddockdir] :: InstallDirs dir -> dir
[sysconfdir] :: InstallDirs dir -> dir
combineInstallDirs :: (a -> b -> c) -> InstallDirs a -> InstallDirs b -> InstallDirs c
defaultInstallDirs :: CompilerFlavor -> Bool -> Bool -> IO InstallDirTemplates
defaultInstallDirs' :: Bool -> CompilerFlavor -> Bool -> Bool -> IO InstallDirTemplates

-- | Substitute the install dir templates into each other.
°5u
°5uTo prevent cyclic substitutions, only some variables are allowed in
°5uparticular dir templates. If out of scope vars are present, they are
°5unot substituted for. Checking for any remaining unsubstituted vars can
°5ube done as a subsequent operation.
°5u
°5uThe reason it is done this way is so that in
°5u<a>prefixRelativeInstallDirs</a> we can replace <a>prefix</a> with the
°5u<a>PrefixVar</a> and get resulting <a>PathTemplate</a>s that still
°5uhave the <a>PrefixVar</a> in them. Doing this makes it each to check
°5uwhich paths are relative to the $prefix.
substituteInstallDirTemplates :: PathTemplateEnv -> InstallDirTemplates -> InstallDirTemplates

-- | Convert a <a>FilePath</a> to a <a>PathTemplate</a> including any
°5utemplate vars.
toPathTemplate :: FilePath -> PathTemplate

-- | Convert back to a path, any remaining vars are included
fromPathTemplate :: PathTemplate -> FilePath
combinePathTemplate :: PathTemplate -> PathTemplate -> PathTemplate

-- | The initial environment has all the static stuff but no paths
initialPathTemplateEnv :: PackageIdentifier -> UnitId -> CompilerInfo -> Platform -> PathTemplateEnv
packageTemplateEnv :: PackageIdentifier -> UnitId -> PathTemplateEnv
compilerTemplateEnv :: CompilerInfo -> PathTemplateEnv
platformTemplateEnv :: Platform -> PathTemplateEnv
abiTemplateEnv :: CompilerInfo -> Platform -> PathTemplateEnv
installDirsTemplateEnv :: InstallDirs PathTemplate -> PathTemplateEnv

-- | Backwards compatibility function which computes the InstallDirs
°5uassuming that <tt>$libname</tt> points to the public library (or some
°5ufake package identifier if there is no public library.) IF AT ALL
°5uPOSSIBLE, please use <a>absoluteComponentInstallDirs</a> instead.
absoluteInstallDirs :: PackageDescription -> LocalBuildInfo -> CopyDest -> InstallDirs FilePath

-- | Backwards compatibility function which computes the InstallDirs
°5uassuming that <tt>$libname</tt> points to the public library (or some
°5ufake package identifier if there is no public library.) IF AT ALL
°5uPOSSIBLE, please use <a>prefixRelativeComponentInstallDirs</a>
°5uinstead.
prefixRelativeInstallDirs :: PackageId -> LocalBuildInfo -> InstallDirs (Maybe FilePath)

-- | See <a>absoluteInstallDirs</a>.
absoluteComponentInstallDirs :: PackageDescription -> LocalBuildInfo -> UnitId -> CopyDest -> InstallDirs FilePath

-- | See <a>prefixRelativeInstallDirs</a>
prefixRelativeComponentInstallDirs :: PackageId -> LocalBuildInfo -> UnitId -> InstallDirs (Maybe FilePath)
substPathTemplate :: PackageId -> LocalBuildInfo -> UnitId -> PathTemplate -> FilePath

module Distribution.Simple.Test.Log

-- | Logs all test results for a package, broken down first by test suite
°5uand then by test case.
data PackageLog
PackageLog :: PackageId -> CompilerId -> Platform -> [TestSuiteLog] -> PackageLog
[package] :: PackageLog -> PackageId
[compiler] :: PackageLog -> CompilerId
[platform] :: PackageLog -> Platform
[testSuites] :: PackageLog -> [TestSuiteLog]
data TestLogs
TestLog :: String -> Options -> Result -> TestLogs
[testName] :: TestLogs -> String
[testOptionsReturned] :: TestLogs -> Options
[testResult] :: TestLogs -> Result
GroupLogs :: String -> [TestLogs] -> TestLogs

-- | Logs test suite results, itemized by test case.
data TestSuiteLog
TestSuiteLog :: UnqualComponentName -> TestLogs -> FilePath -> TestSuiteLog
[testSuiteName] :: TestSuiteLog -> UnqualComponentName
[testLogs] :: TestSuiteLog -> TestLogs
[logFile] :: TestSuiteLog -> FilePath

-- | Count the number of pass, fail, and error test results in a
°5u<a>TestLogs</a> tree.
countTestResults :: TestLogs -> (Int, Int, Int)

-- | A <a>PackageLog</a> with package and platform information specified.
localPackageLog :: PackageDescription -> LocalBuildInfo -> PackageLog

-- | Print a summary to the console after all test suites have been run
°5uindicating the number of successful test suites and cases. Returns
°5u<a>True</a> if all test suites passed and <a>False</a> otherwise.
summarizePackage :: Verbosity -> PackageLog -> IO Bool

-- | Print a summary of the test suite's results on the console,
°5usuppressing output for certain verbosity or test filter levels.
summarizeSuiteFinish :: TestSuiteLog -> String
summarizeSuiteStart :: String -> String

-- | Print a summary of a single test case's result to the console,
°5usupressing output for certain verbosity or test filter levels.
summarizeTest :: Verbosity -> TestShowDetails -> TestLogs -> IO ()

-- | From a <a>TestSuiteLog</a>, determine if the test suite encountered
°5uerrors.
suiteError :: TestLogs -> Bool

-- | From a <a>TestSuiteLog</a>, determine if the test suite failed.
suiteFailed :: TestLogs -> Bool

-- | From a <a>TestSuiteLog</a>, determine if the test suite passed.
suitePassed :: TestLogs -> Bool
testSuiteLogPath :: PathTemplate -> PackageDescription -> LocalBuildInfo -> String -> TestLogs -> FilePath
instance GHC.Classes.Eq Distribution.Simple.Test.Log.PackageLog
instance GHC.Show.Show Distribution.Simple.Test.Log.PackageLog
instance GHC.Read.Read Distribution.Simple.Test.Log.PackageLog
instance GHC.Classes.Eq Distribution.Simple.Test.Log.TestSuiteLog
instance GHC.Show.Show Distribution.Simple.Test.Log.TestSuiteLog
instance GHC.Read.Read Distribution.Simple.Test.Log.TestSuiteLog
instance GHC.Classes.Eq Distribution.Simple.Test.Log.TestLogs
instance GHC.Show.Show Distribution.Simple.Test.Log.TestLogs
instance GHC.Read.Read Distribution.Simple.Test.Log.TestLogs


-- | This module provides an library interface to the <tt>ld</tt> linker
°5uprogram.
module Distribution.Simple.Program.Ld

-- | Call <tt>ld -r</tt> to link a bunch of object files together.
combineObjectFiles :: Verbosity -> LocalBuildInfo -> ConfiguredProgram -> FilePath -> [FilePath] -> IO ()


-- | This module provides an library interface to the <tt>ar</tt> program.
module Distribution.Simple.Program.Ar

-- | Call <tt>ar</tt> to create a library archive from a bunch of object
°5ufiles.
createArLibArchive :: Verbosity -> LocalBuildInfo -> FilePath -> [FilePath] -> IO ()

-- | Like the unix xargs program. Useful for when we've got very long
°5ucommand lines that might overflow an OS limit on command line length
°5uand so you need to invoke a command multiple times to get all the args
°5uin.
°5u
°5uIt takes four template invocations corresponding to the simple,
°5uinitial, middle and last invocations. If the number of args given is
°5usmall enough that we can get away with just a single invocation then
°5uthe simple one is used:
°5u
°5u<pre>
°5u$ simple args
°5u</pre>
°5u
°5uIf the number of args given means that we need to use multiple
°5uinvocations then the templates for the initial, middle and last
°5uinvocations are used:
°5u
°5u<pre>
°5u$ initial args_0
°5u$ middle  args_1
°5u$ middle  args_2
°5u  ...
°5u$ final   args_n
°5u</pre>
multiStageProgramInvocation :: ProgramInvocation -> (ProgramInvocation, ProgramInvocation, ProgramInvocation) -> [String] -> [ProgramInvocation]


-- | This module provides functions for locating various HPC-related paths
°5uand a function for adding the necessary options to a
°5uPackageDescription to build test suites with HPC enabled.
module Distribution.Simple.Hpc
data Way
Vanilla :: Way
Prof :: Way
Dyn :: Way

-- | Attempt to guess the way the test suites in this package were compiled
°5uand linked with the library so the correct module interfaces are
°5ufound.
guessWay :: LocalBuildInfo -> Way
htmlDir :: FilePath -> Way -> FilePath -> FilePath
mixDir :: FilePath -> Way -> FilePath -> FilePath
tixDir :: FilePath -> Way -> FilePath -> FilePath

-- | Path to the .tix file containing a test suite's sum statistics.
tixFilePath :: FilePath -> Way -> FilePath -> FilePath

-- | Generate the HTML markup for all of a package's test suites.
markupPackage :: Verbosity -> LocalBuildInfo -> FilePath -> String -> [TestSuite] -> IO ()

-- | Generate the HTML markup for a test suite.
markupTest :: Verbosity -> LocalBuildInfo -> FilePath -> String -> TestSuite -> IO ()
instance GHC.Show.Show Distribution.Simple.Hpc.Way
instance GHC.Read.Read Distribution.Simple.Hpc.Way
instance GHC.Classes.Eq Distribution.Simple.Hpc.Way
instance GHC.Enum.Enum Distribution.Simple.Hpc.Way
instance GHC.Enum.Bounded Distribution.Simple.Hpc.Way


-- | Handling for user-specified build targets
module Distribution.Simple.BuildTarget

-- | Take a list of <a>String</a> build targets, and parse and validate
°5uthem into actual <a>TargetInfo</a>s to be
°5ubuilt<i>registered</i>whatever.
readTargetInfos :: Verbosity -> PackageDescription -> LocalBuildInfo -> [String] -> IO [TargetInfo]

-- | Read a list of user-supplied build target strings and resolve them to
°5u<a>BuildTarget</a>s according to a <a>PackageDescription</a>. If there
°5uare problems with any of the targets e.g. they don't exist or are
°5umisformatted, throw an <tt>IOException</tt>.
readBuildTargets :: Verbosity -> PackageDescription -> [String] -> IO [BuildTarget]

-- | A fully resolved build target.
data BuildTarget

-- | A specific component
BuildTargetComponent :: ComponentName -> BuildTarget

-- | A specific module within a specific component.
BuildTargetModule :: ComponentName -> ModuleName -> BuildTarget

-- | A specific file within a specific component.
BuildTargetFile :: ComponentName -> FilePath -> BuildTarget

-- | Unambiguously render a <a>BuildTarget</a>, so that it can be parsed in
°5uall situations.
showBuildTarget :: PackageId -> BuildTarget -> String
data QualLevel
QL1 :: QualLevel
QL2 :: QualLevel
QL3 :: QualLevel
buildTargetComponentName :: BuildTarget -> ComponentName

-- | Various ways that a user may specify a build target.
data UserBuildTarget
readUserBuildTargets :: [String] -> ([UserBuildTargetProblem], [UserBuildTarget])
showUserBuildTarget :: UserBuildTarget -> String
data UserBuildTargetProblem
UserBuildTargetUnrecognised :: String -> UserBuildTargetProblem
reportUserBuildTargetProblems :: Verbosity -> [UserBuildTargetProblem] -> IO ()

-- | Given a bunch of user-specified targets, try to resolve what it is
°5uthey refer to.
resolveBuildTargets :: PackageDescription -> [(UserBuildTarget, Bool)] -> ([BuildTargetProblem], [BuildTarget])
data BuildTargetProblem

-- | <ul>
°5u<li><i>expected thing</i> (actually got)</li>
°5u</ul>
BuildTargetExpected :: UserBuildTarget -> [String] -> String -> BuildTargetProblem

-- | <ul>
°5u<li><i>(no such thing, actually got)</i></li>
°5u</ul>
BuildTargetNoSuch :: UserBuildTarget -> [(String, String)] -> BuildTargetProblem
BuildTargetAmbiguous :: UserBuildTarget -> [(UserBuildTarget, BuildTarget)] -> BuildTargetProblem
reportBuildTargetProblems :: Verbosity -> [BuildTargetProblem] -> IO ()
instance GHC.Show.Show a => GHC.Show.Show (Distribution.Simple.BuildTarget.MaybeAmbiguous a)
instance GHC.Show.Show a => GHC.Show.Show (Distribution.Simple.BuildTarget.Match a)
instance GHC.Classes.Eq Distribution.Simple.BuildTarget.MatchError
instance GHC.Show.Show Distribution.Simple.BuildTarget.MatchError
instance GHC.Show.Show Distribution.Simple.BuildTarget.ComponentKind
instance GHC.Classes.Ord Distribution.Simple.BuildTarget.ComponentKind
instance GHC.Classes.Eq Distribution.Simple.BuildTarget.ComponentKind
instance GHC.Show.Show Distribution.Simple.BuildTarget.QualLevel
instance GHC.Enum.Enum Distribution.Simple.BuildTarget.QualLevel
instance GHC.Show.Show Distribution.Simple.BuildTarget.BuildTargetProblem
instance GHC.Show.Show Distribution.Simple.BuildTarget.UserBuildTargetProblem
instance GHC.Generics.Generic Distribution.Simple.BuildTarget.BuildTarget
instance GHC.Show.Show Distribution.Simple.BuildTarget.BuildTarget
instance GHC.Classes.Eq Distribution.Simple.BuildTarget.BuildTarget
instance GHC.Classes.Ord Distribution.Simple.BuildTarget.UserBuildTarget
instance GHC.Classes.Eq Distribution.Simple.BuildTarget.UserBuildTarget
instance GHC.Show.Show Distribution.Simple.BuildTarget.UserBuildTarget
instance GHC.Base.Alternative Distribution.Simple.BuildTarget.Match
instance GHC.Base.MonadPlus Distribution.Simple.BuildTarget.Match
instance GHC.Base.Functor Distribution.Simple.BuildTarget.Match
instance GHC.Base.Applicative Distribution.Simple.BuildTarget.Match
instance GHC.Base.Monad Distribution.Simple.BuildTarget.Match
instance Data.Binary.Class.Binary Distribution.Simple.BuildTarget.BuildTarget


-- | A bunch of dirs, paths and file names used for intermediate build
°5usteps.
module Distribution.Simple.BuildPaths
defaultDistPref :: FilePath
srcPref :: FilePath -> FilePath

-- | This is the name of the directory in which the generated haddocks
°5ushould be stored. It does not include the
°5u<tt><a>dist</a><i>doc</i>html</tt> prefix.
haddockDirName :: HaddockTarget -> PackageDescription -> FilePath
hscolourPref :: HaddockTarget -> FilePath -> PackageDescription -> FilePath

-- | The directory to which generated haddock documentation should be
°5uwritten.
haddockPref :: HaddockTarget -> FilePath -> PackageDescription -> FilePath

-- | The directory in which we put auto-generated modules for EVERY
°5ucomponent in the package. See deprecation notice.

-- | <i>Deprecated: If you can, use <a>autogenComponentModulesDir</a>
°5uinstead, but if you really wanted package-global generated modules,
°5uuse <a>autogenPackageModulesDir</a>. In Cabal 2.0, we avoid using
°5uautogenerated files which apply to all components, because the
°5uinformation you often want in these files, e.g., dependency
°5uinformation, is best specified per component, so that reconfiguring a
°5udifferent component (e.g., enabling tests) doesn't force the entire to
°5ube rebuilt. <a>autogenPackageModulesDir</a> still provides a place to
°5uput files you want to apply to the entire package, but most users of
°5u<a>autogenModulesDir</a> should seriously consider
°5u<a>autogenComponentModulesDir</a> if you really wanted the module to
°5uapply to one component.</i>
autogenModulesDir :: LocalBuildInfo -> String

-- | The directory in which we put auto-generated modules for EVERY
°5ucomponent in the package.
autogenPackageModulesDir :: LocalBuildInfo -> String

-- | The directory in which we put auto-generated modules for a particular
°5ucomponent.
autogenComponentModulesDir :: LocalBuildInfo -> ComponentLocalBuildInfo -> String

-- | The name of the auto-generated module associated with a package

-- | <i>Deprecated: Use autogenPathsModuleName instead</i>
autogenModuleName :: PackageDescription -> ModuleName

-- | The name of the auto-generated Paths_* module associated with a
°5upackage
autogenPathsModuleName :: PackageDescription -> ModuleName
cppHeaderName :: String
haddockName :: PackageDescription -> FilePath

-- | Create a library name for a static library from a given name. Prepends
°5u<tt>lib</tt> and appends the static library extension ('.a').
mkGenericStaticLibName :: String -> String
mkLibName :: UnitId -> String
mkProfLibName :: UnitId -> String

-- | Create a library name for a shared lirbary from a given name. Prepends
°5u<tt>lib</tt> and appends the
°5u'-&lt;compilerFlavour&gt;&lt;compilerVersion&gt;' as well as the
°5ushared library extension.
mkGenericSharedLibName :: CompilerId -> String -> String
mkSharedLibName :: CompilerId -> UnitId -> String
mkStaticLibName :: CompilerId -> UnitId -> String

-- | Default extension for executable files on the current platform.
°5u(typically <tt>""</tt> on Unix and <tt>"exe"</tt> on Windows or OS/2)
exeExtension :: String

-- | Extension for object files. For GHC the extension is <tt>"o"</tt>.
objExtension :: String

-- | Extension for dynamically linked (or shared) libraries (typically
°5u<tt>"so"</tt> on Unix and <tt>"dll"</tt> on Windows)
dllExtension :: String

-- | Extension for static libraries
°5u
°5uTODO: Here, as well as in dllExtension, it's really the target OS that
°5uwe're interested in, not the build OS.
staticLibExtension :: String
getSourceFiles :: Verbosity -> [FilePath] -> [ModuleName] -> IO [(ModuleName, FilePath)]
getLibSourceFiles :: Verbosity -> LocalBuildInfo -> Library -> ComponentLocalBuildInfo -> IO [(ModuleName, FilePath)]
getExeSourceFiles :: Verbosity -> LocalBuildInfo -> Executable -> ComponentLocalBuildInfo -> IO [(ModuleName, FilePath)]
getFLibSourceFiles :: Verbosity -> LocalBuildInfo -> ForeignLib -> ComponentLocalBuildInfo -> IO [(ModuleName, FilePath)]

-- | The directory where we put build results for an executable
exeBuildDir :: LocalBuildInfo -> Executable -> FilePath

-- | The directory where we put build results for a foreign library
flibBuildDir :: LocalBuildInfo -> ForeignLib -> FilePath


-- | This module contains most of the UHC-specific code for configuring,
°5ubuilding and installing packages.
°5u
°5uThanks to the authors of the other implementation-specific files, in
°5uparticular to Isaac Jones, Duncan Coutts and Henning Thielemann, for
°5uinspiration on how to design this module.
module Distribution.Simple.UHC
configure :: Verbosity -> Maybe FilePath -> Maybe FilePath -> ProgramDb -> IO (Compiler, Maybe Platform, ProgramDb)
getInstalledPackages :: Verbosity -> Compiler -> PackageDBStack -> ProgramDb -> IO InstalledPackageIndex
buildLib :: Verbosity -> PackageDescription -> LocalBuildInfo -> Library -> ComponentLocalBuildInfo -> IO ()
buildExe :: Verbosity -> PackageDescription -> LocalBuildInfo -> Executable -> ComponentLocalBuildInfo -> IO ()
installLib :: Verbosity -> LocalBuildInfo -> FilePath -> FilePath -> FilePath -> PackageDescription -> Library -> ComponentLocalBuildInfo -> IO ()
registerPackage :: Verbosity -> Compiler -> ProgramDb -> PackageDBStack -> InstalledPackageInfo -> IO ()
inplacePackageDbPath :: LocalBuildInfo -> FilePath


-- | This has code for checking for various problems in packages. There is
°5uone set of checks that just looks at a <a>PackageDescription</a> in
°5uisolation and another set of checks that also looks at files in the
°5upackage. Some of the checks are basic sanity checks, others are
°5uportability standards that we'd like to encourage. There is a
°5u<a>PackageCheck</a> type that distinguishes the different kinds of
°5ucheck so we can see which ones are appropriate to report in different
°5usituations. This code gets uses when configuring a package when we
°5uconsider only basic problems. The higher standard is uses when when
°5upreparing a source tarball and by Hackage when uploading new packages.
°5uThe reason for this is that we want to hold packages that are expected
°5uto be distributed to a higher standard than packages that are only
°5uever expected to be used on the author's own environment.
module Distribution.PackageDescription.Check

-- | Results of some kind of failed package check.
°5u
°5uThere are a range of severities, from merely dubious to totally
°5uinsane. All of them come with a human readable explanation. In future
°5uwe may augment them with more machine readable explanations, for
°5uexample to help an IDE suggest automatic corrections.
data PackageCheck

-- | This package description is no good. There's no way it's going to
°5ubuild sensibly. This should give an error at configure time.
PackageBuildImpossible :: String -> PackageCheck
[explanation] :: PackageCheck -> String

-- | A problem that is likely to affect building the package, or an issue
°5uthat we'd like every package author to be aware of, even if the
°5upackage is never distributed.
PackageBuildWarning :: String -> PackageCheck
[explanation] :: PackageCheck -> String

-- | An issue that might not be a problem for the package author but might
°5ube annoying or detrimental when the package is distributed to users.
°5uWe should encourage distributed packages to be free from these issues,
°5ubut occasionally there are justifiable reasons so we cannot ban them
°5uentirely.
PackageDistSuspicious :: String -> PackageCheck
[explanation] :: PackageCheck -> String

-- | Like PackageDistSuspicious but will only display warnings rather than
°5ucausing abnormal exit when you run 'cabal check'.
PackageDistSuspiciousWarn :: String -> PackageCheck
[explanation] :: PackageCheck -> String

-- | An issue that is OK in the author's environment but is almost certain
°5uto be a portability problem for other environments. We can quite
°5ulegitimately refuse to publicly distribute packages with these
°5uproblems.
PackageDistInexcusable :: String -> PackageCheck
[explanation] :: PackageCheck -> String

-- | Check for common mistakes and problems in package descriptions.
°5u
°5uThis is the standard collection of checks covering all aspects except
°5ufor checks that require looking at files within the package. For those
°5usee <a>checkPackageFiles</a>.
°5u
°5uIt requires the <a>GenericPackageDescription</a> and optionally a
°5uparticular configuration of that package. If you pass <a>Nothing</a>
°5uthen we just check a version of the generic description using
°5u<a>flattenPackageDescription</a>.
checkPackage :: GenericPackageDescription -> Maybe PackageDescription -> [PackageCheck]
checkConfiguredPackage :: PackageDescription -> [PackageCheck]

-- | Sanity check things that requires IO. It looks at the files in the
°5upackage and expects to find the package unpacked in at the given file
°5upath.
checkPackageFiles :: PackageDescription -> FilePath -> NoCallStackIO [PackageCheck]

-- | Sanity check things that requires looking at files in the package.
°5uThis is a generalised version of <a>checkPackageFiles</a> that can
°5uwork in any monad for which you can provide
°5u<a>CheckPackageContentOps</a> operations.
°5u
°5uThe point of this extra generality is to allow doing checks in some
°5uvirtual file system, for example a tarball in memory.
checkPackageContent :: Monad m => CheckPackageContentOps m -> PackageDescription -> m [PackageCheck]

-- | A record of operations needed to check the contents of packages. Used
°5uby <a>checkPackageContent</a>.
data CheckPackageContentOps m
CheckPackageContentOps :: FilePath -> m Bool -> FilePath -> m Bool -> FilePath -> m [FilePath] -> FilePath -> m ByteString -> CheckPackageContentOps m
[doesFileExist] :: CheckPackageContentOps m -> FilePath -> m Bool
[doesDirectoryExist] :: CheckPackageContentOps m -> FilePath -> m Bool
[getDirectoryContents] :: CheckPackageContentOps m -> FilePath -> m [FilePath]
[getFileContents] :: CheckPackageContentOps m -> FilePath -> m ByteString

-- | Check the names of all files in a package for portability problems.
°5uThis should be done for example when creating or validating a package
°5utarball.
checkPackageFileNames :: [FilePath] -> [PackageCheck]
instance GHC.Classes.Eq Distribution.PackageDescription.Check.PackageCheck
instance GHC.Show.Show Distribution.PackageDescription.Check.PackageCheck


-- | Generating the Paths_pkgname module.
°5u
°5uThis is a module that Cabal generates for the benefit of packages. It
°5uenables them to find their version number and find any installed data
°5ufiles at runtime. This code should probably be split off into another
°5umodule.
module Distribution.Simple.Build.PathsModule
generate :: PackageDescription -> LocalBuildInfo -> ComponentLocalBuildInfo -> String

-- | Generates the name of the environment variable controlling the path
°5ucomponent of interest.
°5u
°5uNote: The format of these strings is part of Cabal's public API;
°5uchanging this function constitutes a *backwards-compatibility* break.
pkgPathEnvVar :: PackageDescription -> String -> String

module Distribution.Simple.Test.LibV09
runTest :: PackageDescription -> LocalBuildInfo -> ComponentLocalBuildInfo -> TestFlags -> TestSuite -> IO TestSuiteLog

-- | Source code for library test suite stub executable
simpleTestStub :: ModuleName -> String

-- | The filename of the source file for the stub executable associated
°5uwith a library <tt>TestSuite</tt>.
stubFilePath :: TestSuite -> FilePath

-- | Main function for test stubs. Once, it was written directly into the
°5ustub, but minimizing the amount of code actually in the stub maximizes
°5uthe number of detectable errors when Cabal is compiled.
stubMain :: IO [Test] -> IO ()

-- | The name of the stub executable associated with a library
°5u<tt>TestSuite</tt>.
stubName :: TestSuite -> FilePath

-- | From a test stub, write the <a>TestSuiteLog</a> to temporary file for
°5uthe calling Cabal process to read.
stubWriteLog :: FilePath -> UnqualComponentName -> TestLogs -> NoCallStackIO ()

-- | Write the source file for a library <tt>TestSuite</tt> stub
°5uexecutable.
writeSimpleTestStub :: TestSuite -> FilePath -> NoCallStackIO ()

module Distribution.Simple.Test.ExeV10
runTest :: PackageDescription -> LocalBuildInfo -> ComponentLocalBuildInfo -> TestFlags -> TestSuite -> IO TestSuiteLog


-- | Generate cabal_macros.h - CPP macros for package version testing
°5u
°5uWhen using CPP you get
°5u
°5u<pre>
°5uVERSION_&lt;package&gt;
°5uMIN_VERSION_&lt;package&gt;(A,B,C)
°5u</pre>
°5u
°5ufor each <i>package</i> in <tt>build-depends</tt>, which is true if
°5uthe version of <i>package</i> in use is <tt>&gt;= A.B.C</tt>, using
°5uthe normal ordering on version numbers.
°5u
°5uTODO Figure out what to do about backpack and internal libraries. It
°5uis very suspecious that this stuff works with munged package
°5uidentifiers
module Distribution.Simple.Build.Macros

-- | The contents of the <tt>cabal_macros.h</tt> for the given configured
°5upackage.
generate :: PackageDescription -> LocalBuildInfo -> ComponentLocalBuildInfo -> String

-- | Helper function that generates just the <tt>VERSION_pkg</tt> and
°5u<tt>MIN_VERSION_pkg</tt> macros for a list of package ids (usually
°5uused with the specific deps of a configured package).
generatePackageVersionMacros :: [PackageId] -> String


-- | See
°5u<a>https://github.com/ezyang/ghc-proposals/blob/backpack/proposals/0000-backpack.rst</a>
module Distribution.Backpack.ConfiguredComponent

-- | A configured component, we know exactly what its <a>ComponentId</a>
°5uis, and the <a>ComponentId</a>s of the things it depends on.
data ConfiguredComponent
ConfiguredComponent :: AnnotatedId ComponentId -> Component -> Bool -> [AnnotatedId ComponentId] -> [ComponentInclude ComponentId IncludeRenaming] -> ConfiguredComponent

-- | Unique identifier of component, plus extra useful info.
[cc_ann_id] :: ConfiguredComponent -> AnnotatedId ComponentId

-- | The fragment of syntax from the Cabal file describing this component.
[cc_component] :: ConfiguredComponent -> Component

-- | Is this the public library component of the package? (If we invoke
°5uSetup with an instantiation, this is the component the instantiation
°5uapplies to.) Note that in one-component configure mode, this is always
°5uTrue, because any component is the "public" one.)
[cc_public] :: ConfiguredComponent -> Bool

-- | Dependencies on executables from <tt>build-tools</tt> and
°5u<tt>build-tool-depends</tt>.
[cc_exe_deps] :: ConfiguredComponent -> [AnnotatedId ComponentId]

-- | The mixins of this package, including both explicit (from the
°5u<tt>mixins</tt> field) and implicit (from <tt>build-depends</tt>). Not
°5umix-in linked yet; component configuration only looks at
°5u<a>ComponentId</a>s.
[cc_includes] :: ConfiguredComponent -> [ComponentInclude ComponentId IncludeRenaming]

-- | The <a>ComponentName</a> of a component; this uniquely identifies a
°5ufragment of syntax within a specified Cabal file describing the
°5ucomponent.
cc_name :: ConfiguredComponent -> ComponentName

-- | Uniquely identifies a configured component.
cc_cid :: ConfiguredComponent -> ComponentId

-- | The package this component came from.
cc_pkgid :: ConfiguredComponent -> PackageId
toConfiguredComponent :: PackageDescription -> ComponentId -> ConfiguredComponentMap -> Component -> LogProgress ConfiguredComponent
toConfiguredComponents :: Bool -> FlagAssignment -> Bool -> Flag String -> Flag ComponentId -> PackageDescription -> ConfiguredComponentMap -> [Component] -> LogProgress [ConfiguredComponent]

-- | Pretty-print a <a>ConfiguredComponent</a>.
dispConfiguredComponent :: ConfiguredComponent -> Doc
type ConfiguredComponentMap = Map PackageName (Map ComponentName (AnnotatedId ComponentId))
extendConfiguredComponentMap :: ConfiguredComponent -> ConfiguredComponentMap -> ConfiguredComponentMap
newPackageDepsBehaviour :: PackageDescription -> Bool


-- | See
°5u<a>https://github.com/ezyang/ghc-proposals/blob/backpack/proposals/0000-backpack.rst</a>
module Distribution.Backpack.ComponentsGraph

-- | A graph of source-level components by their source-level dependencies
type ComponentsGraph = Graph (Node ComponentName Component)

-- | A list of components associated with the source level dependencies
°5ubetween them.
type ComponentsWithDeps = [(Component, [ComponentName])]

-- | Create a <a>Graph</a> of <a>Component</a>, or report a cycle if there
°5uis a problem.
mkComponentsGraph :: ComponentRequestedSpec -> PackageDescription -> Either [ComponentName] ComponentsGraph

-- | Given the package description and a <a>PackageDescription</a> (used to
°5udetermine if a package name is internal or not), sort the components
°5uin dependency order (fewest dependencies first). This is NOT
°5unecessarily the build order (although it is in the absence of
°5uBackpack.)
componentsGraphToList :: ComponentsGraph -> ComponentsWithDeps

-- | Pretty-print <a>ComponentsWithDeps</a>.
dispComponentsWithDeps :: ComponentsWithDeps -> Doc

-- | Error message when there is a cycle; takes the SCC of components.
componentCycleMsg :: [ComponentName] -> Doc


-- | This is a fairly large module. It contains most of the GHC-specific
°5ucode for configuring, building and installing packages. It also
°5uexports a function for finding out what packages are already
°5uinstalled. Configuring involves finding the <tt>ghc</tt> and
°5u<tt>ghc-pkg</tt> programs, finding what language extensions this
°5uversion of ghc supports and returning a <a>Compiler</a> value.
°5u
°5u<a>getInstalledPackages</a> involves calling the <tt>ghc-pkg</tt>
°5uprogram to find out what packages are installed.
°5u
°5uBuilding is somewhat complex as there is quite a bit of information to
°5utake into account. We have to build libs and programs, possibly for
°5uprofiling and shared libs. We have to support building libraries that
°5uwill be usable by GHCi and also ghc's <tt>-split-objs</tt> feature. We
°5uhave to compile any C files using ghc. Linking, especially for
°5u<tt>split-objs</tt> is remarkably complex, partly because there tend
°5uto be 1,000's of <tt>.o</tt> files and this can often be more than we
°5ucan pass to the <tt>ld</tt> or <tt>ar</tt> programs in one go.
°5u
°5uInstalling for libs and exes involves finding the right files and
°5ucopying them to the right places. One of the more tricky things about
°5uthis module is remembering the layout of files in the build directory
°5u(which is not explicitly documented) and thus what search dirs are
°5uused for various kinds of files.
module Distribution.Simple.LHC
configure :: Verbosity -> Maybe FilePath -> Maybe FilePath -> ProgramDb -> IO (Compiler, Maybe Platform, ProgramDb)
getInstalledPackages :: Verbosity -> PackageDBStack -> ProgramDb -> IO InstalledPackageIndex

-- | Build a library with LHC.
buildLib :: Verbosity -> PackageDescription -> LocalBuildInfo -> Library -> ComponentLocalBuildInfo -> IO ()

-- | Build an executable with LHC.
buildExe :: Verbosity -> PackageDescription -> LocalBuildInfo -> Executable -> ComponentLocalBuildInfo -> IO ()

-- | Install for ghc, .hi, .a and, if --with-ghci given, .o
installLib :: Verbosity -> LocalBuildInfo -> FilePath -> FilePath -> FilePath -> PackageDescription -> Library -> ComponentLocalBuildInfo -> IO ()

-- | Install executables for GHC.
installExe :: Verbosity -> LocalBuildInfo -> FilePath -> FilePath -> (FilePath, FilePath) -> PackageDescription -> Executable -> IO ()
registerPackage :: Verbosity -> ProgramDb -> PackageDBStack -> InstalledPackageInfo -> RegisterOptions -> IO ()
hcPkgInfo :: ProgramDb -> HcPkgInfo
ghcOptions :: LocalBuildInfo -> BuildInfo -> ComponentLocalBuildInfo -> FilePath -> [String]
ghcVerbosityOptions :: Verbosity -> [String]


-- | This module contains most of the JHC-specific code for configuring,
°5ubuilding and installing packages.
module Distribution.Simple.JHC
configure :: Verbosity -> Maybe FilePath -> Maybe FilePath -> ProgramDb -> IO (Compiler, Maybe Platform, ProgramDb)
getInstalledPackages :: Verbosity -> PackageDBStack -> ProgramDb -> IO InstalledPackageIndex

-- | Building a package for JHC. Currently C source files are not
°5usupported.
buildLib :: Verbosity -> PackageDescription -> LocalBuildInfo -> Library -> ComponentLocalBuildInfo -> IO ()

-- | Building an executable for JHC. Currently C source files are not
°5usupported.
buildExe :: Verbosity -> PackageDescription -> LocalBuildInfo -> Executable -> ComponentLocalBuildInfo -> IO ()
installLib :: Verbosity -> LocalBuildInfo -> FilePath -> FilePath -> FilePath -> PackageDescription -> Library -> ComponentLocalBuildInfo -> IO ()
installExe :: Verbosity -> FilePath -> FilePath -> (FilePath, FilePath) -> PackageDescription -> Executable -> IO ()

module Distribution.Simple.HaskellSuite
configure :: Verbosity -> Maybe FilePath -> Maybe FilePath -> ProgramDb -> IO (Compiler, Maybe Platform, ProgramDb)
hstoolVersion :: Verbosity -> FilePath -> IO (Maybe Version)
numericVersion :: Verbosity -> FilePath -> IO (Maybe Version)
getCompilerVersion :: Verbosity -> ConfiguredProgram -> IO (String, Version)
getExtensions :: Verbosity -> ConfiguredProgram -> IO [(Extension, Maybe Flag)]
getLanguages :: Verbosity -> ConfiguredProgram -> IO [(Language, Flag)]
getInstalledPackages :: Verbosity -> PackageDBStack -> ProgramDb -> IO InstalledPackageIndex
buildLib :: Verbosity -> PackageDescription -> LocalBuildInfo -> Library -> ComponentLocalBuildInfo -> IO ()
installLib :: Verbosity -> LocalBuildInfo -> FilePath -> FilePath -> FilePath -> PackageDescription -> Library -> ComponentLocalBuildInfo -> IO ()
registerPackage :: Verbosity -> ProgramDb -> PackageDBStack -> InstalledPackageInfo -> IO ()
initPackageDB :: Verbosity -> ProgramDb -> FilePath -> IO ()
packageDbOpt :: PackageDB -> String

module Distribution.Simple.GHCJS
configure :: Verbosity -> Maybe FilePath -> Maybe FilePath -> ProgramDb -> IO (Compiler, Maybe Platform, ProgramDb)

-- | Given a package DB stack, return all installed packages.
getInstalledPackages :: Verbosity -> PackageDBStack -> ProgramDb -> IO InstalledPackageIndex

-- | Given a single package DB, return all installed packages.
getPackageDBContents :: Verbosity -> PackageDB -> ProgramDb -> IO InstalledPackageIndex
buildLib :: Verbosity -> Flag (Maybe Int) -> PackageDescription -> LocalBuildInfo -> Library -> ComponentLocalBuildInfo -> IO ()
buildExe :: Verbosity -> Flag (Maybe Int) -> PackageDescription -> LocalBuildInfo -> Executable -> ComponentLocalBuildInfo -> IO ()
replLib :: Verbosity -> Flag (Maybe Int) -> PackageDescription -> LocalBuildInfo -> Library -> ComponentLocalBuildInfo -> IO ()
replExe :: Verbosity -> Flag (Maybe Int) -> PackageDescription -> LocalBuildInfo -> Executable -> ComponentLocalBuildInfo -> IO ()

-- | Start a REPL without loading any source files.
startInterpreter :: Verbosity -> ProgramDb -> Compiler -> Platform -> PackageDBStack -> IO ()

-- | Install for ghc, .hi, .a and, if --with-ghci given, .o
installLib :: Verbosity -> LocalBuildInfo -> FilePath -> FilePath -> FilePath -> PackageDescription -> Library -> ComponentLocalBuildInfo -> IO ()
installExe :: Verbosity -> LocalBuildInfo -> FilePath -> FilePath -> (FilePath, FilePath) -> PackageDescription -> Executable -> IO ()
libAbiHash :: Verbosity -> PackageDescription -> LocalBuildInfo -> Library -> ComponentLocalBuildInfo -> IO String
hcPkgInfo :: ProgramDb -> HcPkgInfo
registerPackage :: Verbosity -> ProgramDb -> PackageDBStack -> InstalledPackageInfo -> RegisterOptions -> IO ()
componentGhcOptions :: Verbosity -> LocalBuildInfo -> BuildInfo -> ComponentLocalBuildInfo -> FilePath -> GhcOptions
getLibDir :: Verbosity -> LocalBuildInfo -> IO FilePath
isDynamic :: Compiler -> Bool

-- | Return the <a>FilePath</a> to the global GHC package database.
getGlobalPackageDB :: Verbosity -> ConfiguredProgram -> IO FilePath

-- | Get the JavaScript file name and command and arguments to run a
°5uprogram compiled by GHCJS the exe should be the base program name
°5uwithout exe extension
runCmd :: ProgramDb -> FilePath -> (FilePath, FilePath, [String])


-- | This is a fairly large module. It contains most of the GHC-specific
°5ucode for configuring, building and installing packages. It also
°5uexports a function for finding out what packages are already
°5uinstalled. Configuring involves finding the <tt>ghc</tt> and
°5u<tt>ghc-pkg</tt> programs, finding what language extensions this
°5uversion of ghc supports and returning a <a>Compiler</a> value.
°5u
°5u<a>getInstalledPackages</a> involves calling the <tt>ghc-pkg</tt>
°5uprogram to find out what packages are installed.
°5u
°5uBuilding is somewhat complex as there is quite a bit of information to
°5utake into account. We have to build libs and programs, possibly for
°5uprofiling and shared libs. We have to support building libraries that
°5uwill be usable by GHCi and also ghc's <tt>-split-objs</tt> feature. We
°5uhave to compile any C files using ghc. Linking, especially for
°5u<tt>split-objs</tt> is remarkably complex, partly because there tend
°5uto be 1,000's of <tt>.o</tt> files and this can often be more than we
°5ucan pass to the <tt>ld</tt> or <tt>ar</tt> programs in one go.
°5u
°5uInstalling for libs and exes involves finding the right files and
°5ucopying them to the right places. One of the more tricky things about
°5uthis module is remembering the layout of files in the build directory
°5u(which is not explicitly documented) and thus what search dirs are
°5uused for various kinds of files.
module Distribution.Simple.GHC
getGhcInfo :: Verbosity -> ConfiguredProgram -> IO [(String, String)]
configure :: Verbosity -> Maybe FilePath -> Maybe FilePath -> ProgramDb -> IO (Compiler, Maybe Platform, ProgramDb)

-- | Given a package DB stack, return all installed packages.
getInstalledPackages :: Verbosity -> Compiler -> PackageDBStack -> ProgramDb -> IO InstalledPackageIndex
getInstalledPackagesMonitorFiles :: Verbosity -> Platform -> ProgramDb -> [PackageDB] -> IO [FilePath]

-- | Given a single package DB, return all installed packages.
getPackageDBContents :: Verbosity -> PackageDB -> ProgramDb -> IO InstalledPackageIndex
buildLib :: Verbosity -> Flag (Maybe Int) -> PackageDescription -> LocalBuildInfo -> Library -> ComponentLocalBuildInfo -> IO ()

-- | Build a foreign library
buildFLib :: Verbosity -> Flag (Maybe Int) -> PackageDescription -> LocalBuildInfo -> ForeignLib -> ComponentLocalBuildInfo -> IO ()

-- | Build an executable with GHC.
buildExe :: Verbosity -> Flag (Maybe Int) -> PackageDescription -> LocalBuildInfo -> Executable -> ComponentLocalBuildInfo -> IO ()
replLib :: Verbosity -> Flag (Maybe Int) -> PackageDescription -> LocalBuildInfo -> Library -> ComponentLocalBuildInfo -> IO ()

-- | Build a foreign library
replFLib :: Verbosity -> Flag (Maybe Int) -> PackageDescription -> LocalBuildInfo -> ForeignLib -> ComponentLocalBuildInfo -> IO ()

-- | Build an executable with GHC.
replExe :: Verbosity -> Flag (Maybe Int) -> PackageDescription -> LocalBuildInfo -> Executable -> ComponentLocalBuildInfo -> IO ()

-- | Start a REPL without loading any source files.
startInterpreter :: Verbosity -> ProgramDb -> Compiler -> Platform -> PackageDBStack -> IO ()

-- | Install for ghc, .hi, .a and, if --with-ghci given, .o
installLib :: Verbosity -> LocalBuildInfo -> FilePath -> FilePath -> FilePath -> PackageDescription -> Library -> ComponentLocalBuildInfo -> IO ()

-- | Install foreign library for GHC.
installFLib :: Verbosity -> LocalBuildInfo -> FilePath -> FilePath -> PackageDescription -> ForeignLib -> IO ()

-- | Install executables for GHC.
installExe :: Verbosity -> LocalBuildInfo -> FilePath -> FilePath -> (FilePath, FilePath) -> PackageDescription -> Executable -> IO ()

-- | Extracts a String representing a hash of the ABI of a built library.
°5uIt can fail if the library has not yet been built.
libAbiHash :: Verbosity -> PackageDescription -> LocalBuildInfo -> Library -> ComponentLocalBuildInfo -> IO String
hcPkgInfo :: ProgramDb -> HcPkgInfo
registerPackage :: Verbosity -> ProgramDb -> PackageDBStack -> InstalledPackageInfo -> RegisterOptions -> IO ()
componentGhcOptions :: Verbosity -> LocalBuildInfo -> BuildInfo -> ComponentLocalBuildInfo -> FilePath -> GhcOptions
componentCcGhcOptions :: Verbosity -> LocalBuildInfo -> BuildInfo -> ComponentLocalBuildInfo -> FilePath -> FilePath -> GhcOptions
getLibDir :: Verbosity -> LocalBuildInfo -> IO FilePath
isDynamic :: Compiler -> Bool

-- | Return the <a>FilePath</a> to the global GHC package database.
getGlobalPackageDB :: Verbosity -> ConfiguredProgram -> IO FilePath
pkgRoot :: Verbosity -> LocalBuildInfo -> PackageDB -> IO FilePath

-- | The kinds of entries we can stick in a <tt>.ghc.environment</tt> file.
data GhcEnvironmentFileEntry

-- | <pre>
°5u-- a comment
°5u</pre>
GhcEnvFileComment :: String -> GhcEnvironmentFileEntry

-- | <pre>
°5upackage-id foo-1.0-4fe301a...
°5u</pre>
GhcEnvFilePackageId :: UnitId -> GhcEnvironmentFileEntry

-- | <tt>global-package-db</tt>, <tt>user-package-db</tt> or <tt>package-db
°5ublah<i>package.conf.d</i></tt>
GhcEnvFilePackageDb :: PackageDB -> GhcEnvironmentFileEntry

-- | <pre>
°5uclear-package-db
°5u</pre>
GhcEnvFileClearPackageDbStack :: GhcEnvironmentFileEntry

-- | Make entries for a GHC environment file based on a
°5u<a>PackageDBStack</a> and a bunch of package (unit) ids.
°5u
°5uIf you need to do anything more complicated then either use this as a
°5ubasis and add more entries, or just make all the entries directly.
simpleGhcEnvironmentFile :: PackageDBStack -> [UnitId] -> [GhcEnvironmentFileEntry]

-- | Write a <tt>.ghc.environment-$arch-$os-$ver</tt> file in the given
°5udirectory.
°5u
°5uThe <a>Platform</a> and GHC <a>Version</a> are needed as part of the
°5ufile name.
°5u
°5uReturns the name of the file written.
writeGhcEnvironmentFile :: FilePath -> Platform -> Version -> [GhcEnvironmentFileEntry] -> NoCallStackIO FilePath
getImplInfo :: Compiler -> GhcImplInfo

-- | Information about features and quirks of a GHC-based implementation.
°5u
°5uCompiler flavors based on GHC behave similarly enough that some of the
°5usupport code for them is shared. Every implementation has its own
°5upeculiarities, that may or may not be a direct result of the
°5uunderlying GHC version. This record keeps track of these differences.
°5u
°5uAll shared code (i.e. everything not in the Distribution.Simple.FLAVOR
°5umodule) should use implementation info rather than version numbers to
°5utest for supported features.
data GhcImplInfo
GhcImplInfo :: Bool -> Bool -> Bool -> Bool -> Bool -> Bool -> Bool -> Bool -> Bool -> Bool -> GhcImplInfo

-- | <ul>
°5u<li>XHaskell2010 and -XHaskell98 flags</li>
°5u</ul>
[supportsHaskell2010] :: GhcImplInfo -> Bool

-- | <ul>
°5u<li>-supported-languages gives Ext and NoExt</li>
°5u</ul>
[reportsNoExt] :: GhcImplInfo -> Bool

-- | NondecreasingIndentation is always on
[alwaysNondecIndent] :: GhcImplInfo -> Bool

-- | <ul>
°5u<li>ghci-script flag supported</li>
°5u</ul>
[flagGhciScript] :: GhcImplInfo -> Bool

-- | new style -fprof-auto* flags
[flagProfAuto] :: GhcImplInfo -> Bool

-- | use package-conf instead of package-db
[flagPackageConf] :: GhcImplInfo -> Bool

-- | <ul>
°5u<li>g flag supported</li>
°5u</ul>
[flagDebugInfo] :: GhcImplInfo -> Bool

-- | supports numeric <tt>-g</tt> levels
[supportsDebugLevels] :: GhcImplInfo -> Bool

-- | picks up <tt>.ghc.environment</tt> files
[supportsPkgEnvFiles] :: GhcImplInfo -> Bool

-- | <ul>
°5u<li>Wmissing-home-modules is supported</li>
°5u</ul>
[flagWarnMissingHomeModules] :: GhcImplInfo -> Bool


-- | This is the entry point into installing a built package. Performs the
°5u"<tt>./setup install</tt>" and "<tt>./setup copy</tt>" actions. It
°5umoves files into place based on the prefix argument. It does the
°5ugeneric bits and then calls compiler-specific functions to do the
°5urest.
module Distribution.Simple.Install

-- | Perform the "<tt>./setup install</tt>" and "<tt>./setup copy</tt>"
°5uactions. Move files into place based on the prefix argument.
°5u
°5uThis does NOT register libraries, you should call <tt>register</tt> to
°5udo that.
install :: PackageDescription -> LocalBuildInfo -> CopyFlags -> IO ()


-- | See
°5u<a>https://github.com/ezyang/ghc-proposals/blob/backpack/proposals/0000-backpack.rst</a>
module Distribution.Backpack.ModuleShape

-- | A <a>ModuleShape</a> describes the provisions and requirements of a
°5ulibrary. We can extract a <a>ModuleShape</a> from an
°5u<a>InstalledPackageInfo</a>.
data ModuleShape
ModuleShape :: OpenModuleSubst -> Set ModuleName -> ModuleShape
[modShapeProvides] :: ModuleShape -> OpenModuleSubst
[modShapeRequires] :: ModuleShape -> Set ModuleName

-- | The default module shape, with no provisions and no requirements.
emptyModuleShape :: ModuleShape
shapeInstalledPackage :: InstalledPackageInfo -> ModuleShape
instance GHC.Generics.Generic Distribution.Backpack.ModuleShape.ModuleShape
instance GHC.Show.Show Distribution.Backpack.ModuleShape.ModuleShape
instance GHC.Classes.Eq Distribution.Backpack.ModuleShape.ModuleShape
instance Data.Binary.Class.Binary Distribution.Backpack.ModuleShape.ModuleShape
instance Distribution.Backpack.ModSubst.ModSubst Distribution.Backpack.ModuleShape.ModuleShape

module Distribution.Backpack.PreModuleShape
data PreModuleShape
PreModuleShape :: Set ModuleName -> Set ModuleName -> PreModuleShape
[preModShapeProvides] :: PreModuleShape -> Set ModuleName
[preModShapeRequires] :: PreModuleShape -> Set ModuleName
toPreModuleShape :: ModuleShape -> PreModuleShape
renamePreModuleShape :: PreModuleShape -> IncludeRenaming -> PreModuleShape
mixLinkPreModuleShape :: [PreModuleShape] -> PreModuleShape
instance GHC.Generics.Generic Distribution.Backpack.PreModuleShape.PreModuleShape
instance GHC.Show.Show Distribution.Backpack.PreModuleShape.PreModuleShape
instance GHC.Classes.Eq Distribution.Backpack.PreModuleShape.PreModuleShape


-- | See
°5u<a>https://github.com/ezyang/ghc-proposals/blob/backpack/proposals/0000-backpack.rst</a>
module Distribution.Backpack.LinkedComponent

-- | A linked component is a component that has been mix-in linked, at
°5uwhich point we have determined how all the dependencies of the
°5ucomponent are explicitly instantiated (in the form of an OpenUnitId).
°5u<a>ConfiguredComponent</a> is mix-in linked into
°5u<a>LinkedComponent</a>, which is then instantiated into
°5u<tt>ReadyComponent</tt>.
data LinkedComponent
LinkedComponent :: AnnotatedId ComponentId -> Component -> [AnnotatedId OpenUnitId] -> Bool -> [ComponentInclude OpenUnitId ModuleRenaming] -> [ComponentInclude OpenUnitId ModuleRenaming] -> ModuleShape -> LinkedComponent

-- | Uniquely identifies linked component
[lc_ann_id] :: LinkedComponent -> AnnotatedId ComponentId

-- | Corresponds to <a>cc_component</a>.
[lc_component] :: LinkedComponent -> Component

-- | <tt>build-tools</tt> and <tt>build-tool-depends</tt> dependencies.
°5uCorresponds to <a>cc_exe_deps</a>.
[lc_exe_deps] :: LinkedComponent -> [AnnotatedId OpenUnitId]

-- | Is this the public library of a package? Corresponds to
°5u<a>cc_public</a>.
[lc_public] :: LinkedComponent -> Bool

-- | Corresponds to <a>cc_includes</a>, but (1) this does not contain
°5uincludes of signature packages (packages with no exports), and (2) the
°5u<a>ModuleRenaming</a> for requirements (stored in
°5u<a>IncludeRenaming</a>) has been removed, as it is reflected in
°5u<a>OpenUnitId</a>.)
[lc_includes] :: LinkedComponent -> [ComponentInclude OpenUnitId ModuleRenaming]

-- | Like <a>lc_includes</a>, but this specifies includes on signature
°5upackages which have no exports.
[lc_sig_includes] :: LinkedComponent -> [ComponentInclude OpenUnitId ModuleRenaming]

-- | The module shape computed by mix-in linking. This is newly computed
°5ufrom <a>ConfiguredComponent</a>
[lc_shape] :: LinkedComponent -> ModuleShape

-- | The instantiation of <a>lc_uid</a>; this always has the invariant that
°5uit is a mapping from a module name <tt>A</tt> to <tt><a>A</a></tt>
°5u(the hole A).
lc_insts :: LinkedComponent -> [(ModuleName, OpenModule)]

-- | The <a>OpenUnitId</a> of this component in the "default"
°5uinstantiation. See also <a>lc_insts</a>. <a>LinkedComponent</a>s
°5ucannot be instantiated (e.g., there is no <tt>ModSubst</tt> instance
°5ufor them).
lc_uid :: LinkedComponent -> OpenUnitId

-- | Uniquely identifies a <a>LinkedComponent</a>. Corresponds to
°5u<a>cc_cid</a>.
lc_cid :: LinkedComponent -> ComponentId

-- | Corresponds to <a>cc_pkgid</a>.
lc_pkgid :: LinkedComponent -> PackageId
toLinkedComponent :: Verbosity -> FullDb -> PackageId -> LinkedComponentMap -> ConfiguredComponent -> LogProgress LinkedComponent
toLinkedComponents :: Verbosity -> FullDb -> PackageId -> LinkedComponentMap -> [ConfiguredComponent] -> LogProgress [LinkedComponent]
dispLinkedComponent :: LinkedComponent -> Doc
type LinkedComponentMap = Map ComponentId (OpenUnitId, ModuleShape)
extendLinkedComponentMap :: LinkedComponent -> LinkedComponentMap -> LinkedComponentMap
instance Distribution.Package.Package Distribution.Backpack.LinkedComponent.LinkedComponent

module Distribution.Compat.Time

-- | An opaque type representing a file's modification time, represented
°5uinternally as a 64-bit unsigned integer in the Windows UTC format.
newtype ModTime
ModTime :: Word64 -> ModTime

-- | Return modification time of the given file. Works around the low clock
°5uresolution problem that <a>getModificationTime</a> has on GHC &lt;
°5u7.8.
°5u
°5uThis is a modified version of the code originally written for Shake by
°5uNeil Mitchell. See module Development.Shake.FileInfo.
getModTime :: FilePath -> NoCallStackIO ModTime

-- | Return age of given file in days.
getFileAge :: FilePath -> NoCallStackIO Double

-- | Return the current time as <a>ModTime</a>.
getCurTime :: NoCallStackIO ModTime

-- | Convert POSIX seconds to ModTime.
posixSecondsToModTime :: Int64 -> ModTime

-- | Based on code written by Neil Mitchell for Shake. See
°5u<tt>sleepFileTimeCalibrate</tt> in <a>Type</a>. Returns a pair of
°5umicrosecond values: first, the maximum delay seen, and the recommended
°5udelay to use before testing for file modification change. The returned
°5udelay is never smaller than 10 ms, but never larger than 1 second.
calibrateMtimeChangeDelay :: IO (Int, Int)
instance GHC.Classes.Ord Distribution.Compat.Time.ModTime
instance GHC.Classes.Eq Distribution.Compat.Time.ModTime
instance GHC.Enum.Bounded Distribution.Compat.Time.ModTime
instance Data.Binary.Class.Binary Distribution.Compat.Time.ModTime
instance GHC.Show.Show Distribution.Compat.Time.ModTime
instance GHC.Read.Read Distribution.Compat.Time.ModTime


-- | See
°5u<a>https://github.com/ezyang/ghc-proposals/blob/backpack/proposals/0000-backpack.rst</a>
°5u
°5uWARNING: The contents of this module are HIGHLY experimental. We may
°5urefactor it under you.
module Distribution.Backpack.Configure
configureComponentLocalBuildInfos :: Verbosity -> Bool -> ComponentRequestedSpec -> Bool -> Flag String -> Flag ComponentId -> PackageDescription -> [PreExistingComponent] -> FlagAssignment -> [(ModuleName, Module)] -> InstalledPackageIndex -> Compiler -> LogProgress ([ComponentLocalBuildInfo], InstalledPackageIndex)

module Distribution.Backpack.DescribeUnitId

-- | Print a Setup message stating (1) what operation we are doing, for (2)
°5uwhich component (with enough details to uniquely identify the build in
°5uquestion.)
setupMessage' :: Text a => Verbosity -> String -> PackageIdentifier -> ComponentName -> Maybe [(ModuleName, a)] -> IO ()


-- | This module deals with registering and unregistering packages. There
°5uare a couple ways it can do this, one is to do it directly. Another is
°5uto generate a script that can be run later to do it. The idea here
°5ubeing that the user is shielded from the details of what command to
°5uuse for package registration for a particular compiler. In practice
°5uthis aspect was not especially popular so we also provide a way to
°5usimply generate the package registration file which then must be
°5umanually passed to <tt>ghc-pkg</tt>. It is possible to generate
°5uregistration information for where the package is to be installed, or
°5ualternatively to register the package in place in the build tree. The
°5ulatter is occasionally handy, and will become more important when we
°5utry to build multi-package systems.
°5u
°5uThis module does not delegate anything to the per-compiler modules but
°5ujust mixes it all in in this module, which is rather unsatisfactory.
°5uThe script generation and the unregister feature are not well used or
°5utested.
module Distribution.Simple.Register
register :: PackageDescription -> LocalBuildInfo -> RegisterFlags -> IO ()
unregister :: PackageDescription -> LocalBuildInfo -> RegisterFlags -> IO ()
internalPackageDBPath :: LocalBuildInfo -> FilePath -> FilePath
initPackageDB :: Verbosity -> Compiler -> ProgramDb -> FilePath -> IO ()
doesPackageDBExist :: FilePath -> NoCallStackIO Bool

-- | Create an empty package DB at the specified location.
createPackageDB :: Verbosity -> Compiler -> ProgramDb -> Bool -> FilePath -> IO ()
deletePackageDB :: FilePath -> NoCallStackIO ()

-- | Compute the <a>AbiHash</a> of a library that we built inplace.
abiHash :: Verbosity -> PackageDescription -> FilePath -> LocalBuildInfo -> Library -> ComponentLocalBuildInfo -> IO AbiHash

-- | Run <tt>hc-pkg</tt> using a given package DB stack, directly
°5uforwarding the provided command-line arguments to it.
invokeHcPkg :: Verbosity -> Compiler -> ProgramDb -> PackageDBStack -> [String] -> IO ()
registerPackage :: Verbosity -> Compiler -> ProgramDb -> PackageDBStack -> InstalledPackageInfo -> RegisterOptions -> IO ()

-- | Additional variations in the behaviour for <a>register</a>.
data RegisterOptions
RegisterOptions :: Bool -> Bool -> Bool -> RegisterOptions

-- | Allows re-registering / overwriting an existing package
[registerAllowOverwrite] :: RegisterOptions -> Bool

-- | Insist on the ability to register multiple instances of a single
°5uversion of a single package. This will fail if the <tt>hc-pkg</tt>
°5udoes not support it, see <a>nativeMultiInstance</a> and
°5u<a>recacheMultiInstance</a>.
[registerMultiInstance] :: RegisterOptions -> Bool

-- | Require that no checks are performed on the existence of package files
°5umentioned in the registration info. This must be used if registering
°5uprior to putting the files in their final place. This will fail if the
°5u<tt>hc-pkg</tt> does not support it, see <a>suppressFilesCheck</a>.
[registerSuppressFilesCheck] :: RegisterOptions -> Bool

-- | Defaults are <tt>True</tt>, <tt>False</tt> and <tt>False</tt>
defaultRegisterOptions :: RegisterOptions
generateRegistrationInfo :: Verbosity -> PackageDescription -> Library -> LocalBuildInfo -> ComponentLocalBuildInfo -> Bool -> Bool -> FilePath -> PackageDB -> IO InstalledPackageInfo

-- | Construct <a>InstalledPackageInfo</a> for a library that is in place
°5uin the build tree.
°5u
°5uThis function knows about the layout of in place packages.
inplaceInstalledPackageInfo :: FilePath -> FilePath -> PackageDescription -> AbiHash -> Library -> LocalBuildInfo -> ComponentLocalBuildInfo -> InstalledPackageInfo

-- | Construct <a>InstalledPackageInfo</a> for the final install location
°5uof a library package.
°5u
°5uThis function knows about the layout of installed packages.
absoluteInstalledPackageInfo :: PackageDescription -> AbiHash -> Library -> LocalBuildInfo -> ComponentLocalBuildInfo -> InstalledPackageInfo

-- | Construct <a>InstalledPackageInfo</a> for a library in a package,
°5ugiven a set of installation directories.
generalInstalledPackageInfo :: ([FilePath] -> [FilePath]) -> PackageDescription -> AbiHash -> Library -> LocalBuildInfo -> ComponentLocalBuildInfo -> InstallDirs FilePath -> InstalledPackageInfo


-- | This defines a <a>PreProcessor</a> abstraction which represents a
°5upre-processor that can transform one kind of file into another. There
°5uis also a <a>PPSuffixHandler</a> which is a combination of a file
°5uextension and a function for configuring a <a>PreProcessor</a>. It
°5udefines a bunch of known built-in preprocessors like <tt>cpp</tt>,
°5u<tt>cpphs</tt>, <tt>c2hs</tt>, <tt>hsc2hs</tt>, <tt>happy</tt>,
°5u<tt>alex</tt> etc and lists them in <a>knownSuffixHandlers</a>. On top
°5uof this it provides a function for actually preprocessing some sources
°5ugiven a bunch of known suffix handlers. This module is not as good as
°5uit could be, it could really do with a rewrite to address some of the
°5uproblems we have with pre-processors.
module Distribution.Simple.PreProcess

-- | Apply preprocessors to the sources from <a>hsSourceDirs</a> for a
°5ugiven component (lib, exe, or test suite).
preprocessComponent :: PackageDescription -> Component -> LocalBuildInfo -> ComponentLocalBuildInfo -> Bool -> Verbosity -> [PPSuffixHandler] -> IO ()

-- | Find any extra C sources generated by preprocessing that need to be
°5uadded to the component (addresses issue #238).
preprocessExtras :: Verbosity -> Component -> LocalBuildInfo -> IO [FilePath]

-- | Standard preprocessors: GreenCard, c2hs, hsc2hs, happy, alex and
°5ucpphs.
knownSuffixHandlers :: [PPSuffixHandler]

-- | Convenience function; get the suffixes of these preprocessors.
ppSuffixes :: [PPSuffixHandler] -> [String]

-- | A preprocessor for turning non-Haskell files with the given extension
°5uinto plain Haskell source files.
type PPSuffixHandler = (String, BuildInfo -> LocalBuildInfo -> ComponentLocalBuildInfo -> PreProcessor)

-- | The interface to a preprocessor, which may be implemented using an
°5uexternal program, but need not be. The arguments are the name of the
°5uinput file, the name of the output file and a verbosity level. Here is
°5ua simple example that merely prepends a comment to the given source
°5ufile:
°5u
°5u<pre>
°5uppTestHandler :: PreProcessor
°5uppTestHandler =
°5u  PreProcessor {
°5u    platformIndependent = True,
°5u    runPreProcessor = mkSimplePreProcessor $ \inFile outFile verbosity -&gt;
°5u      do info verbosity (inFile++" has been preprocessed to "++outFile)
°5u         stuff &lt;- readFile inFile
°5u         writeFile outFile ("-- preprocessed as a test\n\n" ++ stuff)
°5u         return ExitSuccess
°5u</pre>
°5u
°5uWe split the input and output file names into a base directory and the
°5urest of the file name. The input base dir is the path in the list of
°5usearch dirs that this file was found in. The output base dir is the
°5ubuild dir where all the generated source files are put.
°5u
°5uThe reason for splitting it up this way is that some pre-processors
°5udon't simply generate one output .hs file from one input file but have
°5udependencies on other generated files (notably c2hs, where building
°5uone .hs file may require reading other .chi files, and then compiling
°5uthe .hs file may require reading a generated .h file). In these cases
°5uthe generated files need to embed relative path names to each other
°5u(eg the generated .hs file mentions the .h file in the FFI imports).
°5uThis path must be relative to the base directory where the generated
°5ufiles are located, it cannot be relative to the top level of the build
°5utree because the compilers do not look for .h files relative to there,
°5uie we do not use "-I .", instead we use "-I dist/build" (or whatever
°5udist dir has been set by the user)
°5u
°5uMost pre-processors do not care of course, so mkSimplePreProcessor and
°5urunSimplePreProcessor functions handle the simple case.
data PreProcessor
PreProcessor :: Bool -> (FilePath, FilePath) -> (FilePath, FilePath) -> Verbosity -> IO () -> PreProcessor
[platformIndependent] :: PreProcessor -> Bool
[runPreProcessor] :: PreProcessor -> (FilePath, FilePath) -> (FilePath, FilePath) -> Verbosity -> IO ()
mkSimplePreProcessor :: (FilePath -> FilePath -> Verbosity -> IO ()) -> (FilePath, FilePath) -> (FilePath, FilePath) -> Verbosity -> IO ()
runSimplePreProcessor :: PreProcessor -> FilePath -> FilePath -> Verbosity -> IO ()
ppCpp :: BuildInfo -> LocalBuildInfo -> ComponentLocalBuildInfo -> PreProcessor
ppCpp' :: [String] -> BuildInfo -> LocalBuildInfo -> ComponentLocalBuildInfo -> PreProcessor
ppGreenCard :: BuildInfo -> LocalBuildInfo -> ComponentLocalBuildInfo -> PreProcessor
ppC2hs :: BuildInfo -> LocalBuildInfo -> ComponentLocalBuildInfo -> PreProcessor
ppHsc2hs :: BuildInfo -> LocalBuildInfo -> ComponentLocalBuildInfo -> PreProcessor
ppHappy :: BuildInfo -> LocalBuildInfo -> ComponentLocalBuildInfo -> PreProcessor
ppAlex :: BuildInfo -> LocalBuildInfo -> ComponentLocalBuildInfo -> PreProcessor
ppUnlit :: PreProcessor
platformDefines :: LocalBuildInfo -> [String]


-- | This defines the API that <tt>Setup.hs</tt> scripts can use to
°5ucustomise the way the build works. This module just defines the
°5u<a>UserHooks</a> type. The predefined sets of hooks that implement the
°5u<tt>Simple</tt>, <tt>Make</tt> and <tt>Configure</tt> build systems
°5uare defined in <a>Distribution.Simple</a>. The <a>UserHooks</a> is a
°5ubig record of functions. There are 3 for each action, a pre, post and
°5uthe action itself. There are few other miscellaneous hooks, ones to
°5uextend the set of programs and preprocessors and one to override the
°5ufunction used to read the <tt>.cabal</tt> file.
°5u
°5uThis hooks type is widely agreed to not be the right solution. Partly
°5uthis is because changes to it usually break custom <tt>Setup.hs</tt>
°5ufiles and yet many internal code changes do require changes to the
°5uhooks. For example we cannot pass any extra parameters to most of the
°5ufunctions that implement the various phases because it would involve
°5uchanging the types of the corresponding hook. At some point it will
°5uhave to be replaced.
module Distribution.Simple.UserHooks

-- | Hooks allow authors to add specific functionality before and after a
°5ucommand is run, and also to specify additional preprocessors.
°5u
°5u<ul>
°5u<li>WARNING: The hooks interface is under rather constant flux as we
°5utry to understand users needs. Setup files that depend on this
°5uinterface may break in future releases.</li>
°5u</ul>
data UserHooks
UserHooks :: Args -> Bool -> PackageDescription -> LocalBuildInfo -> IO () -> IO (Maybe GenericPackageDescription) -> [PPSuffixHandler] -> [Program] -> Args -> ConfigFlags -> IO HookedBuildInfo -> (GenericPackageDescription, HookedBuildInfo) -> ConfigFlags -> IO LocalBuildInfo -> Args -> ConfigFlags -> PackageDescription -> LocalBuildInfo -> IO () -> Args -> BuildFlags -> IO HookedBuildInfo -> PackageDescription -> LocalBuildInfo -> UserHooks -> BuildFlags -> IO () -> Args -> BuildFlags -> PackageDescription -> LocalBuildInfo -> IO () -> Args -> ReplFlags -> IO HookedBuildInfo -> PackageDescription -> LocalBuildInfo -> UserHooks -> ReplFlags -> [String] -> IO () -> Args -> ReplFlags -> PackageDescription -> LocalBuildInfo -> IO () -> Args -> CleanFlags -> IO HookedBuildInfo -> PackageDescription -> () -> UserHooks -> CleanFlags -> IO () -> Args -> CleanFlags -> PackageDescription -> () -> IO () -> Args -> CopyFlags -> IO HookedBuildInfo -> PackageDescription -> LocalBuildInfo -> UserHooks -> CopyFlags -> IO () -> Args -> CopyFlags -> PackageDescription -> LocalBuildInfo -> IO () -> Args -> InstallFlags -> IO HookedBuildInfo -> PackageDescription -> LocalBuildInfo -> UserHooks -> InstallFlags -> IO () -> Args -> InstallFlags -> PackageDescription -> LocalBuildInfo -> IO () -> Args -> SDistFlags -> IO HookedBuildInfo -> PackageDescription -> Maybe LocalBuildInfo -> UserHooks -> SDistFlags -> IO () -> Args -> SDistFlags -> PackageDescription -> Maybe LocalBuildInfo -> IO () -> Args -> RegisterFlags -> IO HookedBuildInfo -> PackageDescription -> LocalBuildInfo -> UserHooks -> RegisterFlags -> IO () -> Args -> RegisterFlags -> PackageDescription -> LocalBuildInfo -> IO () -> Args -> RegisterFlags -> IO HookedBuildInfo -> PackageDescription -> LocalBuildInfo -> UserHooks -> RegisterFlags -> IO () -> Args -> RegisterFlags -> PackageDescription -> LocalBuildInfo -> IO () -> Args -> HscolourFlags -> IO HookedBuildInfo -> PackageDescription -> LocalBuildInfo -> UserHooks -> HscolourFlags -> IO () -> Args -> HscolourFlags -> PackageDescription -> LocalBuildInfo -> IO () -> Args -> DoctestFlags -> IO HookedBuildInfo -> PackageDescription -> LocalBuildInfo -> UserHooks -> DoctestFlags -> IO () -> Args -> DoctestFlags -> PackageDescription -> LocalBuildInfo -> IO () -> Args -> HaddockFlags -> IO HookedBuildInfo -> PackageDescription -> LocalBuildInfo -> UserHooks -> HaddockFlags -> IO () -> Args -> HaddockFlags -> PackageDescription -> LocalBuildInfo -> IO () -> Args -> TestFlags -> IO HookedBuildInfo -> Args -> PackageDescription -> LocalBuildInfo -> UserHooks -> TestFlags -> IO () -> Args -> TestFlags -> PackageDescription -> LocalBuildInfo -> IO () -> Args -> BenchmarkFlags -> IO HookedBuildInfo -> Args -> PackageDescription -> LocalBuildInfo -> UserHooks -> BenchmarkFlags -> IO () -> Args -> BenchmarkFlags -> PackageDescription -> LocalBuildInfo -> IO () -> UserHooks

-- | Used for <tt>./setup test</tt>

-- | <i>Deprecated: Please use the new testing interface instead!</i>
[runTests] :: UserHooks -> Args -> Bool -> PackageDescription -> LocalBuildInfo -> IO ()

-- | Read the description file
[readDesc] :: UserHooks -> IO (Maybe GenericPackageDescription)

-- | Custom preprocessors in addition to and overriding
°5u<a>knownSuffixHandlers</a>.
[hookedPreProcessors] :: UserHooks -> [PPSuffixHandler]

-- | These programs are detected at configure time. Arguments for them are
°5uadded to the configure command.
[hookedPrograms] :: UserHooks -> [Program]

-- | Hook to run before configure command
[preConf] :: UserHooks -> Args -> ConfigFlags -> IO HookedBuildInfo

-- | Over-ride this hook to get different behavior during configure.
[confHook] :: UserHooks -> (GenericPackageDescription, HookedBuildInfo) -> ConfigFlags -> IO LocalBuildInfo

-- | Hook to run after configure command
[postConf] :: UserHooks -> Args -> ConfigFlags -> PackageDescription -> LocalBuildInfo -> IO ()

-- | Hook to run before build command. Second arg indicates verbosity
°5ulevel.
[preBuild] :: UserHooks -> Args -> BuildFlags -> IO HookedBuildInfo

-- | Over-ride this hook to get different behavior during build.
[buildHook] :: UserHooks -> PackageDescription -> LocalBuildInfo -> UserHooks -> BuildFlags -> IO ()

-- | Hook to run after build command. Second arg indicates verbosity level.
[postBuild] :: UserHooks -> Args -> BuildFlags -> PackageDescription -> LocalBuildInfo -> IO ()

-- | Hook to run before repl command. Second arg indicates verbosity level.
[preRepl] :: UserHooks -> Args -> ReplFlags -> IO HookedBuildInfo

-- | Over-ride this hook to get different behavior during interpretation.
[replHook] :: UserHooks -> PackageDescription -> LocalBuildInfo -> UserHooks -> ReplFlags -> [String] -> IO ()

-- | Hook to run after repl command. Second arg indicates verbosity level.
[postRepl] :: UserHooks -> Args -> ReplFlags -> PackageDescription -> LocalBuildInfo -> IO ()

-- | Hook to run before clean command. Second arg indicates verbosity
°5ulevel.
[preClean] :: UserHooks -> Args -> CleanFlags -> IO HookedBuildInfo

-- | Over-ride this hook to get different behavior during clean.
[cleanHook] :: UserHooks -> PackageDescription -> () -> UserHooks -> CleanFlags -> IO ()

-- | Hook to run after clean command. Second arg indicates verbosity level.
[postClean] :: UserHooks -> Args -> CleanFlags -> PackageDescription -> () -> IO ()

-- | Hook to run before copy command
[preCopy] :: UserHooks -> Args -> CopyFlags -> IO HookedBuildInfo

-- | Over-ride this hook to get different behavior during copy.
[copyHook] :: UserHooks -> PackageDescription -> LocalBuildInfo -> UserHooks -> CopyFlags -> IO ()

-- | Hook to run after copy command
[postCopy] :: UserHooks -> Args -> CopyFlags -> PackageDescription -> LocalBuildInfo -> IO ()

-- | Hook to run before install command
[preInst] :: UserHooks -> Args -> InstallFlags -> IO HookedBuildInfo

-- | Over-ride this hook to get different behavior during install.
[instHook] :: UserHooks -> PackageDescription -> LocalBuildInfo -> UserHooks -> InstallFlags -> IO ()

-- | Hook to run after install command. postInst should be run on the
°5utarget, not on the build machine.
[postInst] :: UserHooks -> Args -> InstallFlags -> PackageDescription -> LocalBuildInfo -> IO ()

-- | Hook to run before sdist command. Second arg indicates verbosity
°5ulevel.
[preSDist] :: UserHooks -> Args -> SDistFlags -> IO HookedBuildInfo

-- | Over-ride this hook to get different behavior during sdist.
[sDistHook] :: UserHooks -> PackageDescription -> Maybe LocalBuildInfo -> UserHooks -> SDistFlags -> IO ()

-- | Hook to run after sdist command. Second arg indicates verbosity level.
[postSDist] :: UserHooks -> Args -> SDistFlags -> PackageDescription -> Maybe LocalBuildInfo -> IO ()

-- | Hook to run before register command
[preReg] :: UserHooks -> Args -> RegisterFlags -> IO HookedBuildInfo

-- | Over-ride this hook to get different behavior during registration.
[regHook] :: UserHooks -> PackageDescription -> LocalBuildInfo -> UserHooks -> RegisterFlags -> IO ()

-- | Hook to run after register command
[postReg] :: UserHooks -> Args -> RegisterFlags -> PackageDescription -> LocalBuildInfo -> IO ()

-- | Hook to run before unregister command
[preUnreg] :: UserHooks -> Args -> RegisterFlags -> IO HookedBuildInfo

-- | Over-ride this hook to get different behavior during unregistration.
[unregHook] :: UserHooks -> PackageDescription -> LocalBuildInfo -> UserHooks -> RegisterFlags -> IO ()

-- | Hook to run after unregister command
[postUnreg] :: UserHooks -> Args -> RegisterFlags -> PackageDescription -> LocalBuildInfo -> IO ()

-- | Hook to run before hscolour command. Second arg indicates verbosity
°5ulevel.
[preHscolour] :: UserHooks -> Args -> HscolourFlags -> IO HookedBuildInfo

-- | Over-ride this hook to get different behavior during hscolour.
[hscolourHook] :: UserHooks -> PackageDescription -> LocalBuildInfo -> UserHooks -> HscolourFlags -> IO ()

-- | Hook to run after hscolour command. Second arg indicates verbosity
°5ulevel.
[postHscolour] :: UserHooks -> Args -> HscolourFlags -> PackageDescription -> LocalBuildInfo -> IO ()

-- | Hook to run before doctest command. Second arg indicates verbosity
°5ulevel.
[preDoctest] :: UserHooks -> Args -> DoctestFlags -> IO HookedBuildInfo

-- | Over-ride this hook to get different behavior during doctest.
[doctestHook] :: UserHooks -> PackageDescription -> LocalBuildInfo -> UserHooks -> DoctestFlags -> IO ()

-- | Hook to run after doctest command. Second arg indicates verbosity
°5ulevel.
[postDoctest] :: UserHooks -> Args -> DoctestFlags -> PackageDescription -> LocalBuildInfo -> IO ()

-- | Hook to run before haddock command. Second arg indicates verbosity
°5ulevel.
[preHaddock] :: UserHooks -> Args -> HaddockFlags -> IO HookedBuildInfo

-- | Over-ride this hook to get different behavior during haddock.
[haddockHook] :: UserHooks -> PackageDescription -> LocalBuildInfo -> UserHooks -> HaddockFlags -> IO ()

-- | Hook to run after haddock command. Second arg indicates verbosity
°5ulevel.
[postHaddock] :: UserHooks -> Args -> HaddockFlags -> PackageDescription -> LocalBuildInfo -> IO ()

-- | Hook to run before test command.
[preTest] :: UserHooks -> Args -> TestFlags -> IO HookedBuildInfo

-- | Over-ride this hook to get different behavior during test.
[testHook] :: UserHooks -> Args -> PackageDescription -> LocalBuildInfo -> UserHooks -> TestFlags -> IO ()

-- | Hook to run after test command.
[postTest] :: UserHooks -> Args -> TestFlags -> PackageDescription -> LocalBuildInfo -> IO ()

-- | Hook to run before bench command.
[preBench] :: UserHooks -> Args -> BenchmarkFlags -> IO HookedBuildInfo

-- | Over-ride this hook to get different behavior during bench.
[benchHook] :: UserHooks -> Args -> PackageDescription -> LocalBuildInfo -> UserHooks -> BenchmarkFlags -> IO ()

-- | Hook to run after bench command.
[postBench] :: UserHooks -> Args -> BenchmarkFlags -> PackageDescription -> LocalBuildInfo -> IO ()
type Args = [String]

-- | Empty <a>UserHooks</a> which do nothing.
emptyUserHooks :: UserHooks


-- | This is the entry point into testing a built package. It performs the
°5u"<tt>./setup test</tt>" action. It runs test suites designated in the
°5upackage description and reports on the results.
module Distribution.Simple.Test

-- | Perform the "<tt>./setup test</tt>" action.
test :: Args -> PackageDescription -> LocalBuildInfo -> TestFlags -> IO ()


-- | This is the entry point into running the benchmarks in a built
°5upackage. It performs the "<tt>./setup bench</tt>" action. It runs
°5ubenchmarks designated in the package description.
module Distribution.Simple.Bench

-- | Perform the "<tt>./setup bench</tt>" action.
bench :: Args -> PackageDescription -> LocalBuildInfo -> BenchmarkFlags -> IO ()


-- | This handles the <tt>sdist</tt> command. The module exports an
°5u<a>sdist</a> action but also some of the phases that make it up so
°5uthat other tools can use just the bits they need. In particular the
°5upreparation of the tree of files to go into the source tarball is
°5useparated from actually building the source tarball.
°5u
°5uThe <a>createArchive</a> action uses the external <tt>tar</tt> program
°5uand assumes that it accepts the <tt>-z</tt> flag. Neither of these
°5uassumptions are valid on Windows. The <a>sdist</a> action now also
°5udoes some distribution QA checks.
module Distribution.Simple.SrcDist

-- | Create a source distribution.
sdist :: PackageDescription -> Maybe LocalBuildInfo -> SDistFlags -> (FilePath -> FilePath) -> [PPSuffixHandler] -> IO ()
printPackageProblems :: Verbosity -> PackageDescription -> IO ()

-- | Prepare a directory tree of source files.
prepareTree :: Verbosity -> PackageDescription -> Maybe LocalBuildInfo -> FilePath -> [PPSuffixHandler] -> IO ()

-- | Create an archive from a tree of source files, and clean up the tree.
createArchive :: CreateArchiveFun

-- | Prepare a directory tree of source files for a snapshot version. It is
°5uexpected that the appropriate snapshot version has already been set in
°5uthe package description, eg using <a>snapshotPackage</a> or
°5u<a>snapshotVersion</a>.
prepareSnapshotTree :: Verbosity -> PackageDescription -> Maybe LocalBuildInfo -> FilePath -> [PPSuffixHandler] -> IO ()

-- | Modifies a <a>PackageDescription</a> by appending a snapshot number
°5ucorresponding to the given date.
snapshotPackage :: UTCTime -> PackageDescription -> PackageDescription

-- | Modifies a <a>Version</a> by appending a snapshot number corresponding
°5uto the given date.
snapshotVersion :: UTCTime -> Version -> Version

-- | Given a date produce a corresponding integer representation. For
°5uexample given a date <tt>18<i>03</i>2008</tt> produce the number
°5u<tt>20080318</tt>.
dateToSnapshotNumber :: UTCTime -> Int

-- | List all source files of a package. Returns a tuple of lists: first
°5ucomponent is a list of ordinary files, second one is a list of those
°5ufiles that may be executable.
listPackageSources :: Verbosity -> PackageDescription -> [PPSuffixHandler] -> IO ([FilePath], [FilePath])


-- | This deals with the <i>configure</i> phase. It provides the
°5u<a>configure</a> action which is given the package description and
°5uconfigure flags. It then tries to: configure the compiler; resolves
°5uany conditionals in the package description; resolve the package
°5udependencies; check if all the extensions used by this package are
°5usupported by the compiler; check that all the build tools are
°5uavailable (including version checks if appropriate); checks for any
°5urequired <tt>pkg-config</tt> packages (updating the <a>BuildInfo</a>
°5uwith the results)
°5u
°5uThen based on all this it saves the info in the <a>LocalBuildInfo</a>
°5uand writes it out to the <tt>dist/setup-config</tt> file. It also
°5udisplays various details to the user, the amount of information
°5udisplayed depending on the verbosity level.
module Distribution.Simple.Configure

-- | Perform the "<tt>./setup configure</tt>" action. Returns the
°5u<tt>.setup-config</tt> file.
configure :: (GenericPackageDescription, HookedBuildInfo) -> ConfigFlags -> IO LocalBuildInfo

-- | After running configure, output the <a>LocalBuildInfo</a> to the
°5u<a>localBuildInfoFile</a>.
writePersistBuildConfig :: FilePath -> LocalBuildInfo -> NoCallStackIO ()

-- | Read the <a>localBuildInfoFile</a>. Throw an exception if the file is
°5umissing, if the file cannot be read, or if the file was created by an
°5uolder version of Cabal.
getConfigStateFile :: FilePath -> IO LocalBuildInfo

-- | Read the <a>localBuildInfoFile</a>. Throw an exception if the file is
°5umissing, if the file cannot be read, or if the file was created by an
°5uolder version of Cabal.
getPersistBuildConfig :: FilePath -> IO LocalBuildInfo

-- | Check that localBuildInfoFile is up-to-date with respect to the .cabal
°5ufile.
checkPersistBuildConfigOutdated :: FilePath -> FilePath -> NoCallStackIO Bool

-- | Try to read the <a>localBuildInfoFile</a>.
tryGetPersistBuildConfig :: FilePath -> IO (Either ConfigStateFileError LocalBuildInfo)

-- | Try to read the <a>localBuildInfoFile</a>.
maybeGetPersistBuildConfig :: FilePath -> IO (Maybe LocalBuildInfo)

-- | Return the "dist/" prefix, or the default prefix. The prefix is taken
°5ufrom (in order of highest to lowest preference) the override prefix,
°5uthe "CABAL_BUILDDIR" environment variable, or the default prefix.
findDistPref :: FilePath -> Flag FilePath -> NoCallStackIO FilePath

-- | Return the "dist/" prefix, or the default prefix. The prefix is taken
°5ufrom (in order of highest to lowest preference) the override prefix,
°5uthe "CABAL_BUILDDIR" environment variable, or <a>defaultDistPref</a>
°5uis used. Call this function to resolve a <tt>*DistPref</tt> flag
°5uwhenever it is not known to be set. (The <tt>*DistPref</tt> flags are
°5ualways set to a definite value before invoking <tt>UserHooks</tt>.)
findDistPrefOrDefault :: Flag FilePath -> NoCallStackIO FilePath

-- | Create a PackageIndex that makes *any libraries that might be* defined
°5uinternally to this package look like installed packages, in case an
°5uexecutable should refer to any of them as dependencies.
°5u
°5uIt must be *any libraries that might be* defined rather than the
°5uactual definitions, because these depend on conditionals in the .cabal
°5ufile, and we haven't resolved them yet. finalizePD does the resolution
°5uof conditionals, and it takes internalPackageSet as part of its input.
getInternalPackages :: GenericPackageDescription -> Map PackageName (Maybe UnqualComponentName)

-- | This method computes a default, "good enough" <a>ComponentId</a> for a
°5upackage. The intent is that cabal-install (or the user) will specify a
°5umore detailed IPID via the <tt>--ipid</tt> flag if necessary.
computeComponentId :: Bool -> Flag String -> Flag ComponentId -> PackageIdentifier -> ComponentName -> Maybe ([ComponentId], FlagAssignment) -> ComponentId

-- | In GHC 8.0, the string we pass to GHC to use for symbol names for a
°5upackage can be an arbitrary, IPID-compatible string. However, prior to
°5uGHC 8.0 there are some restrictions on what format this string can be
°5u(due to how ghc-pkg parsed the key):
°5u
°5u<ol>
°5u<li>In GHC 7.10, the string had either be of the form foo_ABCD, where
°5ufoo is a non-semantic alphanumeric/hyphenated prefix and ABCD is two
°5ubase-64 encoded 64-bit integers, or a GHC 7.8 style identifier.</li>
°5u<li>In GHC 7.8, the string had to be a valid package identifier like
°5ufoo-0.1.</li>
°5u</ol>
°5u
°5uSo, the problem is that Cabal, in general, has a general IPID, but
°5uneeds to figure out a package key / package ID that the old ghc-pkg
°5uwill actually accept. But there's an EVERY WORSE problem: if ghc-pkg
°5udecides to parse an identifier foo-0.1-xxx as if it were a package
°5uidentifier, which means it will SILENTLY DROP the "xxx" (because it's
°5ua tag, and Cabal does not allow tags.) So we must CONNIVE to ensure
°5uthat we don't pick something that looks like this.
°5u
°5uSo this function attempts to define a mapping into the old formats.
°5u
°5uThe mapping for GHC 7.8 and before:
°5u
°5u<ul>
°5u<li>We use the *compatibility* package name and version. For public
°5ulibraries this is just the package identifier; for internal libraries,
°5uit's something like "z-pkgname-z-libname-0.1". See
°5u<a>computeCompatPackageName</a> for more details.</li>
°5u</ul>
°5u
°5uThe mapping for GHC 7.10:
°5u
°5u<ul>
°5u<li>For CLibName: If the IPID is of the form foo-0.1-ABCDEF where
°5ufoo_ABCDEF would validly parse as a package key, we pass
°5u<a>ABCDEF</a>. (NB: not all hashes parse this way, because GHC 7.10
°5umandated that these hashes be two base-62 encoded 64 bit integers),
°5ubut hashes that Cabal generated using <a>computeComponentId</a> are
°5uguaranteed to have this form.If it is not of this form, we rehash the
°5uIPID into the correct form and pass that.</li>
°5u<li>For sub-components, we rehash the IPID into the correct format and
°5upass that.</li>
°5u</ul>
computeCompatPackageKey :: Compiler -> MungedPackageName -> Version -> UnitId -> String

-- | Computes the package name for a library. If this is the public
°5ulibrary, it will just be the original package name; otherwise, it will
°5ube a munged package name recording the original package name as well
°5uas the name of the internal library.
°5u
°5uA lot of tooling in the Haskell ecosystem assumes that if something is
°5uinstalled to the package database with the package name <tt>foo</tt>,
°5uthen it actually is an entry for the (only public) library in package
°5u<tt>foo</tt>. With internal packages, this is not necessarily true: a
°5upublic library as well as arbitrarily many internal libraries may come
°5ufrom the same package. To prevent tools from getting confused in this
°5ucase, the package name of these internal libraries is munged so that
°5uthey do not conflict the public library proper. A particular case
°5uwhere this matters is ghc-pkg: if we don't munge the package name, the
°5uinplace registration will OVERRIDE a different internal library.
°5u
°5uWe munge into a reserved namespace, "z-", and encode both the
°5ucomponent name and the package name of an internal library using the
°5ufollowing format:
°5u
°5ucompat-pkg-name ::= "z-" package-name "-z-" library-name
°5u
°5uwhere package-name and library-name have "-" ( "z" + ) "-" segments
°5uencoded by adding an extra "z".
°5u
°5uWhen we have the public library, the compat-pkg-name is just the
°5upackage-name, no surprises there!
computeCompatPackageName :: PackageName -> Maybe UnqualComponentName -> MungedPackageName

-- | Get the path of <tt>dist/setup-config</tt>.
localBuildInfoFile :: FilePath -> FilePath

-- | List all installed packages in the given package databases.
getInstalledPackages :: Verbosity -> Compiler -> PackageDBStack -> ProgramDb -> IO InstalledPackageIndex

-- | A set of files (or directories) that can be monitored to detect when
°5uthere might have been a change in the installed packages.
getInstalledPackagesMonitorFiles :: Verbosity -> Compiler -> PackageDBStack -> ProgramDb -> Platform -> IO [FilePath]

-- | Like <a>getInstalledPackages</a>, but for a single package DB.
°5u
°5uNB: Why isn't this always a fall through to
°5u<a>getInstalledPackages</a>? That is because
°5u<a>getInstalledPackages</a> performs some sanity checks on the package
°5udatabase stack in question. However, when sandboxes are involved these
°5usanity checks are not desirable.
getPackageDBContents :: Verbosity -> Compiler -> PackageDB -> ProgramDb -> IO InstalledPackageIndex

-- | <i>Deprecated: <a>configCompiler</a> is deprecated. Use
°5u<a>configCompilerEx</a> instead.</i>
configCompiler :: Maybe CompilerFlavor -> Maybe FilePath -> Maybe FilePath -> ProgramDb -> Verbosity -> IO (Compiler, ProgramDb)

-- | <i>Deprecated: configCompilerAux is deprecated. Use
°5u<a>configCompilerAuxEx</a> instead.</i>
configCompilerAux :: ConfigFlags -> IO (Compiler, ProgramDb)
configCompilerEx :: Maybe CompilerFlavor -> Maybe FilePath -> Maybe FilePath -> ProgramDb -> Verbosity -> IO (Compiler, Platform, ProgramDb)
configCompilerAuxEx :: ConfigFlags -> IO (Compiler, Platform, ProgramDb)

-- | Compute the effective value of the profiling flags
°5u<tt>--enable-library-profiling</tt> and
°5u<tt>--enable-executable-profiling</tt> from the specified
°5u<a>ConfigFlags</a>. This may be useful for external Cabal tools which
°5uneed to interact with Setup in a backwards-compatible way: the most
°5upredictable mechanism for enabling profiling across many legacy
°5uversions is to NOT use <tt>--enable-profiling</tt> and use those two
°5uflags instead.
°5u
°5uNote that <tt>--enable-executable-profiling</tt> also affects
°5uprofiling of benchmarks and (non-detailed) test suites.
computeEffectiveProfiling :: ConfigFlags -> (Bool, Bool)

-- | Makes a <a>BuildInfo</a> from C compiler and linker flags.
°5u
°5uThis can be used with the output from configuration programs like
°5upkg-config and similar package-specific programs like mysql-config,
°5ufreealut-config etc. For example:
°5u
°5u<pre>
°5uccflags &lt;- getDbProgramOutput verbosity prog progdb ["--cflags"]
°5uldflags &lt;- getDbProgramOutput verbosity prog progdb ["--libs"]
°5ureturn (ccldOptionsBuildInfo (words ccflags) (words ldflags))
°5u</pre>
ccLdOptionsBuildInfo :: [String] -> [String] -> BuildInfo
checkForeignDeps :: PackageDescription -> LocalBuildInfo -> Verbosity -> IO ()

-- | The user interface specifies the package dbs to use with a combination
°5uof <tt>--global</tt>, <tt>--user</tt> and
°5u<tt>--package-db=global|user|clear|$file</tt>. This function combines
°5uthe global/user flag and interprets the package-db flag into a single
°5upackage db stack.
interpretPackageDbFlags :: Bool -> [Maybe PackageDB] -> PackageDBStack

-- | The errors that can be thrown when reading the <tt>setup-config</tt>
°5ufile.
data ConfigStateFileError

-- | No header found.
ConfigStateFileNoHeader :: ConfigStateFileError

-- | Incorrect header.
ConfigStateFileBadHeader :: ConfigStateFileError

-- | Cannot parse file contents.
ConfigStateFileNoParse :: ConfigStateFileError

-- | No file!
ConfigStateFileMissing :: ConfigStateFileError

-- | Mismatched version.
ConfigStateFileBadVersion :: PackageIdentifier -> PackageIdentifier -> (Either ConfigStateFileError LocalBuildInfo) -> ConfigStateFileError

-- | Read the <a>localBuildInfoFile</a>, returning either an error or the
°5ulocal build info.
tryGetConfigStateFile :: FilePath -> IO (Either ConfigStateFileError LocalBuildInfo)
platformDefines :: LocalBuildInfo -> [String]
instance GHC.Show.Show Distribution.Simple.Configure.ConfigStateFileError
instance GHC.Exception.Exception Distribution.Simple.Configure.ConfigStateFileError


-- | This is the entry point to actually building the modules in a package.
°5uIt doesn't actually do much itself, most of the work is delegated to
°5ucompiler-specific actions. It does do some non-compiler specific bits
°5ulike running pre-processors.
module Distribution.Simple.Build

-- | Build the libraries and executables in this package.
build :: PackageDescription -> LocalBuildInfo -> BuildFlags -> [PPSuffixHandler] -> IO ()
repl :: PackageDescription -> LocalBuildInfo -> ReplFlags -> [PPSuffixHandler] -> [String] -> IO ()

-- | Start an interpreter without loading any package files.
startInterpreter :: Verbosity -> ProgramDb -> Compiler -> Platform -> PackageDBStack -> IO ()

-- | Runs <a>componentInitialBuildSteps</a> on every configured component.
initialBuildSteps :: FilePath -> PackageDescription -> LocalBuildInfo -> Verbosity -> IO ()

-- | Creates the autogenerated files for a particular configured component.
componentInitialBuildSteps :: FilePath -> PackageDescription -> LocalBuildInfo -> ComponentLocalBuildInfo -> Verbosity -> IO ()

-- | Generate and write out the Paths_<a>pkg</a>.hs and cabal_macros.h
°5ufiles
writeAutogenFiles :: Verbosity -> PackageDescription -> LocalBuildInfo -> ComponentLocalBuildInfo -> IO ()


-- | This module deals with the <tt>haddock</tt> and <tt>hscolour</tt>
°5ucommands. It uses information about installed packages (from
°5u<tt>ghc-pkg</tt>) to find the locations of documentation for dependent
°5upackages, so it can create links.
°5u
°5uThe <tt>hscolour</tt> support allows generating HTML versions of the
°5uoriginal source, with coloured syntax highlighting.
module Distribution.Simple.Haddock
haddock :: PackageDescription -> LocalBuildInfo -> [PPSuffixHandler] -> HaddockFlags -> IO ()
hscolour :: PackageDescription -> LocalBuildInfo -> [PPSuffixHandler] -> HscolourFlags -> IO ()

-- | Given a list of <a>InstalledPackageInfo</a>s, return a list of
°5uinterfaces and HTML paths, and an optional warning for packages with
°5umissing documentation.
haddockPackagePaths :: [InstalledPackageInfo] -> Maybe (InstalledPackageInfo -> FilePath) -> NoCallStackIO ([(FilePath, Maybe FilePath)], Maybe String)
instance GHC.Generics.Generic Distribution.Simple.Haddock.HaddockArgs
instance GHC.Classes.Ord Distribution.Simple.Haddock.Directory
instance GHC.Classes.Eq Distribution.Simple.Haddock.Directory
instance GHC.Show.Show Distribution.Simple.Haddock.Directory
instance GHC.Read.Read Distribution.Simple.Haddock.Directory
instance GHC.Base.Monoid Distribution.Simple.Haddock.HaddockArgs
instance GHC.Base.Semigroup Distribution.Simple.Haddock.HaddockArgs
instance GHC.Base.Monoid Distribution.Simple.Haddock.Directory
instance GHC.Base.Semigroup Distribution.Simple.Haddock.Directory


-- | This module deals with the <tt>doctest</tt> command.
module Distribution.Simple.Doctest
doctest :: PackageDescription -> LocalBuildInfo -> [PPSuffixHandler] -> DoctestFlags -> IO ()
instance GHC.Generics.Generic Distribution.Simple.Doctest.DoctestArgs
instance GHC.Show.Show Distribution.Simple.Doctest.DoctestArgs
instance GHC.Base.Monoid Distribution.Simple.Doctest.DoctestArgs
instance GHC.Base.Semigroup Distribution.Simple.Doctest.DoctestArgs


-- | This is the command line front end to the Simple build system. When
°5ugiven the parsed command-line args and package information, is able to
°5uperform basic commands like configure, build, install, register, etc.
°5u
°5uThis module exports the main functions that Setup.hs scripts use. It
°5ure-exports the <a>UserHooks</a> type, the standard entry points like
°5u<a>defaultMain</a> and <a>defaultMainWithHooks</a> and the predefined
°5usets of <a>UserHooks</a> that custom <tt>Setup.hs</tt> scripts can
°5uextend to add their own behaviour.
°5u
°5uThis module isn't called "Simple" because it's simple. Far from it.
°5uIt's called "Simple" because it does complicated things to simple
°5usoftware.
°5u
°5uThe original idea was that there could be different build systems that
°5uall presented the same compatible command line interfaces. There is
°5ustill a <a>Distribution.Make</a> system but in practice no packages
°5uuse it.
module Distribution.Simple
data AbiTag
NoAbiTag :: AbiTag
AbiTag :: String -> AbiTag

-- | Compiler information used for resolving configurations. Some fields
°5ucan be set to Nothing to indicate that the information is unknown.
data CompilerInfo
CompilerInfo :: CompilerId -> AbiTag -> Maybe [CompilerId] -> Maybe [Language] -> Maybe [Extension] -> CompilerInfo

-- | Compiler flavour and version.
[compilerInfoId] :: CompilerInfo -> CompilerId

-- | Tag for distinguishing incompatible ABI's on the same architecture/os.
[compilerInfoAbiTag] :: CompilerInfo -> AbiTag

-- | Other implementations that this compiler claims to be compatible with,
°5uif known.
[compilerInfoCompat] :: CompilerInfo -> Maybe [CompilerId]

-- | Supported language standards, if known.
[compilerInfoLanguages] :: CompilerInfo -> Maybe [Language]

-- | Supported extensions, if known.
[compilerInfoExtensions] :: CompilerInfo -> Maybe [Extension]
data CompilerId
CompilerId :: CompilerFlavor -> Version -> CompilerId
data CompilerFlavor
GHC :: CompilerFlavor
GHCJS :: CompilerFlavor
NHC :: CompilerFlavor
YHC :: CompilerFlavor
Hugs :: CompilerFlavor
HBC :: CompilerFlavor
Helium :: CompilerFlavor
JHC :: CompilerFlavor
LHC :: CompilerFlavor
UHC :: CompilerFlavor
HaskellSuite :: String -> CompilerFlavor
OtherCompiler :: String -> CompilerFlavor
classifyCompilerFlavor :: String -> CompilerFlavor

-- | Like <a>classifyCompilerFlavor</a> but compatible with the old ReadS
°5uparser.
°5u
°5uIt is compatible in the sense that it accepts only the same strings,
°5ueg <a>GHC</a> but not "ghc". However other strings get mapped to
°5u<a>OtherCompiler</a>. The point of this is that we do not allow extra
°5uvalid values that would upset older Cabal versions that had a stricter
°5uparser however we cope with new values more gracefully so that we'll
°5ube able to introduce new value in future without breaking things so
°5umuch.
parseCompilerFlavorCompat :: ReadP r CompilerFlavor
buildCompilerFlavor :: CompilerFlavor
buildCompilerId :: CompilerId

-- | The default compiler flavour to pick when compiling stuff. This
°5udefaults to the compiler used to build the Cabal lib.
°5u
°5uHowever if it's not a recognised compiler then it's <a>Nothing</a> and
°5uthe user will have to specify which compiler they want.
defaultCompilerFlavor :: Maybe CompilerFlavor
abiTagString :: AbiTag -> String

-- | Make a CompilerInfo of which only the known information is its
°5uCompilerId, its AbiTag and that it does not claim to be compatible
°5uwith other compiler id's.
unknownCompilerInfo :: CompilerId -> AbiTag -> CompilerInfo

-- | Some compilers (notably GHC) support profiling and can instrument
°5uprograms so the system can account costs to different functions. There
°5uare different levels of detail that can be used for this accounting.
°5uFor compilers that do not support this notion or the particular detail
°5ulevels, this is either ignored or just capped to some similar level
°5uthey do support.
data ProfDetailLevel
ProfDetailNone :: ProfDetailLevel
ProfDetailDefault :: ProfDetailLevel
ProfDetailExportedFunctions :: ProfDetailLevel
ProfDetailToplevelFunctions :: ProfDetailLevel
ProfDetailAllFunctions :: ProfDetailLevel
ProfDetailOther :: String -> ProfDetailLevel

-- | Some compilers support emitting debug info. Some have different
°5ulevels. For compilers that do not the level is just capped to the
°5ulevel they do support.
data DebugInfoLevel
NoDebugInfo :: DebugInfoLevel
MinimalDebugInfo :: DebugInfoLevel
NormalDebugInfo :: DebugInfoLevel
MaximalDebugInfo :: DebugInfoLevel

-- | Some compilers support optimising. Some have different levels. For
°5ucompilers that do not the level is just capped to the level they do
°5usupport.
data OptimisationLevel
NoOptimisation :: OptimisationLevel
NormalOptimisation :: OptimisationLevel
MaximumOptimisation :: OptimisationLevel

-- | We typically get packages from several databases, and stack them
°5utogether. This type lets us be explicit about that stacking. For
°5uexample typical stacks include:
°5u
°5u<pre>
°5u[GlobalPackageDB]
°5u[GlobalPackageDB, UserPackageDB]
°5u[GlobalPackageDB, SpecificPackageDB "package.conf.inplace"]
°5u</pre>
°5u
°5uNote that the <a>GlobalPackageDB</a> is invariably at the bottom since
°5uit contains the rts, base and other special compiler-specific
°5upackages.
°5u
°5uWe are not restricted to using just the above combinations. In
°5uparticular we can use several custom package dbs and the user package
°5udb together.
°5u
°5uWhen it comes to writing, the top most (last) package is used.
type PackageDBStack = [PackageDB]

-- | Some compilers have a notion of a database of available packages. For
°5usome there is just one global db of packages, other compilers support
°5ua per-user or an arbitrary db specified at some location in the file
°5usystem. This can be used to build isloated environments of packages,
°5ufor example to build a collection of related packages without
°5uinstalling them globally.
data PackageDB
GlobalPackageDB :: PackageDB
UserPackageDB :: PackageDB
SpecificPackageDB :: FilePath -> PackageDB
data Compiler
Compiler :: CompilerId -> AbiTag -> [CompilerId] -> [(Language, Flag)] -> [(Extension, Maybe Flag)] -> Map String String -> Compiler

-- | Compiler flavour and version.
[compilerId] :: Compiler -> CompilerId

-- | Tag for distinguishing incompatible ABI's on the same architecture/os.
[compilerAbiTag] :: Compiler -> AbiTag

-- | Other implementations that this compiler claims to be compatible with.
[compilerCompat] :: Compiler -> [CompilerId]

-- | Supported language standards.
[compilerLanguages] :: Compiler -> [(Language, Flag)]

-- | Supported extensions.
[compilerExtensions] :: Compiler -> [(Extension, Maybe Flag)]

-- | A key-value map for properties not covered by the above fields.
[compilerProperties] :: Compiler -> Map String String
showCompilerId :: Compiler -> String
showCompilerIdWithAbi :: Compiler -> String
compilerFlavor :: Compiler -> CompilerFlavor
compilerVersion :: Compiler -> Version

-- | Is this compiler compatible with the compiler flavour we're interested
°5uin?
°5u
°5uFor example this checks if the compiler is actually GHC or is another
°5ucompiler that claims to be compatible with some version of GHC, e.g.
°5uGHCJS.
°5u
°5u<pre>
°5uif compilerCompatFlavor GHC compiler then ... else ...
°5u</pre>
compilerCompatFlavor :: CompilerFlavor -> Compiler -> Bool

-- | Is this compiler compatible with the compiler flavour we're interested
°5uin, and if so what version does it claim to be compatible with.
°5u
°5uFor example this checks if the compiler is actually GHC-7.x or is
°5uanother compiler that claims to be compatible with some GHC-7.x
°5uversion.
°5u
°5u<pre>
°5ucase compilerCompatVersion GHC compiler of
°5u  Just (Version (7:_)) -&gt; ...
°5u  _                    -&gt; ...
°5u</pre>
compilerCompatVersion :: CompilerFlavor -> Compiler -> Maybe Version
compilerInfo :: Compiler -> CompilerInfo

-- | Return the package that we should register into. This is the package
°5udb at the top of the stack.
registrationPackageDB :: PackageDBStack -> PackageDB

-- | Make package paths absolute
absolutePackageDBPaths :: PackageDBStack -> NoCallStackIO PackageDBStack
absolutePackageDBPath :: PackageDB -> NoCallStackIO PackageDB
flagToOptimisationLevel :: Maybe String -> OptimisationLevel
flagToDebugInfoLevel :: Maybe String -> DebugInfoLevel
unsupportedLanguages :: Compiler -> [Language] -> [Language]
languageToFlags :: Compiler -> Maybe Language -> [Flag]

-- | For the given compiler, return the extensions it does not support.
unsupportedExtensions :: Compiler -> [Extension] -> [Extension]

-- | For the given compiler, return the flags for the supported extensions.
extensionsToFlags :: Compiler -> [Extension] -> [Flag]

-- | Does this compiler support parallel --make mode?
parmakeSupported :: Compiler -> Bool

-- | Does this compiler support reexported-modules?
reexportedModulesSupported :: Compiler -> Bool

-- | Does this compiler support thinning/renaming on package flags?
renamingPackageFlagsSupported :: Compiler -> Bool

-- | Does this compiler have unified IPIDs (so no package keys)
unifiedIPIDRequired :: Compiler -> Bool

-- | Does this compiler support package keys?
packageKeySupported :: Compiler -> Bool

-- | Does this compiler support unit IDs?
unitIdSupported :: Compiler -> Bool

-- | Does this compiler support Backpack?
backpackSupported :: Compiler -> Bool

-- | Does this compiler support a package database entry with:
°5u"dynamic-library-dirs"?
libraryDynDirSupported :: Compiler -> Bool

-- | Does this compiler's "ar" command supports response file arguments
°5u(i.e. @file-style arguments).
arResponseFilesSupported :: Compiler -> Bool

-- | Does this compiler support Haskell program coverage?
coverageSupported :: Compiler -> Bool

-- | Does this compiler support profiling?
profilingSupported :: Compiler -> Bool
flagToProfDetailLevel :: String -> ProfDetailLevel
knownProfDetailLevels :: [(String, [String], ProfDetailLevel)]
showProfDetailLevel :: ProfDetailLevel -> String

-- | A simple implementation of <tt>main</tt> for a Cabal setup script. It
°5ureads the package description file using IO, and performs the action
°5uspecified on the command line.
defaultMain :: IO ()

-- | Like <a>defaultMain</a>, but accepts the package description as input
°5urather than using IO to read it.
defaultMainNoRead :: GenericPackageDescription -> IO ()

-- | A version of <a>defaultMain</a> that is passed the command line
°5uarguments, rather than getting them from the environment.
defaultMainArgs :: [String] -> IO ()

-- | Hooks allow authors to add specific functionality before and after a
°5ucommand is run, and also to specify additional preprocessors.
°5u
°5u<ul>
°5u<li>WARNING: The hooks interface is under rather constant flux as we
°5utry to understand users needs. Setup files that depend on this
°5uinterface may break in future releases.</li>
°5u</ul>
data UserHooks
UserHooks :: Args -> Bool -> PackageDescription -> LocalBuildInfo -> IO () -> IO (Maybe GenericPackageDescription) -> [PPSuffixHandler] -> [Program] -> Args -> ConfigFlags -> IO HookedBuildInfo -> (GenericPackageDescription, HookedBuildInfo) -> ConfigFlags -> IO LocalBuildInfo -> Args -> ConfigFlags -> PackageDescription -> LocalBuildInfo -> IO () -> Args -> BuildFlags -> IO HookedBuildInfo -> PackageDescription -> LocalBuildInfo -> UserHooks -> BuildFlags -> IO () -> Args -> BuildFlags -> PackageDescription -> LocalBuildInfo -> IO () -> Args -> ReplFlags -> IO HookedBuildInfo -> PackageDescription -> LocalBuildInfo -> UserHooks -> ReplFlags -> [String] -> IO () -> Args -> ReplFlags -> PackageDescription -> LocalBuildInfo -> IO () -> Args -> CleanFlags -> IO HookedBuildInfo -> PackageDescription -> () -> UserHooks -> CleanFlags -> IO () -> Args -> CleanFlags -> PackageDescription -> () -> IO () -> Args -> CopyFlags -> IO HookedBuildInfo -> PackageDescription -> LocalBuildInfo -> UserHooks -> CopyFlags -> IO () -> Args -> CopyFlags -> PackageDescription -> LocalBuildInfo -> IO () -> Args -> InstallFlags -> IO HookedBuildInfo -> PackageDescription -> LocalBuildInfo -> UserHooks -> InstallFlags -> IO () -> Args -> InstallFlags -> PackageDescription -> LocalBuildInfo -> IO () -> Args -> SDistFlags -> IO HookedBuildInfo -> PackageDescription -> Maybe LocalBuildInfo -> UserHooks -> SDistFlags -> IO () -> Args -> SDistFlags -> PackageDescription -> Maybe LocalBuildInfo -> IO () -> Args -> RegisterFlags -> IO HookedBuildInfo -> PackageDescription -> LocalBuildInfo -> UserHooks -> RegisterFlags -> IO () -> Args -> RegisterFlags -> PackageDescription -> LocalBuildInfo -> IO () -> Args -> RegisterFlags -> IO HookedBuildInfo -> PackageDescription -> LocalBuildInfo -> UserHooks -> RegisterFlags -> IO () -> Args -> RegisterFlags -> PackageDescription -> LocalBuildInfo -> IO () -> Args -> HscolourFlags -> IO HookedBuildInfo -> PackageDescription -> LocalBuildInfo -> UserHooks -> HscolourFlags -> IO () -> Args -> HscolourFlags -> PackageDescription -> LocalBuildInfo -> IO () -> Args -> DoctestFlags -> IO HookedBuildInfo -> PackageDescription -> LocalBuildInfo -> UserHooks -> DoctestFlags -> IO () -> Args -> DoctestFlags -> PackageDescription -> LocalBuildInfo -> IO () -> Args -> HaddockFlags -> IO HookedBuildInfo -> PackageDescription -> LocalBuildInfo -> UserHooks -> HaddockFlags -> IO () -> Args -> HaddockFlags -> PackageDescription -> LocalBuildInfo -> IO () -> Args -> TestFlags -> IO HookedBuildInfo -> Args -> PackageDescription -> LocalBuildInfo -> UserHooks -> TestFlags -> IO () -> Args -> TestFlags -> PackageDescription -> LocalBuildInfo -> IO () -> Args -> BenchmarkFlags -> IO HookedBuildInfo -> Args -> PackageDescription -> LocalBuildInfo -> UserHooks -> BenchmarkFlags -> IO () -> Args -> BenchmarkFlags -> PackageDescription -> LocalBuildInfo -> IO () -> UserHooks

-- | Used for <tt>./setup test</tt>

-- | <i>Deprecated: Please use the new testing interface instead!</i>
[runTests] :: UserHooks -> Args -> Bool -> PackageDescription -> LocalBuildInfo -> IO ()

-- | Read the description file
[readDesc] :: UserHooks -> IO (Maybe GenericPackageDescription)

-- | Custom preprocessors in addition to and overriding
°5u<a>knownSuffixHandlers</a>.
[hookedPreProcessors] :: UserHooks -> [PPSuffixHandler]

-- | These programs are detected at configure time. Arguments for them are
°5uadded to the configure command.
[hookedPrograms] :: UserHooks -> [Program]

-- | Hook to run before configure command
[preConf] :: UserHooks -> Args -> ConfigFlags -> IO HookedBuildInfo

-- | Over-ride this hook to get different behavior during configure.
[confHook] :: UserHooks -> (GenericPackageDescription, HookedBuildInfo) -> ConfigFlags -> IO LocalBuildInfo

-- | Hook to run after configure command
[postConf] :: UserHooks -> Args -> ConfigFlags -> PackageDescription -> LocalBuildInfo -> IO ()

-- | Hook to run before build command. Second arg indicates verbosity
°5ulevel.
[preBuild] :: UserHooks -> Args -> BuildFlags -> IO HookedBuildInfo

-- | Over-ride this hook to get different behavior during build.
[buildHook] :: UserHooks -> PackageDescription -> LocalBuildInfo -> UserHooks -> BuildFlags -> IO ()

-- | Hook to run after build command. Second arg indicates verbosity level.
[postBuild] :: UserHooks -> Args -> BuildFlags -> PackageDescription -> LocalBuildInfo -> IO ()

-- | Hook to run before repl command. Second arg indicates verbosity level.
[preRepl] :: UserHooks -> Args -> ReplFlags -> IO HookedBuildInfo

-- | Over-ride this hook to get different behavior during interpretation.
[replHook] :: UserHooks -> PackageDescription -> LocalBuildInfo -> UserHooks -> ReplFlags -> [String] -> IO ()

-- | Hook to run after repl command. Second arg indicates verbosity level.
[postRepl] :: UserHooks -> Args -> ReplFlags -> PackageDescription -> LocalBuildInfo -> IO ()

-- | Hook to run before clean command. Second arg indicates verbosity
°5ulevel.
[preClean] :: UserHooks -> Args -> CleanFlags -> IO HookedBuildInfo

-- | Over-ride this hook to get different behavior during clean.
[cleanHook] :: UserHooks -> PackageDescription -> () -> UserHooks -> CleanFlags -> IO ()

-- | Hook to run after clean command. Second arg indicates verbosity level.
[postClean] :: UserHooks -> Args -> CleanFlags -> PackageDescription -> () -> IO ()

-- | Hook to run before copy command
[preCopy] :: UserHooks -> Args -> CopyFlags -> IO HookedBuildInfo

-- | Over-ride this hook to get different behavior during copy.
[copyHook] :: UserHooks -> PackageDescription -> LocalBuildInfo -> UserHooks -> CopyFlags -> IO ()

-- | Hook to run after copy command
[postCopy] :: UserHooks -> Args -> CopyFlags -> PackageDescription -> LocalBuildInfo -> IO ()

-- | Hook to run before install command
[preInst] :: UserHooks -> Args -> InstallFlags -> IO HookedBuildInfo

-- | Over-ride this hook to get different behavior during install.
[instHook] :: UserHooks -> PackageDescription -> LocalBuildInfo -> UserHooks -> InstallFlags -> IO ()

-- | Hook to run after install command. postInst should be run on the
°5utarget, not on the build machine.
[postInst] :: UserHooks -> Args -> InstallFlags -> PackageDescription -> LocalBuildInfo -> IO ()

-- | Hook to run before sdist command. Second arg indicates verbosity
°5ulevel.
[preSDist] :: UserHooks -> Args -> SDistFlags -> IO HookedBuildInfo

-- | Over-ride this hook to get different behavior during sdist.
[sDistHook] :: UserHooks -> PackageDescription -> Maybe LocalBuildInfo -> UserHooks -> SDistFlags -> IO ()

-- | Hook to run after sdist command. Second arg indicates verbosity level.
[postSDist] :: UserHooks -> Args -> SDistFlags -> PackageDescription -> Maybe LocalBuildInfo -> IO ()

-- | Hook to run before register command
[preReg] :: UserHooks -> Args -> RegisterFlags -> IO HookedBuildInfo

-- | Over-ride this hook to get different behavior during registration.
[regHook] :: UserHooks -> PackageDescription -> LocalBuildInfo -> UserHooks -> RegisterFlags -> IO ()

-- | Hook to run after register command
[postReg] :: UserHooks -> Args -> RegisterFlags -> PackageDescription -> LocalBuildInfo -> IO ()

-- | Hook to run before unregister command
[preUnreg] :: UserHooks -> Args -> RegisterFlags -> IO HookedBuildInfo

-- | Over-ride this hook to get different behavior during unregistration.
[unregHook] :: UserHooks -> PackageDescription -> LocalBuildInfo -> UserHooks -> RegisterFlags -> IO ()

-- | Hook to run after unregister command
[postUnreg] :: UserHooks -> Args -> RegisterFlags -> PackageDescription -> LocalBuildInfo -> IO ()

-- | Hook to run before hscolour command. Second arg indicates verbosity
°5ulevel.
[preHscolour] :: UserHooks -> Args -> HscolourFlags -> IO HookedBuildInfo

-- | Over-ride this hook to get different behavior during hscolour.
[hscolourHook] :: UserHooks -> PackageDescription -> LocalBuildInfo -> UserHooks -> HscolourFlags -> IO ()

-- | Hook to run after hscolour command. Second arg indicates verbosity
°5ulevel.
[postHscolour] :: UserHooks -> Args -> HscolourFlags -> PackageDescription -> LocalBuildInfo -> IO ()

-- | Hook to run before doctest command. Second arg indicates verbosity
°5ulevel.
[preDoctest] :: UserHooks -> Args -> DoctestFlags -> IO HookedBuildInfo

-- | Over-ride this hook to get different behavior during doctest.
[doctestHook] :: UserHooks -> PackageDescription -> LocalBuildInfo -> UserHooks -> DoctestFlags -> IO ()

-- | Hook to run after doctest command. Second arg indicates verbosity
°5ulevel.
[postDoctest] :: UserHooks -> Args -> DoctestFlags -> PackageDescription -> LocalBuildInfo -> IO ()

-- | Hook to run before haddock command. Second arg indicates verbosity
°5ulevel.
[preHaddock] :: UserHooks -> Args -> HaddockFlags -> IO HookedBuildInfo

-- | Over-ride this hook to get different behavior during haddock.
[haddockHook] :: UserHooks -> PackageDescription -> LocalBuildInfo -> UserHooks -> HaddockFlags -> IO ()

-- | Hook to run after haddock command. Second arg indicates verbosity
°5ulevel.
[postHaddock] :: UserHooks -> Args -> HaddockFlags -> PackageDescription -> LocalBuildInfo -> IO ()

-- | Hook to run before test command.
[preTest] :: UserHooks -> Args -> TestFlags -> IO HookedBuildInfo

-- | Over-ride this hook to get different behavior during test.
[testHook] :: UserHooks -> Args -> PackageDescription -> LocalBuildInfo -> UserHooks -> TestFlags -> IO ()

-- | Hook to run after test command.
[postTest] :: UserHooks -> Args -> TestFlags -> PackageDescription -> LocalBuildInfo -> IO ()

-- | Hook to run before bench command.
[preBench] :: UserHooks -> Args -> BenchmarkFlags -> IO HookedBuildInfo

-- | Over-ride this hook to get different behavior during bench.
[benchHook] :: UserHooks -> Args -> PackageDescription -> LocalBuildInfo -> UserHooks -> BenchmarkFlags -> IO ()

-- | Hook to run after bench command.
[postBench] :: UserHooks -> Args -> BenchmarkFlags -> PackageDescription -> LocalBuildInfo -> IO ()
type Args = [String]

-- | A customizable version of <a>defaultMain</a>.
defaultMainWithHooks :: UserHooks -> IO ()

-- | A customizable version of <a>defaultMain</a> that also takes the
°5ucommand line arguments.
defaultMainWithHooksArgs :: UserHooks -> [String] -> IO ()

-- | A customizable version of <a>defaultMainNoRead</a>.
defaultMainWithHooksNoRead :: UserHooks -> GenericPackageDescription -> IO ()

-- | A customizable version of <a>defaultMainNoRead</a> that also takes the
°5ucommand line arguments.
defaultMainWithHooksNoReadArgs :: UserHooks -> GenericPackageDescription -> [String] -> IO ()

-- | Hooks that correspond to a plain instantiation of the "simple" build
°5usystem
simpleUserHooks :: UserHooks
autoconfUserHooks :: UserHooks

-- | Basic autoconf <a>UserHooks</a>:
°5u
°5u<ul>
°5u<li><a>postConf</a> runs <tt>./configure</tt>, if present.</li>
°5u<li>the pre-hooks <a>preBuild</a>, <a>preClean</a>, <a>preCopy</a>,
°5u<a>preInst</a>, <a>preReg</a> and <a>preUnreg</a> read additional
°5ubuild information from <i>package</i><tt>.buildinfo</tt>, if
°5upresent.</li>
°5u</ul>
°5u
°5uThus <tt>configure</tt> can use local system information to generate
°5u<i>package</i><tt>.buildinfo</tt> and possibly other files.

-- | <i>Deprecated: Use simpleUserHooks or autoconfUserHooks, unless you
°5uneed Cabal-1.2 compatibility in which case you must stick with
°5udefaultUserHooks</i>
defaultUserHooks :: UserHooks

-- | Empty <a>UserHooks</a> which do nothing.
emptyUserHooks :: UserHooks

-- | Optional auxiliary package information file
°5u(<i>pkgname</i><tt>.buildinfo</tt>)
defaultHookedPackageDesc :: IO (Maybe FilePath)
