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


-- | A library for working with .cabal files
--   
--   This library provides tools for reading and manipulating the .cabal
--   file format.
@package Cabal-syntax
@version 3.10.3.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

-- | Catch <tt>IOException</tt>.
catchIO :: IO a -> (IOException -> IO a) -> IO a

-- | Catch <a>ExitCode</a>
catchExit :: IO a -> (ExitCode -> IO a) -> IO a

-- | Try <tt>IOException</tt>.
tryIO :: IO a -> IO (Either IOException a)

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


-- | Compatibility layer for <a>Control.Monad.Fail</a>
module Distribution.Compat.MonadFail

-- | When a value is bound in <tt>do</tt>-notation, the pattern on the left
--   hand side of <tt>&lt;-</tt> might not match. In this case, this class
--   provides a function to recover.
--   
--   A <a>Monad</a> without a <a>MonadFail</a> instance may only be used in
--   conjunction with pattern that always match, such as newtypes, tuples,
--   data types with only a single data constructor, and irrefutable
--   patterns (<tt>~pat</tt>).
--   
--   Instances of <a>MonadFail</a> should satisfy the following law:
--   <tt>fail s</tt> should be a left zero for <a>&gt;&gt;=</a>,
--   
--   <pre>
--   fail s &gt;&gt;= f  =  fail s
--   </pre>
--   
--   If your <a>Monad</a> is also <a>MonadPlus</a>, a popular definition is
--   
--   <pre>
--   fail _ = mzero
--   </pre>
--   
--   <tt>fail s</tt> should be an action that runs in the monad itself, not
--   an exception (except in instances of <tt>MonadIO</tt>). In particular,
--   <tt>fail</tt> should not be implemented in terms of <tt>error</tt>.
class Monad m => MonadFail (m :: Type -> Type)
fail :: MonadFail m => String -> m a


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

-- | The <tt>FunctionalDependencies</tt> version of <a>Newtype</a>
--   type-class.
--   
--   Since Cabal-3.0 class arguments are in a different order than in
--   <tt>newtype</tt> package. This change is to allow usage with
--   <tt>DeriveAnyClass</tt> (and <tt>DerivingStrategies</tt>, in GHC-8.2).
--   Unfortunately one has to repeat inner type.
--   
--   <pre>
--   newtype New = New Old
--     deriving anyclass (Newtype Old)
--   </pre>
--   
--   Another approach would be to use <tt>TypeFamilies</tt> (and possibly
--   compute inner type using <a>GHC.Generics</a>), but we think
--   <tt>FunctionalDependencies</tt> version gives cleaner type signatures.
class Newtype o n | n -> o
pack :: Newtype o n => o -> n
pack :: (Newtype o n, Coercible o n) => o -> n
unpack :: Newtype o n => n -> o
unpack :: (Newtype o n, Coercible n o) => n -> o

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

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

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

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

module Distribution.Compat.Typeable

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

-- | A quantified type representation.
type TypeRep = SomeTypeRep

-- | Takes a value of type <tt>a</tt> and returns a concrete representation
--   of that type.
typeRep :: forall {k} proxy (a :: k). Typeable a => proxy a -> TypeRep


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


-- | Implementation of base-62 encoding, which we use when computing hashes
--   for fully instantiated unit ids.
module Distribution.Utils.Base62

-- | Hash a string using GHC's fingerprinting algorithm (a 128-bit MD5
--   hash) and then encode the resulting hash in base 62.
hashToBase62 :: String -> String

module Distribution.Utils.MD5
type MD5 = Fingerprint

-- | Show <a>MD5</a> in human readable form
--   
--   <pre>
--   &gt;&gt;&gt; showMD5 (Fingerprint 123 456)
--   "000000000000007b00000000000001c8"
--   </pre>
--   
--   <pre>
--   &gt;&gt;&gt; showMD5 $ md5 $ BS.pack [0..127]
--   "37eff01866ba3f538421b30b7cbefcac"
--   </pre>
--   
--   @since 3.2.0.0
showMD5 :: MD5 -> String

-- | @since 3.2.0.0
md5 :: ByteString -> MD5

-- | <pre>
--   &gt;&gt;&gt; showMD5 $ md5FromInteger 0x37eff01866ba3f538421b30b7cbefcac
--   "37eff01866ba3f538421b30b7cbefcac"
--   </pre>
--   
--   Note: the input is truncated:
--   
--   <pre>
--   &gt;&gt;&gt; showMD5 $ md5FromInteger 0x1230000037eff01866ba3f538421b30b7cbefcac
--   "37eff01866ba3f538421b30b7cbefcac"
--   </pre>
--   
--   Yet, negative numbers are not a problem...
--   
--   <pre>
--   &gt;&gt;&gt; showMD5 $ md5FromInteger (-1)
--   "ffffffffffffffffffffffffffffffff"
--   </pre>
md5FromInteger :: Integer -> MD5

-- | @since 3.2.0.0
binaryPutMD5 :: MD5 -> Put

-- | @since 3.2.0.0
binaryGetMD5 :: Get MD5

module Distribution.Utils.String

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

-- | Encode <a>String</a> to a list of UTF8-encoded octets
--   
--   Code-points in the <tt>U+D800</tt>-<tt>U+DFFF</tt> range will be
--   encoded as the replacement character (i.e. <tt>U+FFFD</tt>).
--   
--   See also <tt>decodeUtf8</tt>
encodeStringUtf8 :: String -> [Word8]
trim :: String -> String


-- | Structurally tag binary serialisation stream. Useful when most
--   <tt>Binary</tt> instances are <a>Generic</a> derived.
--   
--   Say you have a data type
--   
--   <pre>
--   data Record = Record
--     { _recordFields  :: HM.HashMap Text (Integer, ByteString)
--     , _recordEnabled :: Bool
--     }
--     deriving (Eq, Show, Generic)
--   
--   instance <tt>Binary</tt> Record
--   instance <a>Structured</a> Record
--   </pre>
--   
--   then you can serialise and deserialise <tt>Record</tt> values with a
--   structure tag by simply
--   
--   <pre>
--   <a>structuredEncode</a> record :: <a>ByteString</a>
--   <a>structuredDecode</a> lbs :: IO Record
--   </pre>
--   
--   If structure of <tt>Record</tt> changes in between, deserialisation
--   will fail early.
--   
--   Technically, <a>Structured</a> is not related to <tt>Binary</tt>, and
--   may be useful in other uses.
module Distribution.Utils.Structured

-- | Structured <a>encode</a>. Encode a value to using binary serialisation
--   to a lazy <a>ByteString</a>. Encoding starts with 16 byte large
--   structure hash.
structuredEncode :: forall a. (Binary a, Structured a) => a -> ByteString

-- | Lazily serialise a value to a file
structuredEncodeFile :: (Binary a, Structured a) => FilePath -> a -> IO ()

-- | Structured <a>decode</a>. Decode a value from a lazy
--   <a>ByteString</a>, reconstructing the original structure. Throws pure
--   exception on invalid inputs.
structuredDecode :: forall a. (Binary a, Structured a) => ByteString -> a
structuredDecodeOrFailIO :: (Binary a, Structured a) => ByteString -> IO (Either String a)

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

-- | Class of types with a known <a>Structure</a>.
--   
--   For regular data types <a>Structured</a> can be derived generically.
--   
--   <pre>
--   data Record = Record { a :: Int, b :: Bool, c :: [Char] } deriving (<a>Generic</a>)
--   instance <a>Structured</a> Record
--   </pre>
class Typeable a => Structured a
structure :: Structured a => Proxy a -> Structure
structure :: (Structured a, Generic a, GStructured (Rep a)) => Proxy a -> Structure
type MD5 = Fingerprint

-- | Semantically <tt><a>hashStructure</a> . <a>structure</a></tt>.
structureHash :: forall a. Structured a => Proxy a -> MD5

-- | Flatten <a>Structure</a> into something we can calculate hash of.
--   
--   As <a>Structure</a> can be potentially infinite. For mutually
--   recursive types, we keep track of <a>TypeRep</a>s, and put just
--   <a>TypeRep</a> name when it's occurred another time.
structureBuilder :: Structure -> Builder

-- | Derive <a>structure</a> generically.
genericStructure :: forall a. (Typeable a, Generic a, GStructured (Rep a)) => Proxy a -> Structure

-- | Used to implement <a>genericStructure</a>.
class GStructured (f :: Type -> Type)

-- | Use <a>Typeable</a> to infer name
nominalStructure :: Typeable a => Proxy a -> Structure
containerStructure :: forall f a. (Typeable f, Structured a) => Proxy (f a) -> Structure

-- | Structure of a datatype.
--   
--   It can be infinite, as far as <a>TypeRep</a>s involved are finite.
--   (e.g. polymorphic recursion might cause troubles).
data Structure

-- | nominal, yet can be parametrised by other structures.
Nominal :: !TypeRep -> !TypeVersion -> TypeName -> [Structure] -> Structure

-- | a newtype wrapper
Newtype :: !TypeRep -> !TypeVersion -> TypeName -> Structure -> Structure

-- | sum-of-products structure
Structure :: !TypeRep -> !TypeVersion -> TypeName -> SopStructure -> Structure
data Tag a
Tag :: Tag a
type TypeName = String
type ConstructorName = String

-- | A semantic version of a data type. Usually 0.
type TypeVersion = Word32
type SopStructure = [(ConstructorName, [Structure])]

-- | A MD5 hash digest of <a>Structure</a>.
hashStructure :: Structure -> MD5

-- | A van-Laarhoven lens into <a>TypeVersion</a> of <a>Structure</a>
--   
--   <pre>
--   <a>typeVersion</a> :: Lens' <a>Structure</a> <a>TypeVersion</a>
--   </pre>
typeVersion :: Functor f => (TypeVersion -> f TypeVersion) -> Structure -> f Structure

-- | A van-Laarhoven lens into <a>TypeName</a> of <a>Structure</a>
--   
--   <pre>
--   <a>typeName</a> :: Lens' <a>Structure</a> <a>TypeName</a>
--   </pre>
typeName :: Functor f => (TypeName -> f TypeName) -> Structure -> f Structure
instance GHC.Generics.Generic Distribution.Utils.Structured.Structure
instance GHC.Show.Show Distribution.Utils.Structured.Structure
instance GHC.Classes.Ord Distribution.Utils.Structured.Structure
instance GHC.Classes.Eq Distribution.Utils.Structured.Structure
instance (i GHC.Types.~ GHC.Generics.C, GHC.Generics.Constructor c, Distribution.Utils.Structured.GStructuredProd f) => Distribution.Utils.Structured.GStructuredSum (GHC.Generics.M1 i c f)
instance (i GHC.Types.~ GHC.Generics.S, Distribution.Utils.Structured.GStructuredProd f) => Distribution.Utils.Structured.GStructuredProd (GHC.Generics.M1 i c f)
instance Distribution.Utils.Structured.Structured c => Distribution.Utils.Structured.GStructuredProd (GHC.Generics.K1 i c)
instance Distribution.Utils.Structured.GStructuredProd GHC.Generics.U1
instance (Distribution.Utils.Structured.GStructuredProd f, Distribution.Utils.Structured.GStructuredProd g) => Distribution.Utils.Structured.GStructuredProd (f GHC.Generics.:*: g)
instance (i GHC.Types.~ GHC.Generics.D, GHC.Generics.Datatype c, Distribution.Utils.Structured.GStructuredSum f) => Distribution.Utils.Structured.GStructured (GHC.Generics.M1 i c f)
instance (Distribution.Utils.Structured.GStructuredSum f, Distribution.Utils.Structured.GStructuredSum g) => Distribution.Utils.Structured.GStructuredSum (f GHC.Generics.:+: g)
instance Distribution.Utils.Structured.GStructuredSum GHC.Generics.V1
instance Distribution.Utils.Structured.Structured a => Data.Binary.Class.Binary (Distribution.Utils.Structured.Tag a)
instance Distribution.Utils.Structured.Structured ()
instance Distribution.Utils.Structured.Structured GHC.Types.Bool
instance Distribution.Utils.Structured.Structured GHC.Types.Ordering
instance Distribution.Utils.Structured.Structured GHC.Types.Char
instance Distribution.Utils.Structured.Structured GHC.Types.Int
instance Distribution.Utils.Structured.Structured GHC.Num.Integer.Integer
instance Distribution.Utils.Structured.Structured GHC.Types.Word
instance Distribution.Utils.Structured.Structured GHC.Int.Int8
instance Distribution.Utils.Structured.Structured GHC.Int.Int16
instance Distribution.Utils.Structured.Structured GHC.Int.Int32
instance Distribution.Utils.Structured.Structured GHC.Int.Int64
instance Distribution.Utils.Structured.Structured GHC.Word.Word8
instance Distribution.Utils.Structured.Structured GHC.Word.Word16
instance Distribution.Utils.Structured.Structured GHC.Word.Word32
instance Distribution.Utils.Structured.Structured GHC.Word.Word64
instance Distribution.Utils.Structured.Structured GHC.Types.Float
instance Distribution.Utils.Structured.Structured GHC.Types.Double
instance Distribution.Utils.Structured.Structured a => Distribution.Utils.Structured.Structured (GHC.Maybe.Maybe a)
instance (Distribution.Utils.Structured.Structured a, Distribution.Utils.Structured.Structured b) => Distribution.Utils.Structured.Structured (Data.Either.Either a b)
instance Distribution.Utils.Structured.Structured a => Distribution.Utils.Structured.Structured (GHC.Real.Ratio a)
instance Distribution.Utils.Structured.Structured a => Distribution.Utils.Structured.Structured [a]
instance Distribution.Utils.Structured.Structured a => Distribution.Utils.Structured.Structured (GHC.Base.NonEmpty a)
instance (Distribution.Utils.Structured.Structured a1, Distribution.Utils.Structured.Structured a2) => Distribution.Utils.Structured.Structured (a1, a2)
instance (Distribution.Utils.Structured.Structured a1, Distribution.Utils.Structured.Structured a2, Distribution.Utils.Structured.Structured a3) => Distribution.Utils.Structured.Structured (a1, a2, a3)
instance (Distribution.Utils.Structured.Structured a1, Distribution.Utils.Structured.Structured a2, Distribution.Utils.Structured.Structured a3, Distribution.Utils.Structured.Structured a4) => Distribution.Utils.Structured.Structured (a1, a2, a3, a4)
instance (Distribution.Utils.Structured.Structured a1, Distribution.Utils.Structured.Structured a2, Distribution.Utils.Structured.Structured a3, Distribution.Utils.Structured.Structured a4, Distribution.Utils.Structured.Structured a5) => Distribution.Utils.Structured.Structured (a1, a2, a3, a4, a5)
instance (Distribution.Utils.Structured.Structured a1, Distribution.Utils.Structured.Structured a2, Distribution.Utils.Structured.Structured a3, Distribution.Utils.Structured.Structured a4, Distribution.Utils.Structured.Structured a5, Distribution.Utils.Structured.Structured a6) => Distribution.Utils.Structured.Structured (a1, a2, a3, a4, a5, a6)
instance (Distribution.Utils.Structured.Structured a1, Distribution.Utils.Structured.Structured a2, Distribution.Utils.Structured.Structured a3, Distribution.Utils.Structured.Structured a4, Distribution.Utils.Structured.Structured a5, Distribution.Utils.Structured.Structured a6, Distribution.Utils.Structured.Structured a7) => Distribution.Utils.Structured.Structured (a1, a2, a3, a4, a5, a6, a7)
instance Distribution.Utils.Structured.Structured Data.ByteString.Internal.Type.ByteString
instance Distribution.Utils.Structured.Structured Data.ByteString.Lazy.Internal.ByteString
instance Distribution.Utils.Structured.Structured Data.Text.Internal.Text
instance Distribution.Utils.Structured.Structured Data.Text.Internal.Lazy.Text
instance (Distribution.Utils.Structured.Structured k, Distribution.Utils.Structured.Structured v) => Distribution.Utils.Structured.Structured (Data.Map.Internal.Map k v)
instance Distribution.Utils.Structured.Structured k => Distribution.Utils.Structured.Structured (Data.Set.Internal.Set k)
instance Distribution.Utils.Structured.Structured v => Distribution.Utils.Structured.Structured (Data.IntMap.Internal.IntMap v)
instance Distribution.Utils.Structured.Structured Data.IntSet.Internal.IntSet
instance Distribution.Utils.Structured.Structured v => Distribution.Utils.Structured.Structured (Data.Sequence.Internal.Seq v)
instance Distribution.Utils.Structured.Structured Data.Time.Clock.Internal.UTCTime.UTCTime
instance Distribution.Utils.Structured.Structured Data.Time.Clock.Internal.DiffTime.DiffTime
instance Distribution.Utils.Structured.Structured Data.Time.Clock.Internal.UniversalTime.UniversalTime
instance Distribution.Utils.Structured.Structured Data.Time.Clock.Internal.NominalDiffTime.NominalDiffTime
instance Distribution.Utils.Structured.Structured Data.Time.Calendar.Days.Day
instance Distribution.Utils.Structured.Structured Data.Time.LocalTime.Internal.TimeZone.TimeZone
instance Distribution.Utils.Structured.Structured Data.Time.LocalTime.Internal.TimeOfDay.TimeOfDay
instance Distribution.Utils.Structured.Structured Data.Time.LocalTime.Internal.LocalTime.LocalTime


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

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

-- | An associative operation.
--   
--   <h4><b>Examples</b></h4>
--   
--   <pre>
--   &gt;&gt;&gt; [1,2,3] &lt;&gt; [4,5,6]
--   [1,2,3,4,5,6]
--   </pre>
--   
--   <pre>
--   &gt;&gt;&gt; Just [1, 2, 3] &lt;&gt; Just [4, 5, 6]
--   Just [1,2,3,4,5,6]
--   </pre>
--   
--   <pre>
--   &gt;&gt;&gt; putStr "Hello, " &lt;&gt; putStrLn "World!"
--   Hello, World!
--   </pre>
(<>) :: Semigroup a => a -> a -> a
infixr 6 <>

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

-- | Identity of <a>mappend</a>
--   
--   <h4><b>Examples</b></h4>
--   
--   <pre>
--   &gt;&gt;&gt; "Hello world" &lt;&gt; mempty
--   "Hello world"
--   </pre>
--   
--   <pre>
--   &gt;&gt;&gt; mempty &lt;&gt; [1, 2, 3]
--   [1,2,3]
--   </pre>
mempty :: Monoid a => a

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

-- | Fold a list using the monoid.
--   
--   For most types, the default definition for <a>mconcat</a> will be
--   used, but the function is included in the class definition so that an
--   optimized version can be provided for specific types.
--   
--   <pre>
--   &gt;&gt;&gt; mconcat ["Hello", " ", "Haskell", "!"]
--   "Hello Haskell!"
--   </pre>
mconcat :: Monoid a => [a] -> a

-- | Boolean monoid under conjunction <a>(&amp;&amp;)</a>.
--   
--   <pre>
--   All x &lt;&gt; All y = All (x &amp;&amp; y)
--   </pre>
--   
--   <h4><b>Examples</b></h4>
--   
--   <pre>
--   &gt;&gt;&gt; All True &lt;&gt; mempty &lt;&gt; All False)
--   All {getAll = False}
--   </pre>
--   
--   <pre>
--   &gt;&gt;&gt; mconcat (map (\x -&gt; All (even x)) [2,4,6,7,8])
--   All {getAll = False}
--   </pre>
--   
--   <pre>
--   &gt;&gt;&gt; All True &lt;&gt; mempty
--   All {getAll = True}
--   </pre>
newtype () => All
All :: Bool -> All
[getAll] :: All -> Bool

-- | Boolean monoid under disjunction <a>(||)</a>.
--   
--   <pre>
--   Any x &lt;&gt; Any y = Any (x || y)
--   </pre>
--   
--   <h4><b>Examples</b></h4>
--   
--   <pre>
--   &gt;&gt;&gt; Any True &lt;&gt; mempty &lt;&gt; Any False
--   Any {getAny = True}
--   </pre>
--   
--   <pre>
--   &gt;&gt;&gt; mconcat (map (\x -&gt; Any (even x)) [2,4,6,7,8])
--   Any {getAny = True}
--   </pre>
--   
--   <pre>
--   &gt;&gt;&gt; Any False &lt;&gt; mempty
--   Any {getAny = False}
--   </pre>
newtype () => Any
Any :: Bool -> Any
[getAny] :: Any -> Bool

-- | A copy of <a>First</a>.
newtype First' a
First' :: a -> First' a
[getFirst'] :: First' a -> a

-- | A copy of <a>Last</a>.
newtype Last' a
Last' :: a -> Last' a
[getLast'] :: Last' a -> a

-- | A wrapper around <a>Maybe</a>, providing the <a>Semigroup</a> and
--   <a>Monoid</a> instances implemented for <a>Maybe</a> since
--   <tt>base-4.11</tt>.
newtype Option' a
Option' :: Maybe a -> Option' a
[getOption'] :: Option' a -> Maybe a

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

-- | Generically generate a <a>Monoid</a> <a>mempty</a> for any
--   product-like type implementing <a>Generic</a>.
--   
--   It is only defined for product types.
--   
--   <pre>
--   <a>gmappend</a> <a>gmempty</a> a = a = <a>gmappend</a> a <a>gmempty</a>
--   </pre>
gmempty :: (Generic a, GMonoid (Rep a)) => a
instance GHC.Show.Show a => GHC.Show.Show (Distribution.Compat.Semigroup.First' a)
instance GHC.Classes.Ord a => GHC.Classes.Ord (Distribution.Compat.Semigroup.First' a)
instance GHC.Classes.Eq a => GHC.Classes.Eq (Distribution.Compat.Semigroup.First' a)
instance Data.Binary.Class.Binary a => Data.Binary.Class.Binary (Distribution.Compat.Semigroup.Last' a)
instance GHC.Generics.Generic (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.Functor Distribution.Compat.Semigroup.Option'
instance GHC.Generics.Generic (Distribution.Compat.Semigroup.Option' a)
instance Data.Binary.Class.Binary a => Data.Binary.Class.Binary (Distribution.Compat.Semigroup.Option' a)
instance GHC.Show.Show a => GHC.Show.Show (Distribution.Compat.Semigroup.Option' a)
instance GHC.Read.Read a => GHC.Read.Read (Distribution.Compat.Semigroup.Option' a)
instance GHC.Classes.Ord a => GHC.Classes.Ord (Distribution.Compat.Semigroup.Option' a)
instance GHC.Classes.Eq a => GHC.Classes.Eq (Distribution.Compat.Semigroup.Option' 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 Distribution.Utils.Structured.Structured a => Distribution.Utils.Structured.Structured (Distribution.Compat.Semigroup.Option' a)
instance GHC.Base.Semigroup a => GHC.Base.Semigroup (Distribution.Compat.Semigroup.Option' a)
instance GHC.Base.Semigroup a => GHC.Base.Monoid (Distribution.Compat.Semigroup.Option' a)
instance Distribution.Utils.Structured.Structured a => Distribution.Utils.Structured.Structured (Distribution.Compat.Semigroup.Last' a)
instance GHC.Base.Semigroup (Distribution.Compat.Semigroup.Last' a)
instance GHC.Base.Functor Distribution.Compat.Semigroup.Last'
instance GHC.Base.Semigroup (Distribution.Compat.Semigroup.First' a)

module Distribution.Compat.NonEmptySet

data NonEmptySet a
singleton :: a -> NonEmptySet a
insert :: Ord a => a -> NonEmptySet a -> NonEmptySet a
delete :: Ord a => a -> NonEmptySet a -> Maybe (NonEmptySet a)
toNonEmpty :: NonEmptySet a -> NonEmpty a
fromNonEmpty :: Ord a => NonEmpty a -> NonEmptySet a
toList :: NonEmptySet a -> [a]
toSet :: NonEmptySet a -> Set a
member :: Ord a => a -> NonEmptySet a -> Bool
map :: Ord b => (a -> b) -> NonEmptySet a -> NonEmptySet b
instance (GHC.Read.Read a, GHC.Classes.Ord a) => GHC.Read.Read (Distribution.Compat.NonEmptySet.NonEmptySet a)
instance (Data.Data.Data a, GHC.Classes.Ord a) => Data.Data.Data (Distribution.Compat.NonEmptySet.NonEmptySet a)
instance GHC.Classes.Ord a => GHC.Classes.Ord (Distribution.Compat.NonEmptySet.NonEmptySet a)
instance GHC.Classes.Eq a => GHC.Classes.Eq (Distribution.Compat.NonEmptySet.NonEmptySet a)
instance GHC.Show.Show a => GHC.Show.Show (Distribution.Compat.NonEmptySet.NonEmptySet a)
instance Data.Binary.Class.Binary a => Data.Binary.Class.Binary (Distribution.Compat.NonEmptySet.NonEmptySet a)
instance Distribution.Utils.Structured.Structured a => Distribution.Utils.Structured.Structured (Distribution.Compat.NonEmptySet.NonEmptySet a)
instance Control.DeepSeq.NFData a => Control.DeepSeq.NFData (Distribution.Compat.NonEmptySet.NonEmptySet a)
instance GHC.Classes.Ord a => GHC.Base.Semigroup (Distribution.Compat.NonEmptySet.NonEmptySet a)
instance Data.Foldable.Foldable Distribution.Compat.NonEmptySet.NonEmptySet


-- | This module does two things:
--   
--   <ul>
--   <li>Acts as a compatibility layer, like <tt>base-compat</tt>.</li>
--   <li>Provides commonly used imports.</li>
--   </ul>
module Distribution.Compat.Prelude
data () => Int
data () => Float
data () => Char
data () => IO a
data () => Bool
False :: Bool
True :: Bool
data () => Double
data () => Ordering
LT :: Ordering
EQ :: Ordering
GT :: Ordering

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

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

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

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

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

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

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

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

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

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

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

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

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

-- | attempts to parse a value from the front of the string, returning a
--   list of (parsed value, remaining string) pairs. If there is no
--   successful parse, the returned list is empty.
--   
--   Derived instances of <a>Read</a> and <a>Show</a> satisfy the
--   following:
--   
--   <ul>
--   <li><tt>(x,"")</tt> is an element of <tt>(<a>readsPrec</a> d
--   (<a>showsPrec</a> d x ""))</tt>.</li>
--   </ul>
--   
--   That is, <a>readsPrec</a> parses the string produced by
--   <a>showsPrec</a>, and delivers the value that <a>showsPrec</a> started
--   with.
readsPrec :: Read a => Int -> ReadS a

-- | The method <a>readList</a> is provided to allow the programmer to give
--   a specialised way of parsing lists of values. For example, this is
--   used by the predefined <a>Read</a> instance of the <a>Char</a> type,
--   where values of type <a>String</a> should be are expected to use
--   double quotes, rather than square brackets.
readList :: Read a => ReadS [a]

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

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

-- | A specialised variant of <a>showsPrec</a>, using precedence context
--   zero, 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
--   a specialised way of showing lists of values. For example, this is
--   used by the predefined <a>Show</a> instance of the <a>Char</a> type,
--   where values of type <a>String</a> should be shown in double quotes,
--   rather than between square brackets.
showList :: Show a => [a] -> ShowS

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

-- | The <a>Bounded</a> class is used to name the upper and lower limits of
--   a type. <a>Ord</a> is not a superclass of <a>Bounded</a> since types
--   that are not totally ordered may also have upper and lower bounds.
--   
--   The <a>Bounded</a> class may be derived for any enumeration type;
--   <a>minBound</a> is the first constructor listed in the <tt>data</tt>
--   declaration and <a>maxBound</a> is the last. <a>Bounded</a> may also
--   be derived for single-constructor datatypes whose constituent types
--   are 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.
--   
--   The <tt>enumFrom</tt>... methods are used in Haskell's translation of
--   arithmetic sequences.
--   
--   Instances of <a>Enum</a> may be derived for any enumeration type
--   (types whose constructors have no fields). The nullary constructors
--   are assumed to be numbered left-to-right by <a>fromEnum</a> from
--   <tt>0</tt> through <tt>n-1</tt>. See Chapter 10 of the <i>Haskell
--   Report</i> for more details.
--   
--   For any type that is an instance of class <a>Bounded</a> as well as
--   <a>Enum</a>, the following should hold:
--   
--   <ul>
--   <li>The calls <tt><a>succ</a> <a>maxBound</a></tt> and <tt><a>pred</a>
--   <a>minBound</a></tt> should result in a runtime error.</li>
--   <li><a>fromEnum</a> and <a>toEnum</a> should give a runtime error if
--   the result value is not representable in the result type. For example,
--   <tt><a>toEnum</a> 7 :: <a>Bool</a></tt> is an error.</li>
--   <li><a>enumFrom</a> and <a>enumFromThen</a> should be defined with an
--   implicit bound, thus:</li>
--   </ul>
--   
--   <pre>
--   enumFrom     x   = enumFromTo     x maxBound
--   enumFromThen x y = enumFromThenTo x y bound
--     where
--       bound | fromEnum y &gt;= fromEnum x = maxBound
--             | otherwise                = minBound
--   </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
--   1.
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
--   <a>fromEnum</a> returns when applied to a value that is too large to
--   fit in an <a>Int</a>.
fromEnum :: Enum a => a -> Int

-- | Used in Haskell's translation of <tt>[n..]</tt> with <tt>[n..] =
--   enumFrom n</tt>, a possible implementation being <tt>enumFrom n = n :
--   enumFrom (succ n)</tt>. For example:
--   
--   <ul>
--   <li><pre>enumFrom 4 :: [Integer] = [4,5,6,7,...]</pre></li>
--   <li><pre>enumFrom 6 :: [Int] = [6,7,8,9,...,maxBound ::
--   Int]</pre></li>
--   </ul>
enumFrom :: Enum a => a -> [a]

-- | Used in Haskell's translation of <tt>[n,n'..]</tt> with <tt>[n,n'..] =
--   enumFromThen n n'</tt>, a possible implementation being
--   <tt>enumFromThen n n' = n : n' : worker (f x) (f x n')</tt>,
--   <tt>worker s v = v : worker s (s v)</tt>, <tt>x = fromEnum n' -
--   fromEnum n</tt> and <tt>f n y | n &gt; 0 = f (n - 1) (succ y) | n &lt;
--   0 = f (n + 1) (pred y) | otherwise = y</tt> For example:
--   
--   <ul>
--   <li><pre>enumFromThen 4 6 :: [Integer] = [4,6,8,10...]</pre></li>
--   <li><pre>enumFromThen 6 2 :: [Int] = [6,2,-2,-6,...,minBound ::
--   Int]</pre></li>
--   </ul>
enumFromThen :: Enum a => a -> a -> [a]

-- | Used in Haskell's translation of <tt>[n..m]</tt> with <tt>[n..m] =
--   enumFromTo n m</tt>, a possible implementation being <tt>enumFromTo n
--   m | n &lt;= m = n : enumFromTo (succ n) m | otherwise = []</tt>. For
--   example:
--   
--   <ul>
--   <li><pre>enumFromTo 6 10 :: [Int] = [6,7,8,9,10]</pre></li>
--   <li><pre>enumFromTo 42 1 :: [Integer] = []</pre></li>
--   </ul>
enumFromTo :: Enum a => a -> a -> [a]

-- | Used in Haskell's translation of <tt>[n,n'..m]</tt> with <tt>[n,n'..m]
--   = enumFromThenTo n n' m</tt>, a possible implementation being
--   <tt>enumFromThenTo n n' m = worker (f x) (c x) n m</tt>, <tt>x =
--   fromEnum n' - fromEnum n</tt>, <tt>c x = bool (&gt;=) (<a>(x</a>
--   0)</tt> <tt>f n y | n &gt; 0 = f (n - 1) (succ y) | n &lt; 0 = f (n +
--   1) (pred y) | otherwise = y</tt> and <tt>worker s c v m | c v m = v :
--   worker s c (s v) m | otherwise = []</tt> For example:
--   
--   <ul>
--   <li><pre>enumFromThenTo 4 2 -6 :: [Integer] =
--   [4,2,0,-2,-4,-6]</pre></li>
--   <li><pre>enumFromThenTo 6 8 2 :: [Int] = []</pre></li>
--   </ul>
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.
--   
--   The Haskell Report defines no laws for <a>Floating</a>. However,
--   <tt>(<a>+</a>)</tt>, <tt>(<a>*</a>)</tt> and <a>exp</a> are
--   customarily expected to define an exponential field and have the
--   following properties:
--   
--   <ul>
--   <li><tt>exp (a + b)</tt> = <tt>exp a * exp b</tt></li>
--   <li><tt>exp (fromInteger 0)</tt> = <tt>fromInteger 1</tt></li>
--   </ul>
class Fractional a => Floating a
pi :: Floating a => a
exp :: Floating a => a -> a
log :: Floating a => a -> a
sqrt :: Floating a => a -> a
(**) :: Floating a => a -> a -> a
logBase :: Floating a => a -> a -> a
sin :: Floating a => a -> a
cos :: Floating a => a -> a
tan :: Floating a => a -> a
asin :: Floating a => a -> a
acos :: Floating a => a -> a
atan :: Floating a => a -> a
sinh :: Floating a => a -> a
cosh :: Floating a => a -> a
tanh :: Floating a => a -> a
asinh :: Floating a => a -> a
acosh :: Floating a => a -> a
atanh :: Floating a => a -> a
infixr 8 **

-- | Fractional numbers, supporting real division.
--   
--   The Haskell Report defines no laws for <a>Fractional</a>. However,
--   <tt>(<a>+</a>)</tt> and <tt>(<a>*</a>)</tt> are customarily expected
--   to define a division ring and have the following properties:
--   
--   <ul>
--   <li><i><b><a>recip</a> gives the multiplicative inverse</b></i> <tt>x
--   * recip x</tt> = <tt>recip x * x</tt> = <tt>fromInteger 1</tt></li>
--   <li><i><b>Totality of <a>toRational</a></b></i> <a>toRational</a> is
--   total</li>
--   <li><i><b>Coherence with <a>toRational</a></b></i> if the type also
--   implements <a>Real</a>, then <a>fromRational</a> is a left inverse for
--   <a>toRational</a>, i.e. <tt>fromRational (toRational i) = i</tt></li>
--   </ul>
--   
--   Note that it <i>isn't</i> customarily expected that a type instance of
--   <a>Fractional</a> implement a field. However, all instances in
--   <tt>base</tt> do.
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>
--   <a>Integer</a></tt>). A floating literal stands for an application of
--   <a>fromRational</a> to a value of type <a>Rational</a>, so such
--   literals have type <tt>(<a>Fractional</a> a) =&gt; a</tt>.
fromRational :: Fractional a => Rational -> a
infixl 7 /

-- | The <a>Monad</a> class defines the basic operations over a
--   <i>monad</i>, a concept from a branch of mathematics known as
--   <i>category theory</i>. From the perspective of a Haskell programmer,
--   however, it is best to think of a monad as an <i>abstract datatype</i>
--   of actions. Haskell's <tt>do</tt> expressions provide a convenient
--   syntax for writing monadic expressions.
--   
--   Instances of <a>Monad</a> should satisfy the following:
--   
--   <ul>
--   <li><i>Left identity</i> <tt><a>return</a> a <a>&gt;&gt;=</a> k = k
--   a</tt></li>
--   <li><i>Right identity</i> <tt>m <a>&gt;&gt;=</a> <a>return</a> =
--   m</tt></li>
--   <li><i>Associativity</i> <tt>m <a>&gt;&gt;=</a> (\x -&gt; k x
--   <a>&gt;&gt;=</a> h) = (m <a>&gt;&gt;=</a> k) <a>&gt;&gt;=</a>
--   h</tt></li>
--   </ul>
--   
--   Furthermore, the <a>Monad</a> and <a>Applicative</a> operations should
--   relate as follows:
--   
--   <ul>
--   <li><pre><a>pure</a> = <a>return</a></pre></li>
--   <li><pre>m1 <a>&lt;*&gt;</a> m2 = m1 <a>&gt;&gt;=</a> (\x1 -&gt; m2
--   <a>&gt;&gt;=</a> (\x2 -&gt; <a>return</a> (x1 x2)))</pre></li>
--   </ul>
--   
--   The above laws imply:
--   
--   <ul>
--   <li><pre><a>fmap</a> f xs = xs <a>&gt;&gt;=</a> <a>return</a> .
--   f</pre></li>
--   <li><pre>(<a>&gt;&gt;</a>) = (<a>*&gt;</a>)</pre></li>
--   </ul>
--   
--   and that <a>pure</a> and (<a>&lt;*&gt;</a>) satisfy the applicative
--   functor laws.
--   
--   The instances of <a>Monad</a> for lists, <a>Maybe</a> and <a>IO</a>
--   defined in the <a>Prelude</a> satisfy these laws.
class Applicative m => Monad (m :: Type -> Type)

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

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

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

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

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

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

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

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

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

-- | Sign of a number. The functions <a>abs</a> and <a>signum</a> should
--   satisfy the law:
--   
--   <pre>
--   abs x * signum x == x
--   </pre>
--   
--   For real numbers, the <a>signum</a> is either <tt>-1</tt> (negative),
--   <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
--   application of the function <a>fromInteger</a> to the appropriate
--   value of type <a>Integer</a>, so such literals have type
--   <tt>(<a>Num</a> a) =&gt; a</tt>.
fromInteger :: Num a => Integer -> a
infixl 6 -
infixl 6 +
infixl 7 *
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

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

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

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

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

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

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

-- | The function <a>decodeFloat</a> applied to a real floating-point
--   number returns the significand expressed as an <a>Integer</a> and an
--   appropriately scaled exponent (an <a>Int</a>). If
--   <tt><a>decodeFloat</a> x</tt> yields <tt>(m,n)</tt>, then <tt>x</tt>
--   is equal in value to <tt>m*b^^n</tt>, where <tt>b</tt> is the
--   floating-point radix, and furthermore, either <tt>m</tt> and
--   <tt>n</tt> are both zero or else <tt>b^(d-1) &lt;= <a>abs</a> m &lt;
--   b^d</tt>, where <tt>d</tt> is the value of <tt><a>floatDigits</a>
--   x</tt>. In particular, <tt><a>decodeFloat</a> 0 = (0,0)</tt>. If the
--   type contains a negative zero, also <tt><a>decodeFloat</a> (-0.0) =
--   (0,0)</tt>. <i>The result of</i> <tt><a>decodeFloat</a> x</tt> <i>is
--   unspecified if either of</i> <tt><a>isNaN</a> x</tt> <i>or</i>
--   <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
--   sense that for finite <tt>x</tt> with the exception of <tt>-0.0</tt>,
--   <tt><a>uncurry</a> <a>encodeFloat</a> (<a>decodeFloat</a> x) = x</tt>.
--   <tt><a>encodeFloat</a> m n</tt> is one of the two closest
--   representable floating-point numbers to <tt>m*b^^n</tt> (or
--   <tt>±Infinity</tt> if overflow occurs); usually the closer, but if
--   <tt>m</tt> contains too many bits, the result may be rounded in the
--   wrong direction.
encodeFloat :: RealFloat a => Integer -> Int -> a

-- | <a>exponent</a> corresponds to the second component of
--   <a>decodeFloat</a>. <tt><a>exponent</a> 0 = 0</tt> and for finite
--   nonzero <tt>x</tt>, <tt><a>exponent</a> x = snd (<a>decodeFloat</a> x)
--   + <a>floatDigits</a> x</tt>. If <tt>x</tt> is a finite floating-point
--   number, it is equal in value to <tt><a>significand</a> x * b ^^
--   <a>exponent</a> x</tt>, where <tt>b</tt> is the floating-point radix.
--   The 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
--   interval (<tt>-1</tt>,<tt>1</tt>), either <tt>0.0</tt> or of absolute
--   value <tt>&gt;= 1/b</tt>, where <tt>b</tt> is the floating-point
--   radix. The behaviour is unspecified on infinite or <tt>NaN</tt>
--   values.
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
--   normalized 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
--   real floating <tt>x</tt> and <tt>y</tt>, <tt><a>atan2</a> y x</tt>
--   computes the angle (from the positive x-axis) of the vector from the
--   origin to the point <tt>(x,y)</tt>. <tt><a>atan2</a> y x</tt> returns
--   a value in the range [<tt>-pi</tt>, <tt>pi</tt>]. It follows the
--   Common Lisp semantics for the origin when signed zeroes are supported.
--   <tt><a>atan2</a> y 1</tt>, with <tt>y</tt> in a type that is
--   <a>RealFloat</a>, should return the same value as <tt><a>atan</a>
--   y</tt>. A default definition of <a>atan2</a> is provided, but
--   implementors can provide a more accurate implementation.
atan2 :: RealFloat a => a -> a -> a

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

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

-- | <tt><a>truncate</a> x</tt> returns the integer nearest <tt>x</tt>
--   between 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
--   even 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
--   <tt>x</tt>
ceiling :: (RealFrac a, Integral b) => a -> b

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

-- | When a value is bound in <tt>do</tt>-notation, the pattern on the left
--   hand side of <tt>&lt;-</tt> might not match. In this case, this class
--   provides a function to recover.
--   
--   A <a>Monad</a> without a <a>MonadFail</a> instance may only be used in
--   conjunction with pattern that always match, such as newtypes, tuples,
--   data types with only a single data constructor, and irrefutable
--   patterns (<tt>~pat</tt>).
--   
--   Instances of <a>MonadFail</a> should satisfy the following law:
--   <tt>fail s</tt> should be a left zero for <a>&gt;&gt;=</a>,
--   
--   <pre>
--   fail s &gt;&gt;= f  =  fail s
--   </pre>
--   
--   If your <a>Monad</a> is also <a>MonadPlus</a>, a popular definition is
--   
--   <pre>
--   fail _ = mzero
--   </pre>
--   
--   <tt>fail s</tt> should be an action that runs in the monad itself, not
--   an exception (except in instances of <tt>MonadIO</tt>). In particular,
--   <tt>fail</tt> should not be implemented in terms of <tt>error</tt>.
class Monad m => MonadFail (m :: Type -> Type)
fail :: MonadFail m => String -> m a

-- | A functor with application, providing operations to
--   
--   <ul>
--   <li>embed pure expressions (<a>pure</a>), and</li>
--   <li>sequence computations and combine their results (<a>&lt;*&gt;</a>
--   and <a>liftA2</a>).</li>
--   </ul>
--   
--   A minimal complete definition must include implementations of
--   <a>pure</a> and of either <a>&lt;*&gt;</a> or <a>liftA2</a>. If it
--   defines both, then they must behave the same as their default
--   definitions:
--   
--   <pre>
--   (<a>&lt;*&gt;</a>) = <a>liftA2</a> <a>id</a>
--   </pre>
--   
--   <pre>
--   <a>liftA2</a> f x y = f <a>&lt;$&gt;</a> x <a>&lt;*&gt;</a> y
--   </pre>
--   
--   Further, any definition must satisfy the following:
--   
--   <ul>
--   <li><i>Identity</i> <pre><a>pure</a> <a>id</a> <a>&lt;*&gt;</a> v =
--   v</pre></li>
--   <li><i>Composition</i> <pre><a>pure</a> (.) <a>&lt;*&gt;</a> u
--   <a>&lt;*&gt;</a> v <a>&lt;*&gt;</a> w = u <a>&lt;*&gt;</a> (v
--   <a>&lt;*&gt;</a> w)</pre></li>
--   <li><i>Homomorphism</i> <pre><a>pure</a> f <a>&lt;*&gt;</a>
--   <a>pure</a> x = <a>pure</a> (f x)</pre></li>
--   <li><i>Interchange</i> <pre>u <a>&lt;*&gt;</a> <a>pure</a> y =
--   <a>pure</a> (<a>$</a> y) <a>&lt;*&gt;</a> u</pre></li>
--   </ul>
--   
--   The other methods have the following default definitions, which may be
--   overridden with equivalent specialized implementations:
--   
--   <ul>
--   <li><pre>u <a>*&gt;</a> v = (<a>id</a> <a>&lt;$</a> u)
--   <a>&lt;*&gt;</a> v</pre></li>
--   <li><pre>u <a>&lt;*</a> v = <a>liftA2</a> <a>const</a> u v</pre></li>
--   </ul>
--   
--   As a consequence of these laws, the <a>Functor</a> instance for
--   <tt>f</tt> will satisfy
--   
--   <ul>
--   <li><pre><a>fmap</a> f x = <a>pure</a> f <a>&lt;*&gt;</a> x</pre></li>
--   </ul>
--   
--   It may be useful to note that supposing
--   
--   <pre>
--   forall x y. p (q x y) = f x . g y
--   </pre>
--   
--   it follows from the above that
--   
--   <pre>
--   <a>liftA2</a> p (<a>liftA2</a> q u v) = <a>liftA2</a> f u . <a>liftA2</a> g v
--   </pre>
--   
--   If <tt>f</tt> is also a <a>Monad</a>, it should satisfy
--   
--   <ul>
--   <li><pre><a>pure</a> = <a>return</a></pre></li>
--   <li><pre>m1 <a>&lt;*&gt;</a> m2 = m1 <a>&gt;&gt;=</a> (\x1 -&gt; m2
--   <a>&gt;&gt;=</a> (\x2 -&gt; <a>return</a> (x1 x2)))</pre></li>
--   <li><pre>(<a>*&gt;</a>) = (<a>&gt;&gt;</a>)</pre></li>
--   </ul>
--   
--   (which implies that <a>pure</a> and <a>&lt;*&gt;</a> satisfy the
--   applicative functor laws).
class Functor f => Applicative (f :: Type -> Type)

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

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

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

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

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

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

-- | Identity of <a>mappend</a>
--   
--   <h4><b>Examples</b></h4>
--   
--   <pre>
--   &gt;&gt;&gt; "Hello world" &lt;&gt; mempty
--   "Hello world"
--   </pre>
--   
--   <pre>
--   &gt;&gt;&gt; mempty &lt;&gt; [1, 2, 3]
--   [1,2,3]
--   </pre>
mempty :: Monoid a => a

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

-- | Fold a list using the monoid.
--   
--   For most types, the default definition for <a>mconcat</a> will be
--   used, but the function is included in the class definition so that an
--   optimized version can be provided for specific types.
--   
--   <pre>
--   &gt;&gt;&gt; mconcat ["Hello", " ", "Haskell", "!"]
--   "Hello Haskell!"
--   </pre>
mconcat :: Monoid a => [a] -> a

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

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

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

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

-- | &lt;math&gt;. <a>zipWith</a> generalises <a>zip</a> by zipping with
--   the function given as the first argument, instead of a tupling
--   function.
--   
--   <pre>
--   zipWith (,) xs ys == zip xs ys
--   zipWith f [x1,x2,x3..] [y1,y2,y3..] == [f x1 y1, f x2 y2, f x3 y3..]
--   </pre>
--   
--   For example, <tt><a>zipWith</a> (+)</tt> is applied to two lists to
--   produce the list of corresponding sums:
--   
--   <pre>
--   &gt;&gt;&gt; zipWith (+) [1, 2, 3] [4, 5, 6]
--   [5,7,9]
--   </pre>
--   
--   <a>zipWith</a> is right-lazy:
--   
--   <pre>
--   &gt;&gt;&gt; let f = undefined
--   
--   &gt;&gt;&gt; zipWith f [] undefined
--   []
--   </pre>
--   
--   <a>zipWith</a> is capable of list fusion, but it is restricted to its
--   first list argument and its resulting list.
zipWith :: (a -> b -> c) -> [a] -> [b] -> [c]
even :: Integral a => a -> Bool

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

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

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

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

-- | Identity function.
--   
--   <pre>
--   id x = x
--   </pre>
id :: a -> a

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

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

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

-- | &lt;math&gt;. <a>filter</a>, applied to a predicate and a list,
--   returns the list of those elements that satisfy the predicate; i.e.,
--   
--   <pre>
--   filter p xs = [ x | x &lt;- xs, p x]
--   </pre>
--   
--   <pre>
--   &gt;&gt;&gt; filter odd [1, 2, 3]
--   [1,3]
--   </pre>
filter :: (a -> Bool) -> [a] -> [a]

-- | Left-associative fold of a structure, lazy in the accumulator. This is
--   rarely what you want, but can work well for structures with efficient
--   right-to-left sequencing and an operator that is lazy in its left
--   argument.
--   
--   In the case of lists, <a>foldl</a>, when applied to a binary operator,
--   a starting value (typically the left-identity of the operator), and a
--   list, reduces the list using the binary operator, from left to right:
--   
--   <pre>
--   foldl f z [x1, x2, ..., xn] == (...((z `f` x1) `f` x2) `f`...) `f` xn
--   </pre>
--   
--   Note that to produce the outermost application of the operator the
--   entire input list must be traversed. Like all left-associative folds,
--   <a>foldl</a> will diverge if given an infinite list.
--   
--   If you want an efficient strict left-fold, you probably want to use
--   <a>foldl'</a> instead of <a>foldl</a>. The reason for this is that the
--   latter does not force the <i>inner</i> results (e.g. <tt>z `f` x1</tt>
--   in the above example) before applying them to the operator (e.g. to
--   <tt>(`f` x2)</tt>). This results in a thunk chain <i>O(n)</i> elements
--   long, which then must be evaluated from the outside-in.
--   
--   For a general <a>Foldable</a> structure this should be semantically
--   identical to:
--   
--   <pre>
--   foldl f z = <a>foldl</a> f z . <a>toList</a>
--   </pre>
--   
--   <h4><b>Examples</b></h4>
--   
--   The first example is a strict fold, which in practice is best
--   performed with <a>foldl'</a>.
--   
--   <pre>
--   &gt;&gt;&gt; foldl (+) 42 [1,2,3,4]
--   52
--   </pre>
--   
--   Though the result below is lazy, the input is reversed before
--   prepending it to the initial accumulator, so corecursion begins only
--   after traversing the entire input string.
--   
--   <pre>
--   &gt;&gt;&gt; foldl (\acc c -&gt; c : acc) "abcd" "efgh"
--   "hgfeabcd"
--   </pre>
--   
--   A left fold of a structure that is infinite on the right cannot
--   terminate, even when for any finite input the fold just returns the
--   initial accumulator:
--   
--   <pre>
--   &gt;&gt;&gt; foldl (\a _ -&gt; a) 0 $ repeat 1
--   * Hangs forever *
--   </pre>
--   
--   WARNING: When it comes to lists, you always want to use either
--   <a>foldl'</a> or <a>foldr</a> instead.
foldl :: Foldable t => (b -> a -> b) -> b -> t a -> b

-- | The <a>sum</a> function computes the sum of the numbers of a
--   structure.
--   
--   <h4><b>Examples</b></h4>
--   
--   Basic usage:
--   
--   <pre>
--   &gt;&gt;&gt; sum []
--   0
--   </pre>
--   
--   <pre>
--   &gt;&gt;&gt; sum [42]
--   42
--   </pre>
--   
--   <pre>
--   &gt;&gt;&gt; sum [1..10]
--   55
--   </pre>
--   
--   <pre>
--   &gt;&gt;&gt; sum [4.1, 2.0, 1.7]
--   7.8
--   </pre>
--   
--   <pre>
--   &gt;&gt;&gt; sum [1..]
--   * Hangs forever *
--   </pre>
sum :: (Foldable t, Num a) => t a -> a

-- | The <a>product</a> function computes the product of the numbers of a
--   structure.
--   
--   <h4><b>Examples</b></h4>
--   
--   Basic usage:
--   
--   <pre>
--   &gt;&gt;&gt; product []
--   1
--   </pre>
--   
--   <pre>
--   &gt;&gt;&gt; product [42]
--   42
--   </pre>
--   
--   <pre>
--   &gt;&gt;&gt; product [1..10]
--   3628800
--   </pre>
--   
--   <pre>
--   &gt;&gt;&gt; product [4.1, 2.0, 1.7]
--   13.939999999999998
--   </pre>
--   
--   <pre>
--   &gt;&gt;&gt; product [1..]
--   * Hangs forever *
--   </pre>
product :: (Foldable t, Num a) => t a -> a

-- | The largest element of a non-empty structure.
--   
--   This function is non-total and will raise a runtime exception if the
--   structure happens to be empty. A structure that supports random access
--   and maintains its elements in order should provide a specialised
--   implementation to return the maximum in faster than linear time.
--   
--   <h4><b>Examples</b></h4>
--   
--   Basic usage:
--   
--   <pre>
--   &gt;&gt;&gt; maximum [1..10]
--   10
--   </pre>
--   
--   <pre>
--   &gt;&gt;&gt; maximum []
--   *** Exception: Prelude.maximum: empty list
--   </pre>
--   
--   <pre>
--   &gt;&gt;&gt; maximum Nothing
--   *** Exception: maximum: empty structure
--   </pre>
--   
--   WARNING: This function is partial for possibly-empty structures like
--   lists.
maximum :: (Foldable t, Ord a) => t a -> a

-- | The least element of a non-empty structure.
--   
--   This function is non-total and will raise a runtime exception if the
--   structure happens to be empty. A structure that supports random access
--   and maintains its elements in order should provide a specialised
--   implementation to return the minimum in faster than linear time.
--   
--   <h4><b>Examples</b></h4>
--   
--   Basic usage:
--   
--   <pre>
--   &gt;&gt;&gt; minimum [1..10]
--   1
--   </pre>
--   
--   <pre>
--   &gt;&gt;&gt; minimum []
--   *** Exception: Prelude.minimum: empty list
--   </pre>
--   
--   <pre>
--   &gt;&gt;&gt; minimum Nothing
--   *** Exception: minimum: empty structure
--   </pre>
--   
--   WARNING: This function is partial for possibly-empty structures like
--   lists.
minimum :: (Foldable t, Ord a) => t a -> a

-- | Does the element occur in the structure?
--   
--   Note: <a>elem</a> is often used in infix form.
--   
--   <h4><b>Examples</b></h4>
--   
--   Basic usage:
--   
--   <pre>
--   &gt;&gt;&gt; 3 `elem` []
--   False
--   </pre>
--   
--   <pre>
--   &gt;&gt;&gt; 3 `elem` [1,2]
--   False
--   </pre>
--   
--   <pre>
--   &gt;&gt;&gt; 3 `elem` [1,2,3,4,5]
--   True
--   </pre>
--   
--   For infinite structures, the default implementation of <a>elem</a>
--   terminates if the sought-after value exists at a finite distance from
--   the left side of the structure:
--   
--   <pre>
--   &gt;&gt;&gt; 3 `elem` [1..]
--   True
--   </pre>
--   
--   <pre>
--   &gt;&gt;&gt; 3 `elem` ([4..] ++ [3])
--   * Hangs forever *
--   </pre>
elem :: (Foldable t, Eq a) => a -> t a -> Bool
infix 4 `elem`

-- | <a>cycle</a> ties a finite list into a circular one, or equivalently,
--   the infinite repetition of the original list. It is the identity on
--   infinite lists.
--   
--   <pre>
--   &gt;&gt;&gt; cycle []
--   *** Exception: Prelude.cycle: empty list
--   
--   &gt;&gt;&gt; cycle [42]
--   [42,42,42,42,42,42,42,42,42,42...
--   
--   &gt;&gt;&gt; cycle [2, 5, 7]
--   [2,5,7,2,5,7,2,5,7,2,5,7...
--   </pre>
cycle :: HasCallStack => [a] -> [a]

-- | Append two lists, i.e.,
--   
--   <pre>
--   [x1, ..., xm] ++ [y1, ..., yn] == [x1, ..., xm, y1, ..., yn]
--   [x1, ..., xm] ++ [y1, ...] == [x1, ..., xm, y1, ...]
--   </pre>
--   
--   If the first list is not finite, the result is the first list.
--   
--   WARNING: This function takes linear time in the number of elements of
--   the first list.
(++) :: [a] -> [a] -> [a]
infixr 5 ++
seq :: forall {r :: RuntimeRep} a (b :: TYPE r). a -> b -> b

-- | The concatenation of all the elements of a container of lists.
--   
--   <h4><b>Examples</b></h4>
--   
--   Basic usage:
--   
--   <pre>
--   &gt;&gt;&gt; concat (Just [1, 2, 3])
--   [1,2,3]
--   </pre>
--   
--   <pre>
--   &gt;&gt;&gt; concat (Left 42)
--   []
--   </pre>
--   
--   <pre>
--   &gt;&gt;&gt; concat [[1, 2, 3], [4, 5], [6], []]
--   [1,2,3,4,5,6]
--   </pre>
concat :: Foldable t => t [a] -> [a]

-- | &lt;math&gt;. <a>zip</a> takes two lists and returns a list of
--   corresponding pairs.
--   
--   <pre>
--   &gt;&gt;&gt; zip [1, 2] ['a', 'b']
--   [(1,'a'),(2,'b')]
--   </pre>
--   
--   If one input list is shorter than the other, excess elements of the
--   longer list are discarded, even if one of the lists is infinite:
--   
--   <pre>
--   &gt;&gt;&gt; zip [1] ['a', 'b']
--   [(1,'a')]
--   
--   &gt;&gt;&gt; zip [1, 2] ['a']
--   [(1,'a')]
--   
--   &gt;&gt;&gt; zip [] [1..]
--   []
--   
--   &gt;&gt;&gt; zip [1..] []
--   []
--   </pre>
--   
--   <a>zip</a> is right-lazy:
--   
--   <pre>
--   &gt;&gt;&gt; zip [] undefined
--   []
--   
--   &gt;&gt;&gt; zip undefined []
--   *** Exception: Prelude.undefined
--   ...
--   </pre>
--   
--   <a>zip</a> is capable of list fusion, but it is restricted to its
--   first list argument and its resulting list.
zip :: [a] -> [b] -> [(a, b)]

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

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

-- | &lt;math&gt;. <a>map</a> <tt>f xs</tt> is the list obtained by
--   applying <tt>f</tt> to each element of <tt>xs</tt>, i.e.,
--   
--   <pre>
--   map f [x1, x2, ..., xn] == [f x1, f x2, ..., f xn]
--   map f [x1, x2, ...] == [f x1, f x2, ...]
--   </pre>
--   
--   <pre>
--   &gt;&gt;&gt; map (+1) [1, 2, 3]
--   [2,3,4]
--   </pre>
map :: (a -> b) -> [a] -> [b]

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

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

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

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

-- | A special case of <a>error</a>. It is expected that compilers will
--   recognize this and insert error messages which are more appropriate to
--   the context in which <a>undefined</a> appears.
undefined :: forall (r :: RuntimeRep) (a :: TYPE r). HasCallStack => a

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

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

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

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

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

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

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

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

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

-- | &lt;math&gt;. <a>scanl</a> is similar to <a>foldl</a>, but returns a
--   list of successive reduced values from the left:
--   
--   <pre>
--   scanl f z [x1, x2, ...] == [z, z `f` x1, (z `f` x1) `f` x2, ...]
--   </pre>
--   
--   Note that
--   
--   <pre>
--   last (scanl f z xs) == foldl f z xs
--   </pre>
--   
--   <pre>
--   &gt;&gt;&gt; scanl (+) 0 [1..4]
--   [0,1,3,6,10]
--   
--   &gt;&gt;&gt; scanl (+) 42 []
--   [42]
--   
--   &gt;&gt;&gt; scanl (-) 100 [1..4]
--   [100,99,97,94,90]
--   
--   &gt;&gt;&gt; scanl (\reversedString nextChar -&gt; nextChar : reversedString) "foo" ['a', 'b', 'c', 'd']
--   ["foo","afoo","bafoo","cbafoo","dcbafoo"]
--   
--   &gt;&gt;&gt; scanl (+) 0 [1..]
--   * Hangs forever *
--   </pre>
scanl :: (b -> a -> b) -> b -> [a] -> [b]

-- | &lt;math&gt;. <a>scanl1</a> is a variant of <a>scanl</a> that has no
--   starting value argument:
--   
--   <pre>
--   scanl1 f [x1, x2, ...] == [x1, x1 `f` x2, ...]
--   </pre>
--   
--   <pre>
--   &gt;&gt;&gt; scanl1 (+) [1..4]
--   [1,3,6,10]
--   
--   &gt;&gt;&gt; scanl1 (+) []
--   []
--   
--   &gt;&gt;&gt; scanl1 (-) [1..4]
--   [1,-1,-4,-8]
--   
--   &gt;&gt;&gt; scanl1 (&amp;&amp;) [True, False, True, True]
--   [True,False,False,False]
--   
--   &gt;&gt;&gt; scanl1 (||) [False, False, True, True]
--   [False,False,True,True]
--   
--   &gt;&gt;&gt; scanl1 (+) [1..]
--   * Hangs forever *
--   </pre>
scanl1 :: (a -> a -> a) -> [a] -> [a]

-- | &lt;math&gt;. <a>scanr</a> is the right-to-left dual of <a>scanl</a>.
--   Note that the order of parameters on the accumulating function are
--   reversed compared to <a>scanl</a>. Also note that
--   
--   <pre>
--   head (scanr f z xs) == foldr f z xs.
--   </pre>
--   
--   <pre>
--   &gt;&gt;&gt; scanr (+) 0 [1..4]
--   [10,9,7,4,0]
--   
--   &gt;&gt;&gt; scanr (+) 42 []
--   [42]
--   
--   &gt;&gt;&gt; scanr (-) 100 [1..4]
--   [98,-97,99,-96,100]
--   
--   &gt;&gt;&gt; scanr (\nextChar reversedString -&gt; nextChar : reversedString) "foo" ['a', 'b', 'c', 'd']
--   ["abcdfoo","bcdfoo","cdfoo","dfoo","foo"]
--   
--   &gt;&gt;&gt; force $ scanr (+) 0 [1..]
--   *** Exception: stack overflow
--   </pre>
scanr :: (a -> b -> b) -> b -> [a] -> [b]

-- | &lt;math&gt;. <a>scanr1</a> is a variant of <a>scanr</a> that has no
--   starting value argument.
--   
--   <pre>
--   &gt;&gt;&gt; scanr1 (+) [1..4]
--   [10,9,7,4]
--   
--   &gt;&gt;&gt; scanr1 (+) []
--   []
--   
--   &gt;&gt;&gt; scanr1 (-) [1..4]
--   [-2,3,-1,4]
--   
--   &gt;&gt;&gt; scanr1 (&amp;&amp;) [True, False, True, True]
--   [False,False,True,True]
--   
--   &gt;&gt;&gt; scanr1 (||) [True, True, False, False]
--   [True,True,False,False]
--   
--   &gt;&gt;&gt; force $ scanr1 (+) [1..]
--   *** Exception: stack overflow
--   </pre>
scanr1 :: (a -> a -> a) -> [a] -> [a]

-- | <a>iterate</a> <tt>f x</tt> returns an infinite list of repeated
--   applications of <tt>f</tt> to <tt>x</tt>:
--   
--   <pre>
--   iterate f x == [x, f x, f (f x), ...]
--   </pre>
--   
--   Note that <a>iterate</a> is lazy, potentially leading to thunk
--   build-up if the consumer doesn't force each iterate. See
--   <a>iterate'</a> for a strict variant of this function.
--   
--   <pre>
--   &gt;&gt;&gt; take 10 $ iterate not True
--   [True,False,True,False...
--   
--   &gt;&gt;&gt; take 10 $ iterate (+3) 42
--   [42,45,48,51,54,57,60,63...
--   </pre>
iterate :: (a -> a) -> a -> [a]

-- | <a>repeat</a> <tt>x</tt> is an infinite list, with <tt>x</tt> the
--   value of every element.
--   
--   <pre>
--   &gt;&gt;&gt; repeat 17
--   [17,17,17,17,17,17,17,17,17...
--   </pre>
repeat :: a -> [a]

-- | <a>replicate</a> <tt>n x</tt> is a list of length <tt>n</tt> with
--   <tt>x</tt> the value of every element. It is an instance of the more
--   general <a>genericReplicate</a>, in which <tt>n</tt> may be of any
--   integral type.
--   
--   <pre>
--   &gt;&gt;&gt; replicate 0 True
--   []
--   
--   &gt;&gt;&gt; replicate (-1) True
--   []
--   
--   &gt;&gt;&gt; replicate 4 True
--   [True,True,True,True]
--   </pre>
replicate :: Int -> a -> [a]

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

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

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

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

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

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

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

-- | <a>reverse</a> <tt>xs</tt> returns the elements of <tt>xs</tt> in
--   reverse order. <tt>xs</tt> must be finite.
--   
--   <pre>
--   &gt;&gt;&gt; reverse []
--   []
--   
--   &gt;&gt;&gt; reverse [42]
--   [42]
--   
--   &gt;&gt;&gt; reverse [2,5,7]
--   [7,5,2]
--   
--   &gt;&gt;&gt; reverse [1..]
--   * Hangs forever *
--   </pre>
reverse :: [a] -> [a]

-- | <a>and</a> returns the conjunction of a container of Bools. For the
--   result to be <a>True</a>, the container must be finite; <a>False</a>,
--   however, results from a <a>False</a> value finitely far from the left
--   end.
--   
--   <h4><b>Examples</b></h4>
--   
--   Basic usage:
--   
--   <pre>
--   &gt;&gt;&gt; and []
--   True
--   </pre>
--   
--   <pre>
--   &gt;&gt;&gt; and [True]
--   True
--   </pre>
--   
--   <pre>
--   &gt;&gt;&gt; and [False]
--   False
--   </pre>
--   
--   <pre>
--   &gt;&gt;&gt; and [True, True, False]
--   False
--   </pre>
--   
--   <pre>
--   &gt;&gt;&gt; and (False : repeat True) -- Infinite list [False,True,True,True,...
--   False
--   </pre>
--   
--   <pre>
--   &gt;&gt;&gt; and (repeat True)
--   * Hangs forever *
--   </pre>
and :: Foldable t => t Bool -> Bool

-- | <a>or</a> returns the disjunction of a container of Bools. For the
--   result to be <a>False</a>, the container must be finite; <a>True</a>,
--   however, results from a <a>True</a> value finitely far from the left
--   end.
--   
--   <h4><b>Examples</b></h4>
--   
--   Basic usage:
--   
--   <pre>
--   &gt;&gt;&gt; or []
--   False
--   </pre>
--   
--   <pre>
--   &gt;&gt;&gt; or [True]
--   True
--   </pre>
--   
--   <pre>
--   &gt;&gt;&gt; or [False]
--   False
--   </pre>
--   
--   <pre>
--   &gt;&gt;&gt; or [True, True, False]
--   True
--   </pre>
--   
--   <pre>
--   &gt;&gt;&gt; or (True : repeat False) -- Infinite list [True,False,False,False,...
--   True
--   </pre>
--   
--   <pre>
--   &gt;&gt;&gt; or (repeat False)
--   * Hangs forever *
--   </pre>
or :: Foldable t => t Bool -> Bool

-- | <a>notElem</a> is the negation of <a>elem</a>.
--   
--   <h4><b>Examples</b></h4>
--   
--   Basic usage:
--   
--   <pre>
--   &gt;&gt;&gt; 3 `notElem` []
--   True
--   </pre>
--   
--   <pre>
--   &gt;&gt;&gt; 3 `notElem` [1,2]
--   True
--   </pre>
--   
--   <pre>
--   &gt;&gt;&gt; 3 `notElem` [1,2,3,4,5]
--   False
--   </pre>
--   
--   For infinite structures, <a>notElem</a> terminates if the value exists
--   at a finite distance from the left side of the structure:
--   
--   <pre>
--   &gt;&gt;&gt; 3 `notElem` [1..]
--   False
--   </pre>
--   
--   <pre>
--   &gt;&gt;&gt; 3 `notElem` ([4..] ++ [3])
--   * Hangs forever *
--   </pre>
notElem :: (Foldable t, Eq a) => a -> t a -> Bool
infix 4 `notElem`

-- | &lt;math&gt;. <a>lookup</a> <tt>key assocs</tt> looks up a key in an
--   association list. For the result to be <a>Nothing</a>, the list must
--   be finite.
--   
--   <pre>
--   &gt;&gt;&gt; lookup 2 []
--   Nothing
--   
--   &gt;&gt;&gt; lookup 2 [(1, "first")]
--   Nothing
--   
--   &gt;&gt;&gt; lookup 2 [(1, "first"), (2, "second"), (3, "third")]
--   Just "second"
--   </pre>
lookup :: Eq a => a -> [(a, b)] -> Maybe b

-- | Map a function over all the elements of a container and concatenate
--   the resulting lists.
--   
--   <h4><b>Examples</b></h4>
--   
--   Basic usage:
--   
--   <pre>
--   &gt;&gt;&gt; concatMap (take 3) [[1..], [10..], [100..], [1000..]]
--   [1,2,3,10,11,12,100,101,102,1000,1001,1002]
--   </pre>
--   
--   <pre>
--   &gt;&gt;&gt; concatMap (take 3) (Just [1..])
--   [1,2,3]
--   </pre>
concatMap :: Foldable t => (a -> [b]) -> t a -> [b]

-- | List index (subscript) operator, starting from 0. It is an instance of
--   the more general <a>genericIndex</a>, which takes an index of any
--   integral type.
--   
--   <pre>
--   &gt;&gt;&gt; ['a', 'b', 'c'] !! 0
--   'a'
--   
--   &gt;&gt;&gt; ['a', 'b', 'c'] !! 2
--   'c'
--   
--   &gt;&gt;&gt; ['a', 'b', 'c'] !! 3
--   *** Exception: Prelude.!!: index too large
--   
--   &gt;&gt;&gt; ['a', 'b', 'c'] !! (-1)
--   *** Exception: Prelude.!!: negative index
--   </pre>
--   
--   WARNING: This function is partial. You can use <a>atMay</a> instead.
(!!) :: HasCallStack => [a] -> Int -> a
infixl 9 !!

-- | <a>zip3</a> takes three lists and returns a list of triples, analogous
--   to <a>zip</a>. It is capable of list fusion, but it is restricted to
--   its first list argument and its resulting list.
zip3 :: [a] -> [b] -> [c] -> [(a, b, c)]

-- | The <a>zipWith3</a> function takes a function which combines three
--   elements, as well as three lists and returns a list of the function
--   applied to corresponding elements, analogous to <a>zipWith</a>. It is
--   capable of list fusion, but it is restricted to its first list
--   argument and its resulting list.
--   
--   <pre>
--   zipWith3 (,,) xs ys zs == zip3 xs ys zs
--   zipWith3 f [x1,x2,x3..] [y1,y2,y3..] [z1,z2,z3..] == [f x1 y1 z1, f x2 y2 z2, f x3 y3 z3..]
--   </pre>
zipWith3 :: (a -> b -> c -> d) -> [a] -> [b] -> [c] -> [d]

-- | <a>unzip</a> transforms a list of pairs into a list of first
--   components and a list of second components.
--   
--   <pre>
--   &gt;&gt;&gt; unzip []
--   ([],[])
--   
--   &gt;&gt;&gt; unzip [(1, 'a'), (2, 'b')]
--   ([1,2],"ab")
--   </pre>
unzip :: [(a, b)] -> ([a], [b])

-- | The <a>unzip3</a> function takes a list of triples and returns three
--   lists, analogous to <a>unzip</a>.
--   
--   <pre>
--   &gt;&gt;&gt; unzip3 []
--   ([],[],[])
--   
--   &gt;&gt;&gt; unzip3 [(1, 'a', True), (2, 'b', False)]
--   ([1,2],"ab",[True,False])
--   </pre>
unzip3 :: [(a, b, c)] -> ([a], [b], [c])

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

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

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

-- | utility function that surrounds the inner show function with
--   parentheses when the <a>Bool</a> parameter is <a>True</a>.
showParen :: Bool -> ShowS -> ShowS
odd :: Integral a => a -> Bool

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

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

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

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

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

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

-- | <tt><a>readParen</a> <a>True</a> p</tt> parses what <tt>p</tt> parses,
--   but surrounded with parentheses.
--   
--   <tt><a>readParen</a> <a>False</a> p</tt> parses what <tt>p</tt>
--   parses, but optionally surrounded with parentheses.
readParen :: Bool -> ReadS a -> ReadS a

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

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

-- | Evaluate each monadic action in the structure from left to right, and
--   ignore the results. For a version that doesn't ignore the results see
--   <a>sequence</a>.
--   
--   <a>sequence_</a> is just like <a>sequenceA_</a>, but specialised to
--   monadic actions.
sequence_ :: (Foldable t, Monad m) => t (m a) -> m ()

-- | Splits the argument into a list of <i>lines</i> stripped of their
--   terminating <tt>\n</tt> characters. The <tt>\n</tt> terminator is
--   optional in a final non-empty line of the argument string.
--   
--   For example:
--   
--   <pre>
--   &gt;&gt;&gt; lines ""           -- empty input contains no lines
--   []
--   
--   &gt;&gt;&gt; lines "\n"         -- single empty line
--   [""]
--   
--   &gt;&gt;&gt; lines "one"        -- single unterminated line
--   ["one"]
--   
--   &gt;&gt;&gt; lines "one\n"      -- single non-empty line
--   ["one"]
--   
--   &gt;&gt;&gt; lines "one\n\n"    -- second line is empty
--   ["one",""]
--   
--   &gt;&gt;&gt; lines "one\ntwo"   -- second line is unterminated
--   ["one","two"]
--   
--   &gt;&gt;&gt; lines "one\ntwo\n" -- two non-empty lines
--   ["one","two"]
--   </pre>
--   
--   When the argument string is empty, or ends in a <tt>\n</tt> character,
--   it can be recovered by passing the result of <a>lines</a> to the
--   <a>unlines</a> function. Otherwise, <a>unlines</a> appends the missing
--   terminating <tt>\n</tt>. This makes <tt>unlines . lines</tt>
--   <i>idempotent</i>:
--   
--   <pre>
--   (unlines . lines) . (unlines . lines) = (unlines . lines)
--   </pre>
lines :: String -> [String]

-- | Appends a <tt>\n</tt> character to each input string, then
--   concatenates the results. Equivalent to <tt><tt>foldMap</tt> (s -&gt;
--   s <a>++</a> "\n")</tt>.
--   
--   <pre>
--   &gt;&gt;&gt; unlines ["Hello", "World", "!"]
--   "Hello\nWorld\n!\n"
--   </pre>
--   
--   Note that <tt><a>unlines</a> <a>.</a> <a>lines</a> <a>/=</a>
--   <a>id</a></tt> when the input is not <tt>\n</tt>-terminated:
--   
--   <pre>
--   &gt;&gt;&gt; unlines . lines $ "foo\nbar"
--   "foo\nbar\n"
--   </pre>
unlines :: [String] -> String

-- | <a>words</a> breaks a string up into a list of words, which were
--   delimited by white space (as defined by <a>isSpace</a>). This function
--   trims any white spaces at the beginning and at the end.
--   
--   <pre>
--   &gt;&gt;&gt; words "Lorem ipsum\ndolor"
--   ["Lorem","ipsum","dolor"]
--   
--   &gt;&gt;&gt; words " foo bar "
--   ["foo","bar"]
--   </pre>
words :: String -> [String]

-- | <a>unwords</a> joins words with separating spaces (U+0020 SPACE).
--   
--   <pre>
--   &gt;&gt;&gt; unwords ["Lorem", "ipsum", "dolor"]
--   "Lorem ipsum dolor"
--   </pre>
--   
--   <a>unwords</a> is neither left nor right inverse of <a>words</a>:
--   
--   <pre>
--   &gt;&gt;&gt; words (unwords [" "])
--   []
--   
--   &gt;&gt;&gt; unwords (words "foo\nbar")
--   "foo bar"
--   </pre>
unwords :: [String] -> String

-- | Construct an <a>IOException</a> value with a string describing the
--   error. The <tt>fail</tt> method of the <a>IO</a> instance of the
--   <a>Monad</a> class raises a <a>userError</a>, thus:
--   
--   <pre>
--   instance Monad IO where
--     ...
--     fail s = ioError (userError s)
--   </pre>
userError :: String -> IOError

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

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

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

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

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

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

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

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

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

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

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

-- | An associative operation.
--   
--   <h4><b>Examples</b></h4>
--   
--   <pre>
--   &gt;&gt;&gt; [1,2,3] &lt;&gt; [4,5,6]
--   [1,2,3,4,5,6]
--   </pre>
--   
--   <pre>
--   &gt;&gt;&gt; Just [1, 2, 3] &lt;&gt; Just [4, 5, 6]
--   Just [1,2,3,4,5,6]
--   </pre>
--   
--   <pre>
--   &gt;&gt;&gt; putStr "Hello, " &lt;&gt; putStrLn "World!"
--   Hello, World!
--   </pre>
(<>) :: Semigroup a => a -> a -> a
infixr 6 <>

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

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

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

-- | A quantified type representation.
type TypeRep = SomeTypeRep

-- | Takes a value of type <tt>a</tt> and returns a concrete representation
--   of that type.
typeRep :: forall {k} proxy (a :: k). Typeable a => proxy a -> TypeRep

-- | The <a>Data</a> class comprehends a fundamental primitive
--   <a>gfoldl</a> for folding over constructor applications, say terms.
--   This primitive can be instantiated in several ways to map over the
--   immediate subterms of a term; see the <tt>gmap</tt> combinators later
--   in this class. Indeed, a generic programmer does not necessarily need
--   to use the ingenious gfoldl primitive but rather the intuitive
--   <tt>gmap</tt> combinators. The <a>gfoldl</a> primitive is completed by
--   means to query top-level constructors, to turn constructor
--   representations into proper terms, and to list all possible datatype
--   constructors. This completion allows us to serve generic programming
--   scenarios like read, show, equality, term generation.
--   
--   The combinators <a>gmapT</a>, <a>gmapQ</a>, <a>gmapM</a>, etc are all
--   provided with default definitions in terms of <a>gfoldl</a>, leaving
--   open the opportunity to provide datatype-specific definitions. (The
--   inclusion of the <tt>gmap</tt> combinators as members of class
--   <a>Data</a> allows the programmer or the compiler to derive
--   specialised, and maybe more efficient code per datatype. <i>Note</i>:
--   <a>gfoldl</a> is more higher-order than the <tt>gmap</tt> combinators.
--   This is subject to ongoing benchmarking experiments. It might turn out
--   that the <tt>gmap</tt> combinators will be moved out of the class
--   <a>Data</a>.)
--   
--   Conceptually, the definition of the <tt>gmap</tt> combinators in terms
--   of the primitive <a>gfoldl</a> requires the identification of the
--   <a>gfoldl</a> function arguments. Technically, we also need to
--   identify the type constructor <tt>c</tt> for the construction of the
--   result type from the folded term type.
--   
--   In the definition of <tt>gmapQ</tt><i>x</i> combinators, we use
--   phantom type constructors for the <tt>c</tt> in the type of
--   <a>gfoldl</a> because the result type of a query does not involve the
--   (polymorphic) type of the term argument. In the definition of
--   <a>gmapQl</a> we simply use the plain constant type constructor
--   because <a>gfoldl</a> is left-associative anyway and so it is readily
--   suited to fold a left-associative binary operation over the immediate
--   subterms. In the definition of gmapQr, extra effort is needed. We use
--   a higher-order accumulation trick to mediate between left-associative
--   constructor application vs. right-associative binary operation (e.g.,
--   <tt>(:)</tt>). When the query is meant to compute a value of type
--   <tt>r</tt>, then the result type within generic folding is <tt>r -&gt;
--   r</tt>. So the result of folding is a function to which we finally
--   pass the right unit.
--   
--   With the <tt>-XDeriveDataTypeable</tt> option, GHC can generate
--   instances of the <a>Data</a> class automatically. For example, given
--   the declaration
--   
--   <pre>
--   data T a b = C1 a b | C2 deriving (Typeable, Data)
--   </pre>
--   
--   GHC will generate an instance that is equivalent to
--   
--   <pre>
--   instance (Data a, Data b) =&gt; Data (T a b) where
--       gfoldl k z (C1 a b) = z C1 `k` a `k` b
--       gfoldl k z C2       = z C2
--   
--       gunfold k z c = case constrIndex c of
--                           1 -&gt; k (k (z C1))
--                           2 -&gt; z C2
--   
--       toConstr (C1 _ _) = con_C1
--       toConstr C2       = con_C2
--   
--       dataTypeOf _ = ty_T
--   
--   con_C1 = mkConstr ty_T "C1" [] Prefix
--   con_C2 = mkConstr ty_T "C2" [] Prefix
--   ty_T   = mkDataType "Module.T" [con_C1, con_C2]
--   </pre>
--   
--   This 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
--   with the <tt>DeriveGeneric</tt> flag on.
--   
--   A <a>Generic</a> instance must satisfy the following laws:
--   
--   <pre>
--   <a>from</a> . <a>to</a> ≡ <a>id</a>
--   <a>to</a> . <a>from</a> ≡ <a>id</a>
--   </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
--   evaluate all sub-components), and then return <tt>()</tt>.
--   
--   <h3><a>Generic</a> <a>NFData</a> deriving</h3>
--   
--   Starting with GHC 7.2, you can automatically derive instances for
--   types possessing a <a>Generic</a> instance.
--   
--   Note: <a>Generic1</a> can be auto-derived starting with GHC 7.4
--   
--   <pre>
--   {-# LANGUAGE DeriveGeneric #-}
--   
--   import GHC.Generics (Generic, Generic1)
--   import Control.DeepSeq
--   
--   data Foo a = Foo a String
--                deriving (Eq, Generic, Generic1)
--   
--   instance NFData a =&gt; NFData (Foo a)
--   instance NFData1 Foo
--   
--   data Colour = Red | Green | Blue
--                 deriving Generic
--   
--   instance NFData Colour
--   </pre>
--   
--   Starting with GHC 7.10, the example above can be written more
--   concisely by enabling the new <tt>DeriveAnyClass</tt> extension:
--   
--   <pre>
--   {-# LANGUAGE DeriveGeneric, DeriveAnyClass #-}
--   
--   import GHC.Generics (Generic)
--   import Control.DeepSeq
--   
--   data Foo a = Foo a String
--                deriving (Eq, Generic, Generic1, NFData, NFData1)
--   
--   data Colour = Red | Green | Blue
--                 deriving (Generic, NFData)
--   </pre>
--   
--   <h3>Compatibility with previous <tt>deepseq</tt> versions</h3>
--   
--   Prior to version 1.4.0.0, the default implementation of the <a>rnf</a>
--   method was defined as
--   
--   <pre>
--   <a>rnf</a> a = <a>seq</a> a ()
--   </pre>
--   
--   However, starting with <tt>deepseq-1.4.0.0</tt>, the default
--   implementation is based on <tt>DefaultSignatures</tt> allowing for
--   more accurate auto-derived <a>NFData</a> instances. If you need the
--   previously used exact default <a>rnf</a> method implementation
--   semantics, use
--   
--   <pre>
--   instance NFData Colour where rnf x = seq x ()
--   </pre>
--   
--   or alternatively
--   
--   <pre>
--   instance NFData Colour where rnf = rwhnf
--   </pre>
--   
--   or
--   
--   <pre>
--   {-# LANGUAGE BangPatterns #-}
--   instance NFData Colour where rnf !_ = ()
--   </pre>
rnf :: NFData a => a -> ()

-- | <a>GHC.Generics</a>-based <a>rnf</a> implementation
--   
--   This is needed in order to support <tt>deepseq &lt; 1.4</tt> which
--   didn't have a <a>Generic</a>-based default <a>rnf</a> implementation
--   yet.
--   
--   In order to define instances, use e.g.
--   
--   <pre>
--   instance NFData MyType where rnf = genericRnf
--   </pre>
--   
--   The implementation has been taken from <tt>deepseq-1.4.2</tt>'s
--   default <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
--   encode and decode a Haskell value to a lazy <a>ByteString</a>. It
--   mirrors the <a>Read</a> and <a>Show</a> classes for textual
--   representation of Haskell types, and is suitable for serialising
--   Haskell values to disk, over the network.
--   
--   For decoding and generating simple external binary formats (e.g. C
--   structures), Binary may be used, but in general is not suitable for
--   complex protocols. Instead use the <a>PutM</a> and <a>Get</a>
--   primitives directly.
--   
--   Instances of Binary should satisfy the following property:
--   
--   <pre>
--   decode . encode == id
--   </pre>
--   
--   That is, the <a>get</a> and <a>put</a> methods should be the inverse
--   of each other. A range of instances are provided for basic Haskell
--   types.
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
--   may be overridden to be more efficient but must still have the same
--   encoding format.
putList :: Binary t => [t] -> Put

-- | Class of types with a known <a>Structure</a>.
--   
--   For regular data types <a>Structured</a> can be derived generically.
--   
--   <pre>
--   data Record = Record { a :: Int, b :: Bool, c :: [Char] } deriving (<a>Generic</a>)
--   instance <a>Structured</a> Record
--   </pre>
class Typeable a => Structured a

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

-- | 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]
infixl 3 <|>

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

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

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

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

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

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

data NonEmptySet a

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

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

-- | The <a>Const</a> functor.
newtype () => Const a (b :: k)
Const :: a -> Const a (b :: k)
[getConst] :: Const a (b :: k) -> a

-- | Uninhabited data type
data () => Void

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

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

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

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

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

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

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

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

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

-- | &lt;math&gt;. The <a>isPrefixOf</a> function takes two lists and
--   returns <a>True</a> iff the first list is a prefix of the second.
--   
--   <pre>
--   &gt;&gt;&gt; "Hello" `isPrefixOf` "Hello World!"
--   True
--   
--   &gt;&gt;&gt; "Hello" `isPrefixOf` "Wello Horld!"
--   False
--   </pre>
--   
--   For the result to be <a>True</a>, the first list must be finite;
--   <a>False</a>, however, results from any mismatch:
--   
--   <pre>
--   &gt;&gt;&gt; [0..] `isPrefixOf` [1..]
--   False
--   
--   &gt;&gt;&gt; [0..] `isPrefixOf` [0..99]
--   False
--   
--   &gt;&gt;&gt; [0..99] `isPrefixOf` [0..]
--   True
--   
--   &gt;&gt;&gt; [0..] `isPrefixOf` [0..]
--   * Hangs forever *
--   </pre>
isPrefixOf :: Eq a => [a] -> [a] -> Bool

-- | The <a>isSuffixOf</a> function takes two lists and returns <a>True</a>
--   iff the first list is a suffix of the second.
--   
--   <pre>
--   &gt;&gt;&gt; "ld!" `isSuffixOf` "Hello World!"
--   True
--   
--   &gt;&gt;&gt; "World" `isSuffixOf` "Hello World!"
--   False
--   </pre>
--   
--   The second list must be finite; however the first list may be
--   infinite:
--   
--   <pre>
--   &gt;&gt;&gt; [0..] `isSuffixOf` [0..99]
--   False
--   
--   &gt;&gt;&gt; [0..99] `isSuffixOf` [0..]
--   * Hangs forever *
--   </pre>
isSuffixOf :: Eq a => [a] -> [a] -> Bool

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

-- | &lt;math&gt;. The <a>intersperse</a> function takes an element and a
--   list and `intersperses' that element between the elements of the list.
--   For example,
--   
--   <pre>
--   &gt;&gt;&gt; intersperse ',' "abcde"
--   "a,b,c,d,e"
--   </pre>
intersperse :: a -> [a] -> [a]

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

-- | The <a>sortBy</a> function is the non-overloaded version of
--   <a>sort</a>. The argument must be finite.
--   
--   <pre>
--   &gt;&gt;&gt; sortBy (\(a,_) (b,_) -&gt; compare a b) [(2, "world"), (4, "!"), (1, "Hello")]
--   [(1,"Hello"),(2,"world"),(4,"!")]
--   </pre>
--   
--   The supplied comparison relation is supposed to be reflexive and
--   antisymmetric, otherwise, e. g., for <tt>_ _ -&gt; GT</tt>, the
--   ordered list simply does not exist. The relation is also expected to
--   be transitive: if it is not then <a>sortBy</a> might fail to find an
--   ordered permutation, even if it exists.
sortBy :: (a -> a -> Ordering) -> [a] -> [a]

-- | &lt;math&gt;. The <a>nub</a> function removes duplicate elements from
--   a list. In particular, it keeps only the first occurrence of each
--   element. (The name <a>nub</a> means `essence'.) It is a special case
--   of <a>nubBy</a>, which allows the programmer to supply their own
--   equality test.
--   
--   <pre>
--   &gt;&gt;&gt; nub [1,2,3,4,3,2,1,2,4,3,5]
--   [1,2,3,4,5]
--   </pre>
--   
--   If the order of outputs does not matter and there exists <tt>instance
--   Ord a</tt>, it's faster to use <a>map</a>
--   <tt>Data.List.NonEmpty.</tt><a>head</a> .
--   <tt>Data.List.NonEmpty.</tt><a>group</a> . <a>sort</a>, which takes
--   only &lt;math&gt; time.
nub :: Eq a => [a] -> [a]

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

-- | The <a>partition</a> function takes a predicate and a list, and
--   returns the pair of lists of elements which do and do not satisfy the
--   predicate, respectively; i.e.,
--   
--   <pre>
--   partition p xs == (filter p xs, filter (not . p) xs)
--   </pre>
--   
--   <pre>
--   &gt;&gt;&gt; partition (`elem` "aeiou") "Hello World!"
--   ("eoo","Hll Wrld!")
--   </pre>
partition :: (a -> Bool) -> [a] -> ([a], [a])

-- | The <a>dropWhileEnd</a> function drops the largest suffix of a list in
--   which the given predicate holds for all elements. For example:
--   
--   <pre>
--   &gt;&gt;&gt; dropWhileEnd isSpace "foo\n"
--   "foo"
--   </pre>
--   
--   <pre>
--   &gt;&gt;&gt; dropWhileEnd isSpace "foo bar"
--   "foo bar"
--   </pre>
--   
--   <pre>
--   dropWhileEnd isSpace ("foo\n" ++ undefined) == "foo" ++ undefined
--   </pre>
dropWhileEnd :: (a -> Bool) -> [a] -> [a]

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

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

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

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

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

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

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

-- | Map each element of the structure into a monoid, and combine the
--   results with <tt>(<a>&lt;&gt;</a>)</tt>. This fold is
--   right-associative and lazy in the accumulator. For strict
--   left-associative folds consider <a>foldMap'</a> instead.
--   
--   <h4><b>Examples</b></h4>
--   
--   Basic usage:
--   
--   <pre>
--   &gt;&gt;&gt; foldMap Sum [1, 3, 5]
--   Sum {getSum = 9}
--   </pre>
--   
--   <pre>
--   &gt;&gt;&gt; foldMap Product [1, 3, 5]
--   Product {getProduct = 15}
--   </pre>
--   
--   <pre>
--   &gt;&gt;&gt; foldMap (replicate 3) [1, 2, 3]
--   [1,1,1,2,2,2,3,3,3]
--   </pre>
--   
--   When a Monoid's <tt>(<a>&lt;&gt;</a>)</tt> is lazy in its second
--   argument, <a>foldMap</a> can return a result even from an unbounded
--   structure. For example, lazy accumulation enables
--   <a>Data.ByteString.Builder</a> to efficiently serialise large data
--   structures and produce the output incrementally:
--   
--   <pre>
--   &gt;&gt;&gt; import qualified Data.ByteString.Lazy as L
--   
--   &gt;&gt;&gt; import qualified Data.ByteString.Builder as B
--   
--   &gt;&gt;&gt; let bld :: Int -&gt; B.Builder; bld i = B.intDec i &lt;&gt; B.word8 0x20
--   
--   &gt;&gt;&gt; let lbs = B.toLazyByteString $ foldMap bld [0..]
--   
--   &gt;&gt;&gt; L.take 64 lbs
--   "0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24"
--   </pre>
foldMap :: (Foldable t, Monoid m) => (a -> m) -> t a -> m

-- | Right-associative fold of a structure, lazy in the accumulator.
--   
--   In the case of lists, <a>foldr</a>, when applied to a binary operator,
--   a starting value (typically the right-identity of the operator), and a
--   list, reduces the list using the binary operator, from right to left:
--   
--   <pre>
--   foldr f z [x1, x2, ..., xn] == x1 `f` (x2 `f` ... (xn `f` z)...)
--   </pre>
--   
--   Note that since the head of the resulting expression is produced by an
--   application of the operator to the first element of the list, given an
--   operator lazy in its right argument, <a>foldr</a> can produce a
--   terminating expression from an unbounded list.
--   
--   For a general <a>Foldable</a> structure this should be semantically
--   identical to,
--   
--   <pre>
--   foldr f z = <a>foldr</a> f z . <a>toList</a>
--   </pre>
--   
--   <h4><b>Examples</b></h4>
--   
--   Basic usage:
--   
--   <pre>
--   &gt;&gt;&gt; foldr (||) False [False, True, False]
--   True
--   </pre>
--   
--   <pre>
--   &gt;&gt;&gt; foldr (||) False []
--   False
--   </pre>
--   
--   <pre>
--   &gt;&gt;&gt; foldr (\c acc -&gt; acc ++ [c]) "foo" ['a', 'b', 'c', 'd']
--   "foodcba"
--   </pre>
--   
--   <h5>Infinite structures</h5>
--   
--   ⚠️ Applying <a>foldr</a> to infinite structures usually doesn't
--   terminate.
--   
--   It may still terminate under one of the following conditions:
--   
--   <ul>
--   <li>the folding function is short-circuiting</li>
--   <li>the folding function is lazy on its second argument</li>
--   </ul>
--   
--   <h6>Short-circuiting</h6>
--   
--   <tt>(<a>||</a>)</tt> short-circuits on <a>True</a> values, so the
--   following terminates because there is a <a>True</a> value finitely far
--   from the left side:
--   
--   <pre>
--   &gt;&gt;&gt; foldr (||) False (True : repeat False)
--   True
--   </pre>
--   
--   But the following doesn't terminate:
--   
--   <pre>
--   &gt;&gt;&gt; foldr (||) False (repeat False ++ [True])
--   * Hangs forever *
--   </pre>
--   
--   <h6>Laziness in the second argument</h6>
--   
--   Applying <a>foldr</a> to infinite structures terminates when the
--   operator is lazy in its second argument (the initial accumulator is
--   never used in this case, and so could be left <a>undefined</a>, but
--   <tt>[]</tt> is more clear):
--   
--   <pre>
--   &gt;&gt;&gt; take 5 $ foldr (\i acc -&gt; i : fmap (+3) acc) [] (repeat 1)
--   [1,4,7,10,13]
--   </pre>
foldr :: Foldable t => (a -> b -> b) -> b -> t a -> b

-- | Test whether the structure is empty. The default implementation is
--   Left-associative and lazy in both the initial element and the
--   accumulator. Thus optimised for structures where the first element can
--   be accessed in constant time. Structures where this is not the case
--   should have a non-default implementation.
--   
--   <h4><b>Examples</b></h4>
--   
--   Basic usage:
--   
--   <pre>
--   &gt;&gt;&gt; null []
--   True
--   </pre>
--   
--   <pre>
--   &gt;&gt;&gt; null [1]
--   False
--   </pre>
--   
--   <a>null</a> is expected to terminate even for infinite structures. The
--   default implementation terminates provided the structure is bounded on
--   the left (there is a leftmost element).
--   
--   <pre>
--   &gt;&gt;&gt; null [1..]
--   False
--   </pre>
null :: Foldable t => t a -> Bool

-- | Returns the size/length of a finite structure as an <a>Int</a>. The
--   default implementation just counts elements starting with the
--   leftmost. Instances for structures that can compute the element count
--   faster than via element-by-element counting, should provide a
--   specialised implementation.
--   
--   <h4><b>Examples</b></h4>
--   
--   Basic usage:
--   
--   <pre>
--   &gt;&gt;&gt; length []
--   0
--   </pre>
--   
--   <pre>
--   &gt;&gt;&gt; length ['a', 'b', 'c']
--   3
--   
--   &gt;&gt;&gt; length [1..]
--   * Hangs forever *
--   </pre>
length :: Foldable t => t a -> Int

-- | The <a>find</a> function takes a predicate and a structure and returns
--   the leftmost element of the structure matching the predicate, or
--   <a>Nothing</a> if there is no such element.
--   
--   <h4><b>Examples</b></h4>
--   
--   Basic usage:
--   
--   <pre>
--   &gt;&gt;&gt; find (&gt; 42) [0, 5..]
--   Just 45
--   </pre>
--   
--   <pre>
--   &gt;&gt;&gt; find (&gt; 12) [1..7]
--   Nothing
--   </pre>
find :: Foldable t => (a -> Bool) -> t a -> Maybe a

-- | Left-associative fold of a structure but with strict application of
--   the operator.
--   
--   This ensures that each step of the fold is forced to Weak Head Normal
--   Form before being applied, avoiding the collection of thunks that
--   would otherwise occur. This is often what you want to strictly reduce
--   a finite structure to a single strict result (e.g. <a>sum</a>).
--   
--   For a general <a>Foldable</a> structure this should be semantically
--   identical to,
--   
--   <pre>
--   foldl' f z = <a>foldl'</a> f z . <a>toList</a>
--   </pre>
foldl' :: Foldable t => (b -> a -> b) -> b -> t a -> b

-- | Map each element of a structure to an <a>Applicative</a> action,
--   evaluate these actions from left to right, and ignore the results. For
--   a version that doesn't ignore the results see <a>traverse</a>.
--   
--   <a>traverse_</a> is just like <a>mapM_</a>, but generalised to
--   <a>Applicative</a> actions.
--   
--   <h4><b>Examples</b></h4>
--   
--   Basic usage:
--   
--   <pre>
--   &gt;&gt;&gt; traverse_ print ["Hello", "world", "!"]
--   "Hello"
--   "world"
--   "!"
--   </pre>
traverse_ :: (Foldable t, Applicative f) => (a -> f b) -> t a -> f ()

-- | <a>for_</a> is <a>traverse_</a> with its arguments flipped. For a
--   version that doesn't ignore the results see <a>for</a>. This is
--   <a>forM_</a> generalised to <a>Applicative</a> actions.
--   
--   <a>for_</a> is just like <a>forM_</a>, but generalised to
--   <a>Applicative</a> actions.
--   
--   <h4><b>Examples</b></h4>
--   
--   Basic usage:
--   
--   <pre>
--   &gt;&gt;&gt; for_ [1..4] print
--   1
--   2
--   3
--   4
--   </pre>
for_ :: (Foldable t, Applicative f) => t a -> (a -> f b) -> f ()

-- | Determines whether any element of the structure satisfies the
--   predicate.
--   
--   <h4><b>Examples</b></h4>
--   
--   Basic usage:
--   
--   <pre>
--   &gt;&gt;&gt; any (&gt; 3) []
--   False
--   </pre>
--   
--   <pre>
--   &gt;&gt;&gt; any (&gt; 3) [1,2]
--   False
--   </pre>
--   
--   <pre>
--   &gt;&gt;&gt; any (&gt; 3) [1,2,3,4,5]
--   True
--   </pre>
--   
--   <pre>
--   &gt;&gt;&gt; any (&gt; 3) [1..]
--   True
--   </pre>
--   
--   <pre>
--   &gt;&gt;&gt; any (&gt; 3) [0, -1..]
--   * Hangs forever *
--   </pre>
any :: Foldable t => (a -> Bool) -> t a -> Bool

-- | Determines whether all elements of the structure satisfy the
--   predicate.
--   
--   <h4><b>Examples</b></h4>
--   
--   Basic usage:
--   
--   <pre>
--   &gt;&gt;&gt; all (&gt; 3) []
--   True
--   </pre>
--   
--   <pre>
--   &gt;&gt;&gt; all (&gt; 3) [1,2]
--   False
--   </pre>
--   
--   <pre>
--   &gt;&gt;&gt; all (&gt; 3) [1,2,3,4,5]
--   False
--   </pre>
--   
--   <pre>
--   &gt;&gt;&gt; all (&gt; 3) [1..]
--   False
--   </pre>
--   
--   <pre>
--   &gt;&gt;&gt; all (&gt; 3) [4..]
--   * Hangs forever *
--   </pre>
all :: Foldable t => (a -> Bool) -> t a -> Bool

-- | List of elements of a structure, from left to right. If the entire
--   list is intended to be reduced via a fold, just fold the structure
--   directly bypassing the list.
--   
--   <h4><b>Examples</b></h4>
--   
--   Basic usage:
--   
--   <pre>
--   &gt;&gt;&gt; toList Nothing
--   []
--   </pre>
--   
--   <pre>
--   &gt;&gt;&gt; toList (Just 42)
--   [42]
--   </pre>
--   
--   <pre>
--   &gt;&gt;&gt; toList (Left "foo")
--   []
--   </pre>
--   
--   <pre>
--   &gt;&gt;&gt; toList (Node (Leaf 5) 17 (Node Empty 12 (Leaf 8)))
--   [5,17,12,8]
--   </pre>
--   
--   For lists, <a>toList</a> is the identity:
--   
--   <pre>
--   &gt;&gt;&gt; toList [1, 2, 3]
--   [1,2,3]
--   </pre>
toList :: Foldable t => t a -> [a]

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

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

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

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

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

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

-- | Send the first component of the input through the argument arrow, and
--   copy 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
--   left to right. For example,
--   
--   <pre>
--   liftM2 (+) [0,1] [0,2] = [0,2,1,3]
--   liftM2 (+) (Just 1) Nothing = Nothing
--   </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,
--   
--   <pre>
--   when debug (putStrLn "Debugging")
--   </pre>
--   
--   will output the string <tt>Debugging</tt> if the Boolean value
--   <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
--   uses of <a>ap</a>, which promotes function application.
--   
--   <pre>
--   return f `ap` x1 `ap` ... `ap` xn
--   </pre>
--   
--   is equivalent to
--   
--   <pre>
--   liftMn f x1 x2 ... xn
--   </pre>
ap :: Monad m => m (a -> b) -> m a -> m b

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

-- | The <a>foldM</a> function is analogous to <a>foldl</a>, except that
--   its result is encapsulated in a monad. Note that <a>foldM</a> works
--   from left-to-right over the list arguments. This could be an issue
--   where <tt>(<a>&gt;&gt;</a>)</tt> and the `folded function' are not
--   commutative.
--   
--   <pre>
--   foldM f a1 [x1, x2, ..., xm]
--   
--   ==
--   
--   do
--     a2 &lt;- f a1 x1
--     a3 &lt;- f a2 x2
--     ...
--     f am xm
--   </pre>
--   
--   If right-to-left evaluation is required, the input list should be
--   reversed.
--   
--   Note: <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 <a>filter</a> function.
filterM :: Applicative m => (a -> m Bool) -> [a] -> m [a]

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

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

-- | This is the simplest of the exception-catching functions. It takes a
--   single argument, runs it, and if an exception is raised the "handler"
--   is executed, with the value of the exception passed as an argument.
--   Otherwise, the result is returned as normal. For example:
--   
--   <pre>
--   catch (readFile f)
--         (\e -&gt; do let err = show (e :: IOException)
--                   hPutStr stderr ("Warning: Couldn't open " ++ f ++ ": " ++ err)
--                   return "")
--   </pre>
--   
--   Note that we have to give a type signature to <tt>e</tt>, or the
--   program will not typecheck as the type is ambiguous. While it is
--   possible to catch exceptions of any type, see the section "Catching
--   all exceptions" (in <a>Control.Exception</a>) for an explanation of
--   the problems with doing so.
--   
--   For catching exceptions in pure (non-<a>IO</a>) expressions, see the
--   function <a>evaluate</a>.
--   
--   Note that due to Haskell's unspecified evaluation order, an expression
--   may throw one of several possible exceptions: consider the expression
--   <tt>(error "urk") + (1 `div` 0)</tt>. Does the expression throw
--   <tt>ErrorCall "urk"</tt>, or <tt>DivideByZero</tt>?
--   
--   The answer is "it might throw either"; the choice is
--   non-deterministic. If you are catching any type of exception then you
--   might catch either. If you are calling <tt>catch</tt> with type <tt>IO
--   Int -&gt; (ArithException -&gt; IO Int) -&gt; IO Int</tt> then the
--   handler may get run with <tt>DivideByZero</tt> as an argument, or an
--   <tt>ErrorCall "urk"</tt> exception may be propagated further up. If
--   you call it again, you might get the opposite behaviour. This is ok,
--   because <a>catch</a> is an <a>IO</a> computation.
catch :: Exception e => IO a -> (e -> IO a) -> IO a

-- | A variant of <a>throw</a> that can only be used within the <a>IO</a>
--   monad.
--   
--   Although <a>throwIO</a> has a type that is an instance of the type of
--   <a>throw</a>, the two functions are subtly different:
--   
--   <pre>
--   throw e   `seq` ()  ===&gt; throw e
--   throwIO e `seq` ()  ===&gt; ()
--   </pre>
--   
--   The first example will cause the exception <tt>e</tt> to be raised,
--   whereas the second one won't. In fact, <a>throwIO</a> will only cause
--   an exception to be raised when it is used within the <a>IO</a> monad.
--   
--   The <a>throwIO</a> variant should be used in preference to
--   <a>throw</a> to raise an exception within the <a>IO</a> monad because
--   it guarantees ordering with respect to other operations, whereas
--   <a>throw</a> does not. We say that <a>throwIO</a> throws *precise*
--   exceptions and <a>throw</a>, <a>error</a>, etc. all throw *imprecise*
--   exceptions. For example
--   
--   <pre>
--   throw e + error "boom" ===&gt; error "boom"
--   throw e + error "boom" ===&gt; throw e
--   </pre>
--   
--   are both valid reductions and the compiler may pick any (loop, even),
--   whereas
--   
--   <pre>
--   throwIO e &gt;&gt; error "boom" ===&gt; throwIO e
--   </pre>
--   
--   will always throw <tt>e</tt> when executed.
--   
--   See also the <a>GHC wiki page on precise exceptions</a> for a more
--   technical introduction to how GHC optimises around precise vs.
--   imprecise exceptions.
throwIO :: Exception e => e -> IO a

-- | Evaluate the argument to weak head normal form.
--   
--   <a>evaluate</a> is typically used to uncover any exceptions that a
--   lazy value may contain, and possibly handle them.
--   
--   <a>evaluate</a> only evaluates to <i>weak head normal form</i>. If
--   deeper evaluation is needed, the <tt>force</tt> function from
--   <tt>Control.DeepSeq</tt> may be handy:
--   
--   <pre>
--   evaluate $ force x
--   </pre>
--   
--   There is a subtle difference between <tt><a>evaluate</a> x</tt> and
--   <tt><a>return</a> <a>$!</a> x</tt>, analogous to the difference
--   between <a>throwIO</a> and <a>throw</a>. If the lazy value <tt>x</tt>
--   throws an exception, <tt><a>return</a> <a>$!</a> x</tt> will fail to
--   return an <a>IO</a> action and will throw an exception instead.
--   <tt><a>evaluate</a> x</tt>, on the other hand, always produces an
--   <a>IO</a> action; that action will throw an exception upon
--   <i>execution</i> iff <tt>x</tt> throws an exception upon
--   <i>evaluation</i>.
--   
--   The practical implication of this difference is that due to the
--   <i>imprecise exceptions</i> semantics,
--   
--   <pre>
--   (return $! error "foo") &gt;&gt; error "bar"
--   </pre>
--   
--   may throw either <tt>"foo"</tt> or <tt>"bar"</tt>, depending on the
--   optimizations performed by the compiler. On the other hand,
--   
--   <pre>
--   evaluate (error "foo") &gt;&gt; error "bar"
--   </pre>
--   
--   is guaranteed to throw <tt>"foo"</tt>.
--   
--   The rule of thumb is to use <a>evaluate</a> to force or handle
--   exceptions in lazy values. If, on the other hand, you are forcing a
--   lazy value for efficiency reasons only and do not care about
--   exceptions, you may use <tt><a>return</a> <a>$!</a> x</tt>.
evaluate :: a -> IO a

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

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

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

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

-- | Try <tt>IOException</tt>.
tryIO :: IO a -> IO (Either IOException a)

-- | Catch <tt>IOException</tt>.
catchIO :: IO a -> (IOException -> IO a) -> IO a

-- | Catch <a>ExitCode</a>
catchExit :: IO a -> (ExitCode -> IO a) -> IO a

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

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

-- | Returns <a>True</a> for any Unicode space character, and the control
--   characters <tt>\t</tt>, <tt>\n</tt>, <tt>\r</tt>, <tt>\f</tt>,
--   <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
--   (letters). Title case is used by a small number of letter ligatures
--   like the single-character form of <i>Lj</i>.
--   
--   <b>Note:</b> this predicate does <i>not</i> work for letter-like
--   characters such as: <tt>'Ⓐ'</tt> (<tt>U+24B6</tt> circled Latin
--   capital letter A) and <tt>'Ⅳ'</tt> (<tt>U+2163</tt> Roman numeral
--   four). This is due to selecting only characters with the
--   <a>GeneralCategory</a> <a>UppercaseLetter</a> or
--   <a>TitlecaseLetter</a>.
--   
--   See <a>isUpperCase</a> for a more intuitive predicate. Note that
--   unlike <a>isUpperCase</a>, <a>isUpper</a> does select
--   <i>title-case</i> characters such as <tt>'ǅ'</tt> (<tt>U+01C5</tt>
--   Latin capital letter d with small letter z with caron) or <tt>'ᾯ'</tt>
--   (<tt>U+1FAF</tt> Greek capital letter omega with dasia and perispomeni
--   and prosgegrammeni).
isUpper :: Char -> Bool

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

-- | Selects alphabetic or numeric Unicode characters.
--   
--   Note that numeric digits outside the ASCII range, as well as numeric
--   characters which aren't digits, are selected by this function but not
--   by <a>isDigit</a>. Such characters may be part of identifiers but are
--   not used by the printer and reader to represent numbers.
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
--   other character is returned unchanged.
toLower :: Char -> Char

-- | Convert a letter to the corresponding upper-case letter, if any. Any
--   other character is returned unchanged.
toUpper :: Char -> Char

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

-- | If <a>Void</a> is uninhabited then any <a>Functor</a> that holds only
--   values of type <a>Void</a> is holding no values. It is implemented in
--   terms of <tt>fmap absurd</tt>.
vacuous :: Functor f => f Void -> f a
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

-- | Beside, separated by space, unless one of the arguments is
--   <a>empty</a>. <a>&lt;+&gt;</a> is associative, with identity
--   <a>empty</a>.
(<+>) :: Doc -> Doc -> Doc
infixl 6 <+>

-- | Defines the exit codes that a program can return.
data () => ExitCode

-- | indicates successful termination;
ExitSuccess :: ExitCode

-- | indicates program failure with an exit code. The exact interpretation
--   of the code is operating-system dependent. In particular, some values
--   may be prohibited (e.g. 0 on a POSIX-compliant system).
ExitFailure :: Int -> ExitCode

-- | Computation <a>exitWith</a> <tt>code</tt> throws <a>ExitCode</a>
--   <tt>code</tt>. Normally this terminates the program, returning
--   <tt>code</tt> to the program's caller.
--   
--   On program termination, the standard <a>Handle</a>s <a>stdout</a> and
--   <a>stderr</a> are flushed automatically; any other buffered
--   <a>Handle</a>s need to be flushed manually, otherwise the buffered
--   data will be discarded.
--   
--   A program that fails in any other way is treated as if it had called
--   <a>exitFailure</a>. A program that terminates successfully without
--   calling <a>exitWith</a> explicitly is treated as if it had called
--   <a>exitWith</a> <a>ExitSuccess</a>.
--   
--   As an <a>ExitCode</a> is an <a>Exception</a>, it can be caught using
--   the functions of <a>Control.Exception</a>. This means that cleanup
--   computations added with <a>bracket</a> (from <a>Control.Exception</a>)
--   are also executed properly on <a>exitWith</a>.
--   
--   Note: in GHC, <a>exitWith</a> should be called from the main program
--   thread in order to exit the process. When called from another thread,
--   <a>exitWith</a> will throw an <a>ExitCode</a> as normal, but the
--   exception will not cause the process itself to exit.
exitWith :: ExitCode -> IO a

-- | The computation <a>exitSuccess</a> is equivalent to <a>exitWith</a>
--   <a>ExitSuccess</a>, It terminates the program successfully.
exitSuccess :: IO a

-- | The computation <a>exitFailure</a> is equivalent to <a>exitWith</a>
--   <tt>(</tt><a>ExitFailure</a> <i>exitfail</i><tt>)</tt>, where
--   <i>exitfail</i> is implementation-dependent.
exitFailure :: IO a

-- | Parse a string using the <a>Read</a> instance. Succeeds if there is
--   exactly one valid result.
--   
--   <pre>
--   &gt;&gt;&gt; readMaybe "123" :: Maybe Int
--   Just 123
--   </pre>
--   
--   <pre>
--   &gt;&gt;&gt; readMaybe "hello" :: Maybe Int
--   Nothing
--   </pre>
readMaybe :: Read a => String -> Maybe a

-- | <i>Deprecated: Don't leave me in the code</i>
trace :: String -> a -> a

-- | <i>Deprecated: Don't leave me in the code</i>
traceShow :: Show a => a -> b -> b

-- | <i>Deprecated: Don't leave me in the code</i>
traceShowId :: Show a => a -> a
instance Distribution.Compat.Prelude.GNFData GHC.Generics.V1
instance Distribution.Compat.Prelude.GNFData GHC.Generics.U1
instance Control.DeepSeq.NFData a => Distribution.Compat.Prelude.GNFData (GHC.Generics.K1 i a)
instance Distribution.Compat.Prelude.GNFData a => Distribution.Compat.Prelude.GNFData (GHC.Generics.M1 i c a)
instance (Distribution.Compat.Prelude.GNFData a, Distribution.Compat.Prelude.GNFData b) => Distribution.Compat.Prelude.GNFData (a GHC.Generics.:*: b)
instance (Distribution.Compat.Prelude.GNFData a, Distribution.Compat.Prelude.GNFData b) => Distribution.Compat.Prelude.GNFData (a GHC.Generics.:+: b)


-- | Compact representation of short <tt>Strings</tt>
--   
--   This module is designed to be import qualified
--   
--   <pre>
--   import Distribution.Utils.ShortText (ShortText)
--   import qualified Distribution.Utils.ShortText as ShortText
--   </pre>
module Distribution.Utils.ShortText

-- | Compact representation of short <tt>Strings</tt>
--   
--   The data is stored internally as UTF8 in an <a>ShortByteString</a>
--   when compiled against <tt>bytestring &gt;= 0.10.4</tt>, and otherwise
--   the fallback is to use plain old non-compat '[Char]'.
--   
--   Note: This type is for internal uses (such as e.g.
--   <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

-- | Convert from UTF-8 encoded strict <tt>ByteString</tt>.
unsafeFromUTF8BS :: ByteString -> ShortText

-- | Text whether <a>ShortText</a> is empty.
null :: ShortText -> Bool

-- | <i>O(n)</i>. Length in characters. <i>Slow</i> as converts to string.
length :: ShortText -> Int

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

-- | Encode <a>String</a> to a list of UTF8-encoded octets
--   
--   Code-points in the <tt>U+D800</tt>-<tt>U+DFFF</tt> range will be
--   encoded as the replacement character (i.e. <tt>U+FFFD</tt>).
--   
--   See 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 Distribution.Utils.Structured.Structured 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


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

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

-- | Writes a file atomically.
--   
--   The file is either written successfully or an IO exception is raised
--   and the original file is left unchanged.
--   
--   On windows it is not possible to delete a file that is open by a
--   process. This case will give an IO exception but the atomic property
--   is not affected.
writeFileAtomic :: FilePath -> ByteString -> IO ()

-- | Decode <a>String</a> from UTF8-encoded <a>ByteString</a>
--   
--   Invalid data in the UTF8 stream (this includes code-points
--   <tt>U+D800</tt> through <tt>U+DFFF</tt>) will be decoded as the
--   replacement 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 UTF8-encoded <a>ByteString</a>
--   
--   Code-points in the <tt>U+D800</tt>-<tt>U+DFFF</tt> range will be
--   encoded 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

-- | Check that strict <tt>ByteString</tt> is valid UTF8. Returns 'Just
--   offset' if it's not.
validateUTF8 :: ByteString -> Maybe Int

-- | Reads a UTF8 encoded text file as a Unicode String
--   
--   Reads lazily using ordinary <a>readFile</a>.
readUTF8File :: FilePath -> IO String

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

-- | Writes a Unicode String as a UTF8 encoded text file.
--   
--   Uses <a>writeFileAtomic</a>, so provides the same guarantees.
writeUTF8File :: FilePath -> String -> IO ()

-- | 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 .
--   reverse</tt>, but quite a bit faster. The difference between
--   "Data.List.dropWhileEnd" and this version is that the one in
--   <a>Data.List</a> is strict in elements, but spine-lazy, while this one
--   is spine-strict but lazy in elements. That's what <tt>LE</tt> stands
--   for - "lazy in elements".
--   
--   Example:
--   
--   <pre>
--   &gt;&gt;&gt; safeTail $ Data.List.dropWhileEnd (&lt;3) [undefined, 5, 4, 3, 2, 1]
--   *** Exception: Prelude.undefined
--   ...
--   </pre>
--   
--   <pre>
--   &gt;&gt;&gt; safeTail $ dropWhileEndLE (&lt;3) [undefined, 5, 4, 3, 2, 1]
--   [5,4,3]
--   </pre>
--   
--   <pre>
--   &gt;&gt;&gt; take 3 $ Data.List.dropWhileEnd (&lt;3) [5, 4, 3, 2, 1, undefined]
--   [5,4,3]
--   </pre>
--   
--   <pre>
--   &gt;&gt;&gt; take 3 $ dropWhileEndLE (&lt;3) [5, 4, 3, 2, 1, undefined]
--   *** Exception: Prelude.undefined
--   ...
--   </pre>
dropWhileEndLE :: (a -> Bool) -> [a] -> [a]

-- | <tt>takeWhileEndLE p</tt> is equivalent to <tt>reverse . takeWhile p .
--   reverse</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>
--   comparing p x y = compare (p x) (p y)
--   </pre>
--   
--   Useful combinator for use in conjunction with the <tt>xxxBy</tt>
--   family of functions from <a>Data.List</a>, for example:
--   
--   <pre>
--   ... sortBy (comparing fst) ...
--   </pre>
comparing :: Ord a => (b -> a) -> b -> b -> Ordering

-- | The <a>isInfixOf</a> function takes two lists and returns <a>True</a>
--   iff the first list is contained, wholly and intact, anywhere within
--   the second.
--   
--   <pre>
--   &gt;&gt;&gt; isInfixOf "Haskell" "I really like Haskell."
--   True
--   
--   &gt;&gt;&gt; isInfixOf "Ial" "I really like Haskell."
--   False
--   </pre>
--   
--   For the result to be <a>True</a>, the first list must be finite; for
--   the result to be <a>False</a>, the second list must be finite:
--   
--   <pre>
--   &gt;&gt;&gt; [20..50] `isInfixOf` [0..]
--   True
--   
--   &gt;&gt;&gt; [0..] `isInfixOf` [20..50]
--   False
--   
--   &gt;&gt;&gt; [0..] `isInfixOf` [0..]
--   * Hangs forever *
--   </pre>
isInfixOf :: Eq a => [a] -> [a] -> Bool

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

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

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

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

-- | Ascii letters and digits.
--   
--   <pre>
--   &gt;&gt;&gt; isAsciiAlphaNum 'a'
--   True
--   </pre>
--   
--   <pre>
--   &gt;&gt;&gt; isAsciiAlphaNum 'ä'
--   False
--   </pre>
isAsciiAlphaNum :: Char -> Bool

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

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

-- | Like <a>nub</a>, but has <tt>O(n log n)</tt> complexity instead of
--   <tt>O(n^2)</tt>. Code for <a>ordNub</a> and <a>listUnion</a> taken
--   from 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
--   and takes the nub based on that key.
ordNubBy :: Ord b => (a -> b) -> [a] -> [a]

-- | A right-biased version of <a>ordNub</a>.
--   
--   Example:
--   
--   <pre>
--   &gt;&gt;&gt; ordNub [1,2,1] :: [Int]
--   [1,2]
--   </pre>
--   
--   <pre>
--   &gt;&gt;&gt; ordNubRight [1,2,1] :: [Int]
--   [2,1]
--   </pre>
ordNubRight :: Ord a => [a] -> [a]

-- | A total variant of <a>head</a>.
safeHead :: [a] -> Maybe a

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

-- | A total variant of <a>last</a>.
safeLast :: [a] -> Maybe a

-- | A total variant of <a>init</a>.
safeInit :: [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
--   width.
wrapLine :: Int -> [String] -> [[String]]

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

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

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

-- | The opposite of <tt>snoc</tt>, which is the reverse of <tt>cons</tt>
--   
--   Example:
--   
--   <pre>
--   &gt;&gt;&gt; unsnoc [1, 2, 3]
--   Just ([1,2],3)
--   </pre>
--   
--   <pre>
--   &gt;&gt;&gt; unsnoc []
--   Nothing
--   </pre>
unsnoc :: [a] -> Maybe ([a], a)

-- | Like <a>unsnoc</a>, but for <a>NonEmpty</a> so without the
--   <a>Maybe</a>
--   
--   Example:
--   
--   <pre>
--   &gt;&gt;&gt; unsnocNE (1 :| [2, 3])
--   ([1,2],3)
--   </pre>
--   
--   <pre>
--   &gt;&gt;&gt; unsnocNE (1 :| [])
--   ([],1)
--   </pre>
unsnocNE :: NonEmpty a -> ([a], a)

fstOf3 :: (a, b, c) -> a

sndOf3 :: (a, b, c) -> b

trdOf3 :: (a, b, c) -> c

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

-- | <pre>
--   isRelativeOnAnyPlatform = not . <a>isAbsoluteOnAnyPlatform</a>
--   </pre>
isRelativeOnAnyPlatform :: FilePath -> Bool

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 <a>Condition</a> 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 Distribution.Utils.Structured.Structured c => Distribution.Utils.Structured.Structured (Distribution.Types.Condition.Condition c)
instance Control.DeepSeq.NFData c => Control.DeepSeq.NFData (Distribution.Types.Condition.Condition c)

module Distribution.Parsec.Position

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

positionCol :: Position -> Int

positionRow :: Position -> Int
instance GHC.Generics.Generic Distribution.Parsec.Position.Position
instance GHC.Show.Show Distribution.Parsec.Position.Position
instance GHC.Classes.Ord Distribution.Parsec.Position.Position
instance GHC.Classes.Eq Distribution.Parsec.Position.Position
instance Data.Binary.Class.Binary Distribution.Parsec.Position.Position
instance Control.DeepSeq.NFData Distribution.Parsec.Position.Position

module Distribution.Parsec.Warning

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

-- | Type of parser warning. We do classify warnings.
--   
--   Different application may decide not to show some, or have fatal
--   behaviour 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
--   <a>https://github.com/haskell/cabal/issues/5020</a>.
PWTBuildTypeDefault :: PWarnType

-- | Version operators used (without cabal-version: 1.8)
PWTVersionOperator :: PWarnType

-- | Version wildcard used (without cabal-version: 1.6)
PWTVersionWildcard :: PWarnType

-- | Warnings about cabal-version format.
PWTSpecVersion :: PWarnType

-- | Empty filepath, i.e. literally ""
PWTEmptyFilePath :: PWarnType

-- | Experimental feature
PWTExperimental :: PWarnType
showPWarning :: FilePath -> PWarning -> String
instance GHC.Generics.Generic Distribution.Parsec.Warning.PWarnType
instance GHC.Enum.Bounded Distribution.Parsec.Warning.PWarnType
instance GHC.Enum.Enum Distribution.Parsec.Warning.PWarnType
instance GHC.Show.Show Distribution.Parsec.Warning.PWarnType
instance GHC.Classes.Ord Distribution.Parsec.Warning.PWarnType
instance GHC.Classes.Eq Distribution.Parsec.Warning.PWarnType
instance GHC.Generics.Generic Distribution.Parsec.Warning.PWarning
instance GHC.Show.Show Distribution.Parsec.Warning.PWarning
instance GHC.Classes.Ord Distribution.Parsec.Warning.PWarning
instance GHC.Classes.Eq Distribution.Parsec.Warning.PWarning
instance Data.Binary.Class.Binary Distribution.Parsec.Warning.PWarning
instance Control.DeepSeq.NFData Distribution.Parsec.Warning.PWarning
instance Data.Binary.Class.Binary Distribution.Parsec.Warning.PWarnType
instance Control.DeepSeq.NFData Distribution.Parsec.Warning.PWarnType

module Distribution.Parsec.FieldLineStream

-- | This is essentially a lazy bytestring, but chunks are glued with
--   newline <tt>'\n'</tt>.
data FieldLineStream
FLSLast :: !ByteString -> FieldLineStream
FLSCons :: {-# UNPACK #-} !ByteString -> FieldLineStream -> FieldLineStream

-- | Convert <a>String</a> to <a>FieldLineStream</a>.
--   
--   <i>Note:</i> inefficient!
fieldLineStreamFromString :: String -> FieldLineStream
fieldLineStreamFromBS :: ByteString -> FieldLineStream
fieldLineStreamEnd :: FieldLineStream
instance GHC.Show.Show Distribution.Parsec.FieldLineStream.FieldLineStream
instance GHC.Base.Monad m => Text.Parsec.Prim.Stream Distribution.Parsec.FieldLineStream.FieldLineStream m GHC.Types.Char

module Distribution.Parsec.Error

-- | Parser error.
data PError
PError :: Position -> String -> PError
showPError :: FilePath -> PError -> String
instance GHC.Generics.Generic Distribution.Parsec.Error.PError
instance GHC.Show.Show Distribution.Parsec.Error.PError
instance Data.Binary.Class.Binary Distribution.Parsec.Error.PError
instance Control.DeepSeq.NFData Distribution.Parsec.Error.PError


module Distribution.PackageDescription.Quirks

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


module Distribution.Fields.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 ()

-- | Add warning at specific position
addWarningAt :: Position -> LexWarningType -> Lex ()
toPWarnings :: [LexWarning] -> [PWarning]
instance GHC.Show.Show Distribution.Fields.LexerMonad.LexWarningType
instance GHC.Classes.Ord Distribution.Fields.LexerMonad.LexWarningType
instance GHC.Classes.Eq Distribution.Fields.LexerMonad.LexWarningType
instance GHC.Show.Show Distribution.Fields.LexerMonad.LexWarning
instance GHC.Base.Functor Distribution.Fields.LexerMonad.Lex
instance GHC.Base.Applicative Distribution.Fields.LexerMonad.Lex
instance GHC.Base.Monad Distribution.Fields.LexerMonad.Lex


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

-- | Tokens of outer cabal file structure. Field values are treated
--   opaquely.
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.Fields.Lexer.Token
instance GHC.Show.Show Distribution.Fields.Lexer.LToken


-- | Alternative parser combinators.
--   
--   Originally in <tt>parsers</tt> package.
module Distribution.Compat.Parsing

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

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

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

-- | <tt>skipOptional p</tt> tries to apply parser <tt>p</tt>. It will
--   parse <tt>p</tt> or nothing. It only fails if <tt>p</tt> fails after
--   consuming input. It discards the result of <tt>p</tt>. (Plays the role
--   of 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
--   <tt>p</tt> and <tt>close</tt>. Returns the value returned by
--   <tt>p</tt>.
--   
--   <pre>
--   braces  = between (symbol "{") (symbol "}")
--   </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
--   <tt>p</tt>, separated by <tt>sep</tt>. Returns a list of values
--   returned by <tt>p</tt>.
--   
--   <pre>
--   commaSep p  = p `sepBy` (symbol ",")
--   </pre>
sepBy :: Alternative m => m a -> m sep -> m [a]

-- | <tt>sepByNonEmpty p sep</tt> parses <i>one</i> or more occurrences of
--   <tt>p</tt>, separated by <tt>sep</tt>. Returns a non-empty list of
--   values returned by <tt>p</tt>.
sepByNonEmpty :: Alternative m => m a -> m sep -> m (NonEmpty a)

-- | <tt>sepEndByNonEmpty p sep</tt> parses <i>one</i> or more occurrences
--   of <tt>p</tt>, separated and optionally ended by <tt>sep</tt>. Returns
--   a non-empty list of values returned by <tt>p</tt>.
sepEndByNonEmpty :: Alternative m => m a -> m sep -> m (NonEmpty a)

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

-- | <tt>endByNonEmpty p sep</tt> parses <i>one</i> or more occurrences of
--   <tt>p</tt>, separated and ended by <tt>sep</tt>. Returns a non-empty
--   list of values returned by <tt>p</tt>.
endByNonEmpty :: Alternative m => m a -> m sep -> m (NonEmpty a)

-- | <tt>endBy p sep</tt> parses <i>zero</i> or more occurrences of
--   <tt>p</tt>, separated and ended by <tt>sep</tt>. Returns a list of
--   values returned by <tt>p</tt>.
--   
--   <pre>
--   cStatements  = cStatement `endBy` semi
--   </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
--   <tt>n</tt> is smaller or equal to zero, the parser equals to
--   <tt>return []</tt>. Returns a list of <tt>n</tt> values returned by
--   <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
--   <tt>p</tt>, separated by <tt>op</tt>. Returns a value obtained by a
--   <i>left</i> associative application of all functions returned by
--   <tt>op</tt> to the values returned by <tt>p</tt>. If there are zero
--   occurrences 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
--   <tt>p</tt>, separated by <tt>op</tt> Returns a value obtained by a
--   <i>right</i> associative application of all functions returned by
--   <tt>op</tt> to the values returned by <tt>p</tt>. If there are no
--   occurrences 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
--   <tt>p</tt>, separated by <tt>op</tt> Returns a value obtained by a
--   <i>left</i> associative application of all functions returned by
--   <tt>op</tt> to the values returned by <tt>p</tt>. . This parser can
--   for example be used to eliminate left recursion which typically occurs
--   in expression grammars.
--   
--   <pre>
--   expr   = term   `chainl1` addop
--   term   = factor `chainl1` mulop
--   factor = parens expr &lt;|&gt; integer
--   
--   mulop  = (*) &lt;$ symbol "*"
--        &lt;|&gt; div &lt;$ symbol "/"
--   
--   addop  = (+) &lt;$ symbol "+"
--        &lt;|&gt; (-) &lt;$ symbol "-"
--   </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
--   <tt>p</tt>, separated by <tt>op</tt> Returns a value obtained by a
--   <i>right</i> associative application of all functions returned by
--   <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
--   times until parser <tt>end</tt> succeeds. Returns the list of values
--   returned by <tt>p</tt>. This parser can be used to scan comments:
--   
--   <pre>
--   simpleComment   = do{ string "&lt;!--"
--                       ; manyTill anyChar (try (string "--&gt;"))
--                       }
--   </pre>
--   
--   Note the overlapping parsers <tt>anyChar</tt> and <tt>string
--   "--&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
--   input type.
class Alternative m => Parsing m

-- | Take a parser that may consume input, and on failure, go back to where
--   we 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
--   often 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
--   times, 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
--   primitive parser but it is defined using <a>notFollowedBy</a>.
--   
--   <pre>
--   eof  = notFollowedBy anyChar &lt;?&gt; "end of input"
--   </pre>
eof :: Parsing m => m ()

-- | <tt>notFollowedBy p</tt> only succeeds when parser <tt>p</tt> fails.
--   This parser does not consume any input. This parser can be used to
--   implement the 'longest match' rule. For example, when recognizing
--   keywords (for example <tt>let</tt>), we want to make sure that a
--   keyword is not followed by a legal identifier character, in which case
--   the keyword is actually an identifier (for example <tt>lets</tt>). We
--   can program this behaviour as follows:
--   
--   <pre>
--   keywordLet  = try $ string "let" &lt;* notFollowedBy alphaNum
--   </pre>
notFollowedBy :: (Parsing m, Show a) => m a -> m ()
infixr 0 <?>
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)


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

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

empty :: DList a

-- | Make <a>DList</a> 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
--   dependencies.
--   
--   For the documentation of the combinators see <a>lens</a> package. This
--   module 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

-- | <pre>
--   &gt;&gt;&gt; (3 :: Int) ^. getting (+2) . getting show
--   "5"
--   </pre>
getting :: (s -> a) -> Getting r s 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)

module Distribution.Types.CondTree

-- | A <a>CondTree</a> is used to represent the conditional structure of a
--   Cabal file, reflecting a syntax element subject to constraints, and
--   then any number of sub-elements which may be enabled subject to some
--   condition. Both <tt>a</tt> and <tt>c</tt> are usually <a>Monoid</a>s.
--   
--   To be more concrete, consider the following fragment of a
--   <tt>Cabal</tt> file:
--   
--   <pre>
--   build-depends: base &gt;= 4.0
--   if flag(extra)
--       build-depends: base &gt;= 4.2
--   </pre>
--   
--   One way to represent this is to have <tt><a>CondTree</a>
--   <tt>ConfVar</tt> [<tt>Dependency</tt>] <tt>BuildInfo</tt></tt>. Here,
--   <a>condTreeData</a> represents the actual fields which are not behind
--   any conditional, while <a>condTreeComponents</a> recursively records
--   any further fields which are behind a conditional.
--   <a>condTreeConstraints</a> records the constraints (in this case,
--   <tt>base &gt;= 4.0</tt>) which would be applied if you use this
--   syntax; in general, this is derived off of <tt>targetBuildInfo</tt>
--   (perhaps a good refactoring would be to convert this into an opaque
--   type, 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
--   flag(foo)</tt> on some syntax <tt>a</tt>. It also has an optional
--   false 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

-- | Flatten a CondTree. This will traverse the CondTree by taking all
--   possible paths into account, but merging inclusive when two paths may
--   co-exist, and exclusively when the paths are an if/else
foldCondTree :: forall b c a v. b -> ((c, a) -> b) -> (b -> b -> b) -> (b -> b -> b) -> CondTree v c a -> b
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

-- | @<tt>Traversal</tt>@ for the variables
traverseCondTreeV :: Traversal (CondTree v c a) (CondTree w c a) v w

-- | @<tt>Traversal</tt>@ for the variables
traverseCondBranchV :: Traversal (CondBranch v c a) (CondBranch w c a) v w

-- | @<tt>Traversal</tt>@ for the aggregated constraints
traverseCondTreeC :: Traversal (CondTree v c a) (CondTree v d a) c d

-- | @<tt>Traversal</tt>@ for the aggregated constraints
traverseCondBranchC :: Traversal (CondBranch v c a) (CondBranch v d a) c d

-- | Extract the condition matched by the given predicate from a cond tree.
--   
--   We use this mainly for extracting buildable conditions (see the Note
--   in Distribution.PackageDescription.Configuration), 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
--   cannot be evaluated, both branches are ignored.
simplifyCondTree :: (Semigroup a, Semigroup d) => (v -> Either v Bool) -> CondTree v d a -> (d, a)

-- | Flatten a CondTree. This will resolve the CondTree by taking all
--   possible paths into account. Note that since branches represent
--   exclusive choices this may not result in a "sane" result.
ignoreConditions :: (Semigroup a, Semigroup 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 a, Data.Data.Data c) => 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 (Distribution.Utils.Structured.Structured v, Distribution.Utils.Structured.Structured c, Distribution.Utils.Structured.Structured a) => Distribution.Utils.Structured.Structured (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 (GHC.Base.Semigroup a, GHC.Base.Semigroup c) => GHC.Base.Semigroup (Distribution.Types.CondTree.CondTree v c a)
instance (GHC.Base.Semigroup a, GHC.Base.Semigroup c, GHC.Base.Monoid a, GHC.Base.Monoid c) => GHC.Base.Monoid (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 (Distribution.Utils.Structured.Structured v, Distribution.Utils.Structured.Structured c, Distribution.Utils.Structured.Structured a) => Distribution.Utils.Structured.Structured (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)


-- | Parsers for character streams
--   
--   Originally in <tt>parsers</tt> package.
module Distribution.Compat.CharParsing

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

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

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

-- | Parses a white space character (any character which satisfies
--   <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
--   parsed 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
--   'A' and 'F'). Returns the parsed character.
hexDigit :: CharParsing m => m Char

-- | Parses an octal digit (a character between '0' and '7'). Returns the
--   parsed 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
--   parsed character (i.e. <tt>c</tt>).
--   
--   <i>e.g.</i>
--   
--   <pre>
--   semiColon = <a>char</a> ';'
--   </pre>
char :: CharParsing m => Char -> m Char

-- | <tt>notChar c</tt> parses any single character other than <tt>c</tt>.
--   Returns 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>.
--   Returns the parsed string (i.e. <tt>s</tt>).
--   
--   <pre>
--   divOrMod    =   string "div"
--               &lt;|&gt; string "mod"
--   </pre>
string :: CharParsing m => String -> m String

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

-- | Accepts negative (starting with <tt>-</tt>) and positive (without
--   sign) integral numbers.
signedIntegral :: (CharParsing m, Integral a) => m a

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

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

module Distribution.CabalSpecVersion

-- | Different Cabal-the-spec versions.
--   
--   We branch based on this at least in the parser.
data CabalSpecVersion

-- | this is older than <a>CabalSpecV1_2</a>
CabalSpecV1_0 :: CabalSpecVersion

-- | new syntax (sections)
CabalSpecV1_2 :: CabalSpecVersion
CabalSpecV1_4 :: CabalSpecVersion
CabalSpecV1_6 :: CabalSpecVersion
CabalSpecV1_8 :: CabalSpecVersion
CabalSpecV1_10 :: CabalSpecVersion
CabalSpecV1_12 :: CabalSpecVersion
CabalSpecV1_18 :: CabalSpecVersion
CabalSpecV1_20 :: CabalSpecVersion
CabalSpecV1_22 :: CabalSpecVersion
CabalSpecV1_24 :: CabalSpecVersion
CabalSpecV2_0 :: CabalSpecVersion
CabalSpecV2_2 :: CabalSpecVersion
CabalSpecV2_4 :: CabalSpecVersion
CabalSpecV3_0 :: CabalSpecVersion
CabalSpecV3_4 :: CabalSpecVersion
CabalSpecV3_6 :: CabalSpecVersion
CabalSpecV3_8 :: CabalSpecVersion

-- | Show cabal spec version, but not the way in the .cabal files
showCabalSpecVersion :: CabalSpecVersion -> String
cabalSpecLatest :: CabalSpecVersion

-- | Parse <a>CabalSpecVersion</a> from version digits.
--   
--   It may fail if for recent versions the version is not exact.
cabalSpecFromVersionDigits :: [Int] -> Maybe CabalSpecVersion

cabalSpecToVersionDigits :: CabalSpecVersion -> [Int]

-- | What is the minimum Cabal library version which knows how handle this
--   spec version.
--   
--   <i>Note:</i> this is a point where we could decouple cabal-spec and
--   Cabal versions, if we ever want that.
--   
--   <pre>
--   &gt;&gt;&gt; cabalSpecMinimumLibraryVersion CabalSpecV3_0
--   [2,5]
--   </pre>
--   
--   <pre>
--   &gt;&gt;&gt; cabalSpecMinimumLibraryVersion CabalSpecV2_4
--   [2,3]
--   </pre>
cabalSpecMinimumLibraryVersion :: CabalSpecVersion -> [Int]
specHasCommonStanzas :: CabalSpecVersion -> HasCommonStanzas
specHasElif :: CabalSpecVersion -> HasElif
data HasElif
HasElif :: HasElif
NoElif :: HasElif
data HasCommonStanzas
HasCommonStanzas :: HasCommonStanzas
NoCommonStanzas :: HasCommonStanzas
data HasGlobstar
HasGlobstar :: HasGlobstar
NoGlobstar :: HasGlobstar
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
instance GHC.Show.Show Distribution.CabalSpecVersion.HasElif
instance GHC.Classes.Eq Distribution.CabalSpecVersion.HasElif
instance GHC.Show.Show Distribution.CabalSpecVersion.HasCommonStanzas
instance GHC.Classes.Eq Distribution.CabalSpecVersion.HasCommonStanzas
instance Data.Binary.Class.Binary Distribution.CabalSpecVersion.CabalSpecVersion
instance Distribution.Utils.Structured.Structured Distribution.CabalSpecVersion.CabalSpecVersion
instance Control.DeepSeq.NFData Distribution.CabalSpecVersion.CabalSpecVersion

module Distribution.SPDX.LicenseListVersion

-- | SPDX License List version <tt>Cabal</tt> is aware of.
data LicenseListVersion
LicenseListVersion_3_0 :: LicenseListVersion
LicenseListVersion_3_2 :: LicenseListVersion
LicenseListVersion_3_6 :: LicenseListVersion
LicenseListVersion_3_9 :: LicenseListVersion
LicenseListVersion_3_10 :: LicenseListVersion
LicenseListVersion_3_16 :: LicenseListVersion
cabalSpecVersionToSPDXListVersion :: CabalSpecVersion -> LicenseListVersion
instance GHC.Enum.Bounded Distribution.SPDX.LicenseListVersion.LicenseListVersion
instance GHC.Enum.Enum Distribution.SPDX.LicenseListVersion.LicenseListVersion
instance GHC.Show.Show Distribution.SPDX.LicenseListVersion.LicenseListVersion
instance GHC.Classes.Ord Distribution.SPDX.LicenseListVersion.LicenseListVersion
instance GHC.Classes.Eq Distribution.SPDX.LicenseListVersion.LicenseListVersion

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

-- | The default rendering style used in Cabal for console output. It has a
--   fixed 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
showTokenStr :: String -> String

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

-- | Pretty-print free-format text. Since <tt>cabal-version: 3.0</tt> we
--   don't replace blank lines with dots.
showFreeTextV3 :: String -> Doc
type Separator = [Doc] -> Doc
instance Distribution.Pretty.Pretty Text.PrettyPrint.HughesPJ.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)


-- | Cabal-like file AST types: <a>Field</a>, <a>Section</a> etc
--   
--   These types are parametrized by an annotation.
module Distribution.Fields.Field

-- | A Cabal-like file consists of a series of fields (<tt>foo: bar</tt>)
--   and 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 descendants of <a>Field</a>, including itself.
--   
--   <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
--   field may contain multiple lines.
--   
--   <i>Invariant:</i> <a>ByteString</a> has no newlines.
data FieldLine ann
FieldLine :: !ann -> !ByteString -> FieldLine ann

fieldLineAnn :: FieldLine ann -> ann

fieldLineBS :: FieldLine ann -> ByteString

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

-- | identifier, or something which looks like number. Also many dot
--   numbers, i.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.
--   
--   <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

sectionArgsToString :: [SectionArg ann] -> String

-- | Convert <tt>[<a>FieldLine</a>]</tt> into String.
--   
--   <i>Note:</i> this doesn't preserve indentation or empty lines, as the
--   annotations (e.g. positions) are ignored.
fieldLinesToString :: [FieldLine ann] -> String
instance Data.Traversable.Traversable Distribution.Fields.Field.FieldLine
instance Data.Foldable.Foldable Distribution.Fields.Field.FieldLine
instance GHC.Base.Functor Distribution.Fields.Field.FieldLine
instance GHC.Show.Show ann => GHC.Show.Show (Distribution.Fields.Field.FieldLine ann)
instance GHC.Classes.Eq ann => GHC.Classes.Eq (Distribution.Fields.Field.FieldLine ann)
instance Data.Traversable.Traversable Distribution.Fields.Field.SectionArg
instance Data.Foldable.Foldable Distribution.Fields.Field.SectionArg
instance GHC.Base.Functor Distribution.Fields.Field.SectionArg
instance GHC.Show.Show ann => GHC.Show.Show (Distribution.Fields.Field.SectionArg ann)
instance GHC.Classes.Eq ann => GHC.Classes.Eq (Distribution.Fields.Field.SectionArg ann)
instance Data.Traversable.Traversable Distribution.Fields.Field.Name
instance Data.Foldable.Foldable Distribution.Fields.Field.Name
instance GHC.Base.Functor Distribution.Fields.Field.Name
instance GHC.Show.Show ann => GHC.Show.Show (Distribution.Fields.Field.Name ann)
instance GHC.Classes.Eq ann => GHC.Classes.Eq (Distribution.Fields.Field.Name ann)
instance Data.Traversable.Traversable Distribution.Fields.Field.Field
instance Data.Foldable.Foldable Distribution.Fields.Field.Field
instance GHC.Base.Functor Distribution.Fields.Field.Field
instance GHC.Show.Show ann => GHC.Show.Show (Distribution.Fields.Field.Field ann)
instance GHC.Classes.Eq ann => GHC.Classes.Eq (Distribution.Fields.Field.Field ann)


module Distribution.Fields.Parser

-- | A Cabal-like file consists of a series of fields (<tt>foo: bar</tt>)
--   and 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.
--   
--   <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
--   field may contain multiple lines.
--   
--   <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 something which looks like number. Also many dot
--   numbers, i.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.
--   the 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.Fields.Parser.LexState' Data.Functor.Identity.Identity Distribution.Fields.Lexer.LToken


-- | Cabal-like file AST types: <tt>Field</tt>, <tt>Section</tt> etc,
--   
--   This (intermediate) data type is used for pretty-printing.
module Distribution.Fields.Pretty

-- | This type is used to discern when a comment block should go before or
--   after a cabal-like file field, otherwise it would be hardcoded to a
--   single position. It is often used in conjunction with
--   <tt>PrettyField</tt>.
data CommentPosition
CommentBefore :: [String] -> CommentPosition
CommentAfter :: [String] -> CommentPosition
NoComment :: CommentPosition
data PrettyField ann
PrettyField :: ann -> FieldName -> Doc -> PrettyField ann
PrettySection :: ann -> FieldName -> [Doc] -> [PrettyField ann] -> PrettyField ann
PrettyEmpty :: PrettyField ann

-- | Prettyprint a list of fields.
--   
--   Note: the first argument should return <a>String</a>s without newlines
--   and properly prefixes (with <tt>--</tt>) to count as comments. This
--   unsafety is left in place so one could generate empty lines between
--   comment lines.
showFields :: (ann -> CommentPosition) -> [PrettyField ann] -> String

-- | <a>showFields</a> with user specified indentation.
showFields' :: (ann -> CommentPosition) -> (ann -> [String] -> [String]) -> Int -> [PrettyField ann] -> String

-- | Simple variant of <tt>genericFromParsecField</tt>
fromParsecFields :: [Field ann] -> [PrettyField ann]
genericFromParsecFields :: Applicative f => (FieldName -> [FieldLine ann] -> f Doc) -> (FieldName -> [SectionArg ann] -> f [Doc]) -> [Field ann] -> f [PrettyField ann]

-- | Used in <a>fromParsecFields</a>.
prettyFieldLines :: FieldName -> [FieldLine ann] -> Doc

-- | Used in <a>fromParsecFields</a>.
prettySectionArgs :: FieldName -> [SectionArg ann] -> [Doc]
instance Data.Traversable.Traversable Distribution.Fields.Pretty.PrettyField
instance Data.Foldable.Foldable Distribution.Fields.Pretty.PrettyField
instance GHC.Base.Functor Distribution.Fields.Pretty.PrettyField
instance GHC.Classes.Eq Distribution.Fields.Pretty.Margin
instance GHC.Base.Semigroup Distribution.Fields.Pretty.Margin

module Distribution.Parsec

-- | Class for parsing with <tt>parsec</tt>. Mainly used for
--   <tt>.cabal</tt> file fields.
--   
--   For parsing <tt>.cabal</tt> like file structure, see
--   <a>Distribution.Fields</a>.
class Parsec a
parsec :: (Parsec a, CabalParsing m) => m a
newtype ParsecParser a
PP :: (CabalSpecVersion -> Parsec FieldLineStream [PWarning] a) -> ParsecParser a
[unPP] :: ParsecParser a -> CabalSpecVersion -> Parsec FieldLineStream [PWarning] a

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

-- | Like <a>runParsecParser</a> but lets specify <a>CabalSpecVersion</a>
--   used.
runParsecParser' :: CabalSpecVersion -> ParsecParser a -> FilePath -> FieldLineStream -> Either ParseError a

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

-- | Like <a>simpleParsec</a> but for <a>ByteString</a>
simpleParsecBS :: Parsec a => ByteString -> Maybe a

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

-- | Parse a <a>String</a> with <a>lexemeParsec</a> using specific
--   <a>CabalSpecVersion</a>. Fail if there are any warnings.
simpleParsecW' :: Parsec a => CabalSpecVersion -> String -> Maybe a

-- | <a>parsec</a> <i>could</i> consume trailing spaces, this function
--   <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

-- | Parse a <a>String</a> with given <a>ParsecParser</a>. Trailing
--   whitespace is accepted.
explicitEitherParsec :: ParsecParser a -> String -> Either String a

-- | Parse a <a>String</a> with given <a>ParsecParser</a> and
--   <a>CabalSpecVersion</a>. Trailing whitespace is accepted. See
--   <a>explicitEitherParsec</a>.
explicitEitherParsec' :: CabalSpecVersion -> ParsecParser a -> String -> Either String a

-- | Parsing class which
--   
--   <ul>
--   <li>can report Cabal parser warnings.</li>
--   <li>knows <tt>cabal-version</tt> we work with</li>
--   </ul>
class (CharParsing m, MonadPlus m, MonadFail 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.
--   
--   Different application may decide not to show some, or have fatal
--   behaviour 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
--   <a>https://github.com/haskell/cabal/issues/5020</a>.
PWTBuildTypeDefault :: PWarnType

-- | Version operators used (without cabal-version: 1.8)
PWTVersionOperator :: PWarnType

-- | Version wildcard used (without cabal-version: 1.6)
PWTVersionWildcard :: PWarnType

-- | Warnings about cabal-version format.
PWTSpecVersion :: PWarnType

-- | Empty filepath, i.e. literally ""
PWTEmptyFilePath :: PWarnType

-- | Experimental feature
PWTExperimental :: PWarnType

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

-- | Parser error.
data PError
PError :: Position -> String -> PError
showPError :: FilePath -> PError -> 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

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

-- | <pre>
--   [^ ]
--   </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]
parsecCommaNonEmpty :: CabalParsing m => m a -> m (NonEmpty a)

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

parsecLeadingCommaNonEmpty :: CabalParsing m => m a -> m (NonEmpty a)
parsecOptCommaList :: CabalParsing m => m a -> m [a]

-- | Like <a>parsecOptCommaList</a> but
--   
--   <ul>
--   <li>require all or none commas</li>
--   <li>accept leading or trailing comma.</li>
--   </ul>
--   
--   <pre>
--   p (comma p)*  -- p <tt>sepBy</tt> comma
--   (comma p)*    -- leading comma
--   (p comma)*    -- trailing comma
--   p*            -- no commas: many p
--   </pre>
parsecLeadingOptCommaList :: CabalParsing m => m a -> m [a]

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

module Distribution.Utils.Path

-- | Symbolic paths.
--   
--   These paths are system independent and relative. They are *symbolic*
--   which means we cannot perform any <a>IO</a> until we interpret them.
data SymbolicPath from to

-- | Extract underlying <a>FilePath</a>.
--   
--   Avoid using this in new code.
getSymbolicPath :: SymbolicPath from to -> FilePath
sameDirectory :: (IsDir from, IsDir to) => SymbolicPath from to

-- | Make <a>SymbolicPath</a> without performing any checks.
unsafeMakeSymbolicPath :: FilePath -> SymbolicPath from to
data PackageDir
data SourceDir
data LicenseFile

-- | Class telling that index is for directories.
class IsDir dir
instance (Data.Data.Data from, Data.Data.Data to) => Data.Data.Data (Distribution.Utils.Path.SymbolicPath from to)
instance GHC.Classes.Ord (Distribution.Utils.Path.SymbolicPath from to)
instance GHC.Classes.Eq (Distribution.Utils.Path.SymbolicPath from to)
instance GHC.Read.Read (Distribution.Utils.Path.SymbolicPath from to)
instance GHC.Show.Show (Distribution.Utils.Path.SymbolicPath from to)
instance GHC.Generics.Generic (Distribution.Utils.Path.SymbolicPath from to)
instance Data.Data.Data Distribution.Utils.Path.PackageDir
instance Data.Data.Data Distribution.Utils.Path.SourceDir
instance Data.Data.Data Distribution.Utils.Path.LicenseFile
instance Distribution.Utils.Path.IsDir Distribution.Utils.Path.SourceDir
instance Distribution.Utils.Path.IsDir Distribution.Utils.Path.PackageDir
instance Data.Binary.Class.Binary (Distribution.Utils.Path.SymbolicPath from to)
instance (Data.Typeable.Internal.Typeable from, Data.Typeable.Internal.Typeable to) => Distribution.Utils.Structured.Structured (Distribution.Utils.Path.SymbolicPath from to)
instance Control.DeepSeq.NFData (Distribution.Utils.Path.SymbolicPath from to)
instance Distribution.Parsec.Parsec (Distribution.Utils.Path.SymbolicPath from to)
instance Distribution.Pretty.Pretty (Distribution.Utils.Path.SymbolicPath from to)

module Distribution.Types.Version

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

-- | Construct <a>Version</a> from list of version number components.
--   
--   For instance, <tt>mkVersion [3,2,1]</tt> constructs a <a>Version</a>
--   representing the version <tt>3.2.1</tt>.
--   
--   All version components must be non-negative. <tt>mkVersion []</tt>
--   currently represents the special <i>null</i> version; see also
--   <a>nullVersion</a>.
mkVersion :: [Int] -> Version

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

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

-- | Constant representing the special <i>null</i> <a>Version</a>
--   
--   The <a>nullVersion</a> compares (via <a>Ord</a>) as less than every
--   proper <a>Version</a> value.
nullVersion :: Version

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

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

-- | An integral without leading zeroes.
versionDigitParser :: CabalParsing m => m Int
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 Distribution.Utils.Structured.Structured Distribution.Types.Version.Version
instance Control.DeepSeq.NFData Distribution.Types.Version.Version
instance Distribution.Pretty.Pretty Distribution.Types.Version.Version
instance Distribution.Parsec.Parsec Distribution.Types.Version.Version


-- | The only purpose of this module is to prevent the export of
--   <a>VersionRange</a> constructors from
--   <a>Distribution.Types.VersionRange</a>. To avoid creating orphan
--   instances, a lot of related code had to be moved here too.
module Distribution.Types.VersionRange.Internal
data VersionRange
ThisVersion :: Version -> VersionRange
LaterVersion :: Version -> VersionRange
OrLaterVersion :: Version -> VersionRange
EarlierVersion :: Version -> VersionRange
OrEarlierVersion :: Version -> VersionRange
MajorBoundVersion :: Version -> VersionRange
UnionVersionRanges :: VersionRange -> VersionRange -> VersionRange
IntersectVersionRanges :: VersionRange -> VersionRange -> VersionRange

-- | The version range <tt>-any</tt>. That is, a version range containing
--   all versions.
--   
--   <pre>
--   withinRange v anyVersion = True
--   </pre>
anyVersion :: VersionRange

-- | The empty version range <tt>-none</tt>, that is a version range
--   containing no versions.
--   
--   This can be constructed using any unsatisfiable version range
--   expression, for example <tt>&lt; 0</tt>.
--   
--   <pre>
--   withinRange v noVersion = False
--   </pre>
noVersion :: VersionRange

-- | The version range <tt>== v</tt>.
--   
--   <pre>
--   withinRange v' (thisVersion v) = v' == v
--   </pre>
thisVersion :: Version -> VersionRange

-- | The version range <tt>/= v</tt>.
--   
--   <pre>
--   withinRange v' (notThisVersion v) = v' /= v
--   </pre>
notThisVersion :: Version -> VersionRange

-- | The version range <tt>&gt; v</tt>.
--   
--   <pre>
--   withinRange v' (laterVersion v) = v' &gt; v
--   </pre>
laterVersion :: Version -> VersionRange

-- | The version range <tt>&lt; v</tt>.
--   
--   <pre>
--   withinRange v' (earlierVersion v) = v' &lt; v
--   </pre>
earlierVersion :: Version -> VersionRange

-- | The version range <tt>&gt;= v</tt>.
--   
--   <pre>
--   withinRange v' (orLaterVersion v) = v' &gt;= v
--   </pre>
orLaterVersion :: Version -> VersionRange

-- | The version range <tt>&lt;= v</tt>.
--   
--   <pre>
--   withinRange v' (orEarlierVersion v) = v' &lt;= v
--   </pre>
orEarlierVersion :: Version -> VersionRange

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

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

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

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

-- | F-Algebra of <a>VersionRange</a>. See <a>cataVersionRange</a>.
data VersionRangeF a

-- | <tt>== version</tt>.
ThisVersionF :: Version -> VersionRangeF a

-- | <tt>&gt; version</tt>. NB: not <tt>&gt;=</tt>
LaterVersionF :: Version -> VersionRangeF a

-- | <tt>&gt;= version</tt>.
OrLaterVersionF :: Version -> VersionRangeF a

-- | <tt>&lt; version</tt>.
EarlierVersionF :: Version -> VersionRangeF a

-- | <tt>&lt;= version</tt>.
OrEarlierVersionF :: Version -> VersionRangeF a

-- | <tt>^&gt;= version</tt>, same as <tt>&gt;= version &amp;&amp; &lt;
--   MAJ(version)+1</tt>.
MajorBoundVersionF :: Version -> VersionRangeF a

-- | <tt>||</tt>.
UnionVersionRangesF :: a -> a -> VersionRangeF a

-- | <tt>&amp;&amp;</tt>.
IntersectVersionRangesF :: a -> a -> VersionRangeF a

-- | Generic destructor for <a>VersionRange</a>.
projectVersionRange :: VersionRange -> VersionRangeF VersionRange

-- | Generic constructor for <a>VersionRange</a>.
embedVersionRange :: VersionRangeF VersionRange -> VersionRange

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

-- | <a>VersionRange</a> parser parametrised by version digit parser.
--   
--   <ul>
--   <li><a>versionDigitParser</a> is used for all
--   <a>VersionRange</a>.</li>
--   <li><a>integral</a> is used for backward-compat
--   <tt>pkgconfig-depends</tt> versions,
--   <tt>PkgConfigVersionRange</tt>.</li>
--   </ul>
versionRangeParser :: forall m. CabalParsing m => m Int -> CabalSpecVersion -> m VersionRange

-- | Compute next greater major version to be used as upper bound.
--   
--   Example: <tt>0.4.1</tt> produces the version <tt>0.5</tt> which then
--   can be used to construct a range <tt>&gt;= 0.4.1 &amp;&amp; &lt;
--   0.5</tt>
majorUpperBound :: Version -> Version

-- | Increment the last version number.
--   
--   Example: For <tt>1.2</tt> this returns <tt>1.3</tt> so that it can be
--   used as upper bound when resolving <tt>== 1.2.*</tt>. For
--   <tt>0.4.1</tt> it returns <tt>0.4.2</tt>.
wildcardUpperBound :: Version -> Version
instance GHC.Show.Show Distribution.Types.VersionRange.Internal.VersionRange
instance GHC.Read.Read Distribution.Types.VersionRange.Internal.VersionRange
instance GHC.Generics.Generic Distribution.Types.VersionRange.Internal.VersionRange
instance GHC.Classes.Ord Distribution.Types.VersionRange.Internal.VersionRange
instance GHC.Classes.Eq Distribution.Types.VersionRange.Internal.VersionRange
instance Data.Data.Data Distribution.Types.VersionRange.Internal.VersionRange
instance Data.Traversable.Traversable Distribution.Types.VersionRange.Internal.VersionRangeF
instance Data.Foldable.Foldable Distribution.Types.VersionRange.Internal.VersionRangeF
instance GHC.Base.Functor Distribution.Types.VersionRange.Internal.VersionRangeF
instance GHC.Show.Show a => GHC.Show.Show (Distribution.Types.VersionRange.Internal.VersionRangeF a)
instance GHC.Read.Read a => GHC.Read.Read (Distribution.Types.VersionRange.Internal.VersionRangeF a)
instance GHC.Generics.Generic (Distribution.Types.VersionRange.Internal.VersionRangeF a)
instance GHC.Classes.Eq a => GHC.Classes.Eq (Distribution.Types.VersionRange.Internal.VersionRangeF a)
instance Data.Data.Data a => Data.Data.Data (Distribution.Types.VersionRange.Internal.VersionRangeF a)
instance Data.Binary.Class.Binary Distribution.Types.VersionRange.Internal.VersionRange
instance Distribution.Utils.Structured.Structured Distribution.Types.VersionRange.Internal.VersionRange
instance Control.DeepSeq.NFData Distribution.Types.VersionRange.Internal.VersionRange
instance Distribution.Pretty.Pretty Distribution.Types.VersionRange.Internal.VersionRange
instance Distribution.Parsec.Parsec Distribution.Types.VersionRange.Internal.VersionRange


-- | This module implements a view of a <a>VersionRange</a> as a finite
--   list of separated version intervals and provides the Boolean algebra
--   operations union, intersection, and complement.
--   
--   It interprets the caret operator <tt>^&gt;=x.y</tt> as simply
--   <tt>==x.y.*</tt>. Until <tt>Cabal &lt; 3.6</tt>, this module was
--   called <a>Distribution.Types.VersionInterval</a>. The current module
--   <a>Distribution.Types.VersionInterval</a> (refurbished since <tt>Cabal
--   &gt;= 3.6</tt>) makes some effort to preserve the caret operator, but
--   so far does not expose the Boolean algebra structure.
module Distribution.Types.VersionInterval.Legacy

-- | A complementary representation of a <a>VersionRange</a>, using an
--   increasing sequence of separated (i.e., non-overlapping, non-touching)
--   non-empty intervals. The represented range is the union of these
--   intervals, meaning that the empty sequence denotes the empty range.
--   
--   As ranges form a Boolean algebra, we can compute union, intersection,
--   and complement. These operations are all linear in the size of the
--   input, thanks to the ordered representation.
--   
--   The interval-sequence representation gives a canonical representation
--   for the semantics of <a>VersionRange</a>s. This makes it easier to
--   check things like whether a version range is empty, covers all
--   versions, or requires a certain minimum or maximum version. It also
--   makes it easy to check equality (just <a>==</a>) or containment. It
--   also makes it easier to identify 'simple' version predicates for
--   translation into foreign packaging systems that do not support complex
--   version range expressions.
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
--   <a>VersionRange</a> expression representing the version intervals.
fromVersionIntervals :: VersionIntervals -> VersionRange

-- | Test if a version falls within the version intervals.
--   
--   It exists mostly for completeness and testing. It satisfies the
--   following properties:
--   
--   <pre>
--   withinIntervals v (toVersionIntervals vr) = withinRange v vr
--   withinIntervals v ivs = withinRange v (fromVersionIntervals ivs)
--   </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.
mkVersionIntervals :: [VersionInterval] -> VersionIntervals

-- | Union two interval sequences, fusing intervals where necessary.
--   Computed &lt;math&gt; time, resulting in sequence of length
--   &lt;math&gt;.
unionVersionIntervals :: VersionIntervals -> VersionIntervals -> VersionIntervals

-- | The intersection &lt;math&gt; of two interval sequences &lt;math&gt;
--   and &lt;math&gt; of lengths &lt;math&gt; and &lt;math&gt;, resp.,
--   satisfies the specification &lt;math&gt;. Thanks to the ordered
--   representation of intervals it can be computed in &lt;math&gt; (rather
--   than the naive &lt;math&gt;.
--   
--   The length of &lt;math&gt; is &lt;math&gt;.
intersectVersionIntervals :: VersionIntervals -> VersionIntervals -> VersionIntervals

-- | Compute the complement. &lt;math&gt;.
invertVersionIntervals :: VersionIntervals -> VersionIntervals

-- | Remove the last upper bound, enlarging the range. But empty ranges
--   stay empty. &lt;math&gt;.
relaxLastInterval :: VersionIntervals -> VersionIntervals

-- | Remove the first lower bound (i.e, make it &lt;math&gt;. Empty ranges
--   stay empty. &lt;math&gt;.
relaxHeadInterval :: VersionIntervals -> VersionIntervals

-- | View a <a>VersionRange</a> as a sequence of separated intervals.
--   
--   This provides a canonical view of the semantics of a
--   <a>VersionRange</a> as opposed to the syntax of the expression used to
--   define it. For the syntactic view use <tt>foldVersionRange</tt>.
--   
--   <i>Canonical</i> means that two semantically equal ranges translate to
--   the <i>same</i> <tt>[<a>VersionInterval</a>]</tt>, thus its <a>Eq</a>
--   instance can decide semantical equality of ranges.
--   
--   In the returned sequence, each interval is non-empty. The sequence is
--   in increasing order and the intervals are separated, i.e., they
--   neither overlap nor touch. Therefore only the first and last interval
--   can be unbounded. The sequence can be empty if the range is empty
--   (e.g. a range expression like <tt>&gt; 2 &amp;&amp; &lt; 1</tt>).
--   
--   Other checks are trivial to implement using this view. For example:
--   
--   <pre>
--   isNoVersion vr | [] &lt;- asVersionIntervals vr = True
--                  | otherwise                   = False
--   </pre>
--   
--   <pre>
--   isSpecificVersion vr
--      | [(LowerBound v  InclusiveBound
--         ,UpperBound v' InclusiveBound)] &lt;- asVersionIntervals vr
--      , v == v'   = Just v
--      | otherwise = Nothing
--   </pre>
asVersionIntervals :: VersionRange -> [VersionInterval]

-- | Version intervals with exclusive or inclusive bounds, in all
--   combinations:
--   
--   <ol>
--   <li>&lt;math&gt; meaning &lt;math&gt;.</li>
--   <li>&lt;math&gt; meaning &lt;math&gt;.</li>
--   <li>&lt;math&gt; meaning &lt;math&gt;.</li>
--   <li>&lt;math&gt; meaning &lt;math&gt;.</li>
--   </ol>
--   
--   The upper bound can also be missing, meaning "&lt;math&gt;".
type VersionInterval = (LowerBound, UpperBound)
data LowerBound

-- | Either exclusive <tt>(v,..</tt> or inclusive <tt>[v,..</tt>.
LowerBound :: Version -> !Bound -> LowerBound
data UpperBound

-- | <pre>
--   ..,∞)
--   </pre>
NoUpperBound :: UpperBound

-- | Either exclusive <tt>..,v)</tt> or inclusive <tt>..,v]</tt>.
UpperBound :: Version -> !Bound -> UpperBound
data Bound

-- | <tt>(v,..</tt> if used as lower bound, <tt>..,v)</tt> if used as upper
--   bound.
ExclusiveBound :: Bound

-- | <tt>[v,..</tt> if used as lower bound, <tt>..,v]</tt> if used as upper
--   bound.
InclusiveBound :: Bound
instance GHC.Show.Show Distribution.Types.VersionInterval.Legacy.Bound
instance GHC.Classes.Eq Distribution.Types.VersionInterval.Legacy.Bound
instance GHC.Show.Show Distribution.Types.VersionInterval.Legacy.UpperBound
instance GHC.Classes.Eq Distribution.Types.VersionInterval.Legacy.UpperBound
instance GHC.Show.Show Distribution.Types.VersionInterval.Legacy.LowerBound
instance GHC.Classes.Eq Distribution.Types.VersionInterval.Legacy.LowerBound
instance GHC.Show.Show Distribution.Types.VersionInterval.Legacy.VersionIntervals
instance GHC.Classes.Eq Distribution.Types.VersionInterval.Legacy.VersionIntervals
instance GHC.Classes.Ord Distribution.Types.VersionInterval.Legacy.LowerBound
instance GHC.Classes.Ord Distribution.Types.VersionInterval.Legacy.UpperBound


-- | This module implements a view of a <a>VersionRange</a> as a finite
--   list of separated version intervals.
--   
--   In conversion from and to <a>VersionRange</a> it makes some effort to
--   preserve the caret operator <tt>^&gt;=x.y</tt>. This constraint a
--   priori specifies the same interval as <tt>==x.y.*</tt>, but indicates
--   that newer versions could be acceptable (<tt>allow-newer: ^</tt>).
module Distribution.Types.VersionInterval

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

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

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

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

-- | Since <tt>Cabal-3.6</tt> this function.. TODO
normaliseVersionRange2 :: VersionRange -> VersionRange
relaxLastInterval :: VersionIntervals -> VersionIntervals
relaxHeadInterval :: VersionIntervals -> VersionIntervals

-- | View a <a>VersionRange</a> as a union of intervals.
--   
--   This provides a canonical view of the semantics of a
--   <a>VersionRange</a> as opposed to the syntax of the expression used to
--   define it. For the syntactic view use <tt>foldVersionRange</tt>.
--   
--   Each interval is non-empty. The sequence is in increasing order and no
--   intervals overlap or touch. Therefore only the first and last can be
--   unbounded. The sequence can be empty if the range is empty (e.g. a
--   range expression like <tt><a>&amp;&amp;</a> 2</tt>).
--   
--   Other checks are trivial to implement using this view. For example:
--   
--   <pre>
--   isNoVersion vr | [] &lt;- asVersionIntervals vr = True
--                  | otherwise                   = False
--   </pre>
--   
--   <pre>
--   isSpecificVersion vr
--      | [(LowerBound v  InclusiveBound
--         ,UpperBound v' InclusiveBound)] &lt;- asVersionIntervals vr
--      , v == v'   = Just v
--      | otherwise = Nothing
--   </pre>
asVersionIntervals :: VersionRange -> [VersionInterval]
data VersionInterval
VersionInterval :: !LowerBound -> !UpperBound -> VersionInterval
data LowerBound
LowerBound :: !Version -> !Bound -> LowerBound
data UpperBound
NoUpperBound :: UpperBound
UpperBound :: !Version -> !Bound -> UpperBound
data Bound
ExclusiveBound :: Bound
InclusiveBound :: Bound

-- | <a>VersionIntervals</a> invariant:
--   
--   <ul>
--   <li>all intervals are valid (lower bound is less then upper bound,
--   i.e. non-empty)</li>
--   <li>intervals doesn't touch each other (distinct)</li>
--   </ul>
invariantVersionIntervals :: VersionIntervals -> Bool
instance GHC.Show.Show Distribution.Types.VersionInterval.Bound
instance GHC.Classes.Eq Distribution.Types.VersionInterval.Bound
instance GHC.Show.Show Distribution.Types.VersionInterval.UpperBound
instance GHC.Classes.Eq Distribution.Types.VersionInterval.UpperBound
instance GHC.Show.Show Distribution.Types.VersionInterval.LowerBound
instance GHC.Classes.Eq Distribution.Types.VersionInterval.LowerBound
instance GHC.Show.Show Distribution.Types.VersionInterval.VersionInterval
instance GHC.Classes.Eq Distribution.Types.VersionInterval.VersionInterval
instance GHC.Show.Show Distribution.Types.VersionInterval.VersionIntervals
instance GHC.Classes.Eq Distribution.Types.VersionInterval.VersionIntervals

module Distribution.Types.VersionRange
data VersionRange

-- | The version range <tt>-any</tt>. That is, a version range containing
--   all versions.
--   
--   <pre>
--   withinRange v anyVersion = True
--   </pre>
anyVersion :: VersionRange

-- | The empty version range <tt>-none</tt>, that is a version range
--   containing no versions.
--   
--   This can be constructed using any unsatisfiable version range
--   expression, for example <tt>&lt; 0</tt>.
--   
--   <pre>
--   withinRange v noVersion = False
--   </pre>
noVersion :: VersionRange

-- | The version range <tt>== v</tt>.
--   
--   <pre>
--   withinRange v' (thisVersion v) = v' == v
--   </pre>
thisVersion :: Version -> VersionRange

-- | The version range <tt>/= v</tt>.
--   
--   <pre>
--   withinRange v' (notThisVersion v) = v' /= v
--   </pre>
notThisVersion :: Version -> VersionRange

-- | The version range <tt>&gt; v</tt>.
--   
--   <pre>
--   withinRange v' (laterVersion v) = v' &gt; v
--   </pre>
laterVersion :: Version -> VersionRange

-- | The version range <tt>&lt; v</tt>.
--   
--   <pre>
--   withinRange v' (earlierVersion v) = v' &lt; v
--   </pre>
earlierVersion :: Version -> VersionRange

-- | The version range <tt>&gt;= v</tt>.
--   
--   <pre>
--   withinRange v' (orLaterVersion v) = v' &gt;= v
--   </pre>
orLaterVersion :: Version -> VersionRange

-- | The version range <tt>&lt;= v</tt>.
--   
--   <pre>
--   withinRange v' (orEarlierVersion v) = v' &lt;= v
--   </pre>
orEarlierVersion :: Version -> VersionRange

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

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

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

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

-- | Does this version fall within the given range?
--   
--   This 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>.
--   
--   This provides a syntactic view of the expression defining the version
--   range. The syntactic sugar <tt>"&gt;= v"</tt>, <tt>"&lt;= v"</tt> and
--   <tt>"== v.*"</tt> is presented in terms of the other basic syntax.
--   
--   For a semantic view use <a>asVersionIntervals</a>.
foldVersionRange :: a -> (Version -> a) -> (Version -> a) -> (Version -> a) -> (a -> a -> a) -> (a -> a -> a) -> VersionRange -> a

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

-- | Remove <tt>VersionRangeParens</tt> constructors.
--   
--   Since version 3.4 this function is <a>id</a>, there aren't
--   <tt>VersionRangeParens</tt> constructor in <a>VersionRange</a>
--   anymore.
stripParensVersionRange :: VersionRange -> VersionRange

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

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

-- | F-Algebra of <a>VersionRange</a>. See <a>cataVersionRange</a>.
data VersionRangeF a

-- | <tt>== version</tt>.
ThisVersionF :: Version -> VersionRangeF a

-- | <tt>&gt; version</tt>. NB: not <tt>&gt;=</tt>
LaterVersionF :: Version -> VersionRangeF a

-- | <tt>&gt;= version</tt>.
OrLaterVersionF :: Version -> VersionRangeF a

-- | <tt>&lt; version</tt>.
EarlierVersionF :: Version -> VersionRangeF a

-- | <tt>&lt;= version</tt>.
OrEarlierVersionF :: Version -> VersionRangeF a

-- | <tt>^&gt;= version</tt>, same as <tt>&gt;= version &amp;&amp; &lt;
--   MAJ(version)+1</tt>.
MajorBoundVersionF :: Version -> VersionRangeF a

-- | <tt>||</tt>.
UnionVersionRangesF :: a -> a -> VersionRangeF a

-- | <tt>&amp;&amp;</tt>.
IntersectVersionRangesF :: a -> 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

-- | Generic destructor for <a>VersionRange</a>.
projectVersionRange :: VersionRange -> VersionRangeF VersionRange

-- | Generic constructor for <a>VersionRange</a>.
embedVersionRange :: VersionRangeF VersionRange -> VersionRange

-- | Does this <a>VersionRange</a> place any restriction on the
--   <a>Version</a> or is it in fact equivalent to <tt>AnyVersion</tt>.
--   
--   Note this is a semantic check, not simply a syntactic check. So for
--   example the following is <tt>True</tt> (for all <tt>v</tt>).
--   
--   <pre>
--   isAnyVersion (EarlierVersion v `UnionVersionRanges` orLaterVersion v)
--   </pre>
isAnyVersion :: VersionRange -> Bool
isAnyVersionLight :: VersionRange -> Bool

-- | Increment the last version number.
--   
--   Example: For <tt>1.2</tt> this returns <tt>1.3</tt> so that it can be
--   used as upper bound when resolving <tt>== 1.2.*</tt>. For
--   <tt>0.4.1</tt> it returns <tt>0.4.2</tt>.
wildcardUpperBound :: Version -> Version

-- | Compute next greater major version to be used as upper bound.
--   
--   Example: <tt>0.4.1</tt> produces the version <tt>0.5</tt> which then
--   can be used to construct a range <tt>&gt;= 0.4.1 &amp;&amp; &lt;
--   0.5</tt>
majorUpperBound :: Version -> Version
isWildcardRange :: Version -> Version -> Bool

-- | <a>VersionRange</a> parser parametrised by version digit parser.
--   
--   <ul>
--   <li><a>versionDigitParser</a> is used for all
--   <a>VersionRange</a>.</li>
--   <li><a>integral</a> is used for backward-compat
--   <tt>pkgconfig-depends</tt> versions,
--   <tt>PkgConfigVersionRange</tt>.</li>
--   </ul>
versionRangeParser :: forall m. CabalParsing m => m Int -> CabalSpecVersion -> m VersionRange

module Distribution.Types.SourceRepo

-- | Information about the source revision control system for a package.
--   
--   When specifying a repo it is useful to know the meaning or intention
--   of the information as doing so enables automation. There are two
--   obvious common purposes: one is to find the repo for the latest
--   development version, the other is to find the repo for this specific
--   release. The <tt>ReopKind</tt> specifies which one we mean (or another
--   custom one).
--   
--   A package can specify one or the other kind or both. Most will specify
--   just a head repo but some may want to specify a repo to reconstruct
--   the sources for this package release.
--   
--   The required information is the <a>RepoType</a> which tells us if it's
--   using <a>Darcs</a>, <a>Git</a> for example. The <a>repoLocation</a>
--   and 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
--   <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
--   URL. This field is required.
[repoLocation] :: SourceRepo -> Maybe String

-- | <a>CVS</a> can put multiple "modules" on one server and requires a
--   module name in addition to the location to identify a particular repo.
--   Logically this is part of the location but unfortunately has to be
--   specified separately. This field is required for the <a>CVS</a>
--   <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
--   systems have the notion of multiple branches in a repo that exist in
--   the same location. For example <a>Git</a> and <a>CVS</a> use this
--   while systems like <a>Darcs</a> use different locations for different
--   branches. This field is optional but should be used if necessary to
--   identify 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
--   given for the <a>RepoThis</a> repo kind and not for <a>RepoHead</a>
--   kind.
[repoTag] :: SourceRepo -> Maybe String

-- | Some repositories contain multiple projects in different
--   subdirectories This field specifies the subdirectory where this
--   packages sources can be found, eg the subdirectory containing the
--   <tt>.cabal</tt> file. It is interpreted relative to the root of the
--   repository. This field is optional. If not given the default is "." ie
--   no 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.
--   This repo is where we should track the latest development activity or
--   the usual repo people should get to contribute patches.
RepoHead :: RepoKind

-- | The repository containing the sources for this exact package version
--   or release. For this kind of repo a tag should be given to give enough
--   information to re-create the exact sources.
RepoThis :: RepoKind
RepoKindUnknown :: String -> RepoKind
data RepoType
KnownRepoType :: KnownRepoType -> RepoType
OtherRepoType :: String -> RepoType

-- | An enumeration of common source control systems. The fields used in
--   the <a>SourceRepo</a> depend on the type of repo. The tools and
--   methods used to obtain and track the repo depend on the repo type.
data KnownRepoType
Darcs :: KnownRepoType
Git :: KnownRepoType
SVN :: KnownRepoType
CVS :: KnownRepoType
Mercurial :: KnownRepoType
GnuArch :: KnownRepoType
Bazaar :: KnownRepoType
Monotone :: KnownRepoType

Pijul :: KnownRepoType
knownRepoTypes :: [KnownRepoType]
emptySourceRepo :: RepoKind -> SourceRepo
classifyRepoType :: String -> RepoType
classifyRepoKind :: String -> RepoKind
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 GHC.Enum.Bounded Distribution.Types.SourceRepo.KnownRepoType
instance GHC.Enum.Enum Distribution.Types.SourceRepo.KnownRepoType
instance Data.Data.Data Distribution.Types.SourceRepo.KnownRepoType
instance GHC.Show.Show Distribution.Types.SourceRepo.KnownRepoType
instance GHC.Read.Read Distribution.Types.SourceRepo.KnownRepoType
instance GHC.Classes.Ord Distribution.Types.SourceRepo.KnownRepoType
instance GHC.Generics.Generic Distribution.Types.SourceRepo.KnownRepoType
instance GHC.Classes.Eq Distribution.Types.SourceRepo.KnownRepoType
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.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.Ord Distribution.Types.SourceRepo.SourceRepo
instance GHC.Classes.Eq Distribution.Types.SourceRepo.SourceRepo
instance Data.Binary.Class.Binary Distribution.Types.SourceRepo.SourceRepo
instance Distribution.Utils.Structured.Structured Distribution.Types.SourceRepo.SourceRepo
instance Control.DeepSeq.NFData Distribution.Types.SourceRepo.SourceRepo
instance Data.Binary.Class.Binary Distribution.Types.SourceRepo.RepoType
instance Distribution.Utils.Structured.Structured Distribution.Types.SourceRepo.RepoType
instance Control.DeepSeq.NFData Distribution.Types.SourceRepo.RepoType
instance Distribution.Parsec.Parsec Distribution.Types.SourceRepo.RepoType
instance Distribution.Pretty.Pretty Distribution.Types.SourceRepo.RepoType
instance Data.Binary.Class.Binary Distribution.Types.SourceRepo.KnownRepoType
instance Distribution.Utils.Structured.Structured Distribution.Types.SourceRepo.KnownRepoType
instance Control.DeepSeq.NFData Distribution.Types.SourceRepo.KnownRepoType
instance Distribution.Parsec.Parsec Distribution.Types.SourceRepo.KnownRepoType
instance Distribution.Pretty.Pretty Distribution.Types.SourceRepo.KnownRepoType
instance Data.Binary.Class.Binary Distribution.Types.SourceRepo.RepoKind
instance Distribution.Utils.Structured.Structured Distribution.Types.SourceRepo.RepoKind
instance Control.DeepSeq.NFData Distribution.Types.SourceRepo.RepoKind
instance Distribution.Pretty.Pretty Distribution.Types.SourceRepo.RepoKind
instance Distribution.Parsec.Parsec Distribution.Types.SourceRepo.RepoKind

module Distribution.Types.SourceRepo.Lens

-- | Information about the source revision control system for a package.
--   
--   When specifying a repo it is useful to know the meaning or intention
--   of the information as doing so enables automation. There are two
--   obvious common purposes: one is to find the repo for the latest
--   development version, the other is to find the repo for this specific
--   release. The <tt>ReopKind</tt> specifies which one we mean (or another
--   custom one).
--   
--   A package can specify one or the other kind or both. Most will specify
--   just a head repo but some may want to specify a repo to reconstruct
--   the sources for this package release.
--   
--   The required information is the <a>RepoType</a> which tells us if it's
--   using <a>Darcs</a>, <a>Git</a> for example. The <a>repoLocation</a>
--   and 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)

module Distribution.Types.PkgconfigVersion

-- | <tt>pkg-config</tt> versions.
--   
--   In fact, this can be arbitrary <a>ByteString</a>, but <a>Parsec</a>
--   instance is a little pickier.
newtype PkgconfigVersion
PkgconfigVersion :: ByteString -> PkgconfigVersion

-- | Compare two version strings as <tt>pkg-config</tt> would compare them.
rpmvercmp :: ByteString -> ByteString -> Ordering
instance Data.Data.Data Distribution.Types.PkgconfigVersion.PkgconfigVersion
instance GHC.Show.Show Distribution.Types.PkgconfigVersion.PkgconfigVersion
instance GHC.Read.Read Distribution.Types.PkgconfigVersion.PkgconfigVersion
instance GHC.Generics.Generic Distribution.Types.PkgconfigVersion.PkgconfigVersion
instance GHC.Classes.Eq Distribution.Types.PkgconfigVersion.PkgconfigVersion
instance GHC.Classes.Ord Distribution.Types.PkgconfigVersion.PkgconfigVersion
instance Data.Binary.Class.Binary Distribution.Types.PkgconfigVersion.PkgconfigVersion
instance Distribution.Utils.Structured.Structured Distribution.Types.PkgconfigVersion.PkgconfigVersion
instance Control.DeepSeq.NFData Distribution.Types.PkgconfigVersion.PkgconfigVersion
instance Distribution.Pretty.Pretty Distribution.Types.PkgconfigVersion.PkgconfigVersion
instance Distribution.Parsec.Parsec Distribution.Types.PkgconfigVersion.PkgconfigVersion

module Distribution.Types.PkgconfigVersionRange

data PkgconfigVersionRange
PcAnyVersion :: PkgconfigVersionRange
PcThisVersion :: PkgconfigVersion -> PkgconfigVersionRange
PcLaterVersion :: PkgconfigVersion -> PkgconfigVersionRange
PcEarlierVersion :: PkgconfigVersion -> PkgconfigVersionRange
PcOrLaterVersion :: PkgconfigVersion -> PkgconfigVersionRange
PcOrEarlierVersion :: PkgconfigVersion -> PkgconfigVersionRange
PcUnionVersionRanges :: PkgconfigVersionRange -> PkgconfigVersionRange -> PkgconfigVersionRange
PcIntersectVersionRanges :: PkgconfigVersionRange -> PkgconfigVersionRange -> PkgconfigVersionRange
anyPkgconfigVersion :: PkgconfigVersionRange

-- | TODO: this is not precise, but used only to prettify output.
isAnyPkgconfigVersion :: PkgconfigVersionRange -> Bool
withinPkgconfigVersionRange :: PkgconfigVersion -> PkgconfigVersionRange -> Bool
versionToPkgconfigVersion :: Version -> PkgconfigVersion
versionRangeToPkgconfigVersionRange :: VersionRange -> PkgconfigVersionRange
instance Data.Data.Data Distribution.Types.PkgconfigVersionRange.PkgconfigVersionRange
instance GHC.Classes.Ord Distribution.Types.PkgconfigVersionRange.PkgconfigVersionRange
instance GHC.Classes.Eq Distribution.Types.PkgconfigVersionRange.PkgconfigVersionRange
instance GHC.Show.Show Distribution.Types.PkgconfigVersionRange.PkgconfigVersionRange
instance GHC.Read.Read Distribution.Types.PkgconfigVersionRange.PkgconfigVersionRange
instance GHC.Generics.Generic Distribution.Types.PkgconfigVersionRange.PkgconfigVersionRange
instance Data.Binary.Class.Binary Distribution.Types.PkgconfigVersionRange.PkgconfigVersionRange
instance Distribution.Utils.Structured.Structured Distribution.Types.PkgconfigVersionRange.PkgconfigVersionRange
instance Control.DeepSeq.NFData Distribution.Types.PkgconfigVersionRange.PkgconfigVersionRange
instance Distribution.Pretty.Pretty Distribution.Types.PkgconfigVersionRange.PkgconfigVersionRange
instance Distribution.Parsec.Parsec Distribution.Types.PkgconfigVersionRange.PkgconfigVersionRange

module Distribution.Types.PkgconfigName

-- | A pkg-config library name
--   
--   This 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>
--   
--   <a>mkPkgconfigName</a> is the inverse to <a>unPkgconfigName</a>
--   
--   Note: No validations are performed to ensure that the resulting
--   <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.Utils.Structured.Structured Distribution.Types.PkgconfigName.PkgconfigName
instance Distribution.Pretty.Pretty Distribution.Types.PkgconfigName.PkgconfigName
instance Distribution.Parsec.Parsec Distribution.Types.PkgconfigName.PkgconfigName
instance Control.DeepSeq.NFData Distribution.Types.PkgconfigName.PkgconfigName

module Distribution.Types.PkgconfigDependency

-- | Describes a dependency on a pkg-config library
data PkgconfigDependency
PkgconfigDependency :: PkgconfigName -> PkgconfigVersionRange -> PkgconfigDependency
instance Data.Data.Data Distribution.Types.PkgconfigDependency.PkgconfigDependency
instance GHC.Classes.Ord 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 Distribution.Utils.Structured.Structured Distribution.Types.PkgconfigDependency.PkgconfigDependency
instance Control.DeepSeq.NFData Distribution.Types.PkgconfigDependency.PkgconfigDependency
instance Distribution.Pretty.Pretty Distribution.Types.PkgconfigDependency.PkgconfigDependency
instance Distribution.Parsec.Parsec Distribution.Types.PkgconfigDependency.PkgconfigDependency

module Distribution.Types.PackageName

-- | A package name.
--   
--   Use <a>mkPackageName</a> and <a>unPackageName</a> to convert from/to a
--   <a>String</a>.
--   
--   This 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>
--   
--   <a>mkPackageName</a> is the inverse to <a>unPackageName</a>
--   
--   Note: No validations are performed to ensure that the resulting
--   <a>PackageName</a> is valid
mkPackageName :: String -> PackageName

unPackageNameST :: PackageName -> ShortText

-- | Construct a <a>PackageName</a> from a <a>ShortText</a>
--   
--   Note: No validations are performed to ensure that the resulting
--   <a>PackageName</a> is valid
mkPackageNameST :: ShortText -> 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.Utils.Structured.Structured Distribution.Types.PackageName.PackageName
instance Distribution.Pretty.Pretty Distribution.Types.PackageName.PackageName
instance Distribution.Parsec.Parsec 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.
--   
--   This is distinguished from a <tt>ComponentName</tt> and
--   <tt>ComponentId</tt>. The former also states which of a library,
--   executable, etc the name refers too. The later uniquely identifiers a
--   component and its closure.
data UnqualComponentName

-- | Convert <a>UnqualComponentName</a> to <a>String</a>
unUnqualComponentName :: UnqualComponentName -> String

unUnqualComponentNameST :: UnqualComponentName -> ShortText

-- | Construct a <a>UnqualComponentName</a> from a <a>String</a>
--   
--   <a>mkUnqualComponentName</a> is the inverse to
--   <a>unUnqualComponentName</a>
--   
--   Note: No validations are performed to ensure that the resulting
--   <a>UnqualComponentName</a> is valid
mkUnqualComponentName :: String -> UnqualComponentName

-- | Converts a package name to an unqualified component name
--   
--   Useful in legacy situations where a package name may refer to an
--   internal component, if one is defined with that name.
--   
--   2018-12-21: These "legacy" situations are not legacy. We can
--   <tt>build-depends</tt> on the internal library. However Now dependency
--   contains <tt>Set LibraryName</tt>, and we should use that.
packageNameToUnqualComponentName :: PackageName -> UnqualComponentName

-- | Converts an unqualified component name to a package name
--   
--   <a>packageNameToUnqualComponentName</a> is the inverse of
--   <a>unqualComponentNameToPackageName</a>.
--   
--   Useful in legacy situations where a package name may refer to an
--   internal 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.Utils.Structured.Structured Distribution.Types.UnqualComponentName.UnqualComponentName
instance Distribution.Pretty.Pretty Distribution.Types.UnqualComponentName.UnqualComponentName
instance Distribution.Parsec.Parsec Distribution.Types.UnqualComponentName.UnqualComponentName
instance Control.DeepSeq.NFData Distribution.Types.UnqualComponentName.UnqualComponentName

module Distribution.Types.LibraryVisibility

-- | Multi-lib visibility
data LibraryVisibility

-- | Can be used as a dependency for other packages
LibraryVisibilityPublic :: LibraryVisibility

-- | Internal library, default
LibraryVisibilityPrivate :: LibraryVisibility
instance Data.Data.Data Distribution.Types.LibraryVisibility.LibraryVisibility
instance GHC.Classes.Ord Distribution.Types.LibraryVisibility.LibraryVisibility
instance GHC.Classes.Eq Distribution.Types.LibraryVisibility.LibraryVisibility
instance GHC.Read.Read Distribution.Types.LibraryVisibility.LibraryVisibility
instance GHC.Show.Show Distribution.Types.LibraryVisibility.LibraryVisibility
instance GHC.Generics.Generic Distribution.Types.LibraryVisibility.LibraryVisibility
instance Distribution.Pretty.Pretty Distribution.Types.LibraryVisibility.LibraryVisibility
instance Distribution.Parsec.Parsec Distribution.Types.LibraryVisibility.LibraryVisibility
instance Data.Binary.Class.Binary Distribution.Types.LibraryVisibility.LibraryVisibility
instance Distribution.Utils.Structured.Structured Distribution.Types.LibraryVisibility.LibraryVisibility
instance Control.DeepSeq.NFData Distribution.Types.LibraryVisibility.LibraryVisibility
instance GHC.Base.Semigroup Distribution.Types.LibraryVisibility.LibraryVisibility
instance GHC.Base.Monoid Distribution.Types.LibraryVisibility.LibraryVisibility

module Distribution.Types.LibraryName
data LibraryName
LMainLibName :: LibraryName
LSubLibName :: UnqualComponentName -> LibraryName
defaultLibName :: LibraryName

-- | Convert the <a>UnqualComponentName</a> of a library into a
--   <a>LibraryName</a>.
maybeToLibraryName :: Maybe UnqualComponentName -> LibraryName
showLibraryName :: LibraryName -> String
libraryNameStanza :: LibraryName -> String
libraryNameString :: LibraryName -> Maybe UnqualComponentName

-- | Pretty print <a>LibraryName</a> in build-target-ish syntax.
--   
--   <i>Note:</i> there are no <a>Pretty</a> or <a>Parsec</a> instances, as
--   there's other way to represent <a>LibraryName</a>, namely as bare
--   <a>UnqualComponentName</a>.
prettyLibraryNameComponent :: LibraryName -> Doc
parsecLibraryNameComponent :: CabalParsing m => m LibraryName
instance Data.Data.Data Distribution.Types.LibraryName.LibraryName
instance GHC.Show.Show Distribution.Types.LibraryName.LibraryName
instance GHC.Read.Read Distribution.Types.LibraryName.LibraryName
instance GHC.Classes.Ord Distribution.Types.LibraryName.LibraryName
instance GHC.Generics.Generic Distribution.Types.LibraryName.LibraryName
instance GHC.Classes.Eq Distribution.Types.LibraryName.LibraryName
instance Data.Binary.Class.Binary Distribution.Types.LibraryName.LibraryName
instance Distribution.Utils.Structured.Structured Distribution.Types.LibraryName.LibraryName
instance Control.DeepSeq.NFData Distribution.Types.LibraryName.LibraryName

module Distribution.Types.MungedPackageName

-- | A combination of a package and component name used in various legacy
--   interfaces, chiefly bundled with a version as
--   <tt>MungedPackageId</tt>. It's generally better to use a
--   <tt>UnitId</tt> to opaquely refer to some compilation/packing unit,
--   but that doesn't always work, e.g. where a "name" is needed, in which
--   case this can be used as a fallback.
--   
--   Use <tt>mkMungedPackageName</tt> and <tt>unMungedPackageName</tt> to
--   convert from/to a <a>String</a>.
--   
--   In <tt>3.0.0.0</tt> representation was changed from opaque (string) to
--   semantic representation.
data MungedPackageName
MungedPackageName :: !PackageName -> !LibraryName -> MungedPackageName

-- | Intended for internal use only
--   
--   <pre>
--   &gt;&gt;&gt; decodeCompatPackageName "z-servant-z-lackey"
--   MungedPackageName (PackageName "servant") (LSubLibName (UnqualComponentName "lackey"))
--   </pre>
decodeCompatPackageName :: PackageName -> MungedPackageName

-- | Intended for internal use only
--   
--   <pre>
--   &gt;&gt;&gt; encodeCompatPackageName $ MungedPackageName "servant" (LSubLibName "lackey")
--   PackageName "z-servant-z-lackey"
--   </pre>
--   
--   This is used in <tt>cabal-install</tt> in the Solver. May become
--   obsolete as solver moves to per-component solving.
encodeCompatPackageName :: MungedPackageName -> PackageName
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.Binary.Class.Binary Distribution.Types.MungedPackageName.MungedPackageName
instance Distribution.Utils.Structured.Structured Distribution.Types.MungedPackageName.MungedPackageName
instance Control.DeepSeq.NFData Distribution.Types.MungedPackageName.MungedPackageName
instance Distribution.Pretty.Pretty Distribution.Types.MungedPackageName.MungedPackageName
instance Distribution.Parsec.Parsec Distribution.Types.MungedPackageName.MungedPackageName

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
--   OSX, 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.Ord 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.Parsec Distribution.Types.ForeignLibType.ForeignLibType
instance Data.Binary.Class.Binary Distribution.Types.ForeignLibType.ForeignLibType
instance Distribution.Utils.Structured.Structured 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.ForeignLibOption
data ForeignLibOption

-- | Merge in all dependent libraries (i.e., use <tt>ghc -shared
--   -static</tt> rather than just record the dependencies, ala <tt>ghc
--   -shared -dynamic</tt>). This option is compulsory on Windows and
--   unsupported on other platforms.
ForeignLibStandalone :: ForeignLibOption
instance Data.Data.Data Distribution.Types.ForeignLibOption.ForeignLibOption
instance GHC.Classes.Ord 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.Parsec Distribution.Types.ForeignLibOption.ForeignLibOption
instance Data.Binary.Class.Binary Distribution.Types.ForeignLibOption.ForeignLibOption
instance Distribution.Utils.Structured.Structured Distribution.Types.ForeignLibOption.ForeignLibOption
instance Control.DeepSeq.NFData Distribution.Types.ForeignLibOption.ForeignLibOption

module Distribution.Types.Flag

-- | A flag can represent a feature to be included, or a way of linking a
--   target against its dependencies, or in fact whatever you can think of.
data PackageFlag
MkPackageFlag :: FlagName -> String -> Bool -> Bool -> PackageFlag
[flagName] :: PackageFlag -> FlagName
[flagDescription] :: PackageFlag -> String
[flagDefault] :: PackageFlag -> Bool
[flagManual] :: PackageFlag -> Bool

-- | A <a>PackageFlag</a> initialized with default parameters.
emptyFlag :: FlagName -> PackageFlag

-- | A <a>FlagName</a> is the name of a user-defined configuration flag
--   
--   Use <a>mkFlagName</a> and <a>unFlagName</a> to convert from/to a
--   <a>String</a>.
--   
--   This type is opaque since <tt>Cabal-2.0</tt>
data FlagName

-- | Construct a <a>FlagName</a> from a <a>String</a>
--   
--   <a>mkFlagName</a> is the inverse to <a>unFlagName</a>
--   
--   Note: No validations are performed to ensure that the resulting
--   <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
--   <a>FlagName</a>s to <a>Bool</a> flag values. It represents the flags
--   chosen by the user or discovered during configuration. For example
--   <tt>--flags=foo --flags=-bar</tt> becomes <tt>[("foo", True), ("bar",
--   False)]</tt>
--   
--   TODO: Why we record the multiplicity of the flag?
data FlagAssignment

-- | Construct a <a>FlagAssignment</a> from a list of flag/value pairs.
--   
--   If duplicate flags occur in the input list, the later entries in the
--   list will take precedence.
mkFlagAssignment :: [(FlagName, Bool)] -> FlagAssignment

-- | Deconstruct a <a>FlagAssignment</a> into a list of flag/value pairs.
--   
--   <pre>
--   <a>null</a> (<a>findDuplicateFlagAssignments</a> fa) ==&gt; (<a>mkFlagAssignment</a> . <a>unFlagAssignment</a>) fa == fa
--   </pre>
unFlagAssignment :: FlagAssignment -> [(FlagName, Bool)]

-- | Lookup the value for a flag
--   
--   Returns <a>Nothing</a> if the flag isn't contained in the
--   <a>FlagAssignment</a>.
lookupFlagAssignment :: FlagName -> FlagAssignment -> Maybe Bool

-- | Insert or update the boolean value of a flag.
--   
--   If the flag is already present in the <a>FlagAssignment</a>, the value
--   will be updated and the fact that multiple values have been provided
--   for that flag will be recorded so that a warning can be generated
--   later on.
insertFlagAssignment :: FlagName -> Bool -> FlagAssignment -> FlagAssignment

-- | Remove all flag-assignments from the first <a>FlagAssignment</a> that
--   are contained in the second <a>FlagAssignment</a>
--   
--   NB/TODO: This currently only removes flag assignments which also match
--   the value assignment! We should review the code which uses this
--   operation to figure out if this it's not enough to only compare the
--   flagnames 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

-- | Show flag assignment.
showFlagAssignment :: FlagAssignment -> String

-- | Parses a flag assignment.
parsecFlagAssignment :: CabalParsing m => m FlagAssignment

-- | Parse a non-empty flag assignment
--   
--   The flags have to explicitly start with minus or plus.
parsecFlagAssignmentNonEmpty :: CabalParsing m => m FlagAssignment

-- | We need this as far as we support custom setups older than 2.2.0.0
legacyShowFlagAssignment :: FlagAssignment -> String

legacyShowFlagAssignment' :: FlagAssignment -> [String]

-- | We need this as far as we support custom setups older than 2.2.0.0
legacyParsecFlagAssignment :: CabalParsing m => m FlagAssignment
instance Control.DeepSeq.NFData Distribution.Types.Flag.FlagName
instance Data.Data.Data Distribution.Types.Flag.FlagName
instance GHC.Read.Read Distribution.Types.Flag.FlagName
instance GHC.Show.Show Distribution.Types.Flag.FlagName
instance GHC.Classes.Ord Distribution.Types.Flag.FlagName
instance GHC.Generics.Generic Distribution.Types.Flag.FlagName
instance GHC.Classes.Eq Distribution.Types.Flag.FlagName
instance GHC.Generics.Generic Distribution.Types.Flag.PackageFlag
instance Data.Data.Data Distribution.Types.Flag.PackageFlag
instance GHC.Classes.Eq Distribution.Types.Flag.PackageFlag
instance GHC.Show.Show Distribution.Types.Flag.PackageFlag
instance Control.DeepSeq.NFData Distribution.Types.Flag.FlagAssignment
instance GHC.Generics.Generic Distribution.Types.Flag.FlagAssignment
instance Data.Binary.Class.Binary Distribution.Types.Flag.FlagAssignment
instance Distribution.Utils.Structured.Structured Distribution.Types.Flag.FlagAssignment
instance GHC.Classes.Eq Distribution.Types.Flag.FlagAssignment
instance GHC.Classes.Ord Distribution.Types.Flag.FlagAssignment
instance GHC.Base.Semigroup Distribution.Types.Flag.FlagAssignment
instance GHC.Base.Monoid Distribution.Types.Flag.FlagAssignment
instance GHC.Read.Read Distribution.Types.Flag.FlagAssignment
instance GHC.Show.Show Distribution.Types.Flag.FlagAssignment
instance Distribution.Pretty.Pretty Distribution.Types.Flag.FlagAssignment
instance Distribution.Parsec.Parsec Distribution.Types.Flag.FlagAssignment
instance Data.Binary.Class.Binary Distribution.Types.Flag.PackageFlag
instance Distribution.Utils.Structured.Structured Distribution.Types.Flag.PackageFlag
instance Control.DeepSeq.NFData Distribution.Types.Flag.PackageFlag
instance Data.String.IsString Distribution.Types.Flag.FlagName
instance Data.Binary.Class.Binary Distribution.Types.Flag.FlagName
instance Distribution.Utils.Structured.Structured Distribution.Types.Flag.FlagName
instance Distribution.Pretty.Pretty Distribution.Types.Flag.FlagName
instance Distribution.Parsec.Parsec Distribution.Types.Flag.FlagName

module Distribution.Types.ExecutableScope
data ExecutableScope
ExecutablePublic :: ExecutableScope
ExecutablePrivate :: ExecutableScope
instance Data.Data.Data Distribution.Types.ExecutableScope.ExecutableScope
instance GHC.Classes.Ord 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.Parsec Distribution.Types.ExecutableScope.ExecutableScope
instance Data.Binary.Class.Binary Distribution.Types.ExecutableScope.ExecutableScope
instance Distribution.Utils.Structured.Structured Distribution.Types.ExecutableScope.ExecutableScope
instance Control.DeepSeq.NFData Distribution.Types.ExecutableScope.ExecutableScope
instance GHC.Base.Semigroup Distribution.Types.ExecutableScope.ExecutableScope
instance GHC.Base.Monoid Distribution.Types.ExecutableScope.ExecutableScope

module Distribution.Types.ComponentName
data ComponentName
CLibName :: LibraryName -> ComponentName
CNotLibName :: NotLibComponentName -> ComponentName
pattern CFLibName :: UnqualComponentName -> ComponentName
pattern CExeName :: UnqualComponentName -> ComponentName
pattern CTestName :: UnqualComponentName -> ComponentName
pattern CBenchName :: UnqualComponentName -> ComponentName
showComponentName :: ComponentName -> String
componentNameRaw :: ComponentName -> String
componentNameStanza :: ComponentName -> String

-- | This gets the underlying unqualified component name. In fact, it is
--   guaranteed to uniquely identify a component, returning
--   <tt>Nothing</tt> if the <a>ComponentName</a> was for the public
--   library.
componentNameString :: ComponentName -> Maybe UnqualComponentName
instance GHC.Show.Show Distribution.Types.ComponentName.NotLibComponentName
instance GHC.Read.Read Distribution.Types.ComponentName.NotLibComponentName
instance GHC.Classes.Ord Distribution.Types.ComponentName.NotLibComponentName
instance GHC.Generics.Generic Distribution.Types.ComponentName.NotLibComponentName
instance GHC.Classes.Eq Distribution.Types.ComponentName.NotLibComponentName
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.Utils.Structured.Structured Distribution.Types.ComponentName.ComponentName
instance Distribution.Pretty.Pretty Distribution.Types.ComponentName.ComponentName
instance Distribution.Parsec.Parsec Distribution.Types.ComponentName.ComponentName
instance Data.Binary.Class.Binary Distribution.Types.ComponentName.NotLibComponentName
instance Distribution.Utils.Structured.Structured Distribution.Types.ComponentName.NotLibComponentName

module Distribution.Types.ComponentId

-- | A <a>ComponentId</a> uniquely identifies the transitive source code
--   closure of a component (i.e. libraries, executables).
--   
--   For non-Backpack components, this corresponds one to one with the
--   <tt>UnitId</tt>, which serves as the basis for install paths, linker
--   symbols, etc.
--   
--   Use <a>mkComponentId</a> and <a>unComponentId</a> to convert from/to a
--   <a>String</a>.
--   
--   This 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>
--   
--   <a>mkComponentId</a> is the inverse to <a>unComponentId</a>
--   
--   Note: No validations are performed to ensure that the resulting
--   <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.Utils.Structured.Structured Distribution.Types.ComponentId.ComponentId
instance Distribution.Pretty.Pretty Distribution.Types.ComponentId.ComponentId
instance Distribution.Parsec.Parsec Distribution.Types.ComponentId.ComponentId
instance Control.DeepSeq.NFData Distribution.Types.ComponentId.ComponentId

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
--   defaultUserHooks</tt>, which invokes <tt>configure</tt> to generate
--   additional 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.Ord 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 Distribution.Utils.Structured.Structured Distribution.Types.BuildType.BuildType
instance Control.DeepSeq.NFData Distribution.Types.BuildType.BuildType
instance Distribution.Pretty.Pretty Distribution.Types.BuildType.BuildType
instance Distribution.Parsec.Parsec Distribution.Types.BuildType.BuildType

module Distribution.Types.AbiHash

-- | ABI Hashes
--   
--   Use <a>mkAbiHash</a> and <a>unAbiHash</a> to convert from/to a
--   <a>String</a>.
--   
--   This type is opaque since <tt>Cabal-2.0</tt>
data AbiHash

-- | Convert <a>AbiHash</a> to <a>String</a>
unAbiHash :: AbiHash -> String

-- | Construct a <a>AbiHash</a> from a <a>String</a>
--   
--   <a>mkAbiHash</a> is the inverse to <a>unAbiHash</a>
--   
--   Note: No validations are performed to ensure that the resulting
--   <a>AbiHash</a> is valid
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 Distribution.Utils.Structured.Structured Distribution.Types.AbiHash.AbiHash
instance Control.DeepSeq.NFData Distribution.Types.AbiHash.AbiHash
instance Distribution.Pretty.Pretty Distribution.Types.AbiHash.AbiHash
instance Distribution.Parsec.Parsec Distribution.Types.AbiHash.AbiHash

module Distribution.Text
display :: Pretty a => a -> String
simpleParse :: Parsec a => String -> Maybe a


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

-- | These are the known OS names: Linux, Windows, OSX ,FreeBSD, OpenBSD,
--   NetBSD, DragonFly ,Solaris, AIX, HPUX, IRIX ,HaLVM ,Hurd ,IOS,
--   Android, Ghcjs, Wasi
--   
--   The following aliases can also be used:, * Windows aliases: mingw32,
--   win32, cygwin32 * OSX alias: darwin * Hurd alias: gnu * FreeBSD alias:
--   kfreebsdgnu * 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
Wasi :: OS
OtherOS :: String -> OS
buildOS :: OS

-- | These are the known Arches: I386, X86_64, PPC, PPC64, Sparc, Arm,
--   AArch64, Mips, SH, IA64, S390, S390X, Alpha, Hppa, Rs6000, M68k, Vax,
--   JavaScript and Wasm32.
--   
--   The following aliases can also be used: * PPC alias: powerpc * PPC64
--   alias : powerpc64, powerpc64le * Sparc aliases: sparc64, sun4 * Mips
--   aliases: mipsel, mipseb * Arm aliases: armeb, armel * AArch64 aliases:
--   arm64
data Arch
I386 :: Arch
X86_64 :: Arch
PPC :: Arch
PPC64 :: Arch
Sparc :: Arch
Arm :: Arch
AArch64 :: Arch
Mips :: Arch
SH :: Arch
IA64 :: Arch
S390 :: Arch
S390X :: Arch
Alpha :: Arch
Hppa :: Arch
Rs6000 :: Arch
M68k :: Arch
Vax :: Arch
JavaScript :: Arch
Wasm32 :: Arch
OtherArch :: String -> Arch
buildArch :: Arch
data Platform
Platform :: Arch -> OS -> Platform

-- | The platform Cabal was compiled on. In most cases,
--   <tt>LocalBuildInfo.hostPlatform</tt> should be used instead (the
--   platform 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
--   <a>Arch</a> enums.
--   
--   The reason we have multiple ways to do the classification is because
--   there are two situations where we need to do it.
--   
--   For parsing OS and arch names in .cabal files we really want everyone
--   to be referring to the same or arch by the same name. Variety is not a
--   virtue in this case. We don't mind about case though.
--   
--   For the System.Info.os/arch different Haskell implementations use
--   different names for the same or/arch. Also they tend to distinguish
--   versions of an OS/arch which we just don't care about.
--   
--   The <a>Compat</a> classification allows us to recognise aliases that
--   are already in common use but it allows us to distinguish them from
--   the canonical name which enables us to warn about such deprecated
--   aliases.
data ClassificationStrictness
Permissive :: ClassificationStrictness
Compat :: ClassificationStrictness
Strict :: ClassificationStrictness
classifyOS :: ClassificationStrictness -> String -> OS
classifyArch :: ClassificationStrictness -> String -> 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.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.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.Binary.Class.Binary Distribution.System.Platform
instance Distribution.Utils.Structured.Structured Distribution.System.Platform
instance Control.DeepSeq.NFData Distribution.System.Platform
instance Distribution.Pretty.Pretty Distribution.System.Platform
instance Distribution.Parsec.Parsec Distribution.System.Platform
instance Data.Binary.Class.Binary Distribution.System.Arch
instance Distribution.Utils.Structured.Structured Distribution.System.Arch
instance Control.DeepSeq.NFData Distribution.System.Arch
instance Distribution.Pretty.Pretty Distribution.System.Arch
instance Distribution.Parsec.Parsec Distribution.System.Arch
instance Data.Binary.Class.Binary Distribution.System.OS
instance Distribution.Utils.Structured.Structured Distribution.System.OS
instance Control.DeepSeq.NFData Distribution.System.OS
instance Distribution.Pretty.Pretty Distribution.System.OS
instance Distribution.Parsec.Parsec Distribution.System.OS

module Distribution.SPDX.LicenseReference

-- | A user defined license reference denoted by
--   <tt>LicenseRef-[idstring]</tt> (for a license not on the SPDX License
--   List);
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
--   <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 Distribution.Utils.Structured.Structured Distribution.SPDX.LicenseReference.LicenseRef
instance Control.DeepSeq.NFData Distribution.SPDX.LicenseReference.LicenseRef
instance Distribution.Pretty.Pretty Distribution.SPDX.LicenseReference.LicenseRef
instance Distribution.Parsec.Parsec Distribution.SPDX.LicenseReference.LicenseRef

module Distribution.SPDX.LicenseId

-- | SPDX License identifiers list v3.16
data LicenseId

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

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

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

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

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

-- | <tt>ADSL</tt>, Amazon Digital Services License
ADSL :: 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>Afmparse</tt>, Afmparse License
Afmparse :: LicenseId

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

-- | <tt>AGPL-1.0-only</tt>, Affero General Public License v1.0 only, SPDX
--   License List 3.2, SPDX License List 3.6, SPDX License List 3.9, SPDX
--   License List 3.10, SPDX License List 3.16
AGPL_1_0_only :: LicenseId

-- | <tt>AGPL-1.0-or-later</tt>, Affero General Public License v1.0 or
--   later, SPDX License List 3.2, SPDX License List 3.6, SPDX License List
--   3.9, SPDX License List 3.10, SPDX License List 3.16
AGPL_1_0_or_later :: LicenseId

-- | <tt>AGPL-3.0-only</tt>, GNU Affero General Public License v3.0 only
AGPL_3_0_only :: LicenseId

-- | <tt>AGPL-3.0-or-later</tt>, GNU Affero General Public License v3.0 or
--   later
AGPL_3_0_or_later :: LicenseId

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

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

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

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

-- | <tt>ANTLR-PD-fallback</tt>, ANTLR Software Rights Notice with license
--   fallback, SPDX License List 3.16
ANTLR_PD_fallback :: 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>APAFML</tt>, Adobe Postscript AFM License
APAFML :: LicenseId

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

-- | <tt>App-s2p</tt>, App::s2p License, SPDX License List 3.16
App_s2p :: 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-cl8</tt>, Artistic License 1.0 w/clause 8
Artistic_1_0_cl8 :: LicenseId

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

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

-- | <tt>Artistic-2.0</tt>, Artistic License 2.0
Artistic_2_0 :: 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>blessing</tt>, SQLite Blessing, SPDX License List 3.6, SPDX
--   License List 3.9, SPDX License List 3.10, SPDX License List 3.16
Blessing :: LicenseId

-- | <tt>BlueOak-1.0.0</tt>, Blue Oak Model License 1.0.0, SPDX License
--   List 3.6, SPDX License List 3.9, SPDX License List 3.10, SPDX License
--   List 3.16
BlueOak_1_0_0 :: LicenseId

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

-- | <tt>BSD-1-Clause</tt>, BSD 1-Clause License
BSD_1_Clause :: LicenseId

-- | <tt>BSD-2-Clause-FreeBSD</tt>, BSD 2-Clause FreeBSD License, SPDX
--   License List 3.0, SPDX License List 3.2, SPDX License List 3.6, SPDX
--   License List 3.9
BSD_2_Clause_FreeBSD :: LicenseId

-- | <tt>BSD-2-Clause-NetBSD</tt>, BSD 2-Clause NetBSD License, SPDX
--   License List 3.0, SPDX License List 3.2, SPDX License List 3.6
BSD_2_Clause_NetBSD :: LicenseId

-- | <tt>BSD-2-Clause-Patent</tt>, BSD-2-Clause Plus Patent License
BSD_2_Clause_Patent :: LicenseId

-- | <tt>BSD-2-Clause-Views</tt>, BSD 2-Clause with views sentence, SPDX
--   License List 3.10, SPDX License List 3.16
BSD_2_Clause_Views :: LicenseId

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

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

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

-- | <tt>BSD-3-Clause-LBNL</tt>, Lawrence Berkeley National Labs BSD
--   variant license
BSD_3_Clause_LBNL :: LicenseId

-- | <tt>BSD-3-Clause-Modification</tt>, BSD 3-Clause Modification, SPDX
--   License List 3.16
BSD_3_Clause_Modification :: LicenseId

-- | <tt>BSD-3-Clause-No-Military-License</tt>, BSD 3-Clause No Military
--   License, SPDX License List 3.16
BSD_3_Clause_No_Military_License :: LicenseId

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

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

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

-- | <tt>BSD-3-Clause-Open-MPI</tt>, BSD 3-Clause Open MPI variant, SPDX
--   License List 3.6, SPDX License List 3.9, SPDX License List 3.10, SPDX
--   License List 3.16
BSD_3_Clause_Open_MPI :: LicenseId

-- | <tt>BSD-3-Clause</tt>, BSD 3-Clause <a>New</a> or <a>Revised</a>
--   License
BSD_3_Clause :: LicenseId

-- | <tt>BSD-4-Clause-Shortened</tt>, BSD 4 Clause Shortened, SPDX License
--   List 3.16
BSD_4_Clause_Shortened :: LicenseId

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

-- | <tt>BSD-4-Clause</tt>, BSD 4-Clause <a>Original</a> or <a>Old</a>
--   License
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>BSL-1.0</tt>, Boost Software License 1.0
BSL_1_0 :: LicenseId

-- | <tt>bzip2-1.0.5</tt>, bzip2 and libbzip2 License v1.0.5, SPDX License
--   List 3.0, SPDX License List 3.2, SPDX License List 3.6, SPDX License
--   List 3.9, SPDX License List 3.10
Bzip2_1_0_5 :: LicenseId

-- | <tt>BUSL-1.1</tt>, Business Source License 1.1, SPDX License List 3.16
BUSL_1_1 :: LicenseId

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

-- | <tt>C-UDA-1.0</tt>, Computational Use of Data Agreement v1.0, SPDX
--   License List 3.16
C_UDA_1_0 :: LicenseId

-- | <tt>CAL-1.0-Combined-Work-Exception</tt>, Cryptographic Autonomy
--   License 1.0 (Combined Work Exception), SPDX License List 3.9, SPDX
--   License List 3.10, SPDX License List 3.16
CAL_1_0_Combined_Work_Exception :: LicenseId

-- | <tt>CAL-1.0</tt>, Cryptographic Autonomy License 1.0, SPDX License
--   List 3.9, SPDX License List 3.10, SPDX License List 3.16
CAL_1_0 :: LicenseId

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

-- | <tt>CATOSL-1.1</tt>, Computer Associates Trusted Open Source License
--   1.1
CATOSL_1_1 :: LicenseId

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

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

-- | <tt>CC-BY-2.5-AU</tt>, Creative Commons Attribution 2.5 Australia,
--   SPDX License List 3.16
CC_BY_2_5_AU :: LicenseId

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

-- | <tt>CC-BY-3.0-AT</tt>, Creative Commons Attribution 3.0 Austria, SPDX
--   License List 3.10, SPDX License List 3.16
CC_BY_3_0_AT :: LicenseId

-- | <tt>CC-BY-3.0-DE</tt>, Creative Commons Attribution 3.0 Germany, SPDX
--   License List 3.16
CC_BY_3_0_DE :: LicenseId

-- | <tt>CC-BY-3.0-NL</tt>, Creative Commons Attribution 3.0 Netherlands,
--   SPDX License List 3.16
CC_BY_3_0_NL :: LicenseId

-- | <tt>CC-BY-3.0-US</tt>, Creative Commons Attribution 3.0 United States,
--   SPDX License List 3.16
CC_BY_3_0_US :: LicenseId

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

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

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

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

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

-- | <tt>CC-BY-NC-3.0-DE</tt>, Creative Commons Attribution Non Commercial
--   3.0 Germany, SPDX License List 3.16
CC_BY_NC_3_0_DE :: LicenseId

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

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

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

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

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

-- | <tt>CC-BY-NC-ND-3.0-DE</tt>, Creative Commons Attribution Non
--   Commercial No Derivatives 3.0 Germany, SPDX License List 3.16
CC_BY_NC_ND_3_0_DE :: LicenseId

-- | <tt>CC-BY-NC-ND-3.0-IGO</tt>, Creative Commons Attribution Non
--   Commercial No Derivatives 3.0 IGO, SPDX License List 3.10, SPDX
--   License List 3.16
CC_BY_NC_ND_3_0_IGO :: LicenseId

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

-- | <tt>CC-BY-NC-ND-4.0</tt>, Creative Commons Attribution Non Commercial
--   No Derivatives 4.0 International
CC_BY_NC_ND_4_0 :: LicenseId

-- | <tt>CC-BY-NC-SA-1.0</tt>, Creative Commons Attribution Non Commercial
--   Share Alike 1.0 Generic
CC_BY_NC_SA_1_0 :: LicenseId

-- | <tt>CC-BY-NC-SA-2.0-FR</tt>, Creative Commons
--   Attribution-NonCommercial-ShareAlike 2.0 France, SPDX License List
--   3.16
CC_BY_NC_SA_2_0_FR :: LicenseId

-- | <tt>CC-BY-NC-SA-2.0-UK</tt>, Creative Commons Attribution Non
--   Commercial Share Alike 2.0 England and Wales, SPDX License List 3.16
CC_BY_NC_SA_2_0_UK :: LicenseId

-- | <tt>CC-BY-NC-SA-2.0</tt>, Creative Commons Attribution Non Commercial
--   Share Alike 2.0 Generic
CC_BY_NC_SA_2_0 :: LicenseId

-- | <tt>CC-BY-NC-SA-2.5</tt>, Creative Commons Attribution Non Commercial
--   Share Alike 2.5 Generic
CC_BY_NC_SA_2_5 :: LicenseId

-- | <tt>CC-BY-NC-SA-3.0-DE</tt>, Creative Commons Attribution Non
--   Commercial Share Alike 3.0 Germany, SPDX License List 3.16
CC_BY_NC_SA_3_0_DE :: LicenseId

-- | <tt>CC-BY-NC-SA-3.0-IGO</tt>, Creative Commons Attribution Non
--   Commercial Share Alike 3.0 IGO, SPDX License List 3.16
CC_BY_NC_SA_3_0_IGO :: LicenseId

-- | <tt>CC-BY-NC-SA-3.0</tt>, Creative Commons Attribution Non Commercial
--   Share Alike 3.0 Unported
CC_BY_NC_SA_3_0 :: LicenseId

-- | <tt>CC-BY-NC-SA-4.0</tt>, Creative Commons Attribution Non Commercial
--   Share Alike 4.0 International
CC_BY_NC_SA_4_0 :: LicenseId

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

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

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

-- | <tt>CC-BY-ND-3.0-DE</tt>, Creative Commons Attribution No Derivatives
--   3.0 Germany, SPDX License List 3.16
CC_BY_ND_3_0_DE :: LicenseId

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

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

-- | <tt>CC-BY-SA-1.0</tt>, Creative Commons Attribution Share Alike 1.0
--   Generic
CC_BY_SA_1_0 :: LicenseId

-- | <tt>CC-BY-SA-2.0-UK</tt>, Creative Commons Attribution Share Alike 2.0
--   England and Wales, SPDX License List 3.16
CC_BY_SA_2_0_UK :: LicenseId

-- | <tt>CC-BY-SA-2.0</tt>, Creative Commons Attribution Share Alike 2.0
--   Generic
CC_BY_SA_2_0 :: LicenseId

-- | <tt>CC-BY-SA-2.1-JP</tt>, Creative Commons Attribution Share Alike 2.1
--   Japan, SPDX License List 3.16
CC_BY_SA_2_1_JP :: LicenseId

-- | <tt>CC-BY-SA-2.5</tt>, Creative Commons Attribution Share Alike 2.5
--   Generic
CC_BY_SA_2_5 :: LicenseId

-- | <tt>CC-BY-SA-3.0-AT</tt>, Creative Commons Attribution Share Alike 3.0
--   Austria, SPDX License List 3.10, SPDX License List 3.16
CC_BY_SA_3_0_AT :: LicenseId

-- | <tt>CC-BY-SA-3.0-DE</tt>, Creative Commons Attribution Share Alike 3.0
--   Germany, SPDX License List 3.16
CC_BY_SA_3_0_DE :: LicenseId

-- | <tt>CC-BY-SA-3.0</tt>, Creative Commons Attribution Share Alike 3.0
--   Unported
CC_BY_SA_3_0 :: LicenseId

-- | <tt>CC-BY-SA-4.0</tt>, Creative Commons Attribution Share Alike 4.0
--   International
CC_BY_SA_4_0 :: LicenseId

-- | <tt>CC-PDDC</tt>, Creative Commons Public Domain Dedication and
--   Certification, SPDX License List 3.6, SPDX License List 3.9, SPDX
--   License List 3.10, SPDX License List 3.16
CC_PDDC :: LicenseId

-- | <tt>CC0-1.0</tt>, Creative Commons Zero v1.0 Universal
CC0_1_0 :: 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>CDL-1.0</tt>, Common Documentation License 1.0, SPDX License List
--   3.16
CDL_1_0 :: LicenseId

-- | <tt>CDLA-Permissive-1.0</tt>, Community Data License Agreement
--   Permissive 1.0
CDLA_Permissive_1_0 :: LicenseId

-- | <tt>CDLA-Permissive-2.0</tt>, Community Data License Agreement
--   Permissive 2.0, SPDX License List 3.16
CDLA_Permissive_2_0 :: LicenseId

-- | <tt>CDLA-Sharing-1.0</tt>, Community Data License Agreement Sharing
--   1.0
CDLA_Sharing_1_0 :: 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>CERN-OHL-1.1</tt>, CERN Open Hardware Licence v1.1, SPDX License
--   List 3.6, SPDX License List 3.9, SPDX License List 3.10, SPDX License
--   List 3.16
CERN_OHL_1_1 :: LicenseId

-- | <tt>CERN-OHL-1.2</tt>, CERN Open Hardware Licence v1.2, SPDX License
--   List 3.6, SPDX License List 3.9, SPDX License List 3.10, SPDX License
--   List 3.16
CERN_OHL_1_2 :: LicenseId

-- | <tt>CERN-OHL-P-2.0</tt>, CERN Open Hardware Licence Version 2 -
--   Permissive, SPDX License List 3.9, SPDX License List 3.10, SPDX
--   License List 3.16
CERN_OHL_P_2_0 :: LicenseId

-- | <tt>CERN-OHL-S-2.0</tt>, CERN Open Hardware Licence Version 2 -
--   Strongly Reciprocal, SPDX License List 3.9, SPDX License List 3.10,
--   SPDX License List 3.16
CERN_OHL_S_2_0 :: LicenseId

-- | <tt>CERN-OHL-W-2.0</tt>, CERN Open Hardware Licence Version 2 - Weakly
--   Reciprocal, SPDX License List 3.9, SPDX License List 3.10, SPDX
--   License List 3.16
CERN_OHL_W_2_0 :: LicenseId

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

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

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

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

-- | <tt>COIL-1.0</tt>, Copyfree Open Innovation License, SPDX License List
--   3.16
COIL_1_0 :: LicenseId

-- | <tt>Community-Spec-1.0</tt>, Community Specification License 1.0, SPDX
--   License List 3.16
Community_Spec_1_0 :: LicenseId

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

-- | <tt>copyleft-next-0.3.0</tt>, copyleft-next 0.3.0, SPDX License List
--   3.6, SPDX License List 3.9, SPDX License List 3.10, SPDX License List
--   3.16
Copyleft_next_0_3_0 :: LicenseId

-- | <tt>copyleft-next-0.3.1</tt>, copyleft-next 0.3.1, SPDX License List
--   3.6, SPDX License List 3.9, SPDX License List 3.10, SPDX License List
--   3.16
Copyleft_next_0_3_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>CPOL-1.02</tt>, Code Project Open License 1.02
CPOL_1_02 :: 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>DL-DE-BY-2.0</tt>, Data licence Germany – attribution – version
--   2.0, SPDX License List 3.16
DL_DE_BY_2_0 :: LicenseId

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

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

-- | <tt>DRL-1.0</tt>, Detection Rule License 1.0, SPDX License List 3.16
DRL_1_0 :: LicenseId

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

-- | <tt>dvipdfm</tt>, dvipdfm License
Dvipdfm :: 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>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>eGenix</tt>, eGenix.com Public License 1.1.0
EGenix :: LicenseId

-- | <tt>Elastic-2.0</tt>, Elastic License 2.0, SPDX License List 3.16
Elastic_2_0 :: LicenseId

-- | <tt>Entessa</tt>, Entessa Public License v1.0
Entessa :: LicenseId

-- | <tt>EPICS</tt>, EPICS Open License, SPDX License List 3.10, SPDX
--   License List 3.16
EPICS :: LicenseId

-- | <tt>EPL-1.0</tt>, Eclipse Public License 1.0
EPL_1_0 :: LicenseId

-- | <tt>EPL-2.0</tt>, Eclipse Public License 2.0
EPL_2_0 :: LicenseId

-- | <tt>ErlPL-1.1</tt>, Erlang Public License v1.1
ErlPL_1_1 :: LicenseId

-- | <tt>etalab-2.0</tt>, Etalab Open License 2.0, SPDX License List 3.9,
--   SPDX License List 3.10, SPDX License List 3.16
Etalab_2_0 :: 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>EUPL-1.2</tt>, European Union Public License 1.2
EUPL_1_2 :: LicenseId

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

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

-- | <tt>FDK-AAC</tt>, Fraunhofer FDK AAC Codec Library, SPDX License List
--   3.16
FDK_AAC :: LicenseId

-- | <tt>Frameworx-1.0</tt>, Frameworx Open License 1.0
Frameworx_1_0 :: LicenseId

-- | <tt>FreeBSD-DOC</tt>, FreeBSD Documentation License, SPDX License List
--   3.16
FreeBSD_DOC :: LicenseId

-- | <tt>FreeImage</tt>, FreeImage Public License v1.0
FreeImage :: LicenseId

-- | <tt>FSFAP</tt>, FSF All Permissive License
FSFAP :: LicenseId

-- | <tt>FSFULLR</tt>, FSF Unlimited License (with License Retention)
FSFULLR :: LicenseId

-- | <tt>FSFUL</tt>, FSF Unlimited License
FSFUL :: LicenseId

-- | <tt>FTL</tt>, Freetype Project License
FTL :: LicenseId

-- | <tt>GD</tt>, GD License, SPDX License List 3.16
GD :: LicenseId

-- | <tt>GFDL-1.1-invariants-only</tt>, GNU Free Documentation License v1.1
--   only - invariants, SPDX License List 3.10, SPDX License List 3.16
GFDL_1_1_invariants_only :: LicenseId

-- | <tt>GFDL-1.1-invariants-or-later</tt>, GNU Free Documentation License
--   v1.1 or later - invariants, SPDX License List 3.10, SPDX License List
--   3.16
GFDL_1_1_invariants_or_later :: LicenseId

-- | <tt>GFDL-1.1-no-invariants-only</tt>, GNU Free Documentation License
--   v1.1 only - no invariants, SPDX License List 3.10, SPDX License List
--   3.16
GFDL_1_1_no_invariants_only :: LicenseId

-- | <tt>GFDL-1.1-no-invariants-or-later</tt>, GNU Free Documentation
--   License v1.1 or later - no invariants, SPDX License List 3.10, SPDX
--   License List 3.16
GFDL_1_1_no_invariants_or_later :: LicenseId

-- | <tt>GFDL-1.1-only</tt>, GNU Free Documentation License v1.1 only
GFDL_1_1_only :: LicenseId

-- | <tt>GFDL-1.1-or-later</tt>, GNU Free Documentation License v1.1 or
--   later
GFDL_1_1_or_later :: LicenseId

-- | <tt>GFDL-1.2-invariants-only</tt>, GNU Free Documentation License v1.2
--   only - invariants, SPDX License List 3.10, SPDX License List 3.16
GFDL_1_2_invariants_only :: LicenseId

-- | <tt>GFDL-1.2-invariants-or-later</tt>, GNU Free Documentation License
--   v1.2 or later - invariants, SPDX License List 3.10, SPDX License List
--   3.16
GFDL_1_2_invariants_or_later :: LicenseId

-- | <tt>GFDL-1.2-no-invariants-only</tt>, GNU Free Documentation License
--   v1.2 only - no invariants, SPDX License List 3.10, SPDX License List
--   3.16
GFDL_1_2_no_invariants_only :: LicenseId

-- | <tt>GFDL-1.2-no-invariants-or-later</tt>, GNU Free Documentation
--   License v1.2 or later - no invariants, SPDX License List 3.10, SPDX
--   License List 3.16
GFDL_1_2_no_invariants_or_later :: LicenseId

-- | <tt>GFDL-1.2-only</tt>, GNU Free Documentation License v1.2 only
GFDL_1_2_only :: LicenseId

-- | <tt>GFDL-1.2-or-later</tt>, GNU Free Documentation License v1.2 or
--   later
GFDL_1_2_or_later :: LicenseId

-- | <tt>GFDL-1.3-invariants-only</tt>, GNU Free Documentation License v1.3
--   only - invariants, SPDX License List 3.10, SPDX License List 3.16
GFDL_1_3_invariants_only :: LicenseId

-- | <tt>GFDL-1.3-invariants-or-later</tt>, GNU Free Documentation License
--   v1.3 or later - invariants, SPDX License List 3.10, SPDX License List
--   3.16
GFDL_1_3_invariants_or_later :: LicenseId

-- | <tt>GFDL-1.3-no-invariants-only</tt>, GNU Free Documentation License
--   v1.3 only - no invariants, SPDX License List 3.10, SPDX License List
--   3.16
GFDL_1_3_no_invariants_only :: LicenseId

-- | <tt>GFDL-1.3-no-invariants-or-later</tt>, GNU Free Documentation
--   License v1.3 or later - no invariants, SPDX License List 3.10, SPDX
--   License List 3.16
GFDL_1_3_no_invariants_or_later :: LicenseId

-- | <tt>GFDL-1.3-only</tt>, GNU Free Documentation License v1.3 only
GFDL_1_3_only :: LicenseId

-- | <tt>GFDL-1.3-or-later</tt>, GNU Free Documentation License v1.3 or
--   later
GFDL_1_3_or_later :: LicenseId

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

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

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

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

-- | <tt>GLWTPL</tt>, Good Luck With That Public License, SPDX License List
--   3.10, SPDX License List 3.16
GLWTPL :: LicenseId

-- | <tt>gnuplot</tt>, gnuplot License
Gnuplot :: LicenseId

-- | <tt>GPL-1.0-only</tt>, GNU General Public License v1.0 only
GPL_1_0_only :: LicenseId

-- | <tt>GPL-1.0-or-later</tt>, GNU General Public License v1.0 or later
GPL_1_0_or_later :: LicenseId

-- | <tt>GPL-2.0-only</tt>, GNU General Public License v2.0 only
GPL_2_0_only :: LicenseId

-- | <tt>GPL-2.0-or-later</tt>, GNU General Public License v2.0 or later
GPL_2_0_or_later :: LicenseId

-- | <tt>GPL-3.0-only</tt>, GNU General Public License v3.0 only
GPL_3_0_only :: LicenseId

-- | <tt>GPL-3.0-or-later</tt>, GNU General Public License v3.0 or later
GPL_3_0_or_later :: 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>Hippocratic-2.1</tt>, Hippocratic License 2.1, SPDX License List
--   3.9, SPDX License List 3.10, SPDX License List 3.16
Hippocratic_2_1 :: LicenseId

-- | <tt>HPND-sell-variant</tt>, Historical Permission Notice and
--   Disclaimer - sell variant, SPDX License List 3.6, SPDX License List
--   3.9, SPDX License List 3.10, SPDX License List 3.16
HPND_sell_variant :: LicenseId

-- | <tt>HPND</tt>, Historical Permission Notice and Disclaimer
HPND :: LicenseId

-- | <tt>HTMLTIDY</tt>, HTML Tidy License, SPDX License List 3.16
HTMLTIDY :: LicenseId

-- | <tt>IBM-pibs</tt>, IBM PowerPC Initialization and Boot Software
IBM_pibs :: LicenseId

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

-- | <tt>IJG</tt>, Independent JPEG Group License
IJG :: 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>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>IPL-1.0</tt>, IBM Public License v1.0
IPL_1_0 :: LicenseId

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

-- | <tt>Jam</tt>, Jam License, SPDX License List 3.16
Jam :: LicenseId

-- | <tt>JasPer-2.0</tt>, JasPer License
JasPer_2_0 :: LicenseId

-- | <tt>JPNIC</tt>, Japan Network Information Center License, SPDX License
--   List 3.6, SPDX License List 3.9, SPDX License List 3.10, SPDX License
--   List 3.16
JPNIC :: LicenseId

-- | <tt>JSON</tt>, JSON License
JSON :: 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>Latex2e</tt>, Latex2e License
Latex2e :: LicenseId

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

-- | <tt>LGPL-2.0-only</tt>, GNU Library General Public License v2 only
LGPL_2_0_only :: LicenseId

-- | <tt>LGPL-2.0-or-later</tt>, GNU Library General Public License v2 or
--   later
LGPL_2_0_or_later :: LicenseId

-- | <tt>LGPL-2.1-only</tt>, GNU Lesser General Public License v2.1 only
LGPL_2_1_only :: LicenseId

-- | <tt>LGPL-2.1-or-later</tt>, GNU Lesser General Public License v2.1 or
--   later
LGPL_2_1_or_later :: LicenseId

-- | <tt>LGPL-3.0-only</tt>, GNU Lesser General Public License v3.0 only
LGPL_3_0_only :: LicenseId

-- | <tt>LGPL-3.0-or-later</tt>, GNU Lesser General Public License v3.0 or
--   later
LGPL_3_0_or_later :: LicenseId

-- | <tt>LGPLLR</tt>, Lesser General Public License For Linguistic
--   Resources
LGPLLR :: LicenseId

-- | <tt>libpng-2.0</tt>, PNG Reference Library version 2, SPDX License
--   List 3.6, SPDX License List 3.9, SPDX License List 3.10, SPDX License
--   List 3.16
Libpng_2_0 :: LicenseId

-- | <tt>Libpng</tt>, libpng License
Libpng :: LicenseId

-- | <tt>libselinux-1.0</tt>, libselinux public domain notice, SPDX License
--   List 3.9, SPDX License List 3.10, SPDX License List 3.16
Libselinux_1_0 :: LicenseId

-- | <tt>libtiff</tt>, libtiff License
Libtiff :: LicenseId

-- | <tt>LiLiQ-P-1.1</tt>, Licence Libre du Québec – Permissive version 1.1
LiLiQ_P_1_1 :: LicenseId

-- | <tt>LiLiQ-R-1.1</tt>, Licence Libre du Québec – Réciprocité version
--   1.1
LiLiQ_R_1_1 :: LicenseId

-- | <tt>LiLiQ-Rplus-1.1</tt>, Licence Libre du Québec – Réciprocité forte
--   version 1.1
LiLiQ_Rplus_1_1 :: LicenseId

-- | <tt>Linux-man-pages-copyleft</tt>, Linux man-pages Copyleft, SPDX
--   License List 3.16
Linux_man_pages_copyleft :: LicenseId

-- | <tt>Linux-OpenIB</tt>, Linux Kernel Variant of OpenIB.org license,
--   SPDX License List 3.2, SPDX License List 3.6, SPDX License List 3.9,
--   SPDX License List 3.10, SPDX License List 3.16
Linux_OpenIB :: 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>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>MakeIndex</tt>, MakeIndex License
MakeIndex :: LicenseId

-- | <tt>MirOS</tt>, The MirOS Licence
MirOS :: LicenseId

-- | <tt>MIT-0</tt>, MIT No Attribution, SPDX License List 3.2, SPDX
--   License List 3.6, SPDX License List 3.9, SPDX License List 3.10, SPDX
--   License List 3.16
MIT_0 :: LicenseId

-- | <tt>MIT-advertising</tt>, Enlightenment License (e16)
MIT_advertising :: LicenseId

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

-- | <tt>MIT-enna</tt>, enna License
MIT_enna :: LicenseId

-- | <tt>MIT-feh</tt>, feh License
MIT_feh :: LicenseId

-- | <tt>MIT-Modern-Variant</tt>, MIT License Modern Variant, SPDX License
--   List 3.16
MIT_Modern_Variant :: LicenseId

-- | <tt>MIT-open-group</tt>, MIT Open Group variant, SPDX License List
--   3.16
MIT_open_group :: 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>mpich2</tt>, mpich2 License
Mpich2 :: 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-no-copyleft-exception</tt>, Mozilla Public License 2.0 (no
--   copyleft exception)
MPL_2_0_no_copyleft_exception :: LicenseId

-- | <tt>MPL-2.0</tt>, Mozilla Public License 2.0
MPL_2_0 :: LicenseId

-- | <tt>MS-PL</tt>, Microsoft Public License
MS_PL :: LicenseId

-- | <tt>MS-RL</tt>, Microsoft Reciprocal License
MS_RL :: LicenseId

-- | <tt>MTLL</tt>, Matrix Template Library License
MTLL :: LicenseId

-- | <tt>MulanPSL-1.0</tt>, Mulan Permissive Software License, Version 1,
--   SPDX License List 3.9, SPDX License List 3.10, SPDX License List 3.16
MulanPSL_1_0 :: LicenseId

-- | <tt>MulanPSL-2.0</tt>, Mulan Permissive Software License, Version 2,
--   SPDX License List 3.9, SPDX License List 3.10, SPDX License List 3.16
MulanPSL_2_0 :: LicenseId

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

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

-- | <tt>NAIST-2003</tt>, Nara Institute of Science and Technology License
--   (2003), SPDX License List 3.16
NAIST_2003 :: 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>NCGL-UK-2.0</tt>, Non-Commercial Government Licence, SPDX License
--   List 3.9, SPDX License List 3.10, SPDX License List 3.16
NCGL_UK_2_0 :: LicenseId

-- | <tt>NCSA</tt>, University of Illinois/NCSA Open Source License
NCSA :: LicenseId

-- | <tt>Net-SNMP</tt>, Net-SNMP License
Net_SNMP :: LicenseId

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

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

-- | <tt>NGPL</tt>, Nethack General Public License
NGPL :: LicenseId

-- | <tt>NIST-PD-fallback</tt>, NIST Public Domain Notice with license
--   fallback, SPDX License List 3.10, SPDX License List 3.16
NIST_PD_fallback :: LicenseId

-- | <tt>NIST-PD</tt>, NIST Public Domain Notice, SPDX License List 3.10,
--   SPDX License List 3.16
NIST_PD :: LicenseId

-- | <tt>NLOD-1.0</tt>, Norwegian Licence for Open Government Data (NLOD)
--   1.0
NLOD_1_0 :: LicenseId

-- | <tt>NLOD-2.0</tt>, Norwegian Licence for Open Government Data (NLOD)
--   2.0, SPDX License List 3.16
NLOD_2_0 :: LicenseId

-- | <tt>NLPL</tt>, No Limit Public License
NLPL :: LicenseId

-- | <tt>Nokia</tt>, Nokia Open Source License
Nokia :: LicenseId

-- | <tt>NOSL</tt>, Netizen Open Source License
NOSL :: LicenseId

-- | <tt>Noweb</tt>, Noweb License
Noweb :: 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>NPOSL-3.0</tt>, Non-Profit Open Software License 3.0
NPOSL_3_0 :: LicenseId

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

-- | <tt>NTP-0</tt>, NTP No Attribution, SPDX License List 3.9, SPDX
--   License List 3.10, SPDX License List 3.16
NTP_0 :: LicenseId

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

-- | <tt>O-UDA-1.0</tt>, Open Use of Data Agreement v1.0, SPDX License List
--   3.9, SPDX License List 3.10, SPDX License List 3.16
O_UDA_1_0 :: LicenseId

-- | <tt>OCCT-PL</tt>, Open CASCADE Technology Public License
OCCT_PL :: LicenseId

-- | <tt>OCLC-2.0</tt>, OCLC Research Public License 2.0
OCLC_2_0 :: LicenseId

-- | <tt>ODbL-1.0</tt>, Open Data Commons Open Database License v1.0
ODbL_1_0 :: LicenseId

-- | <tt>ODC-By-1.0</tt>, Open Data Commons Attribution License v1.0, SPDX
--   License List 3.2, SPDX License List 3.6, SPDX License List 3.9, SPDX
--   License List 3.10, SPDX License List 3.16
ODC_By_1_0 :: LicenseId

-- | <tt>OFL-1.0-no-RFN</tt>, SIL Open Font License 1.0 with no Reserved
--   Font Name, SPDX License List 3.9, SPDX License List 3.10, SPDX License
--   List 3.16
OFL_1_0_no_RFN :: LicenseId

-- | <tt>OFL-1.0-RFN</tt>, SIL Open Font License 1.0 with Reserved Font
--   Name, SPDX License List 3.9, SPDX License List 3.10, SPDX License List
--   3.16
OFL_1_0_RFN :: LicenseId

-- | <tt>OFL-1.0</tt>, SIL Open Font License 1.0
OFL_1_0 :: LicenseId

-- | <tt>OFL-1.1-no-RFN</tt>, SIL Open Font License 1.1 with no Reserved
--   Font Name, SPDX License List 3.9, SPDX License List 3.10, SPDX License
--   List 3.16
OFL_1_1_no_RFN :: LicenseId

-- | <tt>OFL-1.1-RFN</tt>, SIL Open Font License 1.1 with Reserved Font
--   Name, SPDX License List 3.9, SPDX License List 3.10, SPDX License List
--   3.16
OFL_1_1_RFN :: LicenseId

-- | <tt>OFL-1.1</tt>, SIL Open Font License 1.1
OFL_1_1 :: LicenseId

-- | <tt>OGC-1.0</tt>, OGC Software License, Version 1.0, SPDX License List
--   3.9, SPDX License List 3.10, SPDX License List 3.16
OGC_1_0 :: LicenseId

-- | <tt>OGDL-Taiwan-1.0</tt>, Taiwan Open Government Data License, version
--   1.0, SPDX License List 3.16
OGDL_Taiwan_1_0 :: LicenseId

-- | <tt>OGL-Canada-2.0</tt>, Open Government Licence - Canada, SPDX
--   License List 3.9, SPDX License List 3.10, SPDX License List 3.16
OGL_Canada_2_0 :: LicenseId

-- | <tt>OGL-UK-1.0</tt>, Open Government Licence v1.0, SPDX License List
--   3.6, SPDX License List 3.9, SPDX License List 3.10, SPDX License List
--   3.16
OGL_UK_1_0 :: LicenseId

-- | <tt>OGL-UK-2.0</tt>, Open Government Licence v2.0, SPDX License List
--   3.6, SPDX License List 3.9, SPDX License List 3.10, SPDX License List
--   3.16
OGL_UK_2_0 :: LicenseId

-- | <tt>OGL-UK-3.0</tt>, Open Government Licence v3.0, SPDX License List
--   3.6, SPDX License List 3.9, SPDX License List 3.10, SPDX License List
--   3.16
OGL_UK_3_0 :: LicenseId

-- | <tt>OGTSL</tt>, Open Group Test Suite License
OGTSL :: 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.1</tt>, Open LDAP Public License v2.0.1
OLDAP_2_0_1 :: LicenseId

-- | <tt>OLDAP-2.0</tt>, Open LDAP Public License v2.0 (or possibly 2.0A
--   and 2.0B)
OLDAP_2_0 :: LicenseId

-- | <tt>OLDAP-2.1</tt>, Open LDAP Public License v2.1
OLDAP_2_1 :: LicenseId

-- | <tt>OLDAP-2.2.1</tt>, Open LDAP Public License v2.2.1
OLDAP_2_2_1 :: LicenseId

-- | <tt>OLDAP-2.2.2</tt>, Open LDAP Public License 2.2.2
OLDAP_2_2_2 :: LicenseId

-- | <tt>OLDAP-2.2</tt>, Open LDAP Public License v2.2
OLDAP_2_2 :: 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>OpenSSL</tt>, OpenSSL License
OpenSSL :: LicenseId

-- | <tt>OPL-1.0</tt>, Open Public License v1.0
OPL_1_0 :: LicenseId

-- | <tt>OPUBL-1.0</tt>, Open Publication License v1.0, SPDX License List
--   3.16
OPUBL_1_0 :: LicenseId

-- | <tt>OSET-PL-2.1</tt>, OSET Public License version 2.1
OSET_PL_2_1 :: 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>Parity-6.0.0</tt>, The Parity Public License 6.0.0, SPDX License
--   List 3.6, SPDX License List 3.9, SPDX License List 3.10, SPDX License
--   List 3.16
Parity_6_0_0 :: LicenseId

-- | <tt>Parity-7.0.0</tt>, The Parity Public License 7.0.0, SPDX License
--   List 3.9, SPDX License List 3.10, SPDX License List 3.16
Parity_7_0_0 :: LicenseId

-- | <tt>PDDL-1.0</tt>, Open Data Commons Public Domain Dedication &amp;
--   License 1.0
PDDL_1_0 :: LicenseId

-- | <tt>PHP-3.01</tt>, PHP License v3.01
PHP_3_01 :: LicenseId

-- | <tt>PHP-3.0</tt>, PHP License v3.0
PHP_3_0 :: LicenseId

-- | <tt>Plexus</tt>, Plexus Classworlds License
Plexus :: LicenseId

-- | <tt>PolyForm-Noncommercial-1.0.0</tt>, PolyForm Noncommercial License
--   1.0.0, SPDX License List 3.9, SPDX License List 3.10, SPDX License
--   List 3.16
PolyForm_Noncommercial_1_0_0 :: LicenseId

-- | <tt>PolyForm-Small-Business-1.0.0</tt>, PolyForm Small Business
--   License 1.0.0, SPDX License List 3.9, SPDX License List 3.10, SPDX
--   License List 3.16
PolyForm_Small_Business_1_0_0 :: LicenseId

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

-- | <tt>PSF-2.0</tt>, Python Software Foundation License 2.0, SPDX License
--   List 3.9, SPDX License List 3.10, SPDX License List 3.16
PSF_2_0 :: 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>Qhull</tt>, Qhull License
Qhull :: LicenseId

-- | <tt>QPL-1.0</tt>, Q Public License 1.0
QPL_1_0 :: LicenseId

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

-- | <tt>RHeCos-1.1</tt>, Red Hat eCos Public License v1.1
RHeCos_1_1 :: 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>RPSL-1.0</tt>, RealNetworks Public Source License v1.0
RPSL_1_0 :: LicenseId

-- | <tt>RSA-MD</tt>, RSA Message-Digest License
RSA_MD :: LicenseId

-- | <tt>RSCPL</tt>, Ricoh Source Code Public License
RSCPL :: 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>SchemeReport</tt>, Scheme Language Report License, SPDX License
--   List 3.16
SchemeReport :: LicenseId

-- | <tt>Sendmail-8.23</tt>, Sendmail License 8.23, SPDX License List 3.6,
--   SPDX License List 3.9, SPDX License List 3.10, SPDX License List 3.16
Sendmail_8_23 :: 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>SHL-0.51</tt>, Solderpad Hardware License, Version 0.51, SPDX
--   License List 3.6, SPDX License List 3.9, SPDX License List 3.10, SPDX
--   License List 3.16
SHL_0_51 :: LicenseId

-- | <tt>SHL-0.5</tt>, Solderpad Hardware License v0.5, SPDX License List
--   3.6, SPDX License List 3.9, SPDX License List 3.10, SPDX License List
--   3.16
SHL_0_5 :: LicenseId

-- | <tt>SimPL-2.0</tt>, Simple Public License 2.0
SimPL_2_0 :: LicenseId

-- | <tt>SISSL-1.2</tt>, Sun Industry Standards Source License v1.2
SISSL_1_2 :: LicenseId

-- | <tt>SISSL</tt>, Sun Industry Standards Source License v1.1
SISSL :: LicenseId

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

-- | <tt>SMLNJ</tt>, Standard ML of New Jersey License
SMLNJ :: LicenseId

-- | <tt>SMPPL</tt>, Secure Messaging Protocol Public License
SMPPL :: 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>SPL-1.0</tt>, Sun Public License v1.0
SPL_1_0 :: LicenseId

-- | <tt>SSH-OpenSSH</tt>, SSH OpenSSH license, SPDX License List 3.9, SPDX
--   License List 3.10, SPDX License List 3.16
SSH_OpenSSH :: LicenseId

-- | <tt>SSH-short</tt>, SSH short notice, SPDX License List 3.9, SPDX
--   License List 3.10, SPDX License List 3.16
SSH_short :: LicenseId

-- | <tt>SSPL-1.0</tt>, Server Side Public License, v 1, SPDX License List
--   3.6, SPDX License List 3.9, SPDX License List 3.10, SPDX License List
--   3.16
SSPL_1_0 :: LicenseId

-- | <tt>SugarCRM-1.1.3</tt>, SugarCRM Public License v1.1.3
SugarCRM_1_1_3 :: LicenseId

-- | <tt>SWL</tt>, Scheme Widget Library (SWL) Software License Agreement
SWL :: LicenseId

-- | <tt>TAPR-OHL-1.0</tt>, TAPR Open Hardware License v1.0, SPDX License
--   List 3.6, SPDX License List 3.9, SPDX License List 3.10, SPDX License
--   List 3.16
TAPR_OHL_1_0 :: LicenseId

-- | <tt>TCL</tt>, TCL/TK License
TCL :: LicenseId

-- | <tt>TCP-wrappers</tt>, TCP Wrappers License
TCP_wrappers :: 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>TU-Berlin-1.0</tt>, Technische Universitaet Berlin License 1.0,
--   SPDX License List 3.2, SPDX License List 3.6, SPDX License List 3.9,
--   SPDX License List 3.10, SPDX License List 3.16
TU_Berlin_1_0 :: LicenseId

-- | <tt>TU-Berlin-2.0</tt>, Technische Universitaet Berlin License 2.0,
--   SPDX License List 3.2, SPDX License List 3.6, SPDX License List 3.9,
--   SPDX License List 3.10, SPDX License List 3.16
TU_Berlin_2_0 :: LicenseId

-- | <tt>UCL-1.0</tt>, Upstream Compatibility License v1.0, SPDX License
--   List 3.9, SPDX License List 3.10, SPDX License List 3.16
UCL_1_0 :: LicenseId

-- | <tt>Unicode-DFS-2015</tt>, Unicode License Agreement - Data Files and
--   Software (2015)
Unicode_DFS_2015 :: LicenseId

-- | <tt>Unicode-DFS-2016</tt>, Unicode License Agreement - Data Files and
--   Software (2016)
Unicode_DFS_2016 :: LicenseId

-- | <tt>Unicode-TOU</tt>, Unicode Terms of Use
Unicode_TOU :: LicenseId

-- | <tt>Unlicense</tt>, The Unlicense
Unlicense :: LicenseId

-- | <tt>UPL-1.0</tt>, Universal Permissive License v1.0
UPL_1_0 :: 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-19980720</tt>, W3C Software Notice and License (1998-07-20)
W3C_19980720 :: LicenseId

-- | <tt>W3C-20150513</tt>, W3C Software Notice and Document License
--   (2015-05-13)
W3C_20150513 :: LicenseId

-- | <tt>W3C</tt>, W3C Software Notice and License (2002-12-31)
W3C :: LicenseId

-- | <tt>Watcom-1.0</tt>, Sybase Open Watcom Public License 1.0
Watcom_1_0 :: LicenseId

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

-- | <tt>WTFPL</tt>, Do What The F*ck You Want To Public License
WTFPL :: LicenseId

-- | <tt>X11-distribute-modifications-variant</tt>, X11 License
--   Distribution Modification Variant, SPDX License List 3.16
X11_distribute_modifications_variant :: 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>Xnet</tt>, X.Net License
Xnet :: 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-acknowledgement</tt>, zlib/libpng License with
--   Acknowledgement
Zlib_acknowledgement :: LicenseId

-- | <tt>Zlib</tt>, zlib License
Zlib :: 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>"BSD-3-Clause"</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).
--   
--   See <a>https://opensource.org/licenses/alphabetical</a>.
licenseIsOsiApproved :: LicenseId -> Bool

-- | Whether the license is considered libre by Free Software Foundation
--   (FSF).
--   
--   See <a>https://www.gnu.org/licenses/license-list.en.html</a>
licenseIsFsfLibre :: LicenseId -> Bool

-- | Create a <a>LicenseId</a> from a <a>String</a>.
mkLicenseId :: LicenseListVersion -> String -> Maybe LicenseId
licenseIdList :: LicenseListVersion -> [LicenseId]

-- | Help message for migrating from non-SPDX license identifiers.
--   
--   Old <tt>License</tt> is almost SPDX, except for <tt>BSD2</tt>,
--   <tt>BSD3</tt>. This function suggests SPDX variant:
--   
--   <pre>
--   &gt;&gt;&gt; licenseIdMigrationMessage "BSD3"
--   "Do you mean BSD-3-Clause?"
--   </pre>
--   
--   Also <tt>OtherLicense</tt>, <tt>AllRightsReserved</tt>, and
--   <tt>PublicDomain</tt> aren't valid SPDX identifiers
--   
--   <pre>
--   &gt;&gt;&gt; traverse_ (print . licenseIdMigrationMessage) [ "OtherLicense", "AllRightsReserved", "PublicDomain" ]
--   "SPDX license list contains plenty of licenses. See https://spdx.org/licenses/. Also they can be combined into complex expressions with AND and OR."
--   "You can use NONE as a value of license field."
--   "Public Domain is a complex matter. See https://wiki.spdx.org/view/Legal_Team/Decisions/Dealing_with_Public_Domain_within_SPDX_Files. Consider using a proper license."
--   </pre>
--   
--   SPDX License list version 3.0 introduced "-only" and "-or-later"
--   variants for GNU family of licenses. See
--   <a>https://spdx.org/news/news/2018/01/license-list-30-released</a>
--   &gt;&gt;&gt; licenseIdMigrationMessage "GPL-2.0" "SPDX license list
--   3.0 deprecated suffixless variants of GNU family of licenses. Use
--   GPL-2.0-only or GPL-2.0-or-later."
--   
--   For other common licenses their old license format coincides with the
--   SPDX identifiers:
--   
--   <pre>
--   &gt;&gt;&gt; traverse eitherParsec ["GPL-2.0-only", "GPL-3.0-only", "LGPL-2.1-only", "MIT", "ISC", "MPL-2.0", "Apache-2.0"] :: Either String [LicenseId]
--   Right [GPL_2_0_only,GPL_3_0_only,LGPL_2_1_only,MIT,ISC,MPL_2_0,Apache_2_0]
--   </pre>
licenseIdMigrationMessage :: String -> String
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.Utils.Structured.Structured Distribution.SPDX.LicenseId.LicenseId
instance Distribution.Pretty.Pretty Distribution.SPDX.LicenseId.LicenseId
instance Distribution.Parsec.Parsec Distribution.SPDX.LicenseId.LicenseId
instance Control.DeepSeq.NFData Distribution.SPDX.LicenseId.LicenseId

module Distribution.SPDX.LicenseExceptionId

-- | SPDX License Exceptions identifiers list v3.16
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>Bootloader-exception</tt>, Bootloader Distribution Exception
Bootloader_exception :: 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>GPL-3.0-linking-exception</tt>, GPL-3.0 Linking Exception, SPDX
--   License List 3.9, SPDX License List 3.10, SPDX License List 3.16
GPL_3_0_linking_exception :: LicenseExceptionId

-- | <tt>GPL-3.0-linking-source-exception</tt>, GPL-3.0 Linking Exception
--   (with Corresponding Source), SPDX License List 3.9, SPDX License List
--   3.10, SPDX License List 3.16
GPL_3_0_linking_source_exception :: LicenseExceptionId

-- | <tt>GPL-CC-1.0</tt>, GPL Cooperation Commitment 1.0, SPDX License List
--   3.6, SPDX License List 3.9, SPDX License List 3.10, SPDX License List
--   3.16
GPL_CC_1_0 :: LicenseExceptionId

-- | <tt>i2p-gpl-java-exception</tt>, i2p GPL+Java Exception
I2p_gpl_java_exception :: LicenseExceptionId

-- | <tt>LGPL-3.0-linking-exception</tt>, LGPL-3.0 Linking Exception, SPDX
--   License List 3.9, SPDX License List 3.10, SPDX License List 3.16
LGPL_3_0_linking_exception :: LicenseExceptionId

-- | <tt>Libtool-exception</tt>, Libtool Exception
Libtool_exception :: LicenseExceptionId

-- | <tt>Linux-syscall-note</tt>, Linux Syscall Note
Linux_syscall_note :: LicenseExceptionId

-- | <tt>LLVM-exception</tt>, LLVM Exception, SPDX License List 3.2, SPDX
--   License List 3.6, SPDX License List 3.9, SPDX License List 3.10, SPDX
--   License List 3.16
LLVM_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, SPDX
--   License List 3.0, SPDX License List 3.2
Nokia_Qt_exception_1_1 :: LicenseExceptionId

-- | <tt>OCaml-LGPL-linking-exception</tt>, OCaml LGPL Linking Exception,
--   SPDX License List 3.6, SPDX License List 3.9, SPDX License List 3.10,
--   SPDX License List 3.16
OCaml_LGPL_linking_exception :: LicenseExceptionId

-- | <tt>OCCT-exception-1.0</tt>, Open CASCADE Exception 1.0
OCCT_exception_1_0 :: LicenseExceptionId

-- | <tt>OpenJDK-assembly-exception-1.0</tt>, OpenJDK Assembly exception
--   1.0, SPDX License List 3.2, SPDX License List 3.6, SPDX License List
--   3.9, SPDX License List 3.10, SPDX License List 3.16
OpenJDK_assembly_exception_1_0 :: LicenseExceptionId

-- | <tt>openvpn-openssl-exception</tt>, OpenVPN OpenSSL Exception
Openvpn_openssl_exception :: LicenseExceptionId

-- | <tt>PS-or-PDF-font-exception-20170817</tt>, PS/PDF font exception
--   (2017-08-17), SPDX License List 3.2, SPDX License List 3.6, SPDX
--   License List 3.9, SPDX License List 3.10, SPDX License List 3.16
PS_or_PDF_font_exception_20170817 :: LicenseExceptionId

-- | <tt>Qt-GPL-exception-1.0</tt>, Qt GPL exception 1.0, SPDX License List
--   3.2, SPDX License List 3.6, SPDX License List 3.9, SPDX License List
--   3.10, SPDX License List 3.16
Qt_GPL_exception_1_0 :: LicenseExceptionId

-- | <tt>Qt-LGPL-exception-1.1</tt>, Qt LGPL exception 1.1, SPDX License
--   List 3.2, SPDX License List 3.6, SPDX License List 3.9, SPDX License
--   List 3.10, SPDX License List 3.16
Qt_LGPL_exception_1_1 :: LicenseExceptionId

-- | <tt>Qwt-exception-1.0</tt>, Qwt exception 1.0
Qwt_exception_1_0 :: LicenseExceptionId

-- | <tt>SHL-2.0</tt>, Solderpad Hardware License v2.0, SPDX License List
--   3.9, SPDX License List 3.10, SPDX License List 3.16
SHL_2_0 :: LicenseExceptionId

-- | <tt>SHL-2.1</tt>, Solderpad Hardware License v2.1, SPDX License List
--   3.9, SPDX License List 3.10, SPDX License List 3.16
SHL_2_1 :: LicenseExceptionId

-- | <tt>Swift-exception</tt>, Swift Exception, SPDX License List 3.6, SPDX
--   License List 3.9, SPDX License List 3.10, SPDX License List 3.16
Swift_exception :: LicenseExceptionId

-- | <tt>u-boot-exception-2.0</tt>, U-Boot exception 2.0
U_boot_exception_2_0 :: LicenseExceptionId

-- | <tt>Universal-FOSS-exception-1.0</tt>, Universal FOSS Exception,
--   Version 1.0, SPDX License List 3.6, SPDX License List 3.9, SPDX
--   License List 3.10, SPDX License List 3.16
Universal_FOSS_exception_1_0 :: LicenseExceptionId

-- | <tt>WxWindows-exception-3.1</tt>, WxWindows Library Exception 3.1
WxWindows_exception_3_1 :: LicenseExceptionId

-- | License SPDX identifier, e.g. <tt>"BSD-3-Clause"</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 :: LicenseListVersion -> String -> Maybe LicenseExceptionId
licenseExceptionIdList :: LicenseListVersion -> [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.Utils.Structured.Structured Distribution.SPDX.LicenseExceptionId.LicenseExceptionId
instance Distribution.Pretty.Pretty Distribution.SPDX.LicenseExceptionId.LicenseExceptionId
instance Distribution.Parsec.Parsec Distribution.SPDX.LicenseExceptionId.LicenseExceptionId
instance Control.DeepSeq.NFData Distribution.SPDX.LicenseExceptionId.LicenseExceptionId

module Distribution.SPDX.LicenseExpression

-- | SPDX License Expression.
--   
--   <pre>
--   idstring              = 1*(ALPHA / DIGIT / "-" / "." )
--   license id            = &lt;short form license identifier inAppendix I.1&gt;
--   license exception id  = &lt;short form license exception identifier inAppendix I.2&gt;
--   license ref           = ["DocumentRef-"1*(idstring)":"]"LicenseRef-"1*(idstring)
--   
--   simple expression     = license id / license id"+" / license ref
--   
--   compound expression   = 1*1(simple expression /
--                           simple expression "WITH" license exception id /
--                           compound expression "AND" compound expression /
--                           compound expression "OR" compound expression ) /
--                           "(" compound expression ")" )
--   
--   license expression    = 1*1(simple expression / compound expression)
--   </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:
--   <tt>GPL-2.0-only</tt>
ELicenseId :: LicenseId -> SimpleLicenseExpression

-- | An SPDX License List Short Form Identifier with a unary"+" operator
--   suffix to represent the current version of the license or any later
--   version. For example: <tt>GPL-2.0+</tt>
ELicenseIdPlus :: LicenseId -> SimpleLicenseExpression

-- | A SPDX user defined license reference: For example:
--   <tt>LicenseRef-23</tt>, <tt>LicenseRef-MIT-Style-1</tt>, or
--   <tt>DocumentRef-spdx-tool-1.2:LicenseRef-MIT-Style-2</tt>
ELicenseRef :: LicenseRef -> SimpleLicenseExpression
simpleLicenseExpression :: LicenseId -> 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 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 Data.Binary.Class.Binary Distribution.SPDX.LicenseExpression.LicenseExpression
instance Distribution.Utils.Structured.Structured Distribution.SPDX.LicenseExpression.LicenseExpression
instance Distribution.Pretty.Pretty Distribution.SPDX.LicenseExpression.LicenseExpression
instance Distribution.Parsec.Parsec Distribution.SPDX.LicenseExpression.LicenseExpression
instance Control.DeepSeq.NFData Distribution.SPDX.LicenseExpression.LicenseExpression
instance Data.Binary.Class.Binary Distribution.SPDX.LicenseExpression.SimpleLicenseExpression
instance Distribution.Utils.Structured.Structured Distribution.SPDX.LicenseExpression.SimpleLicenseExpression
instance Distribution.Pretty.Pretty Distribution.SPDX.LicenseExpression.SimpleLicenseExpression
instance Distribution.Parsec.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>
--   
--   <i>Note:</i> the NOASSERTION case is omitted.
--   
--   Old <a>License</a> can be migrated using following rules:
--   
--   <ul>
--   <li><tt>AllRightsReserved</tt> and <tt>UnspecifiedLicense</tt> to
--   <a>NONE</a>. No license specified which legally defaults to <i>All
--   Rights Reserved</i>. The package may not be legally modified or
--   redistributed by anyone but the rightsholder.</li>
--   <li><tt>OtherLicense</tt> can be converted to <tt>LicenseRef</tt>
--   pointing to the file in the package.</li>
--   <li><tt>UnknownLicense</tt> i.e. other licenses of the form
--   <tt>name-x.y</tt>, should be covered by SPDX license list, otherwise
--   use <tt>LicenseRef</tt>.</li>
--   <li><tt>PublicDomain</tt> isn't covered. Consider using CC0. See
--   <a>https://wiki.spdx.org/view/Legal_Team/Decisions/Dealing_with_Public_Domain_within_SPDX_Files</a>
--   for more information.</li>
--   </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 Distribution.Utils.Structured.Structured Distribution.SPDX.License.License
instance Control.DeepSeq.NFData Distribution.SPDX.License.License
instance Distribution.Pretty.Pretty Distribution.SPDX.License.License
instance Distribution.Parsec.Parsec Distribution.SPDX.License.License


-- | This module implements SPDX specification version 2.1 with a version
--   3.0 license list.
--   
--   Specification 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>
--   
--   <i>Note:</i> the NOASSERTION case is omitted.
--   
--   Old <a>License</a> can be migrated using following rules:
--   
--   <ul>
--   <li><tt>AllRightsReserved</tt> and <tt>UnspecifiedLicense</tt> to
--   <a>NONE</a>. No license specified which legally defaults to <i>All
--   Rights Reserved</i>. The package may not be legally modified or
--   redistributed by anyone but the rightsholder.</li>
--   <li><tt>OtherLicense</tt> can be converted to <tt>LicenseRef</tt>
--   pointing to the file in the package.</li>
--   <li><tt>UnknownLicense</tt> i.e. other licenses of the form
--   <tt>name-x.y</tt>, should be covered by SPDX license list, otherwise
--   use <tt>LicenseRef</tt>.</li>
--   <li><tt>PublicDomain</tt> isn't covered. Consider using CC0. See
--   <a>https://wiki.spdx.org/view/Legal_Team/Decisions/Dealing_with_Public_Domain_within_SPDX_Files</a>
--   for more information.</li>
--   </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.
--   
--   <pre>
--   idstring              = 1*(ALPHA / DIGIT / "-" / "." )
--   license id            = &lt;short form license identifier inAppendix I.1&gt;
--   license exception id  = &lt;short form license exception identifier inAppendix I.2&gt;
--   license ref           = ["DocumentRef-"1*(idstring)":"]"LicenseRef-"1*(idstring)
--   
--   simple expression     = license id / license id"+" / license ref
--   
--   compound expression   = 1*1(simple expression /
--                           simple expression "WITH" license exception id /
--                           compound expression "AND" compound expression /
--                           compound expression "OR" compound expression ) /
--                           "(" compound expression ")" )
--   
--   license expression    = 1*1(simple expression / compound expression)
--   </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:
--   <tt>GPL-2.0-only</tt>
ELicenseId :: LicenseId -> SimpleLicenseExpression

-- | An SPDX License List Short Form Identifier with a unary"+" operator
--   suffix to represent the current version of the license or any later
--   version. For example: <tt>GPL-2.0+</tt>
ELicenseIdPlus :: LicenseId -> SimpleLicenseExpression

-- | A SPDX user defined license reference: For example:
--   <tt>LicenseRef-23</tt>, <tt>LicenseRef-MIT-Style-1</tt>, or
--   <tt>DocumentRef-spdx-tool-1.2:LicenseRef-MIT-Style-2</tt>
ELicenseRef :: LicenseRef -> SimpleLicenseExpression
simpleLicenseExpression :: LicenseId -> LicenseExpression

-- | SPDX License identifiers list v3.16
data LicenseId

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

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

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

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

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

-- | <tt>ADSL</tt>, Amazon Digital Services License
ADSL :: 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>Afmparse</tt>, Afmparse License
Afmparse :: LicenseId

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

-- | <tt>AGPL-1.0-only</tt>, Affero General Public License v1.0 only, SPDX
--   License List 3.2, SPDX License List 3.6, SPDX License List 3.9, SPDX
--   License List 3.10, SPDX License List 3.16
AGPL_1_0_only :: LicenseId

-- | <tt>AGPL-1.0-or-later</tt>, Affero General Public License v1.0 or
--   later, SPDX License List 3.2, SPDX License List 3.6, SPDX License List
--   3.9, SPDX License List 3.10, SPDX License List 3.16
AGPL_1_0_or_later :: LicenseId

-- | <tt>AGPL-3.0-only</tt>, GNU Affero General Public License v3.0 only
AGPL_3_0_only :: LicenseId

-- | <tt>AGPL-3.0-or-later</tt>, GNU Affero General Public License v3.0 or
--   later
AGPL_3_0_or_later :: LicenseId

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

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

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

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

-- | <tt>ANTLR-PD-fallback</tt>, ANTLR Software Rights Notice with license
--   fallback, SPDX License List 3.16
ANTLR_PD_fallback :: 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>APAFML</tt>, Adobe Postscript AFM License
APAFML :: LicenseId

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

-- | <tt>App-s2p</tt>, App::s2p License, SPDX License List 3.16
App_s2p :: 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-cl8</tt>, Artistic License 1.0 w/clause 8
Artistic_1_0_cl8 :: LicenseId

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

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

-- | <tt>Artistic-2.0</tt>, Artistic License 2.0
Artistic_2_0 :: 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>blessing</tt>, SQLite Blessing, SPDX License List 3.6, SPDX
--   License List 3.9, SPDX License List 3.10, SPDX License List 3.16
Blessing :: LicenseId

-- | <tt>BlueOak-1.0.0</tt>, Blue Oak Model License 1.0.0, SPDX License
--   List 3.6, SPDX License List 3.9, SPDX License List 3.10, SPDX License
--   List 3.16
BlueOak_1_0_0 :: LicenseId

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

-- | <tt>BSD-1-Clause</tt>, BSD 1-Clause License
BSD_1_Clause :: LicenseId

-- | <tt>BSD-2-Clause-FreeBSD</tt>, BSD 2-Clause FreeBSD License, SPDX
--   License List 3.0, SPDX License List 3.2, SPDX License List 3.6, SPDX
--   License List 3.9
BSD_2_Clause_FreeBSD :: LicenseId

-- | <tt>BSD-2-Clause-NetBSD</tt>, BSD 2-Clause NetBSD License, SPDX
--   License List 3.0, SPDX License List 3.2, SPDX License List 3.6
BSD_2_Clause_NetBSD :: LicenseId

-- | <tt>BSD-2-Clause-Patent</tt>, BSD-2-Clause Plus Patent License
BSD_2_Clause_Patent :: LicenseId

-- | <tt>BSD-2-Clause-Views</tt>, BSD 2-Clause with views sentence, SPDX
--   License List 3.10, SPDX License List 3.16
BSD_2_Clause_Views :: LicenseId

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

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

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

-- | <tt>BSD-3-Clause-LBNL</tt>, Lawrence Berkeley National Labs BSD
--   variant license
BSD_3_Clause_LBNL :: LicenseId

-- | <tt>BSD-3-Clause-Modification</tt>, BSD 3-Clause Modification, SPDX
--   License List 3.16
BSD_3_Clause_Modification :: LicenseId

-- | <tt>BSD-3-Clause-No-Military-License</tt>, BSD 3-Clause No Military
--   License, SPDX License List 3.16
BSD_3_Clause_No_Military_License :: LicenseId

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

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

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

-- | <tt>BSD-3-Clause-Open-MPI</tt>, BSD 3-Clause Open MPI variant, SPDX
--   License List 3.6, SPDX License List 3.9, SPDX License List 3.10, SPDX
--   License List 3.16
BSD_3_Clause_Open_MPI :: LicenseId

-- | <tt>BSD-3-Clause</tt>, BSD 3-Clause <a>New</a> or <a>Revised</a>
--   License
BSD_3_Clause :: LicenseId

-- | <tt>BSD-4-Clause-Shortened</tt>, BSD 4 Clause Shortened, SPDX License
--   List 3.16
BSD_4_Clause_Shortened :: LicenseId

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

-- | <tt>BSD-4-Clause</tt>, BSD 4-Clause <a>Original</a> or <a>Old</a>
--   License
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>BSL-1.0</tt>, Boost Software License 1.0
BSL_1_0 :: LicenseId

-- | <tt>bzip2-1.0.5</tt>, bzip2 and libbzip2 License v1.0.5, SPDX License
--   List 3.0, SPDX License List 3.2, SPDX License List 3.6, SPDX License
--   List 3.9, SPDX License List 3.10
Bzip2_1_0_5 :: LicenseId

-- | <tt>BUSL-1.1</tt>, Business Source License 1.1, SPDX License List 3.16
BUSL_1_1 :: LicenseId

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

-- | <tt>C-UDA-1.0</tt>, Computational Use of Data Agreement v1.0, SPDX
--   License List 3.16
C_UDA_1_0 :: LicenseId

-- | <tt>CAL-1.0-Combined-Work-Exception</tt>, Cryptographic Autonomy
--   License 1.0 (Combined Work Exception), SPDX License List 3.9, SPDX
--   License List 3.10, SPDX License List 3.16
CAL_1_0_Combined_Work_Exception :: LicenseId

-- | <tt>CAL-1.0</tt>, Cryptographic Autonomy License 1.0, SPDX License
--   List 3.9, SPDX License List 3.10, SPDX License List 3.16
CAL_1_0 :: LicenseId

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

-- | <tt>CATOSL-1.1</tt>, Computer Associates Trusted Open Source License
--   1.1
CATOSL_1_1 :: LicenseId

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

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

-- | <tt>CC-BY-2.5-AU</tt>, Creative Commons Attribution 2.5 Australia,
--   SPDX License List 3.16
CC_BY_2_5_AU :: LicenseId

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

-- | <tt>CC-BY-3.0-AT</tt>, Creative Commons Attribution 3.0 Austria, SPDX
--   License List 3.10, SPDX License List 3.16
CC_BY_3_0_AT :: LicenseId

-- | <tt>CC-BY-3.0-DE</tt>, Creative Commons Attribution 3.0 Germany, SPDX
--   License List 3.16
CC_BY_3_0_DE :: LicenseId

-- | <tt>CC-BY-3.0-NL</tt>, Creative Commons Attribution 3.0 Netherlands,
--   SPDX License List 3.16
CC_BY_3_0_NL :: LicenseId

-- | <tt>CC-BY-3.0-US</tt>, Creative Commons Attribution 3.0 United States,
--   SPDX License List 3.16
CC_BY_3_0_US :: LicenseId

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

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

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

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

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

-- | <tt>CC-BY-NC-3.0-DE</tt>, Creative Commons Attribution Non Commercial
--   3.0 Germany, SPDX License List 3.16
CC_BY_NC_3_0_DE :: LicenseId

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

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

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

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

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

-- | <tt>CC-BY-NC-ND-3.0-DE</tt>, Creative Commons Attribution Non
--   Commercial No Derivatives 3.0 Germany, SPDX License List 3.16
CC_BY_NC_ND_3_0_DE :: LicenseId

-- | <tt>CC-BY-NC-ND-3.0-IGO</tt>, Creative Commons Attribution Non
--   Commercial No Derivatives 3.0 IGO, SPDX License List 3.10, SPDX
--   License List 3.16
CC_BY_NC_ND_3_0_IGO :: LicenseId

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

-- | <tt>CC-BY-NC-ND-4.0</tt>, Creative Commons Attribution Non Commercial
--   No Derivatives 4.0 International
CC_BY_NC_ND_4_0 :: LicenseId

-- | <tt>CC-BY-NC-SA-1.0</tt>, Creative Commons Attribution Non Commercial
--   Share Alike 1.0 Generic
CC_BY_NC_SA_1_0 :: LicenseId

-- | <tt>CC-BY-NC-SA-2.0-FR</tt>, Creative Commons
--   Attribution-NonCommercial-ShareAlike 2.0 France, SPDX License List
--   3.16
CC_BY_NC_SA_2_0_FR :: LicenseId

-- | <tt>CC-BY-NC-SA-2.0-UK</tt>, Creative Commons Attribution Non
--   Commercial Share Alike 2.0 England and Wales, SPDX License List 3.16
CC_BY_NC_SA_2_0_UK :: LicenseId

-- | <tt>CC-BY-NC-SA-2.0</tt>, Creative Commons Attribution Non Commercial
--   Share Alike 2.0 Generic
CC_BY_NC_SA_2_0 :: LicenseId

-- | <tt>CC-BY-NC-SA-2.5</tt>, Creative Commons Attribution Non Commercial
--   Share Alike 2.5 Generic
CC_BY_NC_SA_2_5 :: LicenseId

-- | <tt>CC-BY-NC-SA-3.0-DE</tt>, Creative Commons Attribution Non
--   Commercial Share Alike 3.0 Germany, SPDX License List 3.16
CC_BY_NC_SA_3_0_DE :: LicenseId

-- | <tt>CC-BY-NC-SA-3.0-IGO</tt>, Creative Commons Attribution Non
--   Commercial Share Alike 3.0 IGO, SPDX License List 3.16
CC_BY_NC_SA_3_0_IGO :: LicenseId

-- | <tt>CC-BY-NC-SA-3.0</tt>, Creative Commons Attribution Non Commercial
--   Share Alike 3.0 Unported
CC_BY_NC_SA_3_0 :: LicenseId

-- | <tt>CC-BY-NC-SA-4.0</tt>, Creative Commons Attribution Non Commercial
--   Share Alike 4.0 International
CC_BY_NC_SA_4_0 :: LicenseId

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

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

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

-- | <tt>CC-BY-ND-3.0-DE</tt>, Creative Commons Attribution No Derivatives
--   3.0 Germany, SPDX License List 3.16
CC_BY_ND_3_0_DE :: LicenseId

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

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

-- | <tt>CC-BY-SA-1.0</tt>, Creative Commons Attribution Share Alike 1.0
--   Generic
CC_BY_SA_1_0 :: LicenseId

-- | <tt>CC-BY-SA-2.0-UK</tt>, Creative Commons Attribution Share Alike 2.0
--   England and Wales, SPDX License List 3.16
CC_BY_SA_2_0_UK :: LicenseId

-- | <tt>CC-BY-SA-2.0</tt>, Creative Commons Attribution Share Alike 2.0
--   Generic
CC_BY_SA_2_0 :: LicenseId

-- | <tt>CC-BY-SA-2.1-JP</tt>, Creative Commons Attribution Share Alike 2.1
--   Japan, SPDX License List 3.16
CC_BY_SA_2_1_JP :: LicenseId

-- | <tt>CC-BY-SA-2.5</tt>, Creative Commons Attribution Share Alike 2.5
--   Generic
CC_BY_SA_2_5 :: LicenseId

-- | <tt>CC-BY-SA-3.0-AT</tt>, Creative Commons Attribution Share Alike 3.0
--   Austria, SPDX License List 3.10, SPDX License List 3.16
CC_BY_SA_3_0_AT :: LicenseId

-- | <tt>CC-BY-SA-3.0-DE</tt>, Creative Commons Attribution Share Alike 3.0
--   Germany, SPDX License List 3.16
CC_BY_SA_3_0_DE :: LicenseId

-- | <tt>CC-BY-SA-3.0</tt>, Creative Commons Attribution Share Alike 3.0
--   Unported
CC_BY_SA_3_0 :: LicenseId

-- | <tt>CC-BY-SA-4.0</tt>, Creative Commons Attribution Share Alike 4.0
--   International
CC_BY_SA_4_0 :: LicenseId

-- | <tt>CC-PDDC</tt>, Creative Commons Public Domain Dedication and
--   Certification, SPDX License List 3.6, SPDX License List 3.9, SPDX
--   License List 3.10, SPDX License List 3.16
CC_PDDC :: LicenseId

-- | <tt>CC0-1.0</tt>, Creative Commons Zero v1.0 Universal
CC0_1_0 :: 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>CDL-1.0</tt>, Common Documentation License 1.0, SPDX License List
--   3.16
CDL_1_0 :: LicenseId

-- | <tt>CDLA-Permissive-1.0</tt>, Community Data License Agreement
--   Permissive 1.0
CDLA_Permissive_1_0 :: LicenseId

-- | <tt>CDLA-Permissive-2.0</tt>, Community Data License Agreement
--   Permissive 2.0, SPDX License List 3.16
CDLA_Permissive_2_0 :: LicenseId

-- | <tt>CDLA-Sharing-1.0</tt>, Community Data License Agreement Sharing
--   1.0
CDLA_Sharing_1_0 :: 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>CERN-OHL-1.1</tt>, CERN Open Hardware Licence v1.1, SPDX License
--   List 3.6, SPDX License List 3.9, SPDX License List 3.10, SPDX License
--   List 3.16
CERN_OHL_1_1 :: LicenseId

-- | <tt>CERN-OHL-1.2</tt>, CERN Open Hardware Licence v1.2, SPDX License
--   List 3.6, SPDX License List 3.9, SPDX License List 3.10, SPDX License
--   List 3.16
CERN_OHL_1_2 :: LicenseId

-- | <tt>CERN-OHL-P-2.0</tt>, CERN Open Hardware Licence Version 2 -
--   Permissive, SPDX License List 3.9, SPDX License List 3.10, SPDX
--   License List 3.16
CERN_OHL_P_2_0 :: LicenseId

-- | <tt>CERN-OHL-S-2.0</tt>, CERN Open Hardware Licence Version 2 -
--   Strongly Reciprocal, SPDX License List 3.9, SPDX License List 3.10,
--   SPDX License List 3.16
CERN_OHL_S_2_0 :: LicenseId

-- | <tt>CERN-OHL-W-2.0</tt>, CERN Open Hardware Licence Version 2 - Weakly
--   Reciprocal, SPDX License List 3.9, SPDX License List 3.10, SPDX
--   License List 3.16
CERN_OHL_W_2_0 :: LicenseId

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

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

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

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

-- | <tt>COIL-1.0</tt>, Copyfree Open Innovation License, SPDX License List
--   3.16
COIL_1_0 :: LicenseId

-- | <tt>Community-Spec-1.0</tt>, Community Specification License 1.0, SPDX
--   License List 3.16
Community_Spec_1_0 :: LicenseId

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

-- | <tt>copyleft-next-0.3.0</tt>, copyleft-next 0.3.0, SPDX License List
--   3.6, SPDX License List 3.9, SPDX License List 3.10, SPDX License List
--   3.16
Copyleft_next_0_3_0 :: LicenseId

-- | <tt>copyleft-next-0.3.1</tt>, copyleft-next 0.3.1, SPDX License List
--   3.6, SPDX License List 3.9, SPDX License List 3.10, SPDX License List
--   3.16
Copyleft_next_0_3_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>CPOL-1.02</tt>, Code Project Open License 1.02
CPOL_1_02 :: 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>DL-DE-BY-2.0</tt>, Data licence Germany – attribution – version
--   2.0, SPDX License List 3.16
DL_DE_BY_2_0 :: LicenseId

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

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

-- | <tt>DRL-1.0</tt>, Detection Rule License 1.0, SPDX License List 3.16
DRL_1_0 :: LicenseId

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

-- | <tt>dvipdfm</tt>, dvipdfm License
Dvipdfm :: 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>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>eGenix</tt>, eGenix.com Public License 1.1.0
EGenix :: LicenseId

-- | <tt>Elastic-2.0</tt>, Elastic License 2.0, SPDX License List 3.16
Elastic_2_0 :: LicenseId

-- | <tt>Entessa</tt>, Entessa Public License v1.0
Entessa :: LicenseId

-- | <tt>EPICS</tt>, EPICS Open License, SPDX License List 3.10, SPDX
--   License List 3.16
EPICS :: LicenseId

-- | <tt>EPL-1.0</tt>, Eclipse Public License 1.0
EPL_1_0 :: LicenseId

-- | <tt>EPL-2.0</tt>, Eclipse Public License 2.0
EPL_2_0 :: LicenseId

-- | <tt>ErlPL-1.1</tt>, Erlang Public License v1.1
ErlPL_1_1 :: LicenseId

-- | <tt>etalab-2.0</tt>, Etalab Open License 2.0, SPDX License List 3.9,
--   SPDX License List 3.10, SPDX License List 3.16
Etalab_2_0 :: 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>EUPL-1.2</tt>, European Union Public License 1.2
EUPL_1_2 :: LicenseId

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

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

-- | <tt>FDK-AAC</tt>, Fraunhofer FDK AAC Codec Library, SPDX License List
--   3.16
FDK_AAC :: LicenseId

-- | <tt>Frameworx-1.0</tt>, Frameworx Open License 1.0
Frameworx_1_0 :: LicenseId

-- | <tt>FreeBSD-DOC</tt>, FreeBSD Documentation License, SPDX License List
--   3.16
FreeBSD_DOC :: LicenseId

-- | <tt>FreeImage</tt>, FreeImage Public License v1.0
FreeImage :: LicenseId

-- | <tt>FSFAP</tt>, FSF All Permissive License
FSFAP :: LicenseId

-- | <tt>FSFULLR</tt>, FSF Unlimited License (with License Retention)
FSFULLR :: LicenseId

-- | <tt>FSFUL</tt>, FSF Unlimited License
FSFUL :: LicenseId

-- | <tt>FTL</tt>, Freetype Project License
FTL :: LicenseId

-- | <tt>GD</tt>, GD License, SPDX License List 3.16
GD :: LicenseId

-- | <tt>GFDL-1.1-invariants-only</tt>, GNU Free Documentation License v1.1
--   only - invariants, SPDX License List 3.10, SPDX License List 3.16
GFDL_1_1_invariants_only :: LicenseId

-- | <tt>GFDL-1.1-invariants-or-later</tt>, GNU Free Documentation License
--   v1.1 or later - invariants, SPDX License List 3.10, SPDX License List
--   3.16
GFDL_1_1_invariants_or_later :: LicenseId

-- | <tt>GFDL-1.1-no-invariants-only</tt>, GNU Free Documentation License
--   v1.1 only - no invariants, SPDX License List 3.10, SPDX License List
--   3.16
GFDL_1_1_no_invariants_only :: LicenseId

-- | <tt>GFDL-1.1-no-invariants-or-later</tt>, GNU Free Documentation
--   License v1.1 or later - no invariants, SPDX License List 3.10, SPDX
--   License List 3.16
GFDL_1_1_no_invariants_or_later :: LicenseId

-- | <tt>GFDL-1.1-only</tt>, GNU Free Documentation License v1.1 only
GFDL_1_1_only :: LicenseId

-- | <tt>GFDL-1.1-or-later</tt>, GNU Free Documentation License v1.1 or
--   later
GFDL_1_1_or_later :: LicenseId

-- | <tt>GFDL-1.2-invariants-only</tt>, GNU Free Documentation License v1.2
--   only - invariants, SPDX License List 3.10, SPDX License List 3.16
GFDL_1_2_invariants_only :: LicenseId

-- | <tt>GFDL-1.2-invariants-or-later</tt>, GNU Free Documentation License
--   v1.2 or later - invariants, SPDX License List 3.10, SPDX License List
--   3.16
GFDL_1_2_invariants_or_later :: LicenseId

-- | <tt>GFDL-1.2-no-invariants-only</tt>, GNU Free Documentation License
--   v1.2 only - no invariants, SPDX License List 3.10, SPDX License List
--   3.16
GFDL_1_2_no_invariants_only :: LicenseId

-- | <tt>GFDL-1.2-no-invariants-or-later</tt>, GNU Free Documentation
--   License v1.2 or later - no invariants, SPDX License List 3.10, SPDX
--   License List 3.16
GFDL_1_2_no_invariants_or_later :: LicenseId

-- | <tt>GFDL-1.2-only</tt>, GNU Free Documentation License v1.2 only
GFDL_1_2_only :: LicenseId

-- | <tt>GFDL-1.2-or-later</tt>, GNU Free Documentation License v1.2 or
--   later
GFDL_1_2_or_later :: LicenseId

-- | <tt>GFDL-1.3-invariants-only</tt>, GNU Free Documentation License v1.3
--   only - invariants, SPDX License List 3.10, SPDX License List 3.16
GFDL_1_3_invariants_only :: LicenseId

-- | <tt>GFDL-1.3-invariants-or-later</tt>, GNU Free Documentation License
--   v1.3 or later - invariants, SPDX License List 3.10, SPDX License List
--   3.16
GFDL_1_3_invariants_or_later :: LicenseId

-- | <tt>GFDL-1.3-no-invariants-only</tt>, GNU Free Documentation License
--   v1.3 only - no invariants, SPDX License List 3.10, SPDX License List
--   3.16
GFDL_1_3_no_invariants_only :: LicenseId

-- | <tt>GFDL-1.3-no-invariants-or-later</tt>, GNU Free Documentation
--   License v1.3 or later - no invariants, SPDX License List 3.10, SPDX
--   License List 3.16
GFDL_1_3_no_invariants_or_later :: LicenseId

-- | <tt>GFDL-1.3-only</tt>, GNU Free Documentation License v1.3 only
GFDL_1_3_only :: LicenseId

-- | <tt>GFDL-1.3-or-later</tt>, GNU Free Documentation License v1.3 or
--   later
GFDL_1_3_or_later :: LicenseId

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

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

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

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

-- | <tt>GLWTPL</tt>, Good Luck With That Public License, SPDX License List
--   3.10, SPDX License List 3.16
GLWTPL :: LicenseId

-- | <tt>gnuplot</tt>, gnuplot License
Gnuplot :: LicenseId

-- | <tt>GPL-1.0-only</tt>, GNU General Public License v1.0 only
GPL_1_0_only :: LicenseId

-- | <tt>GPL-1.0-or-later</tt>, GNU General Public License v1.0 or later
GPL_1_0_or_later :: LicenseId

-- | <tt>GPL-2.0-only</tt>, GNU General Public License v2.0 only
GPL_2_0_only :: LicenseId

-- | <tt>GPL-2.0-or-later</tt>, GNU General Public License v2.0 or later
GPL_2_0_or_later :: LicenseId

-- | <tt>GPL-3.0-only</tt>, GNU General Public License v3.0 only
GPL_3_0_only :: LicenseId

-- | <tt>GPL-3.0-or-later</tt>, GNU General Public License v3.0 or later
GPL_3_0_or_later :: 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>Hippocratic-2.1</tt>, Hippocratic License 2.1, SPDX License List
--   3.9, SPDX License List 3.10, SPDX License List 3.16
Hippocratic_2_1 :: LicenseId

-- | <tt>HPND-sell-variant</tt>, Historical Permission Notice and
--   Disclaimer - sell variant, SPDX License List 3.6, SPDX License List
--   3.9, SPDX License List 3.10, SPDX License List 3.16
HPND_sell_variant :: LicenseId

-- | <tt>HPND</tt>, Historical Permission Notice and Disclaimer
HPND :: LicenseId

-- | <tt>HTMLTIDY</tt>, HTML Tidy License, SPDX License List 3.16
HTMLTIDY :: LicenseId

-- | <tt>IBM-pibs</tt>, IBM PowerPC Initialization and Boot Software
IBM_pibs :: LicenseId

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

-- | <tt>IJG</tt>, Independent JPEG Group License
IJG :: 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>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>IPL-1.0</tt>, IBM Public License v1.0
IPL_1_0 :: LicenseId

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

-- | <tt>Jam</tt>, Jam License, SPDX License List 3.16
Jam :: LicenseId

-- | <tt>JasPer-2.0</tt>, JasPer License
JasPer_2_0 :: LicenseId

-- | <tt>JPNIC</tt>, Japan Network Information Center License, SPDX License
--   List 3.6, SPDX License List 3.9, SPDX License List 3.10, SPDX License
--   List 3.16
JPNIC :: LicenseId

-- | <tt>JSON</tt>, JSON License
JSON :: 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>Latex2e</tt>, Latex2e License
Latex2e :: LicenseId

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

-- | <tt>LGPL-2.0-only</tt>, GNU Library General Public License v2 only
LGPL_2_0_only :: LicenseId

-- | <tt>LGPL-2.0-or-later</tt>, GNU Library General Public License v2 or
--   later
LGPL_2_0_or_later :: LicenseId

-- | <tt>LGPL-2.1-only</tt>, GNU Lesser General Public License v2.1 only
LGPL_2_1_only :: LicenseId

-- | <tt>LGPL-2.1-or-later</tt>, GNU Lesser General Public License v2.1 or
--   later
LGPL_2_1_or_later :: LicenseId

-- | <tt>LGPL-3.0-only</tt>, GNU Lesser General Public License v3.0 only
LGPL_3_0_only :: LicenseId

-- | <tt>LGPL-3.0-or-later</tt>, GNU Lesser General Public License v3.0 or
--   later
LGPL_3_0_or_later :: LicenseId

-- | <tt>LGPLLR</tt>, Lesser General Public License For Linguistic
--   Resources
LGPLLR :: LicenseId

-- | <tt>libpng-2.0</tt>, PNG Reference Library version 2, SPDX License
--   List 3.6, SPDX License List 3.9, SPDX License List 3.10, SPDX License
--   List 3.16
Libpng_2_0 :: LicenseId

-- | <tt>Libpng</tt>, libpng License
Libpng :: LicenseId

-- | <tt>libselinux-1.0</tt>, libselinux public domain notice, SPDX License
--   List 3.9, SPDX License List 3.10, SPDX License List 3.16
Libselinux_1_0 :: LicenseId

-- | <tt>libtiff</tt>, libtiff License
Libtiff :: LicenseId

-- | <tt>LiLiQ-P-1.1</tt>, Licence Libre du Québec – Permissive version 1.1
LiLiQ_P_1_1 :: LicenseId

-- | <tt>LiLiQ-R-1.1</tt>, Licence Libre du Québec – Réciprocité version
--   1.1
LiLiQ_R_1_1 :: LicenseId

-- | <tt>LiLiQ-Rplus-1.1</tt>, Licence Libre du Québec – Réciprocité forte
--   version 1.1
LiLiQ_Rplus_1_1 :: LicenseId

-- | <tt>Linux-man-pages-copyleft</tt>, Linux man-pages Copyleft, SPDX
--   License List 3.16
Linux_man_pages_copyleft :: LicenseId

-- | <tt>Linux-OpenIB</tt>, Linux Kernel Variant of OpenIB.org license,
--   SPDX License List 3.2, SPDX License List 3.6, SPDX License List 3.9,
--   SPDX License List 3.10, SPDX License List 3.16
Linux_OpenIB :: 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>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>MakeIndex</tt>, MakeIndex License
MakeIndex :: LicenseId

-- | <tt>MirOS</tt>, The MirOS Licence
MirOS :: LicenseId

-- | <tt>MIT-0</tt>, MIT No Attribution, SPDX License List 3.2, SPDX
--   License List 3.6, SPDX License List 3.9, SPDX License List 3.10, SPDX
--   License List 3.16
MIT_0 :: LicenseId

-- | <tt>MIT-advertising</tt>, Enlightenment License (e16)
MIT_advertising :: LicenseId

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

-- | <tt>MIT-enna</tt>, enna License
MIT_enna :: LicenseId

-- | <tt>MIT-feh</tt>, feh License
MIT_feh :: LicenseId

-- | <tt>MIT-Modern-Variant</tt>, MIT License Modern Variant, SPDX License
--   List 3.16
MIT_Modern_Variant :: LicenseId

-- | <tt>MIT-open-group</tt>, MIT Open Group variant, SPDX License List
--   3.16
MIT_open_group :: 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>mpich2</tt>, mpich2 License
Mpich2 :: 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-no-copyleft-exception</tt>, Mozilla Public License 2.0 (no
--   copyleft exception)
MPL_2_0_no_copyleft_exception :: LicenseId

-- | <tt>MPL-2.0</tt>, Mozilla Public License 2.0
MPL_2_0 :: LicenseId

-- | <tt>MS-PL</tt>, Microsoft Public License
MS_PL :: LicenseId

-- | <tt>MS-RL</tt>, Microsoft Reciprocal License
MS_RL :: LicenseId

-- | <tt>MTLL</tt>, Matrix Template Library License
MTLL :: LicenseId

-- | <tt>MulanPSL-1.0</tt>, Mulan Permissive Software License, Version 1,
--   SPDX License List 3.9, SPDX License List 3.10, SPDX License List 3.16
MulanPSL_1_0 :: LicenseId

-- | <tt>MulanPSL-2.0</tt>, Mulan Permissive Software License, Version 2,
--   SPDX License List 3.9, SPDX License List 3.10, SPDX License List 3.16
MulanPSL_2_0 :: LicenseId

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

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

-- | <tt>NAIST-2003</tt>, Nara Institute of Science and Technology License
--   (2003), SPDX License List 3.16
NAIST_2003 :: 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>NCGL-UK-2.0</tt>, Non-Commercial Government Licence, SPDX License
--   List 3.9, SPDX License List 3.10, SPDX License List 3.16
NCGL_UK_2_0 :: LicenseId

-- | <tt>NCSA</tt>, University of Illinois/NCSA Open Source License
NCSA :: LicenseId

-- | <tt>Net-SNMP</tt>, Net-SNMP License
Net_SNMP :: LicenseId

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

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

-- | <tt>NGPL</tt>, Nethack General Public License
NGPL :: LicenseId

-- | <tt>NIST-PD-fallback</tt>, NIST Public Domain Notice with license
--   fallback, SPDX License List 3.10, SPDX License List 3.16
NIST_PD_fallback :: LicenseId

-- | <tt>NIST-PD</tt>, NIST Public Domain Notice, SPDX License List 3.10,
--   SPDX License List 3.16
NIST_PD :: LicenseId

-- | <tt>NLOD-1.0</tt>, Norwegian Licence for Open Government Data (NLOD)
--   1.0
NLOD_1_0 :: LicenseId

-- | <tt>NLOD-2.0</tt>, Norwegian Licence for Open Government Data (NLOD)
--   2.0, SPDX License List 3.16
NLOD_2_0 :: LicenseId

-- | <tt>NLPL</tt>, No Limit Public License
NLPL :: LicenseId

-- | <tt>Nokia</tt>, Nokia Open Source License
Nokia :: LicenseId

-- | <tt>NOSL</tt>, Netizen Open Source License
NOSL :: LicenseId

-- | <tt>Noweb</tt>, Noweb License
Noweb :: 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>NPOSL-3.0</tt>, Non-Profit Open Software License 3.0
NPOSL_3_0 :: LicenseId

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

-- | <tt>NTP-0</tt>, NTP No Attribution, SPDX License List 3.9, SPDX
--   License List 3.10, SPDX License List 3.16
NTP_0 :: LicenseId

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

-- | <tt>O-UDA-1.0</tt>, Open Use of Data Agreement v1.0, SPDX License List
--   3.9, SPDX License List 3.10, SPDX License List 3.16
O_UDA_1_0 :: LicenseId

-- | <tt>OCCT-PL</tt>, Open CASCADE Technology Public License
OCCT_PL :: LicenseId

-- | <tt>OCLC-2.0</tt>, OCLC Research Public License 2.0
OCLC_2_0 :: LicenseId

-- | <tt>ODbL-1.0</tt>, Open Data Commons Open Database License v1.0
ODbL_1_0 :: LicenseId

-- | <tt>ODC-By-1.0</tt>, Open Data Commons Attribution License v1.0, SPDX
--   License List 3.2, SPDX License List 3.6, SPDX License List 3.9, SPDX
--   License List 3.10, SPDX License List 3.16
ODC_By_1_0 :: LicenseId

-- | <tt>OFL-1.0-no-RFN</tt>, SIL Open Font License 1.0 with no Reserved
--   Font Name, SPDX License List 3.9, SPDX License List 3.10, SPDX License
--   List 3.16
OFL_1_0_no_RFN :: LicenseId

-- | <tt>OFL-1.0-RFN</tt>, SIL Open Font License 1.0 with Reserved Font
--   Name, SPDX License List 3.9, SPDX License List 3.10, SPDX License List
--   3.16
OFL_1_0_RFN :: LicenseId

-- | <tt>OFL-1.0</tt>, SIL Open Font License 1.0
OFL_1_0 :: LicenseId

-- | <tt>OFL-1.1-no-RFN</tt>, SIL Open Font License 1.1 with no Reserved
--   Font Name, SPDX License List 3.9, SPDX License List 3.10, SPDX License
--   List 3.16
OFL_1_1_no_RFN :: LicenseId

-- | <tt>OFL-1.1-RFN</tt>, SIL Open Font License 1.1 with Reserved Font
--   Name, SPDX License List 3.9, SPDX License List 3.10, SPDX License List
--   3.16
OFL_1_1_RFN :: LicenseId

-- | <tt>OFL-1.1</tt>, SIL Open Font License 1.1
OFL_1_1 :: LicenseId

-- | <tt>OGC-1.0</tt>, OGC Software License, Version 1.0, SPDX License List
--   3.9, SPDX License List 3.10, SPDX License List 3.16
OGC_1_0 :: LicenseId

-- | <tt>OGDL-Taiwan-1.0</tt>, Taiwan Open Government Data License, version
--   1.0, SPDX License List 3.16
OGDL_Taiwan_1_0 :: LicenseId

-- | <tt>OGL-Canada-2.0</tt>, Open Government Licence - Canada, SPDX
--   License List 3.9, SPDX License List 3.10, SPDX License List 3.16
OGL_Canada_2_0 :: LicenseId

-- | <tt>OGL-UK-1.0</tt>, Open Government Licence v1.0, SPDX License List
--   3.6, SPDX License List 3.9, SPDX License List 3.10, SPDX License List
--   3.16
OGL_UK_1_0 :: LicenseId

-- | <tt>OGL-UK-2.0</tt>, Open Government Licence v2.0, SPDX License List
--   3.6, SPDX License List 3.9, SPDX License List 3.10, SPDX License List
--   3.16
OGL_UK_2_0 :: LicenseId

-- | <tt>OGL-UK-3.0</tt>, Open Government Licence v3.0, SPDX License List
--   3.6, SPDX License List 3.9, SPDX License List 3.10, SPDX License List
--   3.16
OGL_UK_3_0 :: LicenseId

-- | <tt>OGTSL</tt>, Open Group Test Suite License
OGTSL :: 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.1</tt>, Open LDAP Public License v2.0.1
OLDAP_2_0_1 :: LicenseId

-- | <tt>OLDAP-2.0</tt>, Open LDAP Public License v2.0 (or possibly 2.0A
--   and 2.0B)
OLDAP_2_0 :: LicenseId

-- | <tt>OLDAP-2.1</tt>, Open LDAP Public License v2.1
OLDAP_2_1 :: LicenseId

-- | <tt>OLDAP-2.2.1</tt>, Open LDAP Public License v2.2.1
OLDAP_2_2_1 :: LicenseId

-- | <tt>OLDAP-2.2.2</tt>, Open LDAP Public License 2.2.2
OLDAP_2_2_2 :: LicenseId

-- | <tt>OLDAP-2.2</tt>, Open LDAP Public License v2.2
OLDAP_2_2 :: 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>OpenSSL</tt>, OpenSSL License
OpenSSL :: LicenseId

-- | <tt>OPL-1.0</tt>, Open Public License v1.0
OPL_1_0 :: LicenseId

-- | <tt>OPUBL-1.0</tt>, Open Publication License v1.0, SPDX License List
--   3.16
OPUBL_1_0 :: LicenseId

-- | <tt>OSET-PL-2.1</tt>, OSET Public License version 2.1
OSET_PL_2_1 :: 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>Parity-6.0.0</tt>, The Parity Public License 6.0.0, SPDX License
--   List 3.6, SPDX License List 3.9, SPDX License List 3.10, SPDX License
--   List 3.16
Parity_6_0_0 :: LicenseId

-- | <tt>Parity-7.0.0</tt>, The Parity Public License 7.0.0, SPDX License
--   List 3.9, SPDX License List 3.10, SPDX License List 3.16
Parity_7_0_0 :: LicenseId

-- | <tt>PDDL-1.0</tt>, Open Data Commons Public Domain Dedication &amp;
--   License 1.0
PDDL_1_0 :: LicenseId

-- | <tt>PHP-3.01</tt>, PHP License v3.01
PHP_3_01 :: LicenseId

-- | <tt>PHP-3.0</tt>, PHP License v3.0
PHP_3_0 :: LicenseId

-- | <tt>Plexus</tt>, Plexus Classworlds License
Plexus :: LicenseId

-- | <tt>PolyForm-Noncommercial-1.0.0</tt>, PolyForm Noncommercial License
--   1.0.0, SPDX License List 3.9, SPDX License List 3.10, SPDX License
--   List 3.16
PolyForm_Noncommercial_1_0_0 :: LicenseId

-- | <tt>PolyForm-Small-Business-1.0.0</tt>, PolyForm Small Business
--   License 1.0.0, SPDX License List 3.9, SPDX License List 3.10, SPDX
--   License List 3.16
PolyForm_Small_Business_1_0_0 :: LicenseId

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

-- | <tt>PSF-2.0</tt>, Python Software Foundation License 2.0, SPDX License
--   List 3.9, SPDX License List 3.10, SPDX License List 3.16
PSF_2_0 :: 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>Qhull</tt>, Qhull License
Qhull :: LicenseId

-- | <tt>QPL-1.0</tt>, Q Public License 1.0
QPL_1_0 :: LicenseId

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

-- | <tt>RHeCos-1.1</tt>, Red Hat eCos Public License v1.1
RHeCos_1_1 :: 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>RPSL-1.0</tt>, RealNetworks Public Source License v1.0
RPSL_1_0 :: LicenseId

-- | <tt>RSA-MD</tt>, RSA Message-Digest License
RSA_MD :: LicenseId

-- | <tt>RSCPL</tt>, Ricoh Source Code Public License
RSCPL :: 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>SchemeReport</tt>, Scheme Language Report License, SPDX License
--   List 3.16
SchemeReport :: LicenseId

-- | <tt>Sendmail-8.23</tt>, Sendmail License 8.23, SPDX License List 3.6,
--   SPDX License List 3.9, SPDX License List 3.10, SPDX License List 3.16
Sendmail_8_23 :: 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>SHL-0.51</tt>, Solderpad Hardware License, Version 0.51, SPDX
--   License List 3.6, SPDX License List 3.9, SPDX License List 3.10, SPDX
--   License List 3.16
SHL_0_51 :: LicenseId

-- | <tt>SHL-0.5</tt>, Solderpad Hardware License v0.5, SPDX License List
--   3.6, SPDX License List 3.9, SPDX License List 3.10, SPDX License List
--   3.16
SHL_0_5 :: LicenseId

-- | <tt>SimPL-2.0</tt>, Simple Public License 2.0
SimPL_2_0 :: LicenseId

-- | <tt>SISSL-1.2</tt>, Sun Industry Standards Source License v1.2
SISSL_1_2 :: LicenseId

-- | <tt>SISSL</tt>, Sun Industry Standards Source License v1.1
SISSL :: LicenseId

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

-- | <tt>SMLNJ</tt>, Standard ML of New Jersey License
SMLNJ :: LicenseId

-- | <tt>SMPPL</tt>, Secure Messaging Protocol Public License
SMPPL :: 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>SPL-1.0</tt>, Sun Public License v1.0
SPL_1_0 :: LicenseId

-- | <tt>SSH-OpenSSH</tt>, SSH OpenSSH license, SPDX License List 3.9, SPDX
--   License List 3.10, SPDX License List 3.16
SSH_OpenSSH :: LicenseId

-- | <tt>SSH-short</tt>, SSH short notice, SPDX License List 3.9, SPDX
--   License List 3.10, SPDX License List 3.16
SSH_short :: LicenseId

-- | <tt>SSPL-1.0</tt>, Server Side Public License, v 1, SPDX License List
--   3.6, SPDX License List 3.9, SPDX License List 3.10, SPDX License List
--   3.16
SSPL_1_0 :: LicenseId

-- | <tt>SugarCRM-1.1.3</tt>, SugarCRM Public License v1.1.3
SugarCRM_1_1_3 :: LicenseId

-- | <tt>SWL</tt>, Scheme Widget Library (SWL) Software License Agreement
SWL :: LicenseId

-- | <tt>TAPR-OHL-1.0</tt>, TAPR Open Hardware License v1.0, SPDX License
--   List 3.6, SPDX License List 3.9, SPDX License List 3.10, SPDX License
--   List 3.16
TAPR_OHL_1_0 :: LicenseId

-- | <tt>TCL</tt>, TCL/TK License
TCL :: LicenseId

-- | <tt>TCP-wrappers</tt>, TCP Wrappers License
TCP_wrappers :: 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>TU-Berlin-1.0</tt>, Technische Universitaet Berlin License 1.0,
--   SPDX License List 3.2, SPDX License List 3.6, SPDX License List 3.9,
--   SPDX License List 3.10, SPDX License List 3.16
TU_Berlin_1_0 :: LicenseId

-- | <tt>TU-Berlin-2.0</tt>, Technische Universitaet Berlin License 2.0,
--   SPDX License List 3.2, SPDX License List 3.6, SPDX License List 3.9,
--   SPDX License List 3.10, SPDX License List 3.16
TU_Berlin_2_0 :: LicenseId

-- | <tt>UCL-1.0</tt>, Upstream Compatibility License v1.0, SPDX License
--   List 3.9, SPDX License List 3.10, SPDX License List 3.16
UCL_1_0 :: LicenseId

-- | <tt>Unicode-DFS-2015</tt>, Unicode License Agreement - Data Files and
--   Software (2015)
Unicode_DFS_2015 :: LicenseId

-- | <tt>Unicode-DFS-2016</tt>, Unicode License Agreement - Data Files and
--   Software (2016)
Unicode_DFS_2016 :: LicenseId

-- | <tt>Unicode-TOU</tt>, Unicode Terms of Use
Unicode_TOU :: LicenseId

-- | <tt>Unlicense</tt>, The Unlicense
Unlicense :: LicenseId

-- | <tt>UPL-1.0</tt>, Universal Permissive License v1.0
UPL_1_0 :: 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-19980720</tt>, W3C Software Notice and License (1998-07-20)
W3C_19980720 :: LicenseId

-- | <tt>W3C-20150513</tt>, W3C Software Notice and Document License
--   (2015-05-13)
W3C_20150513 :: LicenseId

-- | <tt>W3C</tt>, W3C Software Notice and License (2002-12-31)
W3C :: LicenseId

-- | <tt>Watcom-1.0</tt>, Sybase Open Watcom Public License 1.0
Watcom_1_0 :: LicenseId

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

-- | <tt>WTFPL</tt>, Do What The F*ck You Want To Public License
WTFPL :: LicenseId

-- | <tt>X11-distribute-modifications-variant</tt>, X11 License
--   Distribution Modification Variant, SPDX License List 3.16
X11_distribute_modifications_variant :: 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>Xnet</tt>, X.Net License
Xnet :: 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-acknowledgement</tt>, zlib/libpng License with
--   Acknowledgement
Zlib_acknowledgement :: LicenseId

-- | <tt>Zlib</tt>, zlib License
Zlib :: 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>"BSD-3-Clause"</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).
--   
--   See <a>https://opensource.org/licenses/alphabetical</a>.
licenseIsOsiApproved :: LicenseId -> Bool

-- | Create a <a>LicenseId</a> from a <a>String</a>.
mkLicenseId :: LicenseListVersion -> String -> Maybe LicenseId
licenseIdList :: LicenseListVersion -> [LicenseId]

-- | SPDX License Exceptions identifiers list v3.16
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>Bootloader-exception</tt>, Bootloader Distribution Exception
Bootloader_exception :: 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>GPL-3.0-linking-exception</tt>, GPL-3.0 Linking Exception, SPDX
--   License List 3.9, SPDX License List 3.10, SPDX License List 3.16
GPL_3_0_linking_exception :: LicenseExceptionId

-- | <tt>GPL-3.0-linking-source-exception</tt>, GPL-3.0 Linking Exception
--   (with Corresponding Source), SPDX License List 3.9, SPDX License List
--   3.10, SPDX License List 3.16
GPL_3_0_linking_source_exception :: LicenseExceptionId

-- | <tt>GPL-CC-1.0</tt>, GPL Cooperation Commitment 1.0, SPDX License List
--   3.6, SPDX License List 3.9, SPDX License List 3.10, SPDX License List
--   3.16
GPL_CC_1_0 :: LicenseExceptionId

-- | <tt>i2p-gpl-java-exception</tt>, i2p GPL+Java Exception
I2p_gpl_java_exception :: LicenseExceptionId

-- | <tt>LGPL-3.0-linking-exception</tt>, LGPL-3.0 Linking Exception, SPDX
--   License List 3.9, SPDX License List 3.10, SPDX License List 3.16
LGPL_3_0_linking_exception :: LicenseExceptionId

-- | <tt>Libtool-exception</tt>, Libtool Exception
Libtool_exception :: LicenseExceptionId

-- | <tt>Linux-syscall-note</tt>, Linux Syscall Note
Linux_syscall_note :: LicenseExceptionId

-- | <tt>LLVM-exception</tt>, LLVM Exception, SPDX License List 3.2, SPDX
--   License List 3.6, SPDX License List 3.9, SPDX License List 3.10, SPDX
--   License List 3.16
LLVM_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, SPDX
--   License List 3.0, SPDX License List 3.2
Nokia_Qt_exception_1_1 :: LicenseExceptionId

-- | <tt>OCaml-LGPL-linking-exception</tt>, OCaml LGPL Linking Exception,
--   SPDX License List 3.6, SPDX License List 3.9, SPDX License List 3.10,
--   SPDX License List 3.16
OCaml_LGPL_linking_exception :: LicenseExceptionId

-- | <tt>OCCT-exception-1.0</tt>, Open CASCADE Exception 1.0
OCCT_exception_1_0 :: LicenseExceptionId

-- | <tt>OpenJDK-assembly-exception-1.0</tt>, OpenJDK Assembly exception
--   1.0, SPDX License List 3.2, SPDX License List 3.6, SPDX License List
--   3.9, SPDX License List 3.10, SPDX License List 3.16
OpenJDK_assembly_exception_1_0 :: LicenseExceptionId

-- | <tt>openvpn-openssl-exception</tt>, OpenVPN OpenSSL Exception
Openvpn_openssl_exception :: LicenseExceptionId

-- | <tt>PS-or-PDF-font-exception-20170817</tt>, PS/PDF font exception
--   (2017-08-17), SPDX License List 3.2, SPDX License List 3.6, SPDX
--   License List 3.9, SPDX License List 3.10, SPDX License List 3.16
PS_or_PDF_font_exception_20170817 :: LicenseExceptionId

-- | <tt>Qt-GPL-exception-1.0</tt>, Qt GPL exception 1.0, SPDX License List
--   3.2, SPDX License List 3.6, SPDX License List 3.9, SPDX License List
--   3.10, SPDX License List 3.16
Qt_GPL_exception_1_0 :: LicenseExceptionId

-- | <tt>Qt-LGPL-exception-1.1</tt>, Qt LGPL exception 1.1, SPDX License
--   List 3.2, SPDX License List 3.6, SPDX License List 3.9, SPDX License
--   List 3.10, SPDX License List 3.16
Qt_LGPL_exception_1_1 :: LicenseExceptionId

-- | <tt>Qwt-exception-1.0</tt>, Qwt exception 1.0
Qwt_exception_1_0 :: LicenseExceptionId

-- | <tt>SHL-2.0</tt>, Solderpad Hardware License v2.0, SPDX License List
--   3.9, SPDX License List 3.10, SPDX License List 3.16
SHL_2_0 :: LicenseExceptionId

-- | <tt>SHL-2.1</tt>, Solderpad Hardware License v2.1, SPDX License List
--   3.9, SPDX License List 3.10, SPDX License List 3.16
SHL_2_1 :: LicenseExceptionId

-- | <tt>Swift-exception</tt>, Swift Exception, SPDX License List 3.6, SPDX
--   License List 3.9, SPDX License List 3.10, SPDX License List 3.16
Swift_exception :: LicenseExceptionId

-- | <tt>u-boot-exception-2.0</tt>, U-Boot exception 2.0
U_boot_exception_2_0 :: LicenseExceptionId

-- | <tt>Universal-FOSS-exception-1.0</tt>, Universal FOSS Exception,
--   Version 1.0, SPDX License List 3.6, SPDX License List 3.9, SPDX
--   License List 3.10, SPDX License List 3.16
Universal_FOSS_exception_1_0 :: LicenseExceptionId

-- | <tt>WxWindows-exception-3.1</tt>, WxWindows Library Exception 3.1
WxWindows_exception_3_1 :: LicenseExceptionId

-- | License SPDX identifier, e.g. <tt>"BSD-3-Clause"</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 :: LicenseListVersion -> String -> Maybe LicenseExceptionId
licenseExceptionIdList :: LicenseListVersion -> [LicenseExceptionId]

-- | A user defined license reference denoted by
--   <tt>LicenseRef-[idstring]</tt> (for a license not on the SPDX License
--   List);
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
--   <tt>-</tt>.
mkLicenseRef' :: Maybe String -> String -> LicenseRef

-- | SPDX License List version <tt>Cabal</tt> is aware of.
data LicenseListVersion
LicenseListVersion_3_0 :: LicenseListVersion
LicenseListVersion_3_2 :: LicenseListVersion
LicenseListVersion_3_6 :: LicenseListVersion
LicenseListVersion_3_9 :: LicenseListVersion
LicenseListVersion_3_10 :: LicenseListVersion
LicenseListVersion_3_16 :: LicenseListVersion
cabalSpecVersionToSPDXListVersion :: CabalSpecVersion -> LicenseListVersion


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

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

-- | Construct a <a>ModuleName</a> from valid module components, i.e. parts
--   separated by dots.

-- | <i>Deprecated: Exists for cabal-install only</i>
fromComponents :: [String] -> ModuleName

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

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

-- | The module name <tt>Main</tt>.
main :: 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.Binary.Class.Binary Distribution.ModuleName.ModuleName
instance Distribution.Utils.Structured.Structured Distribution.ModuleName.ModuleName
instance Control.DeepSeq.NFData Distribution.ModuleName.ModuleName
instance Distribution.Pretty.Pretty Distribution.ModuleName.ModuleName
instance Distribution.Parsec.Parsec Distribution.ModuleName.ModuleName
instance Data.String.IsString Distribution.ModuleName.ModuleName

module Distribution.Types.ModuleRenaming

-- | Renaming applied to the modules provided by a package. The boolean
--   indicates whether or not to also include all of the original names of
--   modules. Thus, <tt>ModuleRenaming False []</tt> is "don't expose any
--   modules, and <tt>ModuleRenaming True [(<a>Data.Bool</a>,
--   <a>Bool</a>)]</tt> is, "expose all modules, but also expose
--   <tt>Data.Bool</tt> as <tt>Bool</tt>". If a renaming is omitted you get
--   the <a>DefaultRenaming</a>.
--   
--   (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
--   <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
--   modules into scope except the hidden ones.
HidingRenaming :: [ModuleName] -> ModuleRenaming

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

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

-- | Tests if its the default renaming; we can use a more compact syntax in
--   <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 Distribution.Utils.Structured.Structured Distribution.Types.ModuleRenaming.ModuleRenaming
instance Control.DeepSeq.NFData Distribution.Types.ModuleRenaming.ModuleRenaming
instance Distribution.Pretty.Pretty Distribution.Types.ModuleRenaming.ModuleRenaming
instance Distribution.Parsec.Parsec 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
--   <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 Distribution.Utils.Structured.Structured Distribution.Types.IncludeRenaming.IncludeRenaming
instance Control.DeepSeq.NFData Distribution.Types.IncludeRenaming.IncludeRenaming
instance Distribution.Pretty.Pretty Distribution.Types.IncludeRenaming.IncludeRenaming
instance Distribution.Parsec.Parsec Distribution.Types.IncludeRenaming.IncludeRenaming

module Distribution.Types.Mixin

-- | <i>Invariant:</i> if <a>mixinLibraryName</a> is <a>LSubLibName</a>,
--   it's not the same as <a>mixinPackageName</a>. In other words, the same
--   invariant as <tt>Dependency</tt> has.
data Mixin
Mixin :: PackageName -> LibraryName -> IncludeRenaming -> Mixin
[mixinPackageName] :: Mixin -> PackageName
[mixinLibraryName] :: Mixin -> LibraryName
[mixinIncludeRenaming] :: Mixin -> IncludeRenaming

-- | Smart constructor of <a>Mixin</a>, enforces invariant.
mkMixin :: PackageName -> LibraryName -> IncludeRenaming -> Mixin

-- | Restore invariant
normaliseMixin :: Mixin -> Mixin
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 Distribution.Utils.Structured.Structured Distribution.Types.Mixin.Mixin
instance Control.DeepSeq.NFData Distribution.Types.Mixin.Mixin
instance Distribution.Pretty.Pretty Distribution.Types.Mixin.Mixin
instance Distribution.Parsec.Parsec Distribution.Types.Mixin.Mixin

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.Ord Distribution.Types.ModuleReexport.ModuleReexport
instance GHC.Classes.Eq Distribution.Types.ModuleReexport.ModuleReexport
instance Data.Binary.Class.Binary Distribution.Types.ModuleReexport.ModuleReexport
instance Distribution.Utils.Structured.Structured Distribution.Types.ModuleReexport.ModuleReexport
instance Control.DeepSeq.NFData Distribution.Types.ModuleReexport.ModuleReexport
instance Distribution.Pretty.Pretty Distribution.Types.ModuleReexport.ModuleReexport
instance Distribution.Parsec.Parsec Distribution.Types.ModuleReexport.ModuleReexport


-- | A data type representing directed graphs, backed by <a>Data.Graph</a>.
--   It is strict in the node type.
--   
--   This is an alternative interface to <a>Data.Graph</a>. In this
--   interface, nodes (identified by the <a>IsNode</a> type class) are
--   associated with a key and record the keys of their neighbors. This
--   interface is more convenient than <a>Graph</a>, which requires
--   vertices to be explicitly handled by integer indexes.
--   
--   The current implementation has somewhat peculiar performance
--   characteristics. The asymptotics of all map-like operations mirror
--   their counterparts in <a>Data.Map</a>. However, to perform a graph
--   operation, we first must build the <a>Data.Graph</a> representation,
--   an operation that takes <i>O(V + E log V)</i>. However, this operation
--   can be amortized across all queries on that particular graph.
--   
--   Some nodes may be broken, i.e., refer to neighbors which are not
--   stored in the graph. In our graph algorithms, we transparently ignore
--   such edges; however, you can easily query for the broken vertices of a
--   graph using <a>broken</a> (and should, e.g., to ensure that a closure
--   of a graph is well-formed.) It's possible to take a closed subset of a
--   broken 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
--   of class <a>IsNode</a>.
data Graph a

-- | The <a>IsNode</a> class is used for datatypes which represent directed
--   graph nodes. A node of type <tt>a</tt> is associated with some unique
--   key of type <tt><a>Key</a> a</tt>; given a node we can determine its
--   key (<a>nodeKey</a>) and the keys of its neighbors
--   (<a>nodeNeighbors</a>).
class Ord (Key a) => IsNode a where {
    type 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
--   value 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
--   map when conflicts occur.
unionLeft :: IsNode a => Graph a -> Graph a -> Graph a

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

-- | <i>Ω(V + E)</i>. Compute the strongly connected components of a graph.
--   Requires 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
--   construction of graph.
cycles :: Graph a -> [[a]]

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

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

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

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

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

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

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

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

-- | <i>O(V log V)</i>. Convert a list of nodes (with distinct keys) into a
--   graph.
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
--   construction 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 Distribution.Utils.Structured.Structured a => Distribution.Utils.Structured.Structured (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 GHC.Types.~ Distribution.Compat.Graph.Key b) => Distribution.Compat.Graph.IsNode (Data.Either.Either a b)


-- | Exports the <a>Version</a> type along with a parser and pretty
--   printer. A version is something like <tt>"1.3.3"</tt>. It also defines
--   the <a>VersionRange</a> data types. Version ranges are like <tt>"&gt;=
--   1.2 &amp;&amp; &lt; 2"</tt>.
module Distribution.Version

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

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

-- | Construct <a>Version</a> from list of version number components.
--   
--   For instance, <tt>mkVersion [3,2,1]</tt> constructs a <a>Version</a>
--   representing the version <tt>3.2.1</tt>.
--   
--   All version components must be non-negative. <tt>mkVersion []</tt>
--   currently represents the special <i>null</i> version; see also
--   <a>nullVersion</a>.
mkVersion :: [Int] -> Version

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

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

-- | Constant representing the special <i>null</i> <a>Version</a>
--   
--   The <a>nullVersion</a> compares (via <a>Ord</a>) as less than every
--   proper <a>Version</a> value.
nullVersion :: Version

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

-- | The version range <tt>-any</tt>. That is, a version range containing
--   all versions.
--   
--   <pre>
--   withinRange v anyVersion = True
--   </pre>
anyVersion :: VersionRange

-- | The empty version range <tt>-none</tt>, that is a version range
--   containing no versions.
--   
--   This can be constructed using any unsatisfiable version range
--   expression, for example <tt>&lt; 0</tt>.
--   
--   <pre>
--   withinRange v noVersion = False
--   </pre>
noVersion :: VersionRange

-- | The version range <tt>== v</tt>.
--   
--   <pre>
--   withinRange v' (thisVersion v) = v' == v
--   </pre>
thisVersion :: Version -> VersionRange

-- | The version range <tt>/= v</tt>.
--   
--   <pre>
--   withinRange v' (notThisVersion v) = v' /= v
--   </pre>
notThisVersion :: Version -> VersionRange

-- | The version range <tt>&gt; v</tt>.
--   
--   <pre>
--   withinRange v' (laterVersion v) = v' &gt; v
--   </pre>
laterVersion :: Version -> VersionRange

-- | The version range <tt>&lt; v</tt>.
--   
--   <pre>
--   withinRange v' (earlierVersion v) = v' &lt; v
--   </pre>
earlierVersion :: Version -> VersionRange

-- | The version range <tt>&gt;= v</tt>.
--   
--   <pre>
--   withinRange v' (orLaterVersion v) = v' &gt;= v
--   </pre>
orLaterVersion :: Version -> VersionRange

-- | The version range <tt>&lt;= v</tt>.
--   
--   <pre>
--   withinRange v' (orEarlierVersion v) = v' &lt;= v
--   </pre>
orEarlierVersion :: Version -> VersionRange

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

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

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

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

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

-- | Does this <a>VersionRange</a> place any restriction on the
--   <a>Version</a> or is it in fact equivalent to <tt>AnyVersion</tt>.
--   
--   Note this is a semantic check, not simply a syntactic check. So for
--   example the following is <tt>True</tt> (for all <tt>v</tt>).
--   
--   <pre>
--   isAnyVersion (EarlierVersion v `UnionVersionRanges` orLaterVersion v)
--   </pre>
isAnyVersion :: VersionRange -> Bool

-- | This is the converse of <a>isAnyVersion</a>. It check if the version
--   range is empty, if there is no possible version that satisfies the
--   version range.
--   
--   For example this is <tt>True</tt> (for all <tt>v</tt>):
--   
--   <pre>
--   isNoVersion (EarlierVersion v `IntersectVersionRanges` LaterVersion v)
--   </pre>
isNoVersion :: VersionRange -> Bool

-- | Is this version range in fact just a specific version?
--   
--   For example the version range <tt>"&gt;= 3 &amp;&amp; &lt;= 3"</tt>
--   contains only the version <tt>3</tt>.
isSpecificVersion :: VersionRange -> Maybe Version

-- | Simplify a <a>VersionRange</a> expression. For non-empty version
--   ranges this produces a canonical form. Empty or inconsistent version
--   ranges are left as-is because that provides more information.
--   
--   If you need a canonical form use <tt>fromVersionIntervals .
--   toVersionIntervals</tt>
--   
--   It satisfies the following properties:
--   
--   <pre>
--   withinRange v (simplifyVersionRange r) = withinRange v r
--   </pre>
--   
--   <pre>
--       withinRange v r = withinRange v r'
--   ==&gt; simplifyVersionRange r = simplifyVersionRange r'
--    || isNoVersion r
--    || isNoVersion r'
--   </pre>
simplifyVersionRange :: VersionRange -> VersionRange

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

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

-- | Remove <tt>VersionRangeParens</tt> constructors.
--   
--   Since version 3.4 this function is <a>id</a>, there aren't
--   <tt>VersionRangeParens</tt> constructor in <a>VersionRange</a>
--   anymore.
stripParensVersionRange :: VersionRange -> VersionRange

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

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

-- | F-Algebra of <a>VersionRange</a>. See <a>cataVersionRange</a>.
data VersionRangeF a

-- | <tt>== version</tt>.
ThisVersionF :: Version -> VersionRangeF a

-- | <tt>&gt; version</tt>. NB: not <tt>&gt;=</tt>
LaterVersionF :: Version -> VersionRangeF a

-- | <tt>&gt;= version</tt>.
OrLaterVersionF :: Version -> VersionRangeF a

-- | <tt>&lt; version</tt>.
EarlierVersionF :: Version -> VersionRangeF a

-- | <tt>&lt;= version</tt>.
OrEarlierVersionF :: Version -> VersionRangeF a

-- | <tt>^&gt;= version</tt>, same as <tt>&gt;= version &amp;&amp; &lt;
--   MAJ(version)+1</tt>.
MajorBoundVersionF :: Version -> VersionRangeF a

-- | <tt>||</tt>.
UnionVersionRangesF :: a -> a -> VersionRangeF a

-- | <tt>&amp;&amp;</tt>.
IntersectVersionRangesF :: a -> 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

-- | Generic destructor for <a>VersionRange</a>.
projectVersionRange :: VersionRange -> VersionRangeF VersionRange

-- | Generic constructor for <a>VersionRange</a>.
embedVersionRange :: VersionRangeF VersionRange -> VersionRange

-- | Increment the last version number.
--   
--   Example: For <tt>1.2</tt> this returns <tt>1.3</tt> so that it can be
--   used as upper bound when resolving <tt>== 1.2.*</tt>. For
--   <tt>0.4.1</tt> it returns <tt>0.4.2</tt>.
wildcardUpperBound :: Version -> Version

-- | Compute next greater major version to be used as upper bound.
--   
--   Example: <tt>0.4.1</tt> produces the version <tt>0.5</tt> which then
--   can be used to construct a range <tt>&gt;= 0.4.1 &amp;&amp; &lt;
--   0.5</tt>
majorUpperBound :: Version -> Version

-- | Given a version range, remove the highest upper bound. Example:
--   <tt>(&gt;= 1 &amp;&amp; &lt; 3) || (&gt;= 4 &amp;&amp; &lt; 5)</tt> is
--   converted to <tt>(&gt;= 1 &amp;&amp; <a>|| (</a>= 4)</tt>.
removeUpperBound :: VersionRange -> VersionRange

-- | Given a version range, remove the lowest lower bound. Example:
--   <tt>(&gt;= 1 &amp;&amp; <a>|| (</a>= 4 &amp;&amp; &lt; 5)</tt> is
--   converted to <tt>(&gt;= 0 &amp;&amp; <a>|| (</a>= 4 &amp;&amp; &lt;
--   5)</tt>.
removeLowerBound :: VersionRange -> VersionRange

-- | Rewrite <tt>^&gt;= x.y.z</tt> into <tt>&gt;= x.y.z &amp;&amp; &lt;
--   x.(y+1)</tt>
transformCaret :: VersionRange -> VersionRange

-- | Rewrite <tt>^&gt;= x.y.z</tt> into <tt>&gt;= x.y.z</tt>
transformCaretUpper :: VersionRange -> VersionRange

-- | Rewrite <tt>^&gt;= x.y.z</tt> into <tt>&lt;x.(y+1)</tt>
transformCaretLower :: VersionRange -> VersionRange

-- | View a <a>VersionRange</a> as a union of intervals.
--   
--   This provides a canonical view of the semantics of a
--   <a>VersionRange</a> as opposed to the syntax of the expression used to
--   define it. For the syntactic view use <tt>foldVersionRange</tt>.
--   
--   Each interval is non-empty. The sequence is in increasing order and no
--   intervals overlap or touch. Therefore only the first and last can be
--   unbounded. The sequence can be empty if the range is empty (e.g. a
--   range expression like <tt><a>&amp;&amp;</a> 2</tt>).
--   
--   Other checks are trivial to implement using this view. For example:
--   
--   <pre>
--   isNoVersion vr | [] &lt;- asVersionIntervals vr = True
--                  | otherwise                   = False
--   </pre>
--   
--   <pre>
--   isSpecificVersion vr
--      | [(LowerBound v  InclusiveBound
--         ,UpperBound v' InclusiveBound)] &lt;- asVersionIntervals vr
--      , v == v'   = Just v
--      | otherwise = Nothing
--   </pre>
asVersionIntervals :: VersionRange -> [VersionInterval]
data VersionInterval
VersionInterval :: !LowerBound -> !UpperBound -> VersionInterval
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
--   boolean version predicate it uses an increasing sequence of
--   non-overlapping, non-empty intervals.
--   
--   The key point is that this representation gives a canonical
--   representation for the semantics of <a>VersionRange</a>s. This makes
--   it easier to check things like whether a version range is empty,
--   covers all versions, or requires a certain minimum or maximum version.
--   It also makes it easy to check equality or containment. It also makes
--   it easier to identify 'simple' version predicates for translation into
--   foreign packaging systems that do not support complex version range
--   expressions.
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
--   <a>VersionRange</a> expression representing the version intervals.
fromVersionIntervals :: VersionIntervals -> VersionRange

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

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]
testTypeExe :: TestType
testTypeLib :: TestType
instance Data.Data.Data Distribution.Types.TestType.TestType
instance GHC.Classes.Ord 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 Distribution.Utils.Structured.Structured Distribution.Types.TestType.TestType
instance Control.DeepSeq.NFData Distribution.Types.TestType.TestType
instance Distribution.Pretty.Pretty Distribution.Types.TestType.TestType
instance Distribution.Parsec.Parsec Distribution.Types.TestType.TestType

module Distribution.Types.TestSuiteInterface

-- | The test suite interfaces that are currently defined.
--   
--   More interfaces may be defined in future, either new revisions or
--   totally new interfaces.
data TestSuiteInterface

-- | Test interface "exitcode-stdio-1.0". The test-suite takes the form of
--   an executable. It returns a zero exit code for success, non-zero for
--   failure. The stdout and stderr channels may be logged. Test tooling
--   may pass command line arguments and/or connect the stdin channel to
--   the test.
TestSuiteExeV10 :: Version -> FilePath -> TestSuiteInterface

-- | Test interface "detailed-0.9". The test-suite takes the form of a
--   library 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
--   the 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.Ord Distribution.Types.TestSuiteInterface.TestSuiteInterface
instance GHC.Classes.Eq Distribution.Types.TestSuiteInterface.TestSuiteInterface
instance Data.Binary.Class.Binary Distribution.Types.TestSuiteInterface.TestSuiteInterface
instance Distribution.Utils.Structured.Structured 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.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.Utils.Structured.Structured Distribution.Types.PackageId.PackageIdentifier
instance Distribution.Pretty.Pretty Distribution.Types.PackageId.PackageIdentifier
instance Distribution.Parsec.Parsec Distribution.Types.PackageId.PackageIdentifier
instance Control.DeepSeq.NFData Distribution.Types.PackageId.PackageIdentifier

module Distribution.Types.UnitId

-- | A unit identifier identifies a (possibly instantiated)
--   package/component that can be installed the installed package
--   database. There are several types of components that can be installed:
--   
--   <ul>
--   <li>A traditional library with no holes, so that <tt>unitIdHash</tt>
--   is <tt>Nothing</tt>. In the absence of Backpack, <a>UnitId</a> is the
--   same as a <a>ComponentId</a>.</li>
--   <li>An indefinite, Backpack library with holes. In this case,
--   <tt>unitIdHash</tt> is still <tt>Nothing</tt>, but in the install,
--   there are only interfaces, no compiled objects.</li>
--   <li>An instantiated Backpack library with all the holes filled in.
--   <tt>unitIdHash</tt> is a <tt>Just</tt> a hash of the instantiating
--   mapping.</li>
--   </ul>
--   
--   A unit is a component plus the additional information on how the holes
--   are filled in. Thus there is a one to many relationship: for a
--   particular component there are many different ways of filling in the
--   holes, and each different combination is a unit (and has a separate
--   <a>UnitId</a>).
--   
--   <a>UnitId</a> is distinct from <tt>OpenUnitId</tt>, in that it is
--   always installed, whereas <tt>OpenUnitId</tt> are intermediate unit
--   identities that arise during mixin linking, and don't necessarily
--   correspond to any actually installed unit. Since the mapping is not
--   actually recorded in a <a>UnitId</a>, you can't actually substitute
--   over them (but you can substitute over <tt>OpenUnitId</tt>). See also
--   <a>Distribution.Backpack.FullUnitId</a> for a mechanism for expanding
--   an instantiated <a>UnitId</a> to retrieve its mapping.
--   
--   Backwards compatibility note: if you need to get the string
--   representation of a UnitId to pass, e.g., as a <tt>-package-id</tt>
--   flag, use the <tt>display</tt> function, which will work on all
--   versions of Cabal.
data UnitId

-- | If you need backwards compatibility, consider using <tt>display</tt>
--   instead, 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
--   says that a <a>UnitId</a> identified this way is definite; i.e., it
--   has no unfilled holes.
data DefUnitId

-- | Unsafely create a <a>DefUnitId</a> from a <a>UnitId</a>. Your
--   responsibility 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
--   <a>ComponentId</a>.
newSimpleUnitId :: ComponentId -> UnitId

-- | Make an old-style UnitId from a package identifier. Assumed to be for
--   the public library
mkLegacyUnitId :: PackageId -> UnitId

-- | Returns library name prefixed with HS, suitable for filenames
getHSLibraryName :: UnitId -> String
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.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 Distribution.Utils.Structured.Structured Distribution.Types.UnitId.DefUnitId
instance Distribution.Parsec.Parsec Distribution.Types.UnitId.DefUnitId
instance Data.Binary.Class.Binary Distribution.Types.UnitId.UnitId
instance Distribution.Utils.Structured.Structured Distribution.Types.UnitId.UnitId
instance Distribution.Pretty.Pretty Distribution.Types.UnitId.UnitId
instance Distribution.Parsec.Parsec 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
--   <a>ModuleName</a> with the <a>UnitId</a> which defined it. This type
--   distinguishes between two packages which provide a module with the
--   same name, or a module from the same package compiled with different
--   dependencies. There are a few cases where Cabal needs to know about
--   module identities, e.g., when writing out reexported modules in the
--   <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.Utils.Structured.Structured Distribution.Types.Module.Module
instance Distribution.Pretty.Pretty Distribution.Types.Module.Module
instance Distribution.Parsec.Parsec Distribution.Types.Module.Module
instance Control.DeepSeq.NFData Distribution.Types.Module.Module


-- | This module defines the core data types for Backpack. For more
--   details, see:
--   
--   
--   <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
--   Backpack component, with a description of how the holes are filled in.
--   Unlike <a>OpenUnitId</a>, the <tt>ModuleSubst</tt> is kept in a
--   structured form that allows for substitution (which fills in holes.)
--   This form of unit cannot be installed. It must first be converted to a
--   <a>UnitId</a>.
--   
--   In the absence of Backpack, there are no holes to fill, so any such
--   component always has an empty module substitution; thus we can lossily
--   represent it as a 'DefiniteUnitId uid'.
--   
--   For a source component using Backpack, however, there is more
--   structure as components may be parametrized over some signatures, and
--   these "holes" may be partially or wholly filled.
--   
--   OpenUnitId plays an important role when we are mix-in linking, and is
--   recorded to the installed packaged database for indefinite packages;
--   however, for compiled packages that are fully instantiated, we
--   instantiate <a>OpenUnitId</a> into <a>UnitId</a>.
--   
--   For more details see the Backpack spec
--   <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
--   its <a>ComponentId</a> and its <a>OpenModuleSubst</a>. TODO: Invariant
--   that <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
--   abbreviated as a hash. The embedded <a>UnitId</a> MUST NOT be for an
--   indefinite component; an <a>OpenUnitId</a> is guaranteed not to have
--   any 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
--   the instantiation is provided.
mkOpenUnitId :: UnitId -> ComponentId -> OpenModuleSubst -> OpenUnitId

-- | A <a>UnitId</a> for a definite package. The <a>DefUnitId</a> invariant
--   says that a <a>UnitId</a> identified this way is definite; i.e., it
--   has no unfilled holes.
data DefUnitId
unDefUnitId :: DefUnitId -> UnitId

-- | Create a <a>DefUnitId</a> from a <a>ComponentId</a> and an
--   instantiation with no holes.
mkDefUnitId :: ComponentId -> Map ModuleName Module -> DefUnitId

-- | Unlike a <a>Module</a>, an <a>OpenModule</a> is either an ordinary
--   module from some unit, OR an <a>OpenModuleVar</a>, representing a hole
--   that 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.
--   
--   NB: These substitutions are NOT idempotent, for example, a valid
--   substitution is (A -&gt; B, B -&gt; A).
type OpenModuleSubst = Map ModuleName OpenModule

-- | Pretty-print the entries of a module substitution, suitable for
--   embedding into a <a>OpenUnitId</a> or passing to GHC via
--   <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>.
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
--   <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
--   <a>IndefFullUnitId</a> be compiled; instead, we just depend on the
--   installed indefinite unit installed at the <a>ComponentId</a>.
abstractUnitId :: OpenUnitId -> UnitId

-- | Take a module substitution and hash it into a string suitable for
--   <a>UnitId</a>. Note that since this takes <a>Module</a>, not
--   <a>OpenModule</a>, you are responsible for recursively converting
--   <a>OpenModule</a> into <a>Module</a>. See also
--   <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 Distribution.Utils.Structured.Structured Distribution.Backpack.OpenUnitId
instance Control.DeepSeq.NFData Distribution.Backpack.OpenUnitId
instance Distribution.Pretty.Pretty Distribution.Backpack.OpenUnitId
instance Distribution.Parsec.Parsec Distribution.Backpack.OpenUnitId
instance Data.Binary.Class.Binary Distribution.Backpack.OpenModule
instance Distribution.Utils.Structured.Structured Distribution.Backpack.OpenModule
instance Control.DeepSeq.NFData Distribution.Backpack.OpenModule
instance Distribution.Pretty.Pretty Distribution.Backpack.OpenModule
instance Distribution.Parsec.Parsec Distribution.Backpack.OpenModule

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.Parsec Distribution.Types.ExposedModule.ExposedModule
instance Data.Binary.Class.Binary Distribution.Types.ExposedModule.ExposedModule
instance Distribution.Utils.Structured.Structured Distribution.Types.ExposedModule.ExposedModule
instance Control.DeepSeq.NFData Distribution.Types.ExposedModule.ExposedModule

module Distribution.Types.PackageVersionConstraint

-- | A version constraint on a package. Different from
--   <tt>ExeDependency</tt> and <tt>Dependency</tt> since it does not
--   specify the need for a component, not even the main library. There are
--   a few places in the codebase where <tt>Dependency</tt> was used where
--   <a>PackageVersionConstraint</a> is not used instead (#5570).
data PackageVersionConstraint
PackageVersionConstraint :: PackageName -> VersionRange -> PackageVersionConstraint

thisPackageVersionConstraint :: PackageIdentifier -> PackageVersionConstraint

simplifyPackageVersionConstraint :: PackageVersionConstraint -> PackageVersionConstraint
instance Data.Data.Data Distribution.Types.PackageVersionConstraint.PackageVersionConstraint
instance GHC.Classes.Eq Distribution.Types.PackageVersionConstraint.PackageVersionConstraint
instance GHC.Show.Show Distribution.Types.PackageVersionConstraint.PackageVersionConstraint
instance GHC.Read.Read Distribution.Types.PackageVersionConstraint.PackageVersionConstraint
instance GHC.Generics.Generic Distribution.Types.PackageVersionConstraint.PackageVersionConstraint
instance Data.Binary.Class.Binary Distribution.Types.PackageVersionConstraint.PackageVersionConstraint
instance Distribution.Utils.Structured.Structured Distribution.Types.PackageVersionConstraint.PackageVersionConstraint
instance Control.DeepSeq.NFData Distribution.Types.PackageVersionConstraint.PackageVersionConstraint
instance Distribution.Pretty.Pretty Distribution.Types.PackageVersionConstraint.PackageVersionConstraint
instance Distribution.Parsec.Parsec Distribution.Types.PackageVersionConstraint.PackageVersionConstraint

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.MungedPackageId

-- | A simple pair of a <a>MungedPackageName</a> and <a>Version</a>.
--   <a>MungedPackageName</a> is to <a>MungedPackageId</a> as
--   <tt>PackageName</tt> is to <a>PackageId</a>. See
--   <a>MungedPackageName</a> for more info.
data MungedPackageId
MungedPackageId :: MungedPackageName -> Version -> MungedPackageId

-- | The combined package and component name. see documentation for
--   <a>MungedPackageName</a>.
[mungedName] :: MungedPackageId -> MungedPackageName

-- | The version of this package / component, eg 1.2
[mungedVersion] :: MungedPackageId -> Version
computeCompatPackageId :: PackageId -> LibraryName -> 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.Utils.Structured.Structured Distribution.Types.MungedPackageId.MungedPackageId
instance Distribution.Pretty.Pretty Distribution.Types.MungedPackageId.MungedPackageId
instance Distribution.Parsec.Parsec Distribution.Types.MungedPackageId.MungedPackageId
instance Control.DeepSeq.NFData Distribution.Types.MungedPackageId.MungedPackageId

module Distribution.Types.LegacyExeDependency

-- | Describes a legacy `build-tools`-style dependency on an executable
--   
--   It is "legacy" because we do not know what the build-tool referred to.
--   It could refer to a pkg-config executable (PkgconfigName), or an
--   internal executable (UnqualComponentName). Thus the name is stringly
--   typed.
data LegacyExeDependency
LegacyExeDependency :: String -> VersionRange -> LegacyExeDependency
instance Data.Data.Data Distribution.Types.LegacyExeDependency.LegacyExeDependency
instance GHC.Classes.Ord 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 Distribution.Utils.Structured.Structured Distribution.Types.LegacyExeDependency.LegacyExeDependency
instance Control.DeepSeq.NFData Distribution.Types.LegacyExeDependency.LegacyExeDependency
instance Distribution.Pretty.Pretty Distribution.Types.LegacyExeDependency.LegacyExeDependency
instance Distribution.Parsec.Parsec Distribution.Types.LegacyExeDependency.LegacyExeDependency

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.Ord 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 Distribution.Utils.Structured.Structured Distribution.Types.ExeDependency.ExeDependency
instance Control.DeepSeq.NFData Distribution.Types.ExeDependency.ExeDependency
instance Distribution.Pretty.Pretty Distribution.Types.ExeDependency.ExeDependency
instance Distribution.Parsec.Parsec Distribution.Types.ExeDependency.ExeDependency

module Distribution.Types.Dependency

-- | Describes a dependency on a source package (API)
--   
--   <i>Invariant:</i> package name does not appear as <a>LSubLibName</a>
--   in set of library names.
--   
--   <i>Note:</i> <a>Dependency</a> is not an instance of <a>Ord</a>, and
--   so it cannot be used in <a>Set</a> or as the key to a <a>Map</a>. For
--   these and similar use cases see <tt>DependencyMap</tt>.
data Dependency

-- | The set of libraries required from the package. Only the selected
--   libraries will be built. It does not affect the cabal-install solver
--   yet.
Dependency :: PackageName -> VersionRange -> NonEmptySet LibraryName -> Dependency

-- | Smart constructor of <a>Dependency</a>.
--   
--   If <a>PackageName</a> is appears as <a>LSubLibName</a> in a set of
--   sublibraries, it is automatically converted to <a>LMainLibName</a>.
mkDependency :: PackageName -> VersionRange -> NonEmptySet LibraryName -> Dependency
depPkgName :: Dependency -> PackageName
depVerRange :: Dependency -> VersionRange
depLibraries :: Dependency -> NonEmptySet LibraryName

-- | Simplify the <a>VersionRange</a> expression in a <a>Dependency</a>.
--   See <a>simplifyVersionRange</a>.
simplifyDependency :: Dependency -> Dependency

-- | Library set with main library.
mainLibSet :: NonEmptySet LibraryName
instance Data.Data.Data Distribution.Types.Dependency.Dependency
instance GHC.Classes.Ord 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 Distribution.Utils.Structured.Structured Distribution.Types.Dependency.Dependency
instance Control.DeepSeq.NFData Distribution.Types.Dependency.Dependency
instance Distribution.Pretty.Pretty Distribution.Types.Dependency.Dependency
instance Distribution.Parsec.Parsec 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
--   code (as opposed to user-provided)? This field is only used
--   internally, and doesn't correspond to anything in the .cabal file. See
--   #3199.
[defaultSetupDepends] :: SetupBuildInfo -> Bool
instance Data.Data.Data Distribution.Types.SetupBuildInfo.SetupBuildInfo
instance GHC.Read.Read Distribution.Types.SetupBuildInfo.SetupBuildInfo
instance GHC.Classes.Ord 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 Distribution.Utils.Structured.Structured 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
--   not appropriate. The monoid instance uses
--   <a>intersectVersionRanges</a>.
data DependencyMap
toDepMap :: [Dependency] -> DependencyMap
fromDepMap :: DependencyMap -> [Dependency]
constrainBy :: DependencyMap -> [PackageVersionConstraint] -> DependencyMap
instance GHC.Classes.Eq Distribution.Types.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.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]
benchmarkTypeExe :: BenchmarkType
instance Data.Data.Data Distribution.Types.BenchmarkType.BenchmarkType
instance GHC.Classes.Ord 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 Distribution.Utils.Structured.Structured Distribution.Types.BenchmarkType.BenchmarkType
instance Control.DeepSeq.NFData Distribution.Types.BenchmarkType.BenchmarkType
instance Distribution.Pretty.Pretty Distribution.Types.BenchmarkType.BenchmarkType
instance Distribution.Parsec.Parsec Distribution.Types.BenchmarkType.BenchmarkType

module Distribution.Types.BenchmarkInterface

-- | The benchmark interfaces that are currently defined.
--   
--   More interfaces may be defined in future, either new revisions or
--   totally new interfaces.
data BenchmarkInterface

-- | Benchmark interface "exitcode-stdio-1.0". The benchmark takes the form
--   of an executable. It returns a zero exit code for success, non-zero
--   for failure. The stdout and stderr channels may be logged. Test
--   tooling may pass command line arguments and/or connect the stdin
--   channel to the test.
BenchmarkExeV10 :: Version -> FilePath -> BenchmarkInterface

-- | A benchmark that does not conform to one of the above interfaces for
--   the 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.Ord Distribution.Types.BenchmarkInterface.BenchmarkInterface
instance GHC.Classes.Eq Distribution.Types.BenchmarkInterface.BenchmarkInterface
instance Data.Binary.Class.Binary Distribution.Types.BenchmarkInterface.BenchmarkInterface
instance Distribution.Utils.Structured.Structured 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


-- | Defines a package identifier along with a parser and pretty printer
--   for it. <a>PackageIdentifier</a>s consist of a name and an exact
--   version. It also defines a <a>Dependency</a> data type. A dependency
--   is a package name and a version range, like <tt>"foo &gt;= 1.2
--   &amp;&amp; &lt; 2"</tt>.
module Distribution.Package

-- | Class of things that have a <a>PackageIdentifier</a>
--   
--   Types in this class are all notions of a package. This allows us to
--   have different types for the different phases that packages go though,
--   from simple name/id, package description, configured or installed
--   packages.
--   
--   Not all kinds of packages can be uniquely identified by a
--   <a>PackageIdentifier</a>. In particular, installed packages cannot,
--   there 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

-- | Class of installed packages.
--   
--   The primary data type which is an instance of this package is
--   <tt>InstalledPackageInfo</tt>, but when we are doing install plans in
--   Cabal install we may have other, installed package-like things which
--   contain more metadata. Installed packages have exact dependencies
--   <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.AbiDependency

-- | An ABI dependency is a dependency on a library which also records the
--   ABI hash (<tt>abiHash</tt>) of the library it depends on.
--   
--   The primary utility of this is to enable an extra sanity when GHC
--   loads libraries: it can check if the dependency has a matching ABI and
--   if not, refuse to load this library. This information is critical if
--   we are shadowing libraries; differences in the ABI hash let us know
--   what 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.Parsec Distribution.Types.AbiDependency.AbiDependency
instance Data.Binary.Class.Binary Distribution.Types.AbiDependency.AbiDependency
instance Distribution.Utils.Structured.Structured Distribution.Types.AbiDependency.AbiDependency
instance Control.DeepSeq.NFData Distribution.Types.AbiDependency.AbiDependency


-- | Package descriptions contain fields for specifying the name of a
--   software license and the name of the file containing the text of that
--   license. While package authors may choose any license they like, Cabal
--   provides an enumeration of a small set of common free and open source
--   software licenses. This is done so that Hackage can recognise
--   licenses, so that tools can detect <a>licensing conflicts</a>, and to
--   deter <a>license proliferation</a>.
--   
--   It is recommended that all package authors use the
--   <tt>license-file</tt> or <tt>license-files</tt> fields in their
--   package descriptions. Further information about these fields can be
--   found in the <a>Cabal users guide</a>.
--   
--   <h1>Additional resources</h1>
--   
--   The following websites provide information about free and open source
--   software licenses:
--   
--   <ul>
--   <li><a>The Open Source Initiative (OSI)</a></li>
--   <li><a>The Free Software Foundation (FSF)</a></li>
--   </ul>
--   
--   <h1>Disclaimer</h1>
--   
--   The descriptions of software licenses provided by this documentation
--   are intended for informational purposes only and in no way constitute
--   legal advice. Please read the text of the licenses and consult a
--   lawyer for any advice regarding software licensing.
module Distribution.License

-- | Indicates the license under which a package's source code is released.
--   Versions of the licenses not listed here will be rejected by Hackage
--   and 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
--   3</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
--   OSI and is incompatible with the GNU GPL. It is provided for
--   historical 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
--   dedicates it to the public domain. This is not a software license.
--   Please note that it is not possible to dedicate works to the public
--   domain in every jurisdiction, nor is a work that is in the public
--   domain in one jurisdiction necessarily in the public domain elsewhere.
PublicDomain :: License

-- | Explicitly 'All Rights Reserved', eg for proprietary software. The
--   package may not be legally modified or redistributed by anyone but the
--   rightsholder.
AllRightsReserved :: License

-- | No license specified which legally defaults to 'All Rights Reserved'.
--   The package may not be legally modified or redistributed by anyone but
--   the 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
--   are converted to <a>LicenseRef</a>.
licenseToSPDX :: License -> License

-- | Convert <a>License</a> to <a>License</a>,
--   
--   This is lossy conversion. We try our best.
--   
--   <pre>
--   &gt;&gt;&gt; licenseFromSPDX . licenseToSPDX $ BSD3
--   BSD3
--   </pre>
--   
--   <pre>
--   &gt;&gt;&gt; licenseFromSPDX . licenseToSPDX $ GPL (Just (mkVersion [3]))
--   GPL (Just (mkVersion [3]))
--   </pre>
--   
--   <pre>
--   &gt;&gt;&gt; licenseFromSPDX . licenseToSPDX $ PublicDomain
--   UnknownLicense "LicenseRefPublicDomain"
--   </pre>
--   
--   <pre>
--   &gt;&gt;&gt; licenseFromSPDX $ SPDX.License $ SPDX.simpleLicenseExpression SPDX.EUPL_1_1
--   UnknownLicense "EUPL-1.1"
--   </pre>
--   
--   <pre>
--   &gt;&gt;&gt; licenseFromSPDX . licenseToSPDX $ AllRightsReserved
--   AllRightsReserved
--   </pre>
--   
--   <pre>
--   &gt;&gt;&gt; licenseFromSPDX &lt;$&gt; simpleParsec "BSD-3-Clause OR GPL-3.0-only"
--   Just (UnknownLicense "BSD3ClauseORGPL30only")
--   </pre>
licenseFromSPDX :: License -> License
instance Data.Data.Data Distribution.License.License
instance GHC.Classes.Ord 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 Distribution.Utils.Structured.Structured Distribution.License.License
instance Control.DeepSeq.NFData Distribution.License.License
instance Distribution.Pretty.Pretty Distribution.License.License
instance Distribution.Parsec.Parsec Distribution.License.License

module Distribution.Types.InstalledPackageInfo
data InstalledPackageInfo
InstalledPackageInfo :: PackageId -> LibraryName -> ComponentId -> LibraryVisibility -> UnitId -> [(ModuleName, OpenModule)] -> String -> Either License License -> !ShortText -> !ShortText -> !ShortText -> !ShortText -> !ShortText -> !ShortText -> !ShortText -> !ShortText -> !ShortText -> AbiHash -> Bool -> Bool -> [ExposedModule] -> [ModuleName] -> Bool -> [FilePath] -> [FilePath] -> [FilePath] -> [FilePath] -> FilePath -> [String] -> [String] -> [String] -> [String] -> [FilePath] -> [String] -> [UnitId] -> [AbiDependency] -> [String] -> [String] -> [String] -> [FilePath] -> [String] -> [FilePath] -> [FilePath] -> Maybe FilePath -> InstalledPackageInfo
[sourcePackageId] :: InstalledPackageInfo -> PackageId
[sourceLibName] :: InstalledPackageInfo -> LibraryName
[installedComponentId_] :: InstalledPackageInfo -> ComponentId
[libVisibility] :: InstalledPackageInfo -> LibraryVisibility
[installedUnitId] :: InstalledPackageInfo -> UnitId
[instantiatedWith] :: InstalledPackageInfo -> [(ModuleName, OpenModule)]
[compatPackageKey] :: InstalledPackageInfo -> String
[license] :: InstalledPackageInfo -> Either License License
[copyright] :: InstalledPackageInfo -> !ShortText
[maintainer] :: InstalledPackageInfo -> !ShortText
[author] :: InstalledPackageInfo -> !ShortText
[stability] :: InstalledPackageInfo -> !ShortText
[homepage] :: InstalledPackageInfo -> !ShortText
[pkgUrl] :: InstalledPackageInfo -> !ShortText
[synopsis] :: InstalledPackageInfo -> !ShortText
[description] :: InstalledPackageInfo -> !ShortText
[category] :: InstalledPackageInfo -> !ShortText
[abiHash] :: InstalledPackageInfo -> AbiHash
[indefinite] :: InstalledPackageInfo -> Bool
[exposed] :: InstalledPackageInfo -> Bool
[exposedModules] :: InstalledPackageInfo -> [ExposedModule]
[hiddenModules] :: InstalledPackageInfo -> [ModuleName]
[trusted] :: InstalledPackageInfo -> Bool
[importDirs] :: InstalledPackageInfo -> [FilePath]
[libraryDirs] :: InstalledPackageInfo -> [FilePath]
[libraryDirsStatic] :: InstalledPackageInfo -> [FilePath]

-- | overrides <a>libraryDirs</a>
[libraryDynDirs] :: InstalledPackageInfo -> [FilePath]
[dataDir] :: InstalledPackageInfo -> FilePath
[hsLibraries] :: InstalledPackageInfo -> [String]
[extraLibraries] :: InstalledPackageInfo -> [String]
[extraLibrariesStatic] :: InstalledPackageInfo -> [String]
[extraGHCiLibraries] :: InstalledPackageInfo -> [String]
[includeDirs] :: InstalledPackageInfo -> [FilePath]
[includes] :: InstalledPackageInfo -> [String]
[depends] :: InstalledPackageInfo -> [UnitId]
[abiDepends] :: InstalledPackageInfo -> [AbiDependency]
[ccOptions] :: InstalledPackageInfo -> [String]
[cxxOptions] :: 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
--   compatibility with old versions of GHC.
mungedPackageName :: InstalledPackageInfo -> MungedPackageName

-- | An ABI dependency is a dependency on a library which also records the
--   ABI hash (<tt>abiHash</tt>) of the library it depends on.
--   
--   The primary utility of this is to enable an extra sanity when GHC
--   loads libraries: it can check if the dependency has a matching ABI and
--   if not, refuse to load this library. This information is critical if
--   we are shadowing libraries; differences in the ABI hash let us know
--   what 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 Distribution.Utils.Structured.Structured 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
installedUnitId :: Lens' InstalledPackageInfo UnitId
sourcePackageId :: Lens' InstalledPackageInfo PackageIdentifier
license :: Lens' InstalledPackageInfo (Either License License)
abiHash :: Lens' InstalledPackageInfo AbiHash
sourceLibName :: Lens' InstalledPackageInfo LibraryName
installedComponentId_ :: Lens' InstalledPackageInfo ComponentId
libVisibility :: Lens' InstalledPackageInfo LibraryVisibility
instantiatedWith :: Lens' InstalledPackageInfo [(ModuleName, OpenModule)]
compatPackageKey :: Lens' InstalledPackageInfo String
copyright :: Lens' InstalledPackageInfo ShortText
maintainer :: Lens' InstalledPackageInfo ShortText
author :: Lens' InstalledPackageInfo ShortText
stability :: Lens' InstalledPackageInfo ShortText
homepage :: Lens' InstalledPackageInfo ShortText
pkgUrl :: Lens' InstalledPackageInfo ShortText
synopsis :: Lens' InstalledPackageInfo ShortText
description :: Lens' InstalledPackageInfo ShortText
category :: Lens' InstalledPackageInfo ShortText
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]
libraryDirsStatic :: Lens' InstalledPackageInfo [FilePath]
libraryDynDirs :: Lens' InstalledPackageInfo [FilePath]
dataDir :: Lens' InstalledPackageInfo FilePath
hsLibraries :: Lens' InstalledPackageInfo [String]
extraLibraries :: Lens' InstalledPackageInfo [String]
extraLibrariesStatic :: 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]
cxxOptions :: 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 parse result type for parsers from AST to Haskell types.
module Distribution.Fields.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
--   successful value or list of errors and possibly recovered a
--   spec-version declaration.
runParseResult :: ParseResult a -> ([PWarning], Either (Maybe Version, NonEmpty PError) a)

-- | <a>Recover</a> the parse result, so we can proceed parsing.
--   <a>runParseResult</a> will still result in <a>Nothing</a>, if there
--   are 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.
--   
--   For 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 ()

-- | Forget <a>ParseResult</a>s warnings.
withoutWarnings :: ParseResult a -> ParseResult a
instance GHC.Base.Functor Distribution.Fields.ParseResult.ParseResult
instance GHC.Base.Applicative Distribution.Fields.ParseResult.ParseResult
instance GHC.Base.Monad Distribution.Fields.ParseResult.ParseResult


-- | Utilities to work with <tt>.cabal</tt> like file structure.
module Distribution.Fields

-- | A Cabal-like file consists of a series of fields (<tt>foo: bar</tt>)
--   and 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.
--   
--   <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
--   field may contain multiple lines.
--   
--   <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 something which looks like number. Also many dot
--   numbers, i.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
type FieldName = ByteString

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

-- | Like <a>readFields</a> but also return lexer warnings
readFields' :: ByteString -> Either ParseError ([Field Position], [LexWarning])

-- | A monad with failure and accumulating errors and warnings.
data ParseResult a

-- | Destruct a <a>ParseResult</a> into the emitted warnings and either a
--   successful value or list of errors and possibly recovered a
--   spec-version declaration.
runParseResult :: ParseResult a -> ([PWarning], Either (Maybe Version, NonEmpty PError) 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.
--   
--   For fatal failure use <a>parseFatalFailure</a>
parseFailure :: Position -> String -> ParseResult ()

-- | Add an fatal error.
parseFatalFailure :: Position -> String -> ParseResult a

-- | Type of parser warning. We do classify warnings.
--   
--   Different application may decide not to show some, or have fatal
--   behaviour 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
--   <a>https://github.com/haskell/cabal/issues/5020</a>.
PWTBuildTypeDefault :: PWarnType

-- | Version operators used (without cabal-version: 1.8)
PWTVersionOperator :: PWarnType

-- | Version wildcard used (without cabal-version: 1.6)
PWTVersionWildcard :: PWarnType

-- | Warnings about cabal-version format.
PWTSpecVersion :: PWarnType

-- | Empty filepath, i.e. literally ""
PWTEmptyFilePath :: PWarnType

-- | Experimental feature
PWTExperimental :: PWarnType

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

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

-- | This type is used to discern when a comment block should go before or
--   after a cabal-like file field, otherwise it would be hardcoded to a
--   single position. It is often used in conjunction with
--   <tt>PrettyField</tt>.
data CommentPosition
CommentBefore :: [String] -> CommentPosition
CommentAfter :: [String] -> CommentPosition
NoComment :: CommentPosition
data PrettyField ann
PrettyField :: ann -> FieldName -> Doc -> PrettyField ann
PrettySection :: ann -> FieldName -> [Doc] -> [PrettyField ann] -> PrettyField ann
PrettyEmpty :: PrettyField ann

-- | Prettyprint a list of fields.
--   
--   Note: the first argument should return <a>String</a>s without newlines
--   and properly prefixes (with <tt>--</tt>) to count as comments. This
--   unsafety is left in place so one could generate empty lines between
--   comment lines.
showFields :: (ann -> CommentPosition) -> [PrettyField ann] -> String
genericFromParsecFields :: Applicative f => (FieldName -> [FieldLine ann] -> f Doc) -> (FieldName -> [SectionArg ann] -> f [Doc]) -> [Field ann] -> f [PrettyField ann]

-- | Simple variant of <tt>genericFromParsecField</tt>
fromParsecFields :: [Field ann] -> [PrettyField ann]


-- | Haskell language dialects and extensions
module Language.Haskell.Extension

-- | This represents a Haskell language dialect.
--   
--   Language <a>Extension</a>s are interpreted relative to one of these
--   base languages.
data Language

-- | The Haskell 98 language as defined by the Haskell 98 report.
--   <a>http://haskell.org/onlinereport/</a>
Haskell98 :: Language

-- | The Haskell 2010 language as defined by the Haskell 2010 report.
--   <a>http://www.haskell.org/onlinereport/haskell2010</a>
Haskell2010 :: Language

-- | The GHC2021 collection of language extensions.
--   <a>https://github.com/ghc-proposals/ghc-proposals/blob/master/proposals/0380-ghc2021.rst</a>
GHC2021 :: Language

-- | An unknown language, identified by its name.
UnknownLanguage :: String -> Language

-- | List of known (supported) languages for GHC
knownLanguages :: [Language]
classifyLanguage :: String -> Language

-- | This represents language extensions beyond a base <a>Language</a>
--   definition (such as <a>Haskell98</a>) that are supported by some
--   implementations, usually in some special mode.
--   
--   Where applicable, references are given to an implementation's official
--   documentation.
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>
--   pragma.
UnknownExtension :: String -> Extension

-- | Known Haskell language extensions, including deprecated and
--   undocumented ones.
--   
--   Check <a>“Overview of all language extensions” in GHC User’s Guide</a>
--   for more information.
data KnownExtension

-- | Allow overlapping class instances, provided there is a unique most
--   specific instance for each use.
OverlappingInstances :: KnownExtension

-- | Ignore structural rules guaranteeing the termination of class instance
--   resolution. Termination is guaranteed by a fixed-depth recursion
--   stack, and compilation may fail if this depth is exceeded.
UndecidableInstances :: KnownExtension

-- | Implies <a>OverlappingInstances</a>. Allow the implementation to
--   choose an instance even when it is possible that further instantiation
--   of types will lead to a more specific instance being applicable.
IncoherentInstances :: KnownExtension

-- | <i>(deprecated)</i> Deprecated in favour of <a>RecursiveDo</a>.
--   
--   Old description: Allow recursive bindings in <tt>do</tt> blocks, using
--   the <tt>rec</tt> keyword. See also <a>RecursiveDo</a>.
DoRec :: KnownExtension

-- | Allow recursive bindings in <tt>do</tt> blocks, using the <tt>rec</tt>
--   keyword, or <tt>mdo</tt>, a variant of <tt>do</tt>.
RecursiveDo :: KnownExtension

-- | Provide syntax for writing list comprehensions which iterate over
--   several lists together, like the <a>zipWith</a> family of functions.
ParallelListComp :: KnownExtension

-- | Allow multiple parameters in a type class.
MultiParamTypeClasses :: KnownExtension

-- | Enable the dreaded monomorphism restriction.
MonomorphismRestriction :: KnownExtension

-- | Enable deep subsumption, relaxing the simple subsumption rules,
--   implicitly inserting eta-expansions when matching up function types
--   with different quantification structures.
DeepSubsumption :: KnownExtension

-- | Allow a specification attached to a multi-parameter type class which
--   indicates that some parameters are entirely determined by others. The
--   implementation will check that this property holds for the declared
--   instances, and will use this property to reduce ambiguity in instance
--   resolution.
FunctionalDependencies :: KnownExtension

-- | <i>(deprecated)</i> A synonym for <a>RankNTypes</a>.
--   
--   Old description: Like <a>RankNTypes</a> but does not allow a
--   higher-rank type to itself appear on the left of a function arrow.
Rank2Types :: KnownExtension

-- | Allow a universally-quantified type to occur on the left of a function
--   arrow.
RankNTypes :: KnownExtension

-- | <i>(deprecated)</i> A synonym for <a>RankNTypes</a>.
--   
--   Old description: Allow data constructors to have polymorphic
--   arguments. Unlike <a>RankNTypes</a>, does not allow this for ordinary
--   functions.
PolymorphicComponents :: KnownExtension

-- | Allow existentially-quantified data constructors.
ExistentialQuantification :: KnownExtension

-- | Cause a type variable in a signature, which has an explicit
--   <tt>forall</tt> quantifier, to scope over the definition of the
--   accompanying value declaration.
ScopedTypeVariables :: KnownExtension

-- | Deprecated, use <a>ScopedTypeVariables</a> instead.
PatternSignatures :: KnownExtension

-- | Enable implicit function parameters with dynamic scope.
ImplicitParams :: KnownExtension

-- | Relax some restrictions on the form of the context of a type
--   signature.
FlexibleContexts :: KnownExtension

-- | Relax some restrictions on the form of the context of an instance
--   declaration.
FlexibleInstances :: KnownExtension

-- | Allow data type declarations with no constructors.
EmptyDataDecls :: KnownExtension

-- | Run the C preprocessor on Haskell source code.
CPP :: KnownExtension

-- | Allow an explicit kind signature giving the kind of types over which a
--   type variable ranges.
KindSignatures :: KnownExtension

-- | Enable a form of pattern which forces evaluation before an attempted
--   match, and a form of strict <tt>let</tt>/<tt>where</tt> binding.
BangPatterns :: KnownExtension

-- | Allow type synonyms in instance heads.
TypeSynonymInstances :: KnownExtension

-- | Enable Template Haskell, a system for compile-time metaprogramming.
TemplateHaskell :: KnownExtension

-- | Enable the Foreign Function Interface. In GHC, implements the standard
--   Haskell 98 Foreign Function Interface Addendum, plus some GHC-specific
--   extensions.
ForeignFunctionInterface :: KnownExtension

-- | Enable arrow notation.
Arrows :: KnownExtension

-- | <i>(deprecated)</i> Enable generic type classes, with default
--   instances defined in terms of the algebraic structure of a type.
Generics :: KnownExtension

-- | Enable the implicit importing of the module <a>Prelude</a>. When
--   disabled, when desugaring certain built-in syntax into ordinary
--   identifiers, use whatever is in scope rather than the <a>Prelude</a>
--   -- version.
ImplicitPrelude :: KnownExtension

-- | Enable syntax for implicitly binding local names corresponding to the
--   field names of a record. Puns bind specific names, unlike
--   <a>RecordWildCards</a>.
NamedFieldPuns :: KnownExtension

-- | Enable a form of guard which matches a pattern and binds variables.
PatternGuards :: KnownExtension

-- | Allow a type declared with <tt>newtype</tt> to use <tt>deriving</tt>
--   for any class with an instance for the underlying type.
GeneralizedNewtypeDeriving :: KnownExtension
GeneralisedNewtypeDeriving :: KnownExtension

-- | Enable the "Trex" extensible records system.
ExtensibleRecords :: KnownExtension

-- | Enable type synonyms which are transparent in some definitions and
--   opaque elsewhere, as a way of implementing abstract datatypes.
RestrictedTypeSynonyms :: KnownExtension

-- | Enable an alternate syntax for string literals, with string
--   templating.
HereDocuments :: KnownExtension

-- | Allow the character <tt>#</tt> as a postfix modifier on identifiers.
--   Also enables literal syntax for unboxed values.
MagicHash :: KnownExtension

-- | Allow data types and type synonyms which are indexed by types, i.e.
--   ad-hoc polymorphism for types.
TypeFamilies :: KnownExtension

-- | Allow a standalone declaration which invokes the type class
--   <tt>deriving</tt> mechanism.
StandaloneDeriving :: KnownExtension

-- | Allow certain Unicode characters to stand for certain ASCII character
--   sequences, e.g. keywords and punctuation.
UnicodeSyntax :: KnownExtension

-- | Allow the use of unboxed types as foreign types, e.g. in <tt>foreign
--   import</tt> and <tt>foreign export</tt>.
UnliftedFFITypes :: KnownExtension

-- | Enable interruptible FFI.
InterruptibleFFI :: KnownExtension

-- | Allow use of CAPI FFI calling convention (<tt>foreign import
--   capi</tt>).
CApiFFI :: KnownExtension

-- | Defer validity checking of types until after expanding type synonyms,
--   relaxing the constraints on how synonyms may be used.
LiberalTypeSynonyms :: KnownExtension

-- | Allow the name of a type constructor, type class, or type variable to
--   be an infix operator.
TypeOperators :: KnownExtension

-- | Enable syntax for implicitly binding local names corresponding to the
--   field names of a record. A wildcard binds all unmentioned names,
--   unlike <a>NamedFieldPuns</a>.
RecordWildCards :: KnownExtension

-- | Deprecated, use <a>NamedFieldPuns</a> instead.
RecordPuns :: KnownExtension

-- | Allow a record field name to be disambiguated by the type of the
--   record it's in.
DisambiguateRecordFields :: KnownExtension

-- | Enable traditional record syntax (as supported by Haskell 98)
TraditionalRecordSyntax :: KnownExtension

-- | Enable overloading of string literals using a type class, much like
--   integer literals.
OverloadedStrings :: KnownExtension

-- | Enable generalized algebraic data types, in which type variables may
--   be instantiated on a per-constructor basis. Implies <a>GADTSyntax</a>.
GADTs :: KnownExtension

-- | Enable GADT syntax for declaring ordinary algebraic datatypes.
GADTSyntax :: KnownExtension

-- | <i>(deprecated)</i> Has no effect.
--   
--   Old description: Make pattern bindings monomorphic.
MonoPatBinds :: KnownExtension

-- | Relax the requirements on mutually-recursive polymorphic functions.
RelaxedPolyRec :: KnownExtension

-- | Allow default instantiation of polymorphic types in more situations.
ExtendedDefaultRules :: KnownExtension

-- | Enable unboxed tuples.
UnboxedTuples :: KnownExtension

-- | Enable <tt>deriving</tt> for classes <a>Typeable</a> and <a>Data</a>.
DeriveDataTypeable :: KnownExtension

-- | Enable <tt>deriving</tt> for <a>Generic</a> and <a>Generic1</a>.
DeriveGeneric :: KnownExtension

-- | Enable support for default signatures.
DefaultSignatures :: KnownExtension

-- | Allow type signatures to be specified in instance declarations.
InstanceSigs :: KnownExtension

-- | Allow a class method's type to place additional constraints on a class
--   type variable.
ConstrainedClassMethods :: KnownExtension

-- | Allow imports to be qualified by the package name the module is
--   intended to be imported from, e.g.
--   
--   <pre>
--   import "network" Network.Socket
--   </pre>
PackageImports :: KnownExtension

-- | <i>(deprecated)</i> Allow a type variable to be instantiated at a
--   polymorphic type.
ImpredicativeTypes :: KnownExtension

-- | <i>(deprecated)</i> Change the syntax for qualified infix operators.
NewQualifiedOperators :: KnownExtension

-- | Relax the interpretation of left operator sections to allow unary
--   postfix operators.
PostfixOperators :: KnownExtension

-- | Enable quasi-quotation, a mechanism for defining new concrete syntax
--   for expressions and patterns.
QuasiQuotes :: KnownExtension

-- | Enable generalized list comprehensions, supporting operations such as
--   sorting and grouping.
TransformListComp :: KnownExtension

-- | Enable monad comprehensions, which generalise the list comprehension
--   syntax to work for any monad.
MonadComprehensions :: KnownExtension

-- | Enable view patterns, which match a value by applying a function and
--   matching on the result.
ViewPatterns :: KnownExtension

-- | Allow concrete XML syntax to be used in expressions and patterns, as
--   per the Haskell Server Pages extension language:
--   <a>http://www.haskell.org/haskellwiki/HSP</a>. The ideas behind it are
--   discussed in the paper "Haskell Server Pages through Dynamic Loading"
--   by Niklas Broberg, from Haskell Workshop '05.
XmlSyntax :: KnownExtension

-- | Allow regular pattern matching over lists, as discussed in the paper
--   "Regular Expression Patterns" by Niklas Broberg, Andreas Farre and
--   Josef Svenningsson, from ICFP '04.
RegularPatterns :: KnownExtension

-- | Enable the use of tuple sections, e.g. <tt>(, True)</tt> desugars into
--   <tt>x -&gt; (x, True)</tt>.
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
--   an integer literal.
NPlusKPatterns :: KnownExtension

-- | Improve the layout rule when <tt>if</tt> expressions are used in a
--   <tt>do</tt> block.
DoAndIfThenElse :: KnownExtension

-- | Enable support for multi-way <tt>if</tt>-expressions.
MultiWayIf :: KnownExtension

-- | Enable support lambda-<tt>case</tt> expressions.
LambdaCase :: KnownExtension

-- | Makes much of the Haskell sugar be desugared into calls to the
--   function with a particular name that is in scope.
RebindableSyntax :: KnownExtension

-- | Make <tt>forall</tt> a keyword in types, which can be used to give the
--   generalisation explicitly.
ExplicitForAll :: KnownExtension

-- | Allow contexts to be put on datatypes, e.g. the <tt>Eq a</tt> in
--   <tt>data Eq a =&gt; Set a = NilSet | ConsSet a (Set a)</tt>.
DatatypeContexts :: KnownExtension

-- | Local (<tt>let</tt> and <tt>where</tt>) bindings are monomorphic.
MonoLocalBinds :: KnownExtension

-- | Enable <tt>deriving</tt> for the <a>Functor</a> class.
DeriveFunctor :: KnownExtension

-- | Enable <tt>deriving</tt> for the <a>Traversable</a> class.
DeriveTraversable :: KnownExtension

-- | Enable <tt>deriving</tt> for the <a>Foldable</a> class.
DeriveFoldable :: KnownExtension

-- | Enable non-decreasing indentation for <tt>do</tt> blocks.
NondecreasingIndentation :: KnownExtension

-- | Allow imports to be qualified with a safe keyword that requires the
--   imported module be trusted as according to the Safe Haskell definition
--   of trust.
--   
--   <pre>
--   import safe Network.Socket
--   </pre>
SafeImports :: KnownExtension

-- | Compile a module in the Safe, Safe Haskell mode -- a restricted form
--   of the Haskell language to ensure type safety.
Safe :: KnownExtension

-- | Compile a module in the Trustworthy, Safe Haskell mode -- no
--   restrictions apply but the module is marked as trusted as long as the
--   package the module resides in is trusted.
Trustworthy :: KnownExtension

-- | Compile a module in the Unsafe, Safe Haskell mode so that modules
--   compiled using Safe, Safe Haskell mode can't import it.
Unsafe :: KnownExtension

-- | Allow type class<i>implicit parameter</i>equality constraints to be
--   used as types with the special kind constraint. Also generalise the
--   <tt>(ctxt =&gt; ty)</tt> syntax so that any type of kind constraint
--   can occur before the arrow.
ConstraintKinds :: KnownExtension

-- | Enable kind polymorphism.
PolyKinds :: KnownExtension

-- | Enable datatype promotion.
DataKinds :: KnownExtension

-- | Enable <tt>type data</tt> declarations, defining constructors at the
--   type level.
TypeData :: KnownExtension

-- | Enable parallel arrays syntax (<tt>[:</tt>, <tt>:]</tt>) for <i>Data
--   Parallel Haskell</i>.
ParallelArrays :: KnownExtension

-- | Enable explicit role annotations, like in (<tt>type role Foo
--   representational representational</tt>).
RoleAnnotations :: KnownExtension

-- | Enable overloading of list literals, arithmetic sequences and list
--   patterns using the <tt>IsList</tt> type class.
OverloadedLists :: KnownExtension

-- | Enable case expressions that have no alternatives. Also applies to
--   lambda-case expressions if they are enabled.
EmptyCase :: KnownExtension

-- | <i>(deprecated)</i> Deprecated in favour of <a>DeriveDataTypeable</a>.
--   
--   Old description: Triggers the generation of derived <a>Typeable</a>
--   instances for every datatype and type class declaration.
AutoDeriveTypeable :: KnownExtension

-- | Desugars negative literals directly (without using negate).
NegativeLiterals :: KnownExtension

-- | Allow the use of binary integer literal syntax (e.g.
--   <tt>0b11001001</tt> to denote <tt>201</tt>).
BinaryLiterals :: KnownExtension

-- | Allow the use of floating literal syntax for all instances of
--   <a>Num</a>, including <a>Int</a> and <a>Integer</a>.
NumDecimals :: KnownExtension

-- | Enable support for type classes with no type parameter.
NullaryTypeClasses :: KnownExtension

-- | Enable explicit namespaces in module import/export lists.
ExplicitNamespaces :: KnownExtension

-- | Allow the user to write ambiguous types, and the type inference engine
--   to infer them.
AllowAmbiguousTypes :: KnownExtension

-- | Enable <tt>foreign import javascript</tt>.
JavaScriptFFI :: KnownExtension

-- | Allow giving names to and abstracting over patterns.
PatternSynonyms :: KnownExtension

-- | Allow anonymous placeholders (underscore) inside type signatures. The
--   type inference engine will generate a message describing the type
--   inferred at the hole's location.
PartialTypeSignatures :: KnownExtension

-- | Allow named placeholders written with a leading underscore inside type
--   signatures. Wildcards with the same name unify to the same type.
NamedWildCards :: KnownExtension

-- | Enable <tt>deriving</tt> for any class.
DeriveAnyClass :: KnownExtension

-- | Enable <tt>deriving</tt> for the <a>Lift</a> class.
DeriveLift :: KnownExtension

-- | Enable support for 'static pointers' (and the <tt>static</tt> keyword)
--   to refer to globally stable names, even across different programs.
StaticPointers :: KnownExtension

-- | Switches data type declarations to be strict by default (as if they
--   had a bang using <tt>BangPatterns</tt>), and allow opt-in field
--   laziness using <tt>~</tt>.
StrictData :: KnownExtension

-- | Switches all pattern bindings to be strict by default (as if they had
--   a bang using <tt>BangPatterns</tt>), ordinary patterns are recovered
--   using <tt>~</tt>. Implies <tt>StrictData</tt>.
Strict :: KnownExtension

-- | Allows <tt>do</tt>-notation for types that are
--   <tt><a>Applicative</a></tt> as well as <tt><a>Monad</a></tt>. When
--   enabled, desugaring <tt>do</tt> notation tries to use
--   <tt>(<a>*</a>)</tt> and <tt><a>fmap</a></tt> and <tt><a>join</a></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
--   compiler to reason about kind equality and therefore enabling GADTs to
--   be promoted to the type-level.
TypeInType :: KnownExtension

-- | Allow recursive (and therefore undecidable) super-class relationships.
UndecidableSuperClasses :: KnownExtension

-- | A temporary extension to help library authors check if their code will
--   compile 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
--   them as injective.
TypeFamilyDependencies :: KnownExtension

-- | Allow multiple <tt>deriving</tt> clauses, each optionally qualified
--   with a <i>strategy</i>.
DerivingStrategies :: KnownExtension

-- | Enable deriving instances via types of the same runtime
--   representation. Implies <a>DerivingStrategies</a>.
DerivingVia :: KnownExtension

-- | Enable the use of unboxed sum syntax.
UnboxedSums :: KnownExtension

-- | Allow use of hexadecimal literal notation for floating-point values.
HexFloatLiterals :: KnownExtension

-- | Allow <tt>do</tt> blocks etc. in argument position.
BlockArguments :: KnownExtension

-- | Allow use of underscores in numeric literals.
NumericUnderscores :: KnownExtension

-- | Allow <tt>forall</tt> in constraints.
QuantifiedConstraints :: KnownExtension

-- | Have <tt>*</tt> refer to <tt>Type</tt>.
StarIsType :: KnownExtension

-- | Liberalises deriving to provide instances for empty data types.
EmptyDataDeriving :: KnownExtension

-- | Enable detection of complete user-supplied kind signatures.
CUSKs :: KnownExtension

-- | Allows the syntax <tt>import M qualified</tt>.
ImportQualifiedPost :: KnownExtension

-- | Allow the use of standalone kind signatures.
StandaloneKindSignatures :: KnownExtension

-- | Enable unlifted newtypes.
UnliftedNewtypes :: KnownExtension

-- | Use whitespace to determine whether the minus sign stands for negation
--   or subtraction.
LexicalNegation :: KnownExtension

-- | Enable qualified do-notation desugaring.
QualifiedDo :: KnownExtension

-- | Enable linear types.
LinearTypes :: KnownExtension

-- | Allow the use of visible forall in types of terms.
RequiredTypeArguments :: KnownExtension

-- | Enable the generation of selector functions corresponding to record
--   fields.
FieldSelectors :: KnownExtension

-- | Enable the use of record dot-accessor and updater syntax
OverloadedRecordDot :: KnownExtension

-- | Provides record <tt>.</tt> syntax in record updates, e.g. <tt>x
--   {foo.bar = 1}</tt>.
OverloadedRecordUpdate :: KnownExtension

-- | Enable data types for which an unlifted or levity-polymorphic result
--   kind is inferred.
UnliftedDatatypes :: KnownExtension

-- | Undocumented parsing-related extensions introduced in GHC 7.0.
AlternativeLayoutRule :: KnownExtension

-- | Undocumented parsing-related extensions introduced in GHC 7.0.
AlternativeLayoutRuleTransitional :: KnownExtension

-- | Undocumented parsing-related extensions introduced in GHC 7.2.
RelaxedLayout :: KnownExtension

-- | Extensions that have been deprecated, possibly paired with another
--   extension that replaces it.
deprecatedExtensions :: [(Extension, Maybe Extension)]
classifyExtension :: String -> Extension
knownExtensions :: [KnownExtension]
instance Data.Data.Data Language.Haskell.Extension.Language
instance GHC.Classes.Ord 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.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.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.Binary.Class.Binary Language.Haskell.Extension.Extension
instance Distribution.Utils.Structured.Structured Language.Haskell.Extension.Extension
instance Control.DeepSeq.NFData Language.Haskell.Extension.Extension
instance Distribution.Pretty.Pretty Language.Haskell.Extension.Extension
instance Distribution.Parsec.Parsec Language.Haskell.Extension.Extension
instance Data.Binary.Class.Binary Language.Haskell.Extension.KnownExtension
instance Distribution.Utils.Structured.Structured Language.Haskell.Extension.KnownExtension
instance Control.DeepSeq.NFData Language.Haskell.Extension.KnownExtension
instance Distribution.Pretty.Pretty Language.Haskell.Extension.KnownExtension
instance Data.Binary.Class.Binary Language.Haskell.Extension.Language
instance Distribution.Utils.Structured.Structured Language.Haskell.Extension.Language
instance Control.DeepSeq.NFData Language.Haskell.Extension.Language
instance Distribution.Pretty.Pretty Language.Haskell.Extension.Language
instance Distribution.Parsec.Parsec Language.Haskell.Extension.Language


-- | This has an enumeration of the various compilers that Cabal knows
--   about. It also specifies the default compiler. Sadly you'll often see
--   code that does case analysis on this compiler flavour enumeration
--   like:
--   
--   <pre>
--   case compilerFlavor comp of
--     GHC -&gt; GHC.getInstalledPackages verbosity packageDb progdb
--   </pre>
--   
--   Obviously it would be better to use the proper <tt>Compiler</tt>
--   abstraction because that would keep all the compiler-specific code
--   together. Unfortunately we cannot make this change yet without
--   breaking the <tt>UserHooks</tt> api, which would break all custom
--   <tt>Setup.hs</tt> files, so for the moment we just have to live with
--   this 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
Eta :: CompilerFlavor
HaskellSuite :: String -> CompilerFlavor
OtherCompiler :: String -> CompilerFlavor
buildCompilerId :: CompilerId
buildCompilerFlavor :: CompilerFlavor

-- | The default compiler flavour to pick when compiling stuff. This
--   defaults to the compiler used to build the Cabal lib.
--   
--   However if it's not a recognised compiler then it's <a>Nothing</a> and
--   the user will have to specify which compiler they want.
defaultCompilerFlavor :: Maybe CompilerFlavor
classifyCompilerFlavor :: String -> CompilerFlavor
knownCompilerFlavors :: [CompilerFlavor]

-- | <a>PerCompilerFlavor</a> carries only info per GHC and GHCJS
--   
--   Cabal parses only <tt>ghc-options</tt> and <tt>ghcjs-options</tt>,
--   others are omitted.
data PerCompilerFlavor v
PerCompilerFlavor :: v -> v -> PerCompilerFlavor v
perCompilerFlavorToList :: PerCompilerFlavor v -> [(CompilerFlavor, v)]
data CompilerId
CompilerId :: CompilerFlavor -> Version -> CompilerId

-- | Compiler information used for resolving configurations. Some fields
--   can 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,
--   if 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
--   CompilerId, its AbiTag and that it does not claim to be compatible
--   with other compiler id's.
unknownCompilerInfo :: CompilerId -> AbiTag -> CompilerInfo
data AbiTag
NoAbiTag :: AbiTag
AbiTag :: String -> AbiTag
abiTagString :: AbiTag -> String
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.Traversable.Traversable Distribution.Compiler.PerCompilerFlavor
instance Data.Foldable.Foldable Distribution.Compiler.PerCompilerFlavor
instance GHC.Base.Functor Distribution.Compiler.PerCompilerFlavor
instance Data.Data.Data v => Data.Data.Data (Distribution.Compiler.PerCompilerFlavor v)
instance GHC.Classes.Ord v => GHC.Classes.Ord (Distribution.Compiler.PerCompilerFlavor v)
instance GHC.Classes.Eq v => GHC.Classes.Eq (Distribution.Compiler.PerCompilerFlavor v)
instance GHC.Read.Read v => GHC.Read.Read (Distribution.Compiler.PerCompilerFlavor v)
instance GHC.Show.Show v => GHC.Show.Show (Distribution.Compiler.PerCompilerFlavor v)
instance GHC.Generics.Generic (Distribution.Compiler.PerCompilerFlavor v)
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 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.Read.Read Distribution.Compiler.CompilerInfo
instance GHC.Show.Show Distribution.Compiler.CompilerInfo
instance GHC.Generics.Generic Distribution.Compiler.CompilerInfo
instance Data.Binary.Class.Binary Distribution.Compiler.CompilerInfo
instance Data.Binary.Class.Binary Distribution.Compiler.AbiTag
instance Distribution.Utils.Structured.Structured Distribution.Compiler.AbiTag
instance Distribution.Pretty.Pretty Distribution.Compiler.AbiTag
instance Distribution.Parsec.Parsec Distribution.Compiler.AbiTag
instance Data.Binary.Class.Binary Distribution.Compiler.CompilerId
instance Distribution.Utils.Structured.Structured Distribution.Compiler.CompilerId
instance Control.DeepSeq.NFData Distribution.Compiler.CompilerId
instance Distribution.Pretty.Pretty Distribution.Compiler.CompilerId
instance Distribution.Parsec.Parsec Distribution.Compiler.CompilerId
instance Data.Binary.Class.Binary a => Data.Binary.Class.Binary (Distribution.Compiler.PerCompilerFlavor a)
instance Distribution.Utils.Structured.Structured a => Distribution.Utils.Structured.Structured (Distribution.Compiler.PerCompilerFlavor a)
instance Control.DeepSeq.NFData a => Control.DeepSeq.NFData (Distribution.Compiler.PerCompilerFlavor a)
instance GHC.Base.Semigroup a => GHC.Base.Semigroup (Distribution.Compiler.PerCompilerFlavor a)
instance (GHC.Base.Semigroup a, GHC.Base.Monoid a) => GHC.Base.Monoid (Distribution.Compiler.PerCompilerFlavor a)
instance Data.Binary.Class.Binary Distribution.Compiler.CompilerFlavor
instance Distribution.Utils.Structured.Structured Distribution.Compiler.CompilerFlavor
instance Control.DeepSeq.NFData Distribution.Compiler.CompilerFlavor
instance Distribution.Pretty.Pretty Distribution.Compiler.CompilerFlavor
instance Distribution.Parsec.Parsec Distribution.Compiler.CompilerFlavor

module Distribution.Types.ConfVar

-- | A <tt>ConfVar</tt> represents the variable type used.
data ConfVar
OS :: OS -> ConfVar
Arch :: Arch -> ConfVar
PackageFlag :: FlagName -> ConfVar
Impl :: CompilerFlavor -> VersionRange -> ConfVar
instance GHC.Generics.Generic Distribution.Types.ConfVar.ConfVar
instance Data.Data.Data Distribution.Types.ConfVar.ConfVar
instance GHC.Show.Show Distribution.Types.ConfVar.ConfVar
instance GHC.Classes.Eq Distribution.Types.ConfVar.ConfVar
instance Data.Binary.Class.Binary Distribution.Types.ConfVar.ConfVar
instance Distribution.Utils.Structured.Structured Distribution.Types.ConfVar.ConfVar
instance Control.DeepSeq.NFData Distribution.Types.ConfVar.ConfVar

module Distribution.Fields.ConfVar

-- | Parse <tt><a>Condition</a> <a>ConfVar</a></tt> from section arguments
--   provided by parsec based outline parser.
parseConditionConfVar :: [SectionArg Position] -> ParseResult (Condition ConfVar)
parseConditionConfVarFromClause :: ByteString -> Either ParseError (Condition ConfVar)

module Distribution.Types.BuildInfo
data BuildInfo
BuildInfo :: Bool -> [LegacyExeDependency] -> [ExeDependency] -> [String] -> [String] -> [String] -> [String] -> [String] -> [String] -> [String] -> [PkgconfigDependency] -> [String] -> [String] -> [FilePath] -> [FilePath] -> [FilePath] -> [FilePath] -> [FilePath] -> [SymbolicPath PackageDir SourceDir] -> [ModuleName] -> [ModuleName] -> [ModuleName] -> Maybe Language -> [Language] -> [Extension] -> [Extension] -> [Extension] -> [String] -> [String] -> [String] -> [String] -> [String] -> [String] -> [String] -> [String] -> [FilePath] -> [FilePath] -> [FilePath] -> [FilePath] -> PerCompilerFlavor [String] -> PerCompilerFlavor [String] -> PerCompilerFlavor [String] -> PerCompilerFlavor [String] -> [(String, String)] -> [Dependency] -> [Mixin] -> BuildInfo

-- | component is buildable here
[buildable] :: BuildInfo -> Bool

-- | Tools needed to build this bit.
--   
--   This is a legacy field that <a>buildToolDepends</a> largely
--   supersedes.
--   
--   Unless use are very sure what you are doing, use the functions in
--   <a>Distribution.Simple.BuildToolDepends</a> rather than accessing this
--   field directly.
[buildTools] :: BuildInfo -> [LegacyExeDependency]

-- | Haskell tools needed to build this bit
--   
--   This field is better than <a>buildTools</a> because it allows one to
--   precisely specify an executable in a package.
--   
--   Unless use are very sure what you are doing, use the functions in
--   <a>Distribution.Simple.BuildToolDepends</a> rather than accessing this
--   field directly.
[buildToolDepends] :: BuildInfo -> [ExeDependency]

-- | options for pre-processing Haskell code
[cppOptions] :: BuildInfo -> [String]

-- | options for assembler
[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]

-- | options for hsc2hs
[hsc2hsOptions] :: 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 -> [SymbolicPath PackageDir SourceDir]

-- | non-exposed or non-main modules
[otherModules] :: BuildInfo -> [ModuleName]

-- | exposed modules that do not have a source file (e.g. <tt>GHC.Prim</tt>
--   from <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
--   package
[extraLibs] :: BuildInfo -> [String]

-- | what libraries to link with when compiling a program fully statically
--   that uses your package
[extraLibsStatic] :: BuildInfo -> [String]

-- | if present, overrides extraLibs when package is loaded with GHCi.
[extraGHCiLibs] :: BuildInfo -> [String]

-- | if present, adds libs to hs-libraries, which become part of the
--   package. Example 1: the Cffi library shipping with the rts, alongside
--   the HSrts-1.0.a,.o,... Example 2: a library that is being built by a
--   foreign tool (e.g. rust) and copied and registered together with this
--   library. The logic on how this library is built will have to be
--   encoded in a custom Setup for now. Otherwise cabal would need to learn
--   how to call arbitrary library builders.
[extraBundledLibs] :: BuildInfo -> [String]

-- | Hidden Flag. This set of strings, will be appended to all libraries
--   when copying. E.g. [libHS<a>name</a>_<a>flavour</a> | flavour &lt;-
--   extraLibFlavours]. This should only be needed in very specific cases,
--   e.g. the <tt>rts</tt> package, where there are multiple copies of
--   slightly differently built libs.
[extraLibFlavours] :: BuildInfo -> [String]

-- | Hidden Flag. This set of strings will be appended to all
--   <i>dynamic</i> libraries when copying. This is particularly useful
--   with the <tt>rts</tt> package, where we want different dynamic
--   flavours of the RTS library to be installed.
[extraDynLibFlavours] :: BuildInfo -> [String]
[extraLibDirs] :: BuildInfo -> [String]
[extraLibDirsStatic] :: BuildInfo -> [String]

-- | directories to find .h files
[includeDirs] :: BuildInfo -> [FilePath]

-- | The .h files to be found in includeDirs
[includes] :: BuildInfo -> [FilePath]

-- | The .h files to be generated (e.g. by <tt>autoconf</tt>)
[autogenIncludes] :: BuildInfo -> [FilePath]

-- | .h files to install with the package
[installIncludes] :: BuildInfo -> [FilePath]
[options] :: BuildInfo -> PerCompilerFlavor [String]
[profOptions] :: BuildInfo -> PerCompilerFlavor [String]
[sharedOptions] :: BuildInfo -> PerCompilerFlavor [String]
[staticOptions] :: BuildInfo -> PerCompilerFlavor [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
--   Quotes
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.Ord 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 Distribution.Utils.Structured.Structured 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
--   <a>BuildInfo</a>s inside packages. One example use-case (which is used
--   in core libraries today) is as a way of passing flags which are
--   computed by a configure script into Cabal. In this case, the autoconf
--   build type adds hooks to read in a textual <a>HookedBuildInfo</a>
--   format prior to doing any operations.
--   
--   Quite honestly, this mechanism is a massive hack since we shouldn't be
--   editing the <tt>PackageDescription</tt> data structure (it's easy to
--   assume that this data structure shouldn't change and run into bugs,
--   see for example 1c20a6328579af9e37677d507e2e9836ef70ab9d). But it's a
--   bit convenient, because there isn't another data structure that allows
--   adding extra <a>BuildInfo</a> style things.
--   
--   In any case, a lot of care has to be taken to make sure the
--   <a>HookedBuildInfo</a> is applied to the <tt>PackageDescription</tt>.
--   In general this process occurs in <a>Distribution.Simple</a>, which is
--   responsible for orchestrating the hooks mechanism. The general
--   strategy:
--   
--   <ol>
--   <li>We run the pre-hook, which produces a <a>HookedBuildInfo</a>
--   (e.g., in the Autoconf case, it reads it out from a file).</li>
--   <li>We sanity-check the hooked build info with
--   <tt>sanityCheckHookedBuildInfo</tt>.</li>
--   <li>We update our <tt>PackageDescription</tt> (either freshly read or
--   cached from <tt>LocalBuildInfo</tt>) with
--   <tt>updatePackageDescription</tt>.</li>
--   </ol>
--   
--   In principle, we are also supposed to update the copy of the
--   <tt>PackageDescription</tt> stored in <tt>LocalBuildInfo</tt> at
--   <tt>localPkgDescr</tt>. Unfortunately, in practice, there are lots of
--   Custom setup scripts which fail to update <tt>localPkgDescr</tt> so
--   you really shouldn't rely on it. It's not DEPRECATED because there are
--   legitimate uses for it, but... yeah. Sharp knife. See
--   <a>https://github.com/haskell/cabal/issues/3606</a> for more
--   information on the issue.
--   
--   It is not well-specified whether or not a <a>HookedBuildInfo</a>
--   applied at configure time is persistent to the
--   <tt>LocalBuildInfo</tt>. The fact that <a>HookedBuildInfo</a> is
--   passed to <tt>confHook</tt> MIGHT SUGGEST that the
--   <a>HookedBuildInfo</a> is applied at this time, but actually since
--   9317b67e6122ab14e53f81b573bd0ecb388eca5a it has been ONLY used to
--   create a modified package description that we check for problems: it
--   is never actually saved to the LBI. Since <a>HookedBuildInfo</a> is
--   applied monoidally to the existing build infos (and it is not an
--   idempotent monoid), it could break things to save it, since we are
--   obligated to apply any new <a>HookedBuildInfo</a> and then we'd get
--   the effect twice. But this does mean we have to re-apply it every
--   time. 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]
hsc2hsOptions :: 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 [SymbolicPath PackageDir SourceDir]
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]
extraLibsStatic :: HasBuildInfo a => Lens' a [String]
extraGHCiLibs :: HasBuildInfo a => Lens' a [String]
extraBundledLibs :: HasBuildInfo a => Lens' a [String]
extraLibFlavours :: HasBuildInfo a => Lens' a [String]
extraDynLibFlavours :: HasBuildInfo a => Lens' a [String]
extraLibDirs :: HasBuildInfo a => Lens' a [String]
extraLibDirsStatic :: HasBuildInfo a => Lens' a [String]
includeDirs :: HasBuildInfo a => Lens' a [FilePath]
includes :: HasBuildInfo a => Lens' a [FilePath]
autogenIncludes :: HasBuildInfo a => Lens' a [FilePath]
installIncludes :: HasBuildInfo a => Lens' a [FilePath]
options :: HasBuildInfo a => Lens' a (PerCompilerFlavor [String])
profOptions :: HasBuildInfo a => Lens' a (PerCompilerFlavor [String])
sharedOptions :: HasBuildInfo a => Lens' a (PerCompilerFlavor [String])
staticOptions :: HasBuildInfo a => Lens' a (PerCompilerFlavor [String])
customFieldsBI :: HasBuildInfo a => Lens' a [(String, String)]
targetBuildDepends :: HasBuildInfo a => Lens' a [Dependency]
mixins :: HasBuildInfo a => Lens' a [Mixin]
class HasBuildInfos a
traverseBuildInfos :: HasBuildInfos a => Traversal' a BuildInfo
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 -> [String] -> TestSuite
[testName] :: TestSuite -> UnqualComponentName
[testInterface] :: TestSuite -> TestSuiteInterface
[testBuildInfo] :: TestSuite -> BuildInfo
[testCodeGenerators] :: TestSuite -> [String]
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
--   subset of <a>testModules</a>.
testModulesAutogen :: TestSuite -> [ModuleName]
instance Data.Data.Data Distribution.Types.TestSuite.TestSuite
instance GHC.Classes.Ord 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 Distribution.Utils.Structured.Structured 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
testBuildInfo :: Lens' TestSuite BuildInfo
testName :: Lens' TestSuite UnqualComponentName
testInterface :: Lens' TestSuite TestSuiteInterface

module Distribution.Types.Library
data Library
Library :: LibraryName -> [ModuleName] -> [ModuleReexport] -> [ModuleName] -> Bool -> LibraryVisibility -> BuildInfo -> Library
[libName] :: Library -> LibraryName
[exposedModules] :: Library -> [ModuleName]
[reexportedModules] :: Library -> [ModuleReexport]

-- | What sigs need implementations?
[signatures] :: Library -> [ModuleName]

-- | Is the lib to be exposed by default? (i.e. whether its modules
--   available in GHCi for example)
[libExposed] :: Library -> Bool

-- | Whether this multilib can be used as a dependency for other packages.
[libVisibility] :: Library -> LibraryVisibility
[libBuildInfo] :: Library -> BuildInfo
emptyLibrary :: Library

-- | Get all the module names from the library (exposed and internal
--   modules) which are explicitly listed in the package description which
--   would need to be compiled. (This does not include reexports, which do
--   not need to be compiled.) This may not include all modules for which
--   GHC generated interface files (i.e., implicit modules.)
explicitLibModules :: Library -> [ModuleName]

-- | Get all the auto generated module names from the library, exposed or
--   not. This are a subset of <tt>libModules</tt>.
libModulesAutogen :: Library -> [ModuleName]
instance Data.Data.Data Distribution.Types.Library.Library
instance GHC.Read.Read Distribution.Types.Library.Library
instance GHC.Classes.Ord 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 Distribution.Utils.Structured.Structured 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 LibraryName
libBuildInfo :: Lens' Library BuildInfo
libVisibility :: Lens' Library LibraryVisibility
exposedModules :: Lens' Library [ModuleName]
reexportedModules :: Lens' Library [ModuleReexport]
signatures :: Lens' Library [ModuleName]
libExposed :: Lens' Library Bool

module Distribution.Types.ForeignLib

-- | A foreign library stanza is like a library stanza, except that the
--   built 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
--   all 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
--   the libtool documentation on the current:revision:age versioning
--   scheme.
[foreignLibVersionInfo] :: ForeignLib -> Maybe LibVersionInfo

-- | Linux library version
[foreignLibVersionLinux] :: ForeignLib -> Maybe Version

-- | (Windows-specific) module definition files
--   
--   This is a list rather than a maybe field so that we can flatten the
--   condition 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
--   Linux version is specified, use that. If we're on Linux, and
--   libtool-style version-info is specified, translate that field into
--   appropriate version numbers. Otherwise, this feature is unsupported so
--   we don't return any version data.
foreignLibVersion :: ForeignLib -> OS -> [Int]
data LibVersionInfo

-- | Construct <a>LibVersionInfo</a> from <tt>(current, revision, age)</tt>
--   numbers.
--   
--   For instance, <tt>mkLibVersionInfo (3,0,0)</tt> constructs a
--   <a>LibVersionInfo</a> representing the version-info <tt>3:0:0</tt>.
--   
--   All version components must be non-negative.
mkLibVersionInfo :: (Int, Int, Int) -> LibVersionInfo

-- | From a given <a>LibVersionInfo</a>, extract the <tt>(current,
--   revision, age)</tt> numbers.
libVersionInfoCRA :: LibVersionInfo -> (Int, Int, Int)

-- | Given a version-info field, produce a <tt>major.minor.build</tt>
--   version
libVersionNumber :: LibVersionInfo -> (Int, Int, Int)

-- | Given a version-info field, return <tt>"major.minor.build"</tt> as a
--   <a>String</a>
libVersionNumberShow :: LibVersionInfo -> String

-- | Return the <tt>major</tt> version of a version-info field.
libVersionMajor :: LibVersionInfo -> Int
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 Data.Data.Data Distribution.Types.ForeignLib.ForeignLib
instance GHC.Classes.Ord 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 Distribution.Types.BuildInfo.Lens.HasBuildInfo Distribution.Types.ForeignLib.ForeignLib
instance Data.Binary.Class.Binary Distribution.Types.ForeignLib.ForeignLib
instance Distribution.Utils.Structured.Structured 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 Distribution.Utils.Structured.Structured Distribution.Types.ForeignLib.LibVersionInfo
instance Control.DeepSeq.NFData Distribution.Types.ForeignLib.LibVersionInfo
instance Distribution.Pretty.Pretty Distribution.Types.ForeignLib.LibVersionInfo
instance Distribution.Parsec.Parsec Distribution.Types.ForeignLib.LibVersionInfo

module Distribution.Types.ForeignLib.Lens

-- | A foreign library stanza is like a library stanza, except that the
--   built code is intended for consumption by a non-Haskell client.
data ForeignLib
foreignLibName :: Lens' ForeignLib UnqualComponentName
foreignLibBuildInfo :: Lens' ForeignLib BuildInfo
foreignLibType :: Lens' ForeignLib ForeignLibType
foreignLibOptions :: Lens' ForeignLib [ForeignLibOption]
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
--   of <a>exeModules</a>.
exeModulesAutogen :: Executable -> [ModuleName]
instance Data.Data.Data Distribution.Types.Executable.Executable
instance GHC.Classes.Ord 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 Distribution.Utils.Structured.Structured 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
exeBuildInfo :: Lens' Executable BuildInfo
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
--   subset of <a>benchmarkModules</a>.
benchmarkModulesAutogen :: Benchmark -> [ModuleName]
instance Data.Data.Data Distribution.Types.Benchmark.Benchmark
instance GHC.Classes.Ord 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 Distribution.Utils.Structured.Structured 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:
--   False</tt>)? See also this note in
--   <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
--   this note in
--   <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
--   benchmarks are NOT enabled by default.
defaultComponentRequestedSpec :: ComponentRequestedSpec

-- | Is this component name enabled? See also this note in
--   <a>Distribution.Types.ComponentRequestedSpec#buildable_vs_enabled_components</a>.
componentNameRequested :: ComponentRequestedSpec -> ComponentName -> Bool

-- | Is this component enabled? See also this note in
--   <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
instance Distribution.Utils.Structured.Structured Distribution.Types.ComponentRequestedSpec.ComponentRequestedSpec


-- | This defines the data structure for the <tt>.cabal</tt> file format.
--   There are several parts to this structure. It has top level info and
--   then <a>Library</a>, <a>Executable</a>, <a>TestSuite</a>, and
--   <a>Benchmark</a> sections each of which have associated
--   <a>BuildInfo</a> data that's used to build the library, exe, test, or
--   benchmark. To further complicate things there is both a
--   <a>PackageDescription</a> and a <tt>GenericPackageDescription</tt>.
--   This distinction relates to cabal configurations. When we initially
--   read a <tt>.cabal</tt> file we get a
--   <tt>GenericPackageDescription</tt> which has all the conditional
--   sections. Before actually building a package we have to decide on each
--   conditional. Once we've done that we get a <a>PackageDescription</a>.
--   It was done this way initially to avoid breaking too much stuff when
--   the feature was introduced. It could probably do with being
--   rationalised at some point to make it simpler.
module Distribution.Types.PackageDescription

-- | This data type is the internal representation of the file
--   <tt>pkg.cabal</tt>. It contains two kinds of information about the
--   package: information which is needed for all packages, such as the
--   package name and version, and information which is needed for the
--   simple build system only, such as the compiler options and library
--   name.
data PackageDescription
PackageDescription :: CabalSpecVersion -> PackageIdentifier -> Either License License -> [SymbolicPath PackageDir LicenseFile] -> !ShortText -> !ShortText -> !ShortText -> !ShortText -> [(CompilerFlavor, VersionRange)] -> !ShortText -> !ShortText -> !ShortText -> [SourceRepo] -> !ShortText -> !ShortText -> !ShortText -> [(String, String)] -> 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.
[specVersion] :: PackageDescription -> CabalSpecVersion
[package] :: PackageDescription -> PackageIdentifier
[licenseRaw] :: PackageDescription -> Either License License
[licenseFiles] :: PackageDescription -> [SymbolicPath PackageDir LicenseFile]
[copyright] :: PackageDescription -> !ShortText
[maintainer] :: PackageDescription -> !ShortText
[author] :: PackageDescription -> !ShortText
[stability] :: PackageDescription -> !ShortText
[testedWith] :: PackageDescription -> [(CompilerFlavor, VersionRange)]
[homepage] :: PackageDescription -> !ShortText
[pkgUrl] :: PackageDescription -> !ShortText
[bugReports] :: PackageDescription -> !ShortText
[sourceRepos] :: PackageDescription -> [SourceRepo]

-- | A one-line summary of this package
[synopsis] :: PackageDescription -> !ShortText

-- | A more verbose description of this package
[description] :: PackageDescription -> !ShortText
[category] :: PackageDescription -> !ShortText

-- | Custom fields starting with x-, stored in a simple assoc-list.
[customFieldsPD] :: PackageDescription -> [(String, String)]

-- | The original <tt>build-type</tt> value as parsed from the
--   <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 SPDX <tt>LicenseExpression</tt> of the package.
license :: PackageDescription -> License

-- | See <a>license</a>.
license' :: Either License License -> License

-- | The effective <tt>build-type</tt> after applying defaulting rules.
--   
--   The original <tt>build-type</tt> value parsed is stored in the
--   <a>buildTypeRaw</a> field. However, the <tt>build-type</tt> field is
--   optional and can therefore be empty in which case we need to compute
--   the <i>effective</i> <tt>build-type</tt>. This function implements the
--   following defaulting rules:
--   
--   <ul>
--   <li>For <tt>cabal-version:2.0</tt> and below, default to the
--   <tt>Custom</tt> build-type unconditionally.</li>
--   <li>Otherwise, if a <tt>custom-setup</tt> stanza is defined, default
--   to the <tt>Custom</tt> build-type; else default to <tt>Simple</tt>
--   build-type.</li>
--   </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
--   given function with the library build info as argument. You probably
--   want <tt>withLibLBI</tt> if you have a <tt>LocalBuildInfo</tt>, see
--   the note in
--   <a>Distribution.Types.ComponentRequestedSpec#buildable_vs_enabled_components</a>
--   for 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
--   description. You probably want <tt>withExeLBI</tt> if you have a
--   <tt>LocalBuildInfo</tt>, see the note in
--   <a>Distribution.Types.ComponentRequestedSpec#buildable_vs_enabled_components</a>
--   for 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
--   probably want <tt>withTestLBI</tt> if you have a
--   <tt>LocalBuildInfo</tt>, see the note in
--   <a>Distribution.Types.ComponentRequestedSpec#buildable_vs_enabled_components</a>
--   for 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
--   probably want <tt>withBenchLBI</tt> if you have a
--   <tt>LocalBuildInfo</tt>, see the note in
--   <a>Distribution.Types.ComponentRequestedSpec#buildable_vs_enabled_components</a>
--   for 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
--   description.
withForeignLib :: PackageDescription -> (ForeignLib -> IO ()) -> IO ()

-- | All <a>BuildInfo</a> in the <a>PackageDescription</a>: libraries,
--   executables, test-suites and benchmarks.
--   
--   Useful for implementing package checks.
allBuildInfo :: PackageDescription -> [BuildInfo]

-- | Return all of the <a>BuildInfo</a>s of enabled components, i.e., all
--   of the ones that would be built if you run <tt>./Setup build</tt>.
enabledBuildInfos :: PackageDescription -> ComponentRequestedSpec -> [BuildInfo]

-- | Get the combined build-depends entries of all components.
allBuildDepends :: PackageDescription -> [Dependency]

-- | Get the combined build-depends entries of all enabled components, per
--   the given request spec.
enabledBuildDepends :: PackageDescription -> ComponentRequestedSpec -> [Dependency]
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
--   not marked with <tt>buildable: False</tt>. This does NOT indicate if
--   we are actually going to build the component, see
--   <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.Ord 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 Distribution.Utils.Structured.Structured Distribution.Types.PackageDescription.PackageDescription
instance Control.DeepSeq.NFData Distribution.Types.PackageDescription.PackageDescription
instance Distribution.Package.Package Distribution.Types.PackageDescription.PackageDescription
instance Distribution.Types.BuildInfo.Lens.HasBuildInfos Distribution.Types.PackageDescription.PackageDescription

module Distribution.Types.GenericPackageDescription
data GenericPackageDescription
GenericPackageDescription :: PackageDescription -> Maybe Version -> [PackageFlag] -> 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

-- | This is a version as specified in source. We populate this field in
--   index reading for dummy GPDs, only when GPD reading failed, but
--   scanning haven't.
--   
--   Cabal-the-library never produces GPDs with Just as gpdScannedVersion.
--   
--   Perfectly, PackageIndex should have sum type, so we don't need to have
--   dummy GPDs.
[gpdScannedVersion] :: GenericPackageDescription -> Maybe Version
[genPackageFlags] :: GenericPackageDescription -> [PackageFlag]
[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
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 Distribution.Package.Package Distribution.Types.GenericPackageDescription.GenericPackageDescription
instance Data.Binary.Class.Binary Distribution.Types.GenericPackageDescription.GenericPackageDescription
instance Distribution.Utils.Structured.Structured Distribution.Types.GenericPackageDescription.GenericPackageDescription
instance Control.DeepSeq.NFData Distribution.Types.GenericPackageDescription.GenericPackageDescription
instance Distribution.Types.BuildInfo.Lens.HasBuildInfos Distribution.Types.GenericPackageDescription.GenericPackageDescription

module Distribution.Types.GenericPackageDescription.Lens
data GenericPackageDescription

-- | A flag can represent a feature to be included, or a way of linking a
--   target against its dependencies, or in fact whatever you can think of.
data PackageFlag

-- | A <a>FlagName</a> is the name of a user-defined configuration flag
--   
--   Use <a>mkFlagName</a> and <a>unFlagName</a> to convert from/to a
--   <a>String</a>.
--   
--   This 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
PackageFlag :: FlagName -> ConfVar
Impl :: CompilerFlavor -> VersionRange -> ConfVar
packageDescription :: Lens' GenericPackageDescription PackageDescription
flagName :: Lens' PackageFlag FlagName
flagDescription :: Lens' PackageFlag String
flagDefault :: Lens' PackageFlag Bool
flagManual :: Lens' PackageFlag Bool
gpdScannedVersion :: Lens' GenericPackageDescription (Maybe Version)
genPackageFlags :: Lens' GenericPackageDescription [PackageFlag]
condLibrary :: Lens' GenericPackageDescription (Maybe (CondTree ConfVar [Dependency] Library))
condSubLibraries :: Lens' GenericPackageDescription [(UnqualComponentName, CondTree ConfVar [Dependency] Library)]
condForeignLibs :: Lens' GenericPackageDescription [(UnqualComponentName, CondTree ConfVar [Dependency] ForeignLib)]
condExecutables :: Lens' GenericPackageDescription [(UnqualComponentName, CondTree ConfVar [Dependency] Executable)]
condTestSuites :: Lens' GenericPackageDescription [(UnqualComponentName, CondTree ConfVar [Dependency] TestSuite)]
condBenchmarks :: Lens' GenericPackageDescription [(UnqualComponentName, CondTree ConfVar [Dependency] Benchmark)]
allCondTrees :: Applicative f => (forall a. CondTree ConfVar [Dependency] a -> f (CondTree ConfVar [Dependency] a)) -> GenericPackageDescription -> f GenericPackageDescription
_OS :: Traversal' ConfVar OS
_Arch :: Traversal' ConfVar Arch
_PackageFlag :: 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
benchmarkBuildInfo :: Lens' Benchmark BuildInfo
benchmarkInterface :: Lens' Benchmark BenchmarkInterface

module Distribution.Types.PackageDescription.Lens

-- | This data type is the internal representation of the file
--   <tt>pkg.cabal</tt>. It contains two kinds of information about the
--   package: information which is needed for all packages, such as the
--   package name and version, and information which is needed for the
--   simple build system only, such as the compiler options and library
--   name.
data PackageDescription

componentBuildInfo :: ComponentName -> Traversal' PackageDescription BuildInfo

allLibraries :: Traversal' PackageDescription Library
package :: Lens' PackageDescription PackageIdentifier
copyright :: Lens' PackageDescription ShortText
maintainer :: Lens' PackageDescription ShortText
author :: Lens' PackageDescription ShortText
stability :: Lens' PackageDescription ShortText
homepage :: Lens' PackageDescription ShortText
pkgUrl :: Lens' PackageDescription ShortText
synopsis :: Lens' PackageDescription ShortText
description :: Lens' PackageDescription ShortText
category :: Lens' PackageDescription ShortText
dataDir :: Lens' PackageDescription FilePath
specVersion :: Lens' PackageDescription CabalSpecVersion
licenseRaw :: Lens' PackageDescription (Either License License)
licenseFiles :: Lens' PackageDescription [SymbolicPath PackageDir LicenseFile]
testedWith :: Lens' PackageDescription [(CompilerFlavor, VersionRange)]
bugReports :: Lens' PackageDescription ShortText
sourceRepos :: Lens' PackageDescription [SourceRepo]
customFieldsPD :: Lens' PackageDescription [(String, String)]
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]
extraSrcFiles :: Lens' PackageDescription [String]
extraTmpFiles :: Lens' PackageDescription [String]
extraDocFiles :: Lens' PackageDescription [String]

componentModules :: Monoid r => ComponentName -> Getting r PackageDescription [ModuleName]

module Distribution.Types.Lens


-- | Backwards compatibility reexport of most things you need to know about
--   <tt>.cabal</tt> files.
module Distribution.PackageDescription


-- | This is about the cabal configurations feature. It exports
--   <a>finalizePD</a> and <a>flattenPackageDescription</a> which are
--   functions for converting <a>GenericPackageDescription</a>s down to
--   <a>PackageDescription</a>s. It has code for working with the tree of
--   conditions and resolving or flattening conditions.
module Distribution.PackageDescription.Configuration

-- | Create a package description with all configurations resolved.
--   
--   This function takes a <a>GenericPackageDescription</a> and several
--   environment parameters and tries to generate <a>PackageDescription</a>
--   by finding a flag assignment that result in satisfiable dependencies.
--   
--   It takes as inputs a not necessarily complete specifications of flags
--   assignments, an optional package index as well as platform parameters.
--   If some flags are not assigned explicitly, this function will try to
--   pick an assignment that causes this function to succeed. The package
--   index is optional since on some platforms we cannot determine which
--   packages have been installed before. When no package index is
--   supplied, every dependency is assumed to be satisfiable, therefore all
--   not explicitly assigned flags will get their default values.
--   
--   This function will fail if it cannot find a flag assignment that leads
--   to satisfiable dependencies. (It will not try alternative assignments
--   for explicitly specified flags.) In case of failure it will return the
--   missing dependencies that it encountered when trying different flag
--   assignments. On success, it will return the package description and
--   the full flag assignment chosen.
--   
--   Note that this drops any stanzas which have <tt>buildable: False</tt>.
--   While this is arguably the right thing to do, it means we give bad
--   error messages in some situations, see #3858.
finalizePD :: FlagAssignment -> ComponentRequestedSpec -> (Dependency -> Bool) -> Platform -> CompilerInfo -> [PackageVersionConstraint] -> GenericPackageDescription -> Either [Dependency] (PackageDescription, FlagAssignment)

-- | Flatten a generic package description by ignoring all conditions and
--   just join the field descriptors into on package description. Note,
--   however, that this may lead to inconsistent field values, since all
--   values are joined into one field, which may not be possible in the
--   original package description, due to the use of exclusive choices (if
--   ... else ...).
--   
--   TODO: One particularly tricky case is defaulting. In the original
--   package description, e.g., the source directory might either be the
--   default or a certain, explicitly set path. Since defaults are filled
--   in only after the package has been resolved and when no explicit value
--   has been set, the default path will be missing from the package
--   description returned by this function.
flattenPackageDescription :: GenericPackageDescription -> PackageDescription

-- | Parse a configuration condition from a string.
parseCondition :: CabalParsing m => m (Condition ConfVar)
freeVars :: CondTree ConfVar c a -> [FlagName]

-- | Extract the condition matched by the given predicate from a cond tree.
--   
--   We use this mainly for extracting buildable conditions (see the Note
--   in Distribution.PackageDescription.Configuration), 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
--   in a <a>GenericPackageDescription</a>.
extractConditions :: (BuildInfo -> Bool) -> GenericPackageDescription -> [Condition ConfVar]

-- | Transforms a <a>CondTree</a> by putting the input under the "then"
--   branch of a conditional that is True when Buildable is True. If
--   <a>addBuildableCondition</a> can determine that Buildable is always
--   True, it returns the input unchanged. If Buildable is always False, it
--   returns 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
--   nested <tt>build-depends</tt> fields.
transformAllBuildDepends :: (Dependency -> Dependency) -> GenericPackageDescription -> GenericPackageDescription

-- | Walk a <a>GenericPackageDescription</a> and apply <tt>f</tt> to all
--   nested <tt>build-depends</tt> fields.
transformAllBuildDependsN :: ([Dependency] -> [Dependency]) -> GenericPackageDescription -> GenericPackageDescription

-- | Simplify a configuration condition using the OS and arch names.
--   Returns the names of all the flags occurring in the condition.
simplifyWithSysParams :: OS -> Arch -> CompilerInfo -> Condition ConfVar -> (Condition FlagName, [FlagName])
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 Distribution.PackageDescription.Configuration.DepMapUnion
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 module provides <tt>newtype</tt> wrappers to be used with
--   <a>Distribution.FieldGrammar</a>.
module Distribution.FieldGrammar.Newtypes

-- | <a>alaList</a> and <a>alaList'</a> are simply <a>List</a>, with
--   additional phantom arguments to constrain the resulting type
--   
--   <pre>
--   &gt;&gt;&gt; :t alaList VCat
--   alaList VCat :: [a] -&gt; List VCat (Identity a) a
--   </pre>
--   
--   <pre>
--   &gt;&gt;&gt; :t alaList' FSep Token
--   alaList' FSep Token :: [String] -&gt; List FSep Token String
--   </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
class Sep sep
prettySep :: Sep sep => Proxy sep -> [Doc] -> Doc
parseSep :: (Sep sep, CabalParsing m) => Proxy sep -> m a -> m [a]
parseSepNE :: (Sep sep, CabalParsing m) => Proxy sep -> m a -> m (NonEmpty a)

-- | List separated with optional commas. Displayed with <tt>sep</tt>,
--   arguments of type <tt>a</tt> are parsed and pretty-printed as
--   <tt>b</tt>.
data List sep b a

-- | <a>alaSet</a> and <a>alaSet'</a> are simply <a>Set'</a> constructor,
--   with additional phantom arguments to constrain the resulting type
--   
--   <pre>
--   &gt;&gt;&gt; :t alaSet VCat
--   alaSet VCat :: Set a -&gt; Set' VCat (Identity a) a
--   </pre>
--   
--   <pre>
--   &gt;&gt;&gt; :t alaSet' FSep Token
--   alaSet' FSep Token :: Set String -&gt; Set' FSep Token String
--   </pre>
--   
--   <pre>
--   &gt;&gt;&gt; unpack' (alaSet' FSep Token) &lt;$&gt; eitherParsec "foo bar foo"
--   Right (fromList ["bar","foo"])
--   </pre>
alaSet :: sep -> Set a -> Set' sep (Identity a) a

-- | More general version of <a>alaSet</a>.
alaSet' :: sep -> (a -> b) -> Set a -> Set' sep b a

-- | Like <a>List</a>, but for <a>Set</a>.
data Set' sep b a

-- | <a>alaNonEmpty</a> and <a>alaNonEmpty'</a> are simply <a>NonEmpty'</a>
--   constructor, with additional phantom arguments to constrain the
--   resulting type
--   
--   <pre>
--   &gt;&gt;&gt; :t alaNonEmpty VCat
--   alaNonEmpty VCat :: NonEmpty a -&gt; NonEmpty' VCat (Identity a) a
--   </pre>
--   
--   <pre>
--   &gt;&gt;&gt; unpack' (alaNonEmpty' FSep Token) &lt;$&gt; eitherParsec "foo bar foo"
--   Right ("foo" :| ["bar","foo"])
--   </pre>
alaNonEmpty :: sep -> NonEmpty a -> NonEmpty' sep (Identity a) a

-- | More general version of <a>alaNonEmpty</a>.
alaNonEmpty' :: sep -> (a -> b) -> NonEmpty a -> NonEmpty' sep b a

-- | Like <a>List</a>, but for <a>NonEmpty</a>.
data NonEmpty' sep b a

-- | Version range or just version, i.e. <tt>cabal-version</tt> field.
--   
--   There are few things to consider:
--   
--   <ul>
--   <li>Starting with 2.2 the cabal-version field should be the first
--   field in the file and only exact version is accepted. Therefore if we
--   get e.g. <tt>&gt;= 2.2</tt>, we fail. See
--   <a>https://github.com/haskell/cabal/issues/4899</a></li>
--   </ul>
--   
--   We have this newtype, as writing Parsec and Pretty instances for
--   CabalSpecVersion would cause cycle in modules: Version -&gt;
--   CabalSpecVersion -&gt; Parsec -&gt; ...
newtype SpecVersion
SpecVersion :: CabalSpecVersion -> SpecVersion
[getSpecVersion] :: SpecVersion -> CabalSpecVersion

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

-- | Filepath are parsed as <a>Token</a>.
newtype FilePathNT
FilePathNT :: String -> FilePathNT
[getFilePathNT] :: FilePathNT -> String
instance GHC.Show.Show Distribution.FieldGrammar.Newtypes.SpecVersion
instance GHC.Classes.Eq Distribution.FieldGrammar.Newtypes.SpecVersion
instance GHC.Classes.Eq Distribution.FieldGrammar.Newtypes.SpecLicense
instance GHC.Show.Show Distribution.FieldGrammar.Newtypes.SpecLicense
instance Distribution.Compat.Newtype.Newtype (Distribution.Compiler.CompilerFlavor, Distribution.Types.VersionRange.Internal.VersionRange) Distribution.FieldGrammar.Newtypes.TestedWith
instance Distribution.Parsec.Parsec Distribution.FieldGrammar.Newtypes.TestedWith
instance Distribution.Pretty.Pretty Distribution.FieldGrammar.Newtypes.TestedWith
instance Distribution.Compat.Newtype.Newtype (Data.Either.Either Distribution.SPDX.License.License Distribution.License.License) Distribution.FieldGrammar.Newtypes.SpecLicense
instance Distribution.Parsec.Parsec Distribution.FieldGrammar.Newtypes.SpecLicense
instance Distribution.Pretty.Pretty Distribution.FieldGrammar.Newtypes.SpecLicense
instance Distribution.Compat.Newtype.Newtype Distribution.CabalSpecVersion.CabalSpecVersion Distribution.FieldGrammar.Newtypes.SpecVersion
instance Distribution.Parsec.Parsec Distribution.FieldGrammar.Newtypes.SpecVersion
instance Distribution.Pretty.Pretty Distribution.FieldGrammar.Newtypes.SpecVersion
instance Distribution.Compat.Newtype.Newtype GHC.Base.String Distribution.FieldGrammar.Newtypes.FilePathNT
instance Distribution.Parsec.Parsec Distribution.FieldGrammar.Newtypes.FilePathNT
instance Distribution.Pretty.Pretty Distribution.FieldGrammar.Newtypes.FilePathNT
instance Distribution.Compat.Newtype.Newtype a (Distribution.FieldGrammar.Newtypes.MQuoted a)
instance Distribution.Parsec.Parsec a => Distribution.Parsec.Parsec (Distribution.FieldGrammar.Newtypes.MQuoted a)
instance Distribution.Pretty.Pretty a => Distribution.Pretty.Pretty (Distribution.FieldGrammar.Newtypes.MQuoted a)
instance Distribution.Compat.Newtype.Newtype GHC.Base.String Distribution.FieldGrammar.Newtypes.Token'
instance Distribution.Parsec.Parsec Distribution.FieldGrammar.Newtypes.Token'
instance Distribution.Pretty.Pretty Distribution.FieldGrammar.Newtypes.Token'
instance Distribution.Compat.Newtype.Newtype GHC.Base.String Distribution.FieldGrammar.Newtypes.Token
instance Distribution.Parsec.Parsec Distribution.FieldGrammar.Newtypes.Token
instance Distribution.Pretty.Pretty Distribution.FieldGrammar.Newtypes.Token
instance Distribution.Compat.Newtype.Newtype (GHC.Base.NonEmpty a) (Distribution.FieldGrammar.Newtypes.NonEmpty' sep wrapper a)
instance (Distribution.Compat.Newtype.Newtype a b, Distribution.FieldGrammar.Newtypes.Sep sep, Distribution.Parsec.Parsec b) => Distribution.Parsec.Parsec (Distribution.FieldGrammar.Newtypes.NonEmpty' sep b a)
instance (Distribution.Compat.Newtype.Newtype a b, Distribution.FieldGrammar.Newtypes.Sep sep, Distribution.Pretty.Pretty b) => Distribution.Pretty.Pretty (Distribution.FieldGrammar.Newtypes.NonEmpty' sep b a)
instance Distribution.Compat.Newtype.Newtype (Data.Set.Internal.Set a) (Distribution.FieldGrammar.Newtypes.Set' sep wrapper a)
instance (Distribution.Compat.Newtype.Newtype a b, GHC.Classes.Ord a, Distribution.FieldGrammar.Newtypes.Sep sep, Distribution.Parsec.Parsec b) => Distribution.Parsec.Parsec (Distribution.FieldGrammar.Newtypes.Set' sep b a)
instance (Distribution.Compat.Newtype.Newtype a b, Distribution.FieldGrammar.Newtypes.Sep sep, Distribution.Pretty.Pretty b) => Distribution.Pretty.Pretty (Distribution.FieldGrammar.Newtypes.Set' sep b a)
instance Distribution.Compat.Newtype.Newtype [a] (Distribution.FieldGrammar.Newtypes.List sep wrapper a)
instance (Distribution.Compat.Newtype.Newtype a b, Distribution.FieldGrammar.Newtypes.Sep sep, Distribution.Parsec.Parsec b) => Distribution.Parsec.Parsec (Distribution.FieldGrammar.Newtypes.List sep b a)
instance (Distribution.Compat.Newtype.Newtype a b, Distribution.FieldGrammar.Newtypes.Sep sep, Distribution.Pretty.Pretty b) => Distribution.Pretty.Pretty (Distribution.FieldGrammar.Newtypes.List sep b a)
instance Distribution.FieldGrammar.Newtypes.Sep Distribution.FieldGrammar.Newtypes.CommaVCat
instance Distribution.FieldGrammar.Newtypes.Sep Distribution.FieldGrammar.Newtypes.CommaFSep
instance Distribution.FieldGrammar.Newtypes.Sep Distribution.FieldGrammar.Newtypes.VCat
instance Distribution.FieldGrammar.Newtypes.Sep Distribution.FieldGrammar.Newtypes.FSep
instance Distribution.FieldGrammar.Newtypes.Sep Distribution.FieldGrammar.Newtypes.NoCommaFSep

module Distribution.FieldGrammar.Class

-- | <a>FieldGrammar</a> is parametrised by
--   
--   <ul>
--   <li><tt>s</tt> which is a structure we are parsing. We need this to
--   provide prettyprinter functionality</li>
--   <li><tt>a</tt> type of the field.</li>
--   </ul>
--   
--   <i>Note:</i> We'd like to have <tt>forall s. Applicative (f s)</tt>
--   context.
class (c SpecVersion, c TestedWith, c SpecLicense, c Token, c Token', c FilePathNT) => FieldGrammar c g | g -> c

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

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

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

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

-- | Optional field with default value.
optionalFieldDefAla :: (FieldGrammar c g, c b, Newtype a b, Eq a) => FieldName -> (a -> b) -> ALens' s a -> a -> g s a
freeTextField :: FieldGrammar c g => FieldName -> ALens' s (Maybe String) -> g s (Maybe String)
freeTextFieldDef :: FieldGrammar c g => FieldName -> ALens' s String -> g s String

freeTextFieldDefST :: FieldGrammar c g => FieldName -> ALens' s ShortText -> g s ShortText

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

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

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

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

-- | Deprecated since
deprecatedSince :: FieldGrammar c g => CabalSpecVersion -> String -> g s a -> g s a

-- | Removed in. If we encounter removed field, parsing fails.
removedIn :: FieldGrammar c g => CabalSpecVersion -> String -> g s a -> g s a

-- | Annotate field with since spec-version.
availableSince :: FieldGrammar c g => CabalSpecVersion -> a -> g s a -> g s a

-- | Annotate field with since spec-version. This is used to recognise, but
--   warn about the field. It is used to process <tt>other-extensions</tt>
--   field.
--   
--   Default implementation is to not warn.
availableSinceWarn :: FieldGrammar c g => CabalSpecVersion -> g s a -> g s a

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

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

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

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

-- | Default implementation for <a>freeTextFieldDefST</a>.
defaultFreeTextFieldDefST :: (Functor (g s), FieldGrammar c g) => FieldName -> ALens' s ShortText -> g s ShortText

module Distribution.FieldGrammar.Pretty
data PrettyFieldGrammar s a

-- | We can use <a>PrettyFieldGrammar</a> to pp print the <tt>s</tt>.
--   
--   <i>Note:</i> there is not trailing <tt>($+$ text "")</tt>.
prettyFieldGrammar :: CabalSpecVersion -> PrettyFieldGrammar s a -> s -> [PrettyField ()]
instance GHC.Base.Functor (Distribution.FieldGrammar.Pretty.PrettyFieldGrammar s)
instance GHC.Base.Applicative (Distribution.FieldGrammar.Pretty.PrettyFieldGrammar s)
instance Distribution.FieldGrammar.Class.FieldGrammar Distribution.Pretty.Pretty Distribution.FieldGrammar.Pretty.PrettyFieldGrammar


-- | This module provides a <tt>FieldGrammarParser</tt>, one way to parse
--   <tt>.cabal</tt> -like files.
--   
--   Fields can be specified multiple times in the .cabal files. The order
--   of such entries is important, but the mutual ordering of different
--   fields is not.Also conditional sections are considered after
--   non-conditional data. The example of this silent-commutation quirk is
--   the fact that
--   
--   <pre>
--   buildable: True
--   if os(linux)
--     buildable: False
--   </pre>
--   
--   and
--   
--   <pre>
--   if os(linux)
--     buildable: False
--   buildable: True
--   </pre>
--   
--   behave the same! This is the limitation of
--   <tt>GeneralPackageDescription</tt> structure.
--   
--   So we transform the list of fields <tt>[<a>Field</a> ann]</tt> into a
--   map of grouped ordinary fields and a list of lists of sections:
--   <tt><a>Fields</a> ann = <a>Map</a> <a>FieldName</a>
--   [<a>NamelessField</a> ann]</tt> and <tt>[[<a>Section</a> ann]]</tt>.
--   
--   We need list of list of sections, because we need to distinguish
--   situations where there are fields in between. For example
--   
--   <pre>
--   if flag(bytestring-lt-0_10_4)
--     build-depends: bytestring &lt; 0.10.4
--   
--   default-language: Haskell2020
--   
--   else
--     build-depends: bytestring &gt;= 0.10.4
--   </pre>
--   
--   is obviously invalid specification.
--   
--   We can parse <a>Fields</a> like we parse <tt>aeson</tt> objects, yet
--   we use slightly higher-level API, so we can process unspecified
--   fields, to 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 -> FieldLineStream -> ParseResult a
fieldLinesToStream :: [FieldLine ann] -> FieldLineStream
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.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.ParsecFieldGrammar s)
instance GHC.Base.Applicative (Distribution.FieldGrammar.Parsec.ParsecFieldGrammar s)
instance Distribution.FieldGrammar.Class.FieldGrammar Distribution.Parsec.Parsec Distribution.FieldGrammar.Parsec.ParsecFieldGrammar


-- | This module provides a way to specify a grammar of <tt>.cabal</tt>
--   -like files.
module Distribution.FieldGrammar

-- | <a>FieldGrammar</a> is parametrised by
--   
--   <ul>
--   <li><tt>s</tt> which is a structure we are parsing. We need this to
--   provide prettyprinter functionality</li>
--   <li><tt>a</tt> type of the field.</li>
--   </ul>
--   
--   <i>Note:</i> We'd like to have <tt>forall s. Applicative (f s)</tt>
--   context.
class (c SpecVersion, c TestedWith, c SpecLicense, c Token, c Token', c FilePathNT) => FieldGrammar c g | g -> c

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

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

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

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

-- | Optional field with default value.
optionalFieldDefAla :: (FieldGrammar c g, c b, Newtype a b, Eq a) => FieldName -> (a -> b) -> ALens' s a -> a -> g s a
freeTextField :: FieldGrammar c g => FieldName -> ALens' s (Maybe String) -> g s (Maybe String)
freeTextFieldDef :: FieldGrammar c g => FieldName -> ALens' s String -> g s String

freeTextFieldDefST :: FieldGrammar c g => FieldName -> ALens' s ShortText -> g s ShortText

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

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

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

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

-- | Deprecated since
deprecatedSince :: FieldGrammar c g => CabalSpecVersion -> String -> g s a -> g s a

-- | Removed in. If we encounter removed field, parsing fails.
removedIn :: FieldGrammar c g => CabalSpecVersion -> String -> g s a -> g s a

-- | Annotate field with since spec-version.
availableSince :: FieldGrammar c g => CabalSpecVersion -> a -> g s a -> g s a

-- | Annotate field with since spec-version. This is used to recognise, but
--   warn about the field. It is used to process <tt>other-extensions</tt>
--   field.
--   
--   Default implementation is to not warn.
availableSinceWarn :: FieldGrammar c g => CabalSpecVersion -> g s a -> g s a

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

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

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

-- | Field which can be define multiple times, and the results are
--   <tt>mappend</tt>ed.
monoidalField :: (FieldGrammar c g, c (Identity a), Monoid a) => FieldName -> ALens' 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>.
--   
--   <i>Note:</i> there is not trailing <tt>($+$ text "")</tt>.
prettyFieldGrammar :: CabalSpecVersion -> PrettyFieldGrammar s a -> s -> [PrettyField ()]

-- | Reverse function application which binds tighter than <a>&lt;$&gt;</a>
--   and <a>&lt;*&gt;</a>. Useful for refining grammar specification.
--   
--   <pre>
--   &lt;*&gt; <a>monoidalFieldAla</a> "extensions"           (alaList' FSep MQuoted)       oldExtensions
--       ^^^ <a>deprecatedSince</a> [1,12] "Please use 'default-extensions' or 'other-extensions' fields."
--   </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 -> FieldLineStream -> ParseResult a

-- | Default implementation for <a>freeTextFieldDefST</a>.
defaultFreeTextFieldDefST :: (Functor (g s), FieldGrammar c g) => FieldName -> ALens' s ShortText -> g s ShortText


-- | <a>GenericPackageDescription</a> Field descriptions
module Distribution.PackageDescription.FieldGrammar
packageDescriptionFieldGrammar :: (FieldGrammar c g, Applicative (g PackageDescription), Applicative (g PackageIdentifier), c (Identity BuildType), c (Identity PackageName), c (Identity Version), c (List FSep FilePathNT String), c (List FSep CompatFilePath String), c (List FSep (Identity (SymbolicPath PackageDir LicenseFile)) (SymbolicPath PackageDir LicenseFile)), c (List FSep TestedWith (CompilerFlavor, VersionRange)), c (List VCat FilePathNT String), c FilePathNT, c CompatLicenseFile, c CompatFilePath, c SpecLicense, c SpecVersion) => g PackageDescription PackageDescription

-- | Compat FilePath accepts empty file path, but issues a warning.
--   
--   There are simply too many (~1200) package definition files
--   
--   <pre>
--   license-file: ""
--   </pre>
--   
--   and
--   
--   <pre>
--   data-dir: ""
--   </pre>
--   
--   across Hackage to outrule them completely. I suspect some of them are
--   generated (e.g. formatted) by machine.
newtype CompatFilePath
CompatFilePath :: FilePath -> CompatFilePath
[getCompatFilePath] :: CompatFilePath -> FilePath
newtype CompatLicenseFile
CompatLicenseFile :: [SymbolicPath PackageDir LicenseFile] -> CompatLicenseFile
[getCompatLicenseFile] :: CompatLicenseFile -> [SymbolicPath PackageDir LicenseFile]
libraryFieldGrammar :: (FieldGrammar c g, Applicative (g Library), Applicative (g BuildInfo), c (Identity LibraryVisibility), c (List CommaFSep (Identity ExeDependency) ExeDependency), c (List CommaFSep (Identity LegacyExeDependency) LegacyExeDependency), c (List CommaFSep (Identity PkgconfigDependency) PkgconfigDependency), c (List CommaVCat (Identity Dependency) Dependency), c (List CommaVCat (Identity Mixin) Mixin), c (List CommaVCat (Identity ModuleReexport) ModuleReexport), c (List FSep (MQuoted Extension) Extension), c (List FSep (MQuoted Language) Language), c (List FSep FilePathNT String), c (List FSep Token String), c (List NoCommaFSep Token' String), c (List VCat (MQuoted ModuleName) ModuleName), c (List VCat FilePathNT String), c (List FSep (Identity (SymbolicPath PackageDir SourceDir)) (SymbolicPath PackageDir SourceDir)), c (List VCat Token String), c (MQuoted Language)) => LibraryName -> g Library Library
foreignLibFieldGrammar :: (FieldGrammar c g, Applicative (g ForeignLib), Applicative (g BuildInfo), c (Identity ForeignLibType), c (Identity LibVersionInfo), c (Identity Version), c (List CommaFSep (Identity ExeDependency) ExeDependency), c (List CommaFSep (Identity LegacyExeDependency) LegacyExeDependency), c (List CommaFSep (Identity PkgconfigDependency) PkgconfigDependency), c (List CommaVCat (Identity Dependency) Dependency), c (List CommaVCat (Identity Mixin) Mixin), c (List FSep (Identity ForeignLibOption) ForeignLibOption), c (List FSep (MQuoted Extension) Extension), c (List FSep (MQuoted Language) Language), c (List FSep FilePathNT String), c (List FSep Token String), c (List FSep (Identity (SymbolicPath PackageDir SourceDir)) (SymbolicPath PackageDir SourceDir)), c (List NoCommaFSep Token' String), c (List VCat (MQuoted ModuleName) ModuleName), c (List VCat FilePathNT String), c (List VCat Token String), c (MQuoted Language)) => UnqualComponentName -> g ForeignLib ForeignLib
executableFieldGrammar :: (FieldGrammar c g, Applicative (g Executable), Applicative (g BuildInfo), c (Identity ExecutableScope), c (List CommaFSep (Identity ExeDependency) ExeDependency), c (List CommaFSep (Identity LegacyExeDependency) LegacyExeDependency), c (List CommaFSep (Identity PkgconfigDependency) PkgconfigDependency), c (List CommaVCat (Identity Dependency) Dependency), c (List CommaVCat (Identity Mixin) Mixin), c (List FSep (MQuoted Extension) Extension), c (List FSep (MQuoted Language) Language), c (List FSep FilePathNT String), c (List FSep Token String), c (List FSep (Identity (SymbolicPath PackageDir SourceDir)) (SymbolicPath PackageDir SourceDir)), c (List NoCommaFSep Token' String), c (List VCat (MQuoted ModuleName) ModuleName), c (List VCat FilePathNT String), c (List VCat Token String), c (MQuoted Language)) => UnqualComponentName -> g Executable Executable

-- | An intermediate type just used for parsing the test-suite stanza.
--   After validation it is converted into the proper <a>TestSuite</a>
--   type.
data TestSuiteStanza
TestSuiteStanza :: Maybe TestType -> Maybe FilePath -> Maybe ModuleName -> BuildInfo -> [String] -> TestSuiteStanza
[_testStanzaTestType] :: TestSuiteStanza -> Maybe TestType
[_testStanzaMainIs] :: TestSuiteStanza -> Maybe FilePath
[_testStanzaTestModule] :: TestSuiteStanza -> Maybe ModuleName
[_testStanzaBuildInfo] :: TestSuiteStanza -> BuildInfo
[_testStanzaCodeGenerators] :: TestSuiteStanza -> [String]
testSuiteFieldGrammar :: (FieldGrammar c g, Applicative (g TestSuiteStanza), Applicative (g BuildInfo), c (Identity ModuleName), c (Identity TestType), c (List CommaFSep (Identity ExeDependency) ExeDependency), c (List CommaFSep (Identity LegacyExeDependency) LegacyExeDependency), c (List CommaFSep (Identity PkgconfigDependency) PkgconfigDependency), c (List CommaFSep Token String), c (List CommaVCat (Identity Dependency) Dependency), c (List CommaVCat (Identity Mixin) Mixin), c (List FSep (MQuoted Extension) Extension), c (List FSep (MQuoted Language) Language), c (List FSep FilePathNT String), c (List FSep Token String), c (List NoCommaFSep Token' String), c (List VCat (MQuoted ModuleName) ModuleName), c (List VCat FilePathNT String), c (List FSep (Identity (SymbolicPath PackageDir SourceDir)) (SymbolicPath PackageDir SourceDir)), c (List VCat Token String), c (MQuoted Language)) => g TestSuiteStanza TestSuiteStanza
validateTestSuite :: CabalSpecVersion -> 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
--   validation 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 c g, Applicative (g BenchmarkStanza), Applicative (g BuildInfo), c (Identity BenchmarkType), c (Identity ModuleName), c (List CommaFSep (Identity ExeDependency) ExeDependency), c (List CommaFSep (Identity LegacyExeDependency) LegacyExeDependency), c (List CommaFSep (Identity PkgconfigDependency) PkgconfigDependency), c (List CommaVCat (Identity Dependency) Dependency), c (List CommaVCat (Identity Mixin) Mixin), c (List FSep (MQuoted Extension) Extension), c (List FSep (MQuoted Language) Language), c (List FSep FilePathNT String), c (List FSep Token String), c (List NoCommaFSep Token' String), c (List VCat (MQuoted ModuleName) ModuleName), c (List VCat FilePathNT String), c (List FSep (Identity (SymbolicPath PackageDir SourceDir)) (SymbolicPath PackageDir SourceDir)), c (List VCat Token String), c (MQuoted Language)) => g BenchmarkStanza BenchmarkStanza
validateBenchmark :: CabalSpecVersion -> Position -> BenchmarkStanza -> ParseResult Benchmark
unvalidateBenchmark :: Benchmark -> BenchmarkStanza
formatDependencyList :: [Dependency] -> List CommaVCat (Identity Dependency) Dependency
formatExposedModules :: [ModuleName] -> List VCat (MQuoted ModuleName) ModuleName
formatExtraSourceFiles :: [FilePath] -> List VCat FilePathNT FilePath
formatHsSourceDirs :: [SymbolicPath PackageDir SourceDir] -> List FSep (Identity (SymbolicPath PackageDir SourceDir)) (SymbolicPath PackageDir SourceDir)
formatMixinList :: [Mixin] -> List CommaVCat (Identity Mixin) Mixin
formatOtherExtensions :: [Extension] -> List FSep (MQuoted Extension) Extension
formatOtherModules :: [ModuleName] -> List VCat (MQuoted ModuleName) ModuleName
benchmarkStanzaBenchmarkType :: Lens' BenchmarkStanza (Maybe BenchmarkType)
benchmarkStanzaMainIs :: Lens' BenchmarkStanza (Maybe FilePath)
benchmarkStanzaBenchmarkModule :: Lens' BenchmarkStanza (Maybe ModuleName)
benchmarkStanzaBuildInfo :: Lens' BenchmarkStanza BuildInfo
flagFieldGrammar :: (FieldGrammar c g, Applicative (g PackageFlag)) => FlagName -> g PackageFlag PackageFlag
sourceRepoFieldGrammar :: (FieldGrammar c g, Applicative (g SourceRepo), c (Identity RepoType), c Token, c FilePathNT) => RepoKind -> g SourceRepo SourceRepo
setupBInfoFieldGrammar :: (FieldGrammar c g, Functor (g SetupBuildInfo), c (List CommaVCat (Identity Dependency) Dependency)) => Bool -> g SetupBuildInfo SetupBuildInfo
buildInfoFieldGrammar :: (FieldGrammar c g, Applicative (g BuildInfo), c (List CommaFSep (Identity ExeDependency) ExeDependency), c (List CommaFSep (Identity LegacyExeDependency) LegacyExeDependency), c (List CommaFSep (Identity PkgconfigDependency) PkgconfigDependency), c (List CommaVCat (Identity Dependency) Dependency), c (List CommaVCat (Identity Mixin) Mixin), c (List FSep (MQuoted Extension) Extension), c (List FSep (MQuoted Language) Language), c (List FSep FilePathNT String), c (List FSep Token String), c (List NoCommaFSep Token' String), c (List VCat (MQuoted ModuleName) ModuleName), c (List VCat FilePathNT String), c (List FSep (Identity (SymbolicPath PackageDir SourceDir)) (SymbolicPath PackageDir SourceDir)), c (List VCat Token String), c (MQuoted Language)) => g BuildInfo BuildInfo
instance Distribution.Compat.Newtype.Newtype [Distribution.Utils.Path.SymbolicPath Distribution.Utils.Path.PackageDir Distribution.Utils.Path.LicenseFile] Distribution.PackageDescription.FieldGrammar.CompatLicenseFile
instance Distribution.Parsec.Parsec Distribution.PackageDescription.FieldGrammar.CompatLicenseFile
instance Distribution.Pretty.Pretty Distribution.PackageDescription.FieldGrammar.CompatLicenseFile
instance Distribution.Compat.Newtype.Newtype GHC.Base.String Distribution.PackageDescription.FieldGrammar.CompatFilePath
instance Distribution.Parsec.Parsec Distribution.PackageDescription.FieldGrammar.CompatFilePath
instance Distribution.Pretty.Pretty Distribution.PackageDescription.FieldGrammar.CompatFilePath
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 -> IO ()

-- | Writes a generic package description to a string
showGenericPackageDescription :: GenericPackageDescription -> String

-- | Convert a generic package description to <a>PrettyField</a>s.
ppGenericPackageDescription :: CabalSpecVersion -> GenericPackageDescription -> [PrettyField ()]

writePackageDescription :: FilePath -> PackageDescription -> IO ()

showPackageDescription :: PackageDescription -> String

writeHookedBuildInfo :: FilePath -> HookedBuildInfo -> IO ()

showHookedBuildInfo :: HookedBuildInfo -> String


-- | This defined parsers and partial pretty printers for the
--   <tt>.cabal</tt> format.
module Distribution.PackageDescription.Parsec

-- | Parses the given file into a <a>GenericPackageDescription</a>.
--   
--   In Cabal 1.2 the syntax for package descriptions was changed to a
--   format 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
--   successful value or list of errors and possibly recovered a
--   spec-version declaration.
runParseResult :: ParseResult a -> ([PWarning], Either (Maybe Version, NonEmpty PError) a)

-- | Quickly scan new-style spec-version
--   
--   A new-style spec-version declaration begins the .cabal file and follow
--   the following case-insensitive grammar (expressed in RFC5234 ABNF):
--   
--   <pre>
--   newstyle-spec-version-decl = "cabal-version" *WS ":" *WS newstyle-pec-version *WS
--   
--   spec-version               = NUM "." NUM [ "." NUM ]
--   
--   NUM    = DIGIT0 / DIGITP 1*DIGIT0
--   DIGIT0 = %x30-39
--   DIGITP = %x31-39
--   WS = %20
--   </pre>
scanSpecVersion :: ByteString -> Maybe Version
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.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 of field parsers and pretty-printers.
data FieldDescrs s a

-- | Lookup a field value pretty-printer.
fieldDescrPretty :: FieldDescrs s a -> FieldName -> Maybe (s -> Doc)

-- | Lookup a field value parser.
fieldDescrParse :: CabalParsing m => FieldDescrs s a -> FieldName -> Maybe (s -> m s)
fieldDescrsToList :: CabalParsing m => FieldDescrs s a -> [(FieldName, s -> Doc, s -> m s)]
instance GHC.Base.Functor (Distribution.FieldGrammar.FieldDescrs.FieldDescrs s)
instance Distribution.FieldGrammar.Class.FieldGrammar Distribution.FieldGrammar.FieldDescrs.ParsecPretty Distribution.FieldGrammar.FieldDescrs.FieldDescrs
instance (Distribution.Parsec.Parsec a, Distribution.Pretty.Pretty a) => Distribution.FieldGrammar.FieldDescrs.ParsecPretty a
instance GHC.Base.Applicative (Distribution.FieldGrammar.FieldDescrs.FieldDescrs s)

module Distribution.Types.InstalledPackageInfo.FieldGrammar
ipiFieldGrammar :: (FieldGrammar c g, Applicative (g InstalledPackageInfo), Applicative (g Basic), c (Identity AbiHash), c (Identity LibraryVisibility), c (Identity PackageName), c (Identity UnitId), c (Identity UnqualComponentName), c (List FSep (Identity AbiDependency) AbiDependency), c (List FSep (Identity UnitId) UnitId), c (List FSep (MQuoted ModuleName) ModuleName), c (List FSep FilePathNT String), c (List FSep Token String), c (MQuoted MungedPackageName), c (MQuoted Version), c CompatPackageKey, c ExposedModules, c InstWith, c SpecLicenseLenient) => g InstalledPackageInfo InstalledPackageInfo
instance Distribution.Compat.Newtype.Newtype (Data.Either.Either Distribution.SPDX.License.License Distribution.License.License) Distribution.Types.InstalledPackageInfo.FieldGrammar.SpecLicenseLenient
instance Distribution.Parsec.Parsec Distribution.Types.InstalledPackageInfo.FieldGrammar.SpecLicenseLenient
instance Distribution.Pretty.Pretty Distribution.Types.InstalledPackageInfo.FieldGrammar.SpecLicenseLenient
instance Distribution.Compat.Newtype.Newtype [(Distribution.ModuleName.ModuleName, Distribution.Backpack.OpenModule)] Distribution.Types.InstalledPackageInfo.FieldGrammar.InstWith
instance Distribution.Pretty.Pretty Distribution.Types.InstalledPackageInfo.FieldGrammar.InstWith
instance Distribution.Parsec.Parsec Distribution.Types.InstalledPackageInfo.FieldGrammar.InstWith
instance Distribution.Compat.Newtype.Newtype GHC.Base.String Distribution.Types.InstalledPackageInfo.FieldGrammar.CompatPackageKey
instance Distribution.Pretty.Pretty Distribution.Types.InstalledPackageInfo.FieldGrammar.CompatPackageKey
instance Distribution.Parsec.Parsec Distribution.Types.InstalledPackageInfo.FieldGrammar.CompatPackageKey
instance Distribution.Compat.Newtype.Newtype [Distribution.Types.ExposedModule.ExposedModule] Distribution.Types.InstalledPackageInfo.FieldGrammar.ExposedModules
instance Distribution.Parsec.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
--   communicated to the <tt>ghc-pkg</tt> program in order to register a
--   package. <tt>ghc-pkg</tt> now consumes this package format (as of
--   version 6.4). This is specific to GHC at the moment.
--   
--   The <tt>.cabal</tt> file format is for describing a package that is
--   not yet installed. It has a lot of flexibility, like conditionals and
--   dependency ranges. As such, that format is not at all suitable for
--   describing a package that has already been built and installed. By the
--   time we get to that stage, we have resolved all conditionals and
--   resolved dependency version constraints to exact versions of dependent
--   packages. So, this module defines the <a>InstalledPackageInfo</a> data
--   structure that contains all the info we keep about an installed
--   package. There is a parser and pretty printer. The textual format is
--   rather simpler than the <tt>.cabal</tt> format: there are no sections,
--   for example.
module Distribution.InstalledPackageInfo
data InstalledPackageInfo
InstalledPackageInfo :: PackageId -> LibraryName -> ComponentId -> LibraryVisibility -> UnitId -> [(ModuleName, OpenModule)] -> String -> Either License License -> !ShortText -> !ShortText -> !ShortText -> !ShortText -> !ShortText -> !ShortText -> !ShortText -> !ShortText -> !ShortText -> AbiHash -> Bool -> Bool -> [ExposedModule] -> [ModuleName] -> Bool -> [FilePath] -> [FilePath] -> [FilePath] -> [FilePath] -> FilePath -> [String] -> [String] -> [String] -> [String] -> [FilePath] -> [String] -> [UnitId] -> [AbiDependency] -> [String] -> [String] -> [String] -> [FilePath] -> [String] -> [FilePath] -> [FilePath] -> Maybe FilePath -> InstalledPackageInfo
[sourcePackageId] :: InstalledPackageInfo -> PackageId
[sourceLibName] :: InstalledPackageInfo -> LibraryName
[installedComponentId_] :: InstalledPackageInfo -> ComponentId
[libVisibility] :: InstalledPackageInfo -> LibraryVisibility
[installedUnitId] :: InstalledPackageInfo -> UnitId
[instantiatedWith] :: InstalledPackageInfo -> [(ModuleName, OpenModule)]
[compatPackageKey] :: InstalledPackageInfo -> String
[license] :: InstalledPackageInfo -> Either License License
[copyright] :: InstalledPackageInfo -> !ShortText
[maintainer] :: InstalledPackageInfo -> !ShortText
[author] :: InstalledPackageInfo -> !ShortText
[stability] :: InstalledPackageInfo -> !ShortText
[homepage] :: InstalledPackageInfo -> !ShortText
[pkgUrl] :: InstalledPackageInfo -> !ShortText
[synopsis] :: InstalledPackageInfo -> !ShortText
[description] :: InstalledPackageInfo -> !ShortText
[category] :: InstalledPackageInfo -> !ShortText
[abiHash] :: InstalledPackageInfo -> AbiHash
[indefinite] :: InstalledPackageInfo -> Bool
[exposed] :: InstalledPackageInfo -> Bool
[exposedModules] :: InstalledPackageInfo -> [ExposedModule]
[hiddenModules] :: InstalledPackageInfo -> [ModuleName]
[trusted] :: InstalledPackageInfo -> Bool
[importDirs] :: InstalledPackageInfo -> [FilePath]
[libraryDirs] :: InstalledPackageInfo -> [FilePath]
[libraryDirsStatic] :: InstalledPackageInfo -> [FilePath]

-- | overrides <a>libraryDirs</a>
[libraryDynDirs] :: InstalledPackageInfo -> [FilePath]
[dataDir] :: InstalledPackageInfo -> FilePath
[hsLibraries] :: InstalledPackageInfo -> [String]
[extraLibraries] :: InstalledPackageInfo -> [String]
[extraLibrariesStatic] :: InstalledPackageInfo -> [String]
[extraGHCiLibraries] :: InstalledPackageInfo -> [String]
[includeDirs] :: InstalledPackageInfo -> [FilePath]
[includes] :: InstalledPackageInfo -> [String]
[depends] :: InstalledPackageInfo -> [UnitId]
[abiDepends] :: InstalledPackageInfo -> [AbiDependency]
[ccOptions] :: InstalledPackageInfo -> [String]
[cxxOptions] :: InstalledPackageInfo -> [String]
[ldOptions] :: InstalledPackageInfo -> [String]
[frameworkDirs] :: InstalledPackageInfo -> [FilePath]
[frameworks] :: InstalledPackageInfo -> [String]
[haddockInterfaces] :: InstalledPackageInfo -> [FilePath]
[haddockHTMLs] :: InstalledPackageInfo -> [FilePath]
[pkgRoot] :: InstalledPackageInfo -> Maybe FilePath
installedComponentId :: InstalledPackageInfo -> ComponentId

-- | Get the indefinite unit identity representing this package. This IS
--   NOT guaranteed to give you a substitution; for instantiated packages
--   you will get <tt>DefiniteUnitId (installedUnitId ipi)</tt>. For
--   indefinite libraries, however, you will correctly get an
--   <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
--   indefinite 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
--   ABI hash (<tt>abiHash</tt>) of the library it depends on.
--   
--   The primary utility of this is to enable an extra sanity when GHC
--   loads libraries: it can check if the dependency has a matching ABI and
--   if not, refuse to load this library. This information is critical if
--   we are shadowing libraries; differences in the ABI hash let us know
--   what packages get shadowed by the new version of a package.
data AbiDependency
AbiDependency :: UnitId -> AbiHash -> AbiDependency
[depUnitId] :: AbiDependency -> UnitId
[depAbiHash] :: AbiDependency -> AbiHash
emptyInstalledPackageInfo :: InstalledPackageInfo

-- | Return either errors, or IPI with list of warnings
parseInstalledPackageInfo :: ByteString -> Either (NonEmpty String) ([String], InstalledPackageInfo)

-- | Pretty print <a>InstalledPackageInfo</a>.
--   
--   <tt>pkgRoot</tt> isn't printed, as ghc-pkg prints it manually (as
--   GHC-8.4).
showInstalledPackageInfo :: InstalledPackageInfo -> String

-- | The variant of <a>showInstalledPackageInfo</a> which outputs
--   <tt>pkgroot</tt> field too.
showFullInstalledPackageInfo :: InstalledPackageInfo -> String

-- | <pre>
--   &gt;&gt;&gt; let ipi = emptyInstalledPackageInfo { maintainer = fromString "Tester" }
--   
--   &gt;&gt;&gt; fmap ($ ipi) $ showInstalledPackageInfoField "maintainer"
--   Just "maintainer: Tester"
--   </pre>
showInstalledPackageInfoField :: String -> Maybe (InstalledPackageInfo -> String)
showSimpleInstalledPackageInfoField :: String -> Maybe (InstalledPackageInfo -> String)
