{-# LANGUAGE OverloadedStrings #-}
-- | 'GenericPackageDescription' Field descriptions
module Distribution.PackageDescription.FieldGrammar (
    -- * Package description
    packageDescriptionFieldGrammar,
    -- * Library
    libraryFieldGrammar,
    -- * Foreign library
    foreignLibFieldGrammar,
    -- * Executable
    executableFieldGrammar,
    -- * Test suite
    TestSuiteStanza (..),
    testSuiteFieldGrammar,
    validateTestSuite,
    unvalidateTestSuite,
    -- ** Lenses
    testStanzaTestType,
    testStanzaMainIs,
    testStanzaTestModule,
    testStanzaBuildInfo,
    -- * Benchmark
    BenchmarkStanza (..),
    benchmarkFieldGrammar,
    validateBenchmark,
    unvalidateBenchmark,
    -- ** Lenses
    benchmarkStanzaBenchmarkType,
    benchmarkStanzaMainIs,
    benchmarkStanzaBenchmarkModule,
    benchmarkStanzaBuildInfo,
    -- * Flag
    flagFieldGrammar,
    -- * Source repository
    sourceRepoFieldGrammar,
    -- * Setup build info
    setupBInfoFieldGrammar,
    -- * Component build info
    buildInfoFieldGrammar,
    ) where

import Distribution.Compat.Lens
import Distribution.Compat.Prelude
import Prelude ()

import Distribution.CabalSpecVersion
import Distribution.Compiler                  (CompilerFlavor (..), PerCompilerFlavor (..))
import Distribution.FieldGrammar
import Distribution.ModuleName                (ModuleName)
import Distribution.Package
import Distribution.PackageDescription
import Distribution.Parsec
import Distribution.Parsec.Newtypes
import Distribution.Fields
import Distribution.Pretty                    (prettyShow)
import Distribution.Types.ExecutableScope
import Distribution.Types.ForeignLib
import Distribution.Types.ForeignLibType
import Distribution.Types.LibraryVisibility
import Distribution.Types.UnqualComponentName
import Distribution.Version                   (anyVersion)

import qualified Distribution.SPDX as SPDX

import qualified Distribution.Types.Lens as L

-------------------------------------------------------------------------------
-- PackageDescription
-------------------------------------------------------------------------------

packageDescriptionFieldGrammar
    :: (FieldGrammar g, Applicative (g PackageDescription), Applicative (g PackageIdentifier))
    => g PackageDescription PackageDescription
packageDescriptionFieldGrammar :: g PackageDescription PackageDescription
packageDescriptionFieldGrammar = Either Version VersionRange
-> PackageIdentifier
-> Either License License
-> [FilePath]
-> FilePath
-> FilePath
-> FilePath
-> FilePath
-> [(CompilerFlavor, VersionRange)]
-> FilePath
-> FilePath
-> FilePath
-> [SourceRepo]
-> FilePath
-> FilePath
-> FilePath
-> [(FilePath, FilePath)]
-> Maybe BuildType
-> Maybe SetupBuildInfo
-> Maybe Library
-> [Library]
-> [Executable]
-> [ForeignLib]
-> [TestSuite]
-> [Benchmark]
-> [FilePath]
-> FilePath
-> [FilePath]
-> [FilePath]
-> [FilePath]
-> PackageDescription
PackageDescription
    (Either Version VersionRange
 -> PackageIdentifier
 -> Either License License
 -> [FilePath]
 -> FilePath
 -> FilePath
 -> FilePath
 -> FilePath
 -> [(CompilerFlavor, VersionRange)]
 -> FilePath
 -> FilePath
 -> FilePath
 -> [SourceRepo]
 -> FilePath
 -> FilePath
 -> FilePath
 -> [(FilePath, FilePath)]
 -> Maybe BuildType
 -> Maybe SetupBuildInfo
 -> Maybe Library
 -> [Library]
 -> [Executable]
 -> [ForeignLib]
 -> [TestSuite]
 -> [Benchmark]
 -> [FilePath]
 -> FilePath
 -> [FilePath]
 -> [FilePath]
 -> [FilePath]
 -> PackageDescription)
-> g PackageDescription (Either Version VersionRange)
-> g PackageDescription
     (PackageIdentifier
      -> Either License License
      -> [FilePath]
      -> FilePath
      -> FilePath
      -> FilePath
      -> FilePath
      -> [(CompilerFlavor, VersionRange)]
      -> FilePath
      -> FilePath
      -> FilePath
      -> [SourceRepo]
      -> FilePath
      -> FilePath
      -> FilePath
      -> [(FilePath, FilePath)]
      -> Maybe BuildType
      -> Maybe SetupBuildInfo
      -> Maybe Library
      -> [Library]
      -> [Executable]
      -> [ForeignLib]
      -> [TestSuite]
      -> [Benchmark]
      -> [FilePath]
      -> FilePath
      -> [FilePath]
      -> [FilePath]
      -> [FilePath]
      -> PackageDescription)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
<$> FieldName
-> (Either Version VersionRange -> SpecVersion)
-> ALens' PackageDescription (Either Version VersionRange)
-> Either Version VersionRange
-> g PackageDescription (Either Version VersionRange)
forall (g :: * -> * -> *) b a s.
(FieldGrammar g, Parsec b, Pretty b, Newtype a b, Eq a) =>
FieldName -> (a -> b) -> ALens' s a -> a -> g s a
optionalFieldDefAla "cabal-version" Either Version VersionRange -> SpecVersion
SpecVersion                ALens' PackageDescription (Either Version VersionRange)
Lens' PackageDescription (Either Version VersionRange)
L.specVersionRaw (VersionRange -> Either Version VersionRange
forall a b. b -> Either a b
Right VersionRange
anyVersion)
    g PackageDescription
  (PackageIdentifier
   -> Either License License
   -> [FilePath]
   -> FilePath
   -> FilePath
   -> FilePath
   -> FilePath
   -> [(CompilerFlavor, VersionRange)]
   -> FilePath
   -> FilePath
   -> FilePath
   -> [SourceRepo]
   -> FilePath
   -> FilePath
   -> FilePath
   -> [(FilePath, FilePath)]
   -> Maybe BuildType
   -> Maybe SetupBuildInfo
   -> Maybe Library
   -> [Library]
   -> [Executable]
   -> [ForeignLib]
   -> [TestSuite]
   -> [Benchmark]
   -> [FilePath]
   -> FilePath
   -> [FilePath]
   -> [FilePath]
   -> [FilePath]
   -> PackageDescription)
-> g PackageDescription PackageIdentifier
-> g PackageDescription
     (Either License License
      -> [FilePath]
      -> FilePath
      -> FilePath
      -> FilePath
      -> FilePath
      -> [(CompilerFlavor, VersionRange)]
      -> FilePath
      -> FilePath
      -> FilePath
      -> [SourceRepo]
      -> FilePath
      -> FilePath
      -> FilePath
      -> [(FilePath, FilePath)]
      -> Maybe BuildType
      -> Maybe SetupBuildInfo
      -> Maybe Library
      -> [Library]
      -> [Executable]
      -> [ForeignLib]
      -> [TestSuite]
      -> [Benchmark]
      -> [FilePath]
      -> FilePath
      -> [FilePath]
      -> [FilePath]
      -> [FilePath]
      -> PackageDescription)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
<*> ALens' PackageDescription PackageIdentifier
-> g PackageIdentifier PackageIdentifier
-> g PackageDescription PackageIdentifier
forall (g :: * -> * -> *) a b c.
FieldGrammar g =>
ALens' a b -> g b c -> g a c
blurFieldGrammar ALens' PackageDescription PackageIdentifier
Lens' PackageDescription PackageIdentifier
L.package g PackageIdentifier PackageIdentifier
packageIdentifierGrammar
    g PackageDescription
  (Either License License
   -> [FilePath]
   -> FilePath
   -> FilePath
   -> FilePath
   -> FilePath
   -> [(CompilerFlavor, VersionRange)]
   -> FilePath
   -> FilePath
   -> FilePath
   -> [SourceRepo]
   -> FilePath
   -> FilePath
   -> FilePath
   -> [(FilePath, FilePath)]
   -> Maybe BuildType
   -> Maybe SetupBuildInfo
   -> Maybe Library
   -> [Library]
   -> [Executable]
   -> [ForeignLib]
   -> [TestSuite]
   -> [Benchmark]
   -> [FilePath]
   -> FilePath
   -> [FilePath]
   -> [FilePath]
   -> [FilePath]
   -> PackageDescription)
-> g PackageDescription (Either License License)
-> g PackageDescription
     ([FilePath]
      -> FilePath
      -> FilePath
      -> FilePath
      -> FilePath
      -> [(CompilerFlavor, VersionRange)]
      -> FilePath
      -> FilePath
      -> FilePath
      -> [SourceRepo]
      -> FilePath
      -> FilePath
      -> FilePath
      -> [(FilePath, FilePath)]
      -> Maybe BuildType
      -> Maybe SetupBuildInfo
      -> Maybe Library
      -> [Library]
      -> [Executable]
      -> [ForeignLib]
      -> [TestSuite]
      -> [Benchmark]
      -> [FilePath]
      -> FilePath
      -> [FilePath]
      -> [FilePath]
      -> [FilePath]
      -> PackageDescription)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
<*> FieldName
-> (Either License License -> SpecLicense)
-> ALens' PackageDescription (Either License License)
-> Either License License
-> g PackageDescription (Either License License)
forall (g :: * -> * -> *) b a s.
(FieldGrammar g, Parsec b, Pretty b, Newtype a b, Eq a) =>
FieldName -> (a -> b) -> ALens' s a -> a -> g s a
optionalFieldDefAla "license"       Either License License -> SpecLicense
SpecLicense                ALens' PackageDescription (Either License License)
Lens' PackageDescription (Either License License)
L.licenseRaw (License -> Either License License
forall a b. a -> Either a b
Left License
SPDX.NONE)
    g PackageDescription
  ([FilePath]
   -> FilePath
   -> FilePath
   -> FilePath
   -> FilePath
   -> [(CompilerFlavor, VersionRange)]
   -> FilePath
   -> FilePath
   -> FilePath
   -> [SourceRepo]
   -> FilePath
   -> FilePath
   -> FilePath
   -> [(FilePath, FilePath)]
   -> Maybe BuildType
   -> Maybe SetupBuildInfo
   -> Maybe Library
   -> [Library]
   -> [Executable]
   -> [ForeignLib]
   -> [TestSuite]
   -> [Benchmark]
   -> [FilePath]
   -> FilePath
   -> [FilePath]
   -> [FilePath]
   -> [FilePath]
   -> PackageDescription)
-> g PackageDescription [FilePath]
-> g PackageDescription
     (FilePath
      -> FilePath
      -> FilePath
      -> FilePath
      -> [(CompilerFlavor, VersionRange)]
      -> FilePath
      -> FilePath
      -> FilePath
      -> [SourceRepo]
      -> FilePath
      -> FilePath
      -> FilePath
      -> [(FilePath, FilePath)]
      -> Maybe BuildType
      -> Maybe SetupBuildInfo
      -> Maybe Library
      -> [Library]
      -> [Executable]
      -> [ForeignLib]
      -> [TestSuite]
      -> [Benchmark]
      -> [FilePath]
      -> FilePath
      -> [FilePath]
      -> [FilePath]
      -> [FilePath]
      -> PackageDescription)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
<*> g PackageDescription [FilePath]
licenseFilesGrammar
    g PackageDescription
  (FilePath
   -> FilePath
   -> FilePath
   -> FilePath
   -> [(CompilerFlavor, VersionRange)]
   -> FilePath
   -> FilePath
   -> FilePath
   -> [SourceRepo]
   -> FilePath
   -> FilePath
   -> FilePath
   -> [(FilePath, FilePath)]
   -> Maybe BuildType
   -> Maybe SetupBuildInfo
   -> Maybe Library
   -> [Library]
   -> [Executable]
   -> [ForeignLib]
   -> [TestSuite]
   -> [Benchmark]
   -> [FilePath]
   -> FilePath
   -> [FilePath]
   -> [FilePath]
   -> [FilePath]
   -> PackageDescription)
-> g PackageDescription FilePath
-> g PackageDescription
     (FilePath
      -> FilePath
      -> FilePath
      -> [(CompilerFlavor, VersionRange)]
      -> FilePath
      -> FilePath
      -> FilePath
      -> [SourceRepo]
      -> FilePath
      -> FilePath
      -> FilePath
      -> [(FilePath, FilePath)]
      -> Maybe BuildType
      -> Maybe SetupBuildInfo
      -> Maybe Library
      -> [Library]
      -> [Executable]
      -> [ForeignLib]
      -> [TestSuite]
      -> [Benchmark]
      -> [FilePath]
      -> FilePath
      -> [FilePath]
      -> [FilePath]
      -> [FilePath]
      -> PackageDescription)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
<*> FieldName
-> ALens' PackageDescription FilePath
-> g PackageDescription FilePath
forall (g :: * -> * -> *) s.
FieldGrammar g =>
FieldName -> ALens' s FilePath -> g s FilePath
freeTextFieldDef    "copyright"                                ALens' PackageDescription FilePath
Lens' PackageDescription FilePath
L.copyright
    g PackageDescription
  (FilePath
   -> FilePath
   -> FilePath
   -> [(CompilerFlavor, VersionRange)]
   -> FilePath
   -> FilePath
   -> FilePath
   -> [SourceRepo]
   -> FilePath
   -> FilePath
   -> FilePath
   -> [(FilePath, FilePath)]
   -> Maybe BuildType
   -> Maybe SetupBuildInfo
   -> Maybe Library
   -> [Library]
   -> [Executable]
   -> [ForeignLib]
   -> [TestSuite]
   -> [Benchmark]
   -> [FilePath]
   -> FilePath
   -> [FilePath]
   -> [FilePath]
   -> [FilePath]
   -> PackageDescription)
-> g PackageDescription FilePath
-> g PackageDescription
     (FilePath
      -> FilePath
      -> [(CompilerFlavor, VersionRange)]
      -> FilePath
      -> FilePath
      -> FilePath
      -> [SourceRepo]
      -> FilePath
      -> FilePath
      -> FilePath
      -> [(FilePath, FilePath)]
      -> Maybe BuildType
      -> Maybe SetupBuildInfo
      -> Maybe Library
      -> [Library]
      -> [Executable]
      -> [ForeignLib]
      -> [TestSuite]
      -> [Benchmark]
      -> [FilePath]
      -> FilePath
      -> [FilePath]
      -> [FilePath]
      -> [FilePath]
      -> PackageDescription)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
<*> FieldName
-> ALens' PackageDescription FilePath
-> g PackageDescription FilePath
forall (g :: * -> * -> *) s.
FieldGrammar g =>
FieldName -> ALens' s FilePath -> g s FilePath
freeTextFieldDef    "maintainer"                               ALens' PackageDescription FilePath
Lens' PackageDescription FilePath
L.maintainer
    g PackageDescription
  (FilePath
   -> FilePath
   -> [(CompilerFlavor, VersionRange)]
   -> FilePath
   -> FilePath
   -> FilePath
   -> [SourceRepo]
   -> FilePath
   -> FilePath
   -> FilePath
   -> [(FilePath, FilePath)]
   -> Maybe BuildType
   -> Maybe SetupBuildInfo
   -> Maybe Library
   -> [Library]
   -> [Executable]
   -> [ForeignLib]
   -> [TestSuite]
   -> [Benchmark]
   -> [FilePath]
   -> FilePath
   -> [FilePath]
   -> [FilePath]
   -> [FilePath]
   -> PackageDescription)
-> g PackageDescription FilePath
-> g PackageDescription
     (FilePath
      -> [(CompilerFlavor, VersionRange)]
      -> FilePath
      -> FilePath
      -> FilePath
      -> [SourceRepo]
      -> FilePath
      -> FilePath
      -> FilePath
      -> [(FilePath, FilePath)]
      -> Maybe BuildType
      -> Maybe SetupBuildInfo
      -> Maybe Library
      -> [Library]
      -> [Executable]
      -> [ForeignLib]
      -> [TestSuite]
      -> [Benchmark]
      -> [FilePath]
      -> FilePath
      -> [FilePath]
      -> [FilePath]
      -> [FilePath]
      -> PackageDescription)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
<*> FieldName
-> ALens' PackageDescription FilePath
-> g PackageDescription FilePath
forall (g :: * -> * -> *) s.
FieldGrammar g =>
FieldName -> ALens' s FilePath -> g s FilePath
freeTextFieldDef    "author"                                   ALens' PackageDescription FilePath
Lens' PackageDescription FilePath
L.author
    g PackageDescription
  (FilePath
   -> [(CompilerFlavor, VersionRange)]
   -> FilePath
   -> FilePath
   -> FilePath
   -> [SourceRepo]
   -> FilePath
   -> FilePath
   -> FilePath
   -> [(FilePath, FilePath)]
   -> Maybe BuildType
   -> Maybe SetupBuildInfo
   -> Maybe Library
   -> [Library]
   -> [Executable]
   -> [ForeignLib]
   -> [TestSuite]
   -> [Benchmark]
   -> [FilePath]
   -> FilePath
   -> [FilePath]
   -> [FilePath]
   -> [FilePath]
   -> PackageDescription)
-> g PackageDescription FilePath
-> g PackageDescription
     ([(CompilerFlavor, VersionRange)]
      -> FilePath
      -> FilePath
      -> FilePath
      -> [SourceRepo]
      -> FilePath
      -> FilePath
      -> FilePath
      -> [(FilePath, FilePath)]
      -> Maybe BuildType
      -> Maybe SetupBuildInfo
      -> Maybe Library
      -> [Library]
      -> [Executable]
      -> [ForeignLib]
      -> [TestSuite]
      -> [Benchmark]
      -> [FilePath]
      -> FilePath
      -> [FilePath]
      -> [FilePath]
      -> [FilePath]
      -> PackageDescription)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
<*> FieldName
-> ALens' PackageDescription FilePath
-> g PackageDescription FilePath
forall (g :: * -> * -> *) s.
FieldGrammar g =>
FieldName -> ALens' s FilePath -> g s FilePath
freeTextFieldDef    "stability"                                ALens' PackageDescription FilePath
Lens' PackageDescription FilePath
L.stability
    g PackageDescription
  ([(CompilerFlavor, VersionRange)]
   -> FilePath
   -> FilePath
   -> FilePath
   -> [SourceRepo]
   -> FilePath
   -> FilePath
   -> FilePath
   -> [(FilePath, FilePath)]
   -> Maybe BuildType
   -> Maybe SetupBuildInfo
   -> Maybe Library
   -> [Library]
   -> [Executable]
   -> [ForeignLib]
   -> [TestSuite]
   -> [Benchmark]
   -> [FilePath]
   -> FilePath
   -> [FilePath]
   -> [FilePath]
   -> [FilePath]
   -> PackageDescription)
-> g PackageDescription [(CompilerFlavor, VersionRange)]
-> g PackageDescription
     (FilePath
      -> FilePath
      -> FilePath
      -> [SourceRepo]
      -> FilePath
      -> FilePath
      -> FilePath
      -> [(FilePath, FilePath)]
      -> Maybe BuildType
      -> Maybe SetupBuildInfo
      -> Maybe Library
      -> [Library]
      -> [Executable]
      -> [ForeignLib]
      -> [TestSuite]
      -> [Benchmark]
      -> [FilePath]
      -> FilePath
      -> [FilePath]
      -> [FilePath]
      -> [FilePath]
      -> PackageDescription)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
<*> FieldName
-> ([(CompilerFlavor, VersionRange)]
    -> List FSep TestedWith (CompilerFlavor, VersionRange))
-> ALens' PackageDescription [(CompilerFlavor, VersionRange)]
-> g PackageDescription [(CompilerFlavor, VersionRange)]
forall (g :: * -> * -> *) b a s.
(FieldGrammar g, Parsec b, Pretty b, Monoid a, Newtype a b) =>
FieldName -> (a -> b) -> ALens' s a -> g s a
monoidalFieldAla    "tested-with"   (FSep
-> ((CompilerFlavor, VersionRange) -> TestedWith)
-> [(CompilerFlavor, VersionRange)]
-> List FSep TestedWith (CompilerFlavor, VersionRange)
forall sep a b. sep -> (a -> b) -> [a] -> List sep b a
alaList' FSep
FSep (CompilerFlavor, VersionRange) -> TestedWith
TestedWith) ALens' PackageDescription [(CompilerFlavor, VersionRange)]
Lens' PackageDescription [(CompilerFlavor, VersionRange)]
L.testedWith
    g PackageDescription
  (FilePath
   -> FilePath
   -> FilePath
   -> [SourceRepo]
   -> FilePath
   -> FilePath
   -> FilePath
   -> [(FilePath, FilePath)]
   -> Maybe BuildType
   -> Maybe SetupBuildInfo
   -> Maybe Library
   -> [Library]
   -> [Executable]
   -> [ForeignLib]
   -> [TestSuite]
   -> [Benchmark]
   -> [FilePath]
   -> FilePath
   -> [FilePath]
   -> [FilePath]
   -> [FilePath]
   -> PackageDescription)
-> g PackageDescription FilePath
-> g PackageDescription
     (FilePath
      -> FilePath
      -> [SourceRepo]
      -> FilePath
      -> FilePath
      -> FilePath
      -> [(FilePath, FilePath)]
      -> Maybe BuildType
      -> Maybe SetupBuildInfo
      -> Maybe Library
      -> [Library]
      -> [Executable]
      -> [ForeignLib]
      -> [TestSuite]
      -> [Benchmark]
      -> [FilePath]
      -> FilePath
      -> [FilePath]
      -> [FilePath]
      -> [FilePath]
      -> PackageDescription)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
<*> FieldName
-> ALens' PackageDescription FilePath
-> g PackageDescription FilePath
forall (g :: * -> * -> *) s.
FieldGrammar g =>
FieldName -> ALens' s FilePath -> g s FilePath
freeTextFieldDef    "homepage"                                 ALens' PackageDescription FilePath
Lens' PackageDescription FilePath
L.homepage
    g PackageDescription
  (FilePath
   -> FilePath
   -> [SourceRepo]
   -> FilePath
   -> FilePath
   -> FilePath
   -> [(FilePath, FilePath)]
   -> Maybe BuildType
   -> Maybe SetupBuildInfo
   -> Maybe Library
   -> [Library]
   -> [Executable]
   -> [ForeignLib]
   -> [TestSuite]
   -> [Benchmark]
   -> [FilePath]
   -> FilePath
   -> [FilePath]
   -> [FilePath]
   -> [FilePath]
   -> PackageDescription)
-> g PackageDescription FilePath
-> g PackageDescription
     (FilePath
      -> [SourceRepo]
      -> FilePath
      -> FilePath
      -> FilePath
      -> [(FilePath, FilePath)]
      -> Maybe BuildType
      -> Maybe SetupBuildInfo
      -> Maybe Library
      -> [Library]
      -> [Executable]
      -> [ForeignLib]
      -> [TestSuite]
      -> [Benchmark]
      -> [FilePath]
      -> FilePath
      -> [FilePath]
      -> [FilePath]
      -> [FilePath]
      -> PackageDescription)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
<*> FieldName
-> ALens' PackageDescription FilePath
-> g PackageDescription FilePath
forall (g :: * -> * -> *) s.
FieldGrammar g =>
FieldName -> ALens' s FilePath -> g s FilePath
freeTextFieldDef    "package-url"                              ALens' PackageDescription FilePath
Lens' PackageDescription FilePath
L.pkgUrl
    g PackageDescription
  (FilePath
   -> [SourceRepo]
   -> FilePath
   -> FilePath
   -> FilePath
   -> [(FilePath, FilePath)]
   -> Maybe BuildType
   -> Maybe SetupBuildInfo
   -> Maybe Library
   -> [Library]
   -> [Executable]
   -> [ForeignLib]
   -> [TestSuite]
   -> [Benchmark]
   -> [FilePath]
   -> FilePath
   -> [FilePath]
   -> [FilePath]
   -> [FilePath]
   -> PackageDescription)
-> g PackageDescription FilePath
-> g PackageDescription
     ([SourceRepo]
      -> FilePath
      -> FilePath
      -> FilePath
      -> [(FilePath, FilePath)]
      -> Maybe BuildType
      -> Maybe SetupBuildInfo
      -> Maybe Library
      -> [Library]
      -> [Executable]
      -> [ForeignLib]
      -> [TestSuite]
      -> [Benchmark]
      -> [FilePath]
      -> FilePath
      -> [FilePath]
      -> [FilePath]
      -> [FilePath]
      -> PackageDescription)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
<*> FieldName
-> ALens' PackageDescription FilePath
-> g PackageDescription FilePath
forall (g :: * -> * -> *) s.
FieldGrammar g =>
FieldName -> ALens' s FilePath -> g s FilePath
freeTextFieldDef    "bug-reports"                              ALens' PackageDescription FilePath
Lens' PackageDescription FilePath
L.bugReports
    g PackageDescription
  ([SourceRepo]
   -> FilePath
   -> FilePath
   -> FilePath
   -> [(FilePath, FilePath)]
   -> Maybe BuildType
   -> Maybe SetupBuildInfo
   -> Maybe Library
   -> [Library]
   -> [Executable]
   -> [ForeignLib]
   -> [TestSuite]
   -> [Benchmark]
   -> [FilePath]
   -> FilePath
   -> [FilePath]
   -> [FilePath]
   -> [FilePath]
   -> PackageDescription)
-> g PackageDescription [SourceRepo]
-> g PackageDescription
     (FilePath
      -> FilePath
      -> FilePath
      -> [(FilePath, FilePath)]
      -> Maybe BuildType
      -> Maybe SetupBuildInfo
      -> Maybe Library
      -> [Library]
      -> [Executable]
      -> [ForeignLib]
      -> [TestSuite]
      -> [Benchmark]
      -> [FilePath]
      -> FilePath
      -> [FilePath]
      -> [FilePath]
      -> [FilePath]
      -> PackageDescription)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
<*> [SourceRepo] -> g PackageDescription [SourceRepo]
forall (f :: * -> *) a. Applicative f => a -> f a
pure [] -- source-repos are stanza
    g PackageDescription
  (FilePath
   -> FilePath
   -> FilePath
   -> [(FilePath, FilePath)]
   -> Maybe BuildType
   -> Maybe SetupBuildInfo
   -> Maybe Library
   -> [Library]
   -> [Executable]
   -> [ForeignLib]
   -> [TestSuite]
   -> [Benchmark]
   -> [FilePath]
   -> FilePath
   -> [FilePath]
   -> [FilePath]
   -> [FilePath]
   -> PackageDescription)
-> g PackageDescription FilePath
-> g PackageDescription
     (FilePath
      -> FilePath
      -> [(FilePath, FilePath)]
      -> Maybe BuildType
      -> Maybe SetupBuildInfo
      -> Maybe Library
      -> [Library]
      -> [Executable]
      -> [ForeignLib]
      -> [TestSuite]
      -> [Benchmark]
      -> [FilePath]
      -> FilePath
      -> [FilePath]
      -> [FilePath]
      -> [FilePath]
      -> PackageDescription)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
<*> FieldName
-> ALens' PackageDescription FilePath
-> g PackageDescription FilePath
forall (g :: * -> * -> *) s.
FieldGrammar g =>
FieldName -> ALens' s FilePath -> g s FilePath
freeTextFieldDef    "synopsis"                                 ALens' PackageDescription FilePath
Lens' PackageDescription FilePath
L.synopsis
    g PackageDescription
  (FilePath
   -> FilePath
   -> [(FilePath, FilePath)]
   -> Maybe BuildType
   -> Maybe SetupBuildInfo
   -> Maybe Library
   -> [Library]
   -> [Executable]
   -> [ForeignLib]
   -> [TestSuite]
   -> [Benchmark]
   -> [FilePath]
   -> FilePath
   -> [FilePath]
   -> [FilePath]
   -> [FilePath]
   -> PackageDescription)
-> g PackageDescription FilePath
-> g PackageDescription
     (FilePath
      -> [(FilePath, FilePath)]
      -> Maybe BuildType
      -> Maybe SetupBuildInfo
      -> Maybe Library
      -> [Library]
      -> [Executable]
      -> [ForeignLib]
      -> [TestSuite]
      -> [Benchmark]
      -> [FilePath]
      -> FilePath
      -> [FilePath]
      -> [FilePath]
      -> [FilePath]
      -> PackageDescription)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
<*> FieldName
-> ALens' PackageDescription FilePath
-> g PackageDescription FilePath
forall (g :: * -> * -> *) s.
FieldGrammar g =>
FieldName -> ALens' s FilePath -> g s FilePath
freeTextFieldDef    "description"                              ALens' PackageDescription FilePath
Lens' PackageDescription FilePath
L.description
    g PackageDescription
  (FilePath
   -> [(FilePath, FilePath)]
   -> Maybe BuildType
   -> Maybe SetupBuildInfo
   -> Maybe Library
   -> [Library]
   -> [Executable]
   -> [ForeignLib]
   -> [TestSuite]
   -> [Benchmark]
   -> [FilePath]
   -> FilePath
   -> [FilePath]
   -> [FilePath]
   -> [FilePath]
   -> PackageDescription)
-> g PackageDescription FilePath
-> g PackageDescription
     ([(FilePath, FilePath)]
      -> Maybe BuildType
      -> Maybe SetupBuildInfo
      -> Maybe Library
      -> [Library]
      -> [Executable]
      -> [ForeignLib]
      -> [TestSuite]
      -> [Benchmark]
      -> [FilePath]
      -> FilePath
      -> [FilePath]
      -> [FilePath]
      -> [FilePath]
      -> PackageDescription)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
<*> FieldName
-> ALens' PackageDescription FilePath
-> g PackageDescription FilePath
forall (g :: * -> * -> *) s.
FieldGrammar g =>
FieldName -> ALens' s FilePath -> g s FilePath
freeTextFieldDef    "category"                                 ALens' PackageDescription FilePath
Lens' PackageDescription FilePath
L.category
    g PackageDescription
  ([(FilePath, FilePath)]
   -> Maybe BuildType
   -> Maybe SetupBuildInfo
   -> Maybe Library
   -> [Library]
   -> [Executable]
   -> [ForeignLib]
   -> [TestSuite]
   -> [Benchmark]
   -> [FilePath]
   -> FilePath
   -> [FilePath]
   -> [FilePath]
   -> [FilePath]
   -> PackageDescription)
-> g PackageDescription [(FilePath, FilePath)]
-> g PackageDescription
     (Maybe BuildType
      -> Maybe SetupBuildInfo
      -> Maybe Library
      -> [Library]
      -> [Executable]
      -> [ForeignLib]
      -> [TestSuite]
      -> [Benchmark]
      -> [FilePath]
      -> FilePath
      -> [FilePath]
      -> [FilePath]
      -> [FilePath]
      -> PackageDescription)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
<*> FieldName
-> ALens' PackageDescription [(FilePath, FilePath)]
-> g PackageDescription [(FilePath, FilePath)]
forall (g :: * -> * -> *) s.
FieldGrammar g =>
FieldName
-> ALens' s [(FilePath, FilePath)] -> g s [(FilePath, FilePath)]
prefixedFields      "x-"                                       ALens' PackageDescription [(FilePath, FilePath)]
Lens' PackageDescription [(FilePath, FilePath)]
L.customFieldsPD
    g PackageDescription
  (Maybe BuildType
   -> Maybe SetupBuildInfo
   -> Maybe Library
   -> [Library]
   -> [Executable]
   -> [ForeignLib]
   -> [TestSuite]
   -> [Benchmark]
   -> [FilePath]
   -> FilePath
   -> [FilePath]
   -> [FilePath]
   -> [FilePath]
   -> PackageDescription)
-> g PackageDescription (Maybe BuildType)
-> g PackageDescription
     (Maybe SetupBuildInfo
      -> Maybe Library
      -> [Library]
      -> [Executable]
      -> [ForeignLib]
      -> [TestSuite]
      -> [Benchmark]
      -> [FilePath]
      -> FilePath
      -> [FilePath]
      -> [FilePath]
      -> [FilePath]
      -> PackageDescription)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
<*> FieldName
-> ALens' PackageDescription (Maybe BuildType)
-> g PackageDescription (Maybe BuildType)
forall (g :: * -> * -> *) a s.
(FieldGrammar g, Parsec a, Pretty a) =>
FieldName -> ALens' s (Maybe a) -> g s (Maybe a)
optionalField       "build-type"                               ALens' PackageDescription (Maybe BuildType)
Lens' PackageDescription (Maybe BuildType)
L.buildTypeRaw
    g PackageDescription
  (Maybe SetupBuildInfo
   -> Maybe Library
   -> [Library]
   -> [Executable]
   -> [ForeignLib]
   -> [TestSuite]
   -> [Benchmark]
   -> [FilePath]
   -> FilePath
   -> [FilePath]
   -> [FilePath]
   -> [FilePath]
   -> PackageDescription)
-> g PackageDescription (Maybe SetupBuildInfo)
-> g PackageDescription
     (Maybe Library
      -> [Library]
      -> [Executable]
      -> [ForeignLib]
      -> [TestSuite]
      -> [Benchmark]
      -> [FilePath]
      -> FilePath
      -> [FilePath]
      -> [FilePath]
      -> [FilePath]
      -> PackageDescription)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
<*> Maybe SetupBuildInfo -> g PackageDescription (Maybe SetupBuildInfo)
forall (f :: * -> *) a. Applicative f => a -> f a
pure Maybe SetupBuildInfo
forall a. Maybe a
Nothing -- custom-setup
    -- components
    g PackageDescription
  (Maybe Library
   -> [Library]
   -> [Executable]
   -> [ForeignLib]
   -> [TestSuite]
   -> [Benchmark]
   -> [FilePath]
   -> FilePath
   -> [FilePath]
   -> [FilePath]
   -> [FilePath]
   -> PackageDescription)
-> g PackageDescription (Maybe Library)
-> g PackageDescription
     ([Library]
      -> [Executable]
      -> [ForeignLib]
      -> [TestSuite]
      -> [Benchmark]
      -> [FilePath]
      -> FilePath
      -> [FilePath]
      -> [FilePath]
      -> [FilePath]
      -> PackageDescription)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
<*> Maybe Library -> g PackageDescription (Maybe Library)
forall (f :: * -> *) a. Applicative f => a -> f a
pure Maybe Library
forall a. Maybe a
Nothing  -- lib
    g PackageDescription
  ([Library]
   -> [Executable]
   -> [ForeignLib]
   -> [TestSuite]
   -> [Benchmark]
   -> [FilePath]
   -> FilePath
   -> [FilePath]
   -> [FilePath]
   -> [FilePath]
   -> PackageDescription)
-> g PackageDescription [Library]
-> g PackageDescription
     ([Executable]
      -> [ForeignLib]
      -> [TestSuite]
      -> [Benchmark]
      -> [FilePath]
      -> FilePath
      -> [FilePath]
      -> [FilePath]
      -> [FilePath]
      -> PackageDescription)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
<*> [Library] -> g PackageDescription [Library]
forall (f :: * -> *) a. Applicative f => a -> f a
pure []       -- sub libs
    g PackageDescription
  ([Executable]
   -> [ForeignLib]
   -> [TestSuite]
   -> [Benchmark]
   -> [FilePath]
   -> FilePath
   -> [FilePath]
   -> [FilePath]
   -> [FilePath]
   -> PackageDescription)
-> g PackageDescription [Executable]
-> g PackageDescription
     ([ForeignLib]
      -> [TestSuite]
      -> [Benchmark]
      -> [FilePath]
      -> FilePath
      -> [FilePath]
      -> [FilePath]
      -> [FilePath]
      -> PackageDescription)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
<*> [Executable] -> g PackageDescription [Executable]
forall (f :: * -> *) a. Applicative f => a -> f a
pure []       -- executables
    g PackageDescription
  ([ForeignLib]
   -> [TestSuite]
   -> [Benchmark]
   -> [FilePath]
   -> FilePath
   -> [FilePath]
   -> [FilePath]
   -> [FilePath]
   -> PackageDescription)
-> g PackageDescription [ForeignLib]
-> g PackageDescription
     ([TestSuite]
      -> [Benchmark]
      -> [FilePath]
      -> FilePath
      -> [FilePath]
      -> [FilePath]
      -> [FilePath]
      -> PackageDescription)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
<*> [ForeignLib] -> g PackageDescription [ForeignLib]
forall (f :: * -> *) a. Applicative f => a -> f a
pure []       -- foreign libs
    g PackageDescription
  ([TestSuite]
   -> [Benchmark]
   -> [FilePath]
   -> FilePath
   -> [FilePath]
   -> [FilePath]
   -> [FilePath]
   -> PackageDescription)
-> g PackageDescription [TestSuite]
-> g PackageDescription
     ([Benchmark]
      -> [FilePath]
      -> FilePath
      -> [FilePath]
      -> [FilePath]
      -> [FilePath]
      -> PackageDescription)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
<*> [TestSuite] -> g PackageDescription [TestSuite]
forall (f :: * -> *) a. Applicative f => a -> f a
pure []       -- test suites
    g PackageDescription
  ([Benchmark]
   -> [FilePath]
   -> FilePath
   -> [FilePath]
   -> [FilePath]
   -> [FilePath]
   -> PackageDescription)
-> g PackageDescription [Benchmark]
-> g PackageDescription
     ([FilePath]
      -> FilePath
      -> [FilePath]
      -> [FilePath]
      -> [FilePath]
      -> PackageDescription)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
<*> [Benchmark] -> g PackageDescription [Benchmark]
forall (f :: * -> *) a. Applicative f => a -> f a
pure []       -- benchmarks
    --  * Files
    g PackageDescription
  ([FilePath]
   -> FilePath
   -> [FilePath]
   -> [FilePath]
   -> [FilePath]
   -> PackageDescription)
-> g PackageDescription [FilePath]
-> g PackageDescription
     (FilePath
      -> [FilePath] -> [FilePath] -> [FilePath] -> PackageDescription)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
<*> FieldName
-> ([FilePath] -> List VCat FilePathNT FilePath)
-> ALens' PackageDescription [FilePath]
-> g PackageDescription [FilePath]
forall (g :: * -> * -> *) b a s.
(FieldGrammar g, Parsec b, Pretty b, Monoid a, Newtype a b) =>
FieldName -> (a -> b) -> ALens' s a -> g s a
monoidalFieldAla    "data-files"         (VCat
-> (FilePath -> FilePathNT)
-> [FilePath]
-> List VCat FilePathNT FilePath
forall sep a b. sep -> (a -> b) -> [a] -> List sep b a
alaList' VCat
VCat FilePath -> FilePathNT
FilePathNT) ALens' PackageDescription [FilePath]
Lens' PackageDescription [FilePath]
L.dataFiles
    g PackageDescription
  (FilePath
   -> [FilePath] -> [FilePath] -> [FilePath] -> PackageDescription)
-> g PackageDescription FilePath
-> g PackageDescription
     ([FilePath] -> [FilePath] -> [FilePath] -> PackageDescription)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
<*> FieldName
-> (FilePath -> FilePathNT)
-> ALens' PackageDescription FilePath
-> FilePath
-> g PackageDescription FilePath
forall (g :: * -> * -> *) b a s.
(FieldGrammar g, Parsec b, Pretty b, Newtype a b, Eq a) =>
FieldName -> (a -> b) -> ALens' s a -> a -> g s a
optionalFieldDefAla "data-dir"           FilePath -> FilePathNT
FilePathNT                 ALens' PackageDescription FilePath
Lens' PackageDescription FilePath
L.dataDir ""
    g PackageDescription
  ([FilePath] -> [FilePath] -> [FilePath] -> PackageDescription)
-> g PackageDescription [FilePath]
-> g PackageDescription
     ([FilePath] -> [FilePath] -> PackageDescription)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
<*> FieldName
-> ([FilePath] -> List VCat FilePathNT FilePath)
-> ALens' PackageDescription [FilePath]
-> g PackageDescription [FilePath]
forall (g :: * -> * -> *) b a s.
(FieldGrammar g, Parsec b, Pretty b, Monoid a, Newtype a b) =>
FieldName -> (a -> b) -> ALens' s a -> g s a
monoidalFieldAla    "extra-source-files" (VCat
-> (FilePath -> FilePathNT)
-> [FilePath]
-> List VCat FilePathNT FilePath
forall sep a b. sep -> (a -> b) -> [a] -> List sep b a
alaList' VCat
VCat FilePath -> FilePathNT
FilePathNT) ALens' PackageDescription [FilePath]
Lens' PackageDescription [FilePath]
L.extraSrcFiles
    g PackageDescription
  ([FilePath] -> [FilePath] -> PackageDescription)
-> g PackageDescription [FilePath]
-> g PackageDescription ([FilePath] -> PackageDescription)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
<*> FieldName
-> ([FilePath] -> List VCat FilePathNT FilePath)
-> ALens' PackageDescription [FilePath]
-> g PackageDescription [FilePath]
forall (g :: * -> * -> *) b a s.
(FieldGrammar g, Parsec b, Pretty b, Monoid a, Newtype a b) =>
FieldName -> (a -> b) -> ALens' s a -> g s a
monoidalFieldAla    "extra-tmp-files"    (VCat
-> (FilePath -> FilePathNT)
-> [FilePath]
-> List VCat FilePathNT FilePath
forall sep a b. sep -> (a -> b) -> [a] -> List sep b a
alaList' VCat
VCat FilePath -> FilePathNT
FilePathNT) ALens' PackageDescription [FilePath]
Lens' PackageDescription [FilePath]
L.extraTmpFiles
    g PackageDescription ([FilePath] -> PackageDescription)
-> g PackageDescription [FilePath]
-> g PackageDescription PackageDescription
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
<*> FieldName
-> ([FilePath] -> List VCat FilePathNT FilePath)
-> ALens' PackageDescription [FilePath]
-> g PackageDescription [FilePath]
forall (g :: * -> * -> *) b a s.
(FieldGrammar g, Parsec b, Pretty b, Monoid a, Newtype a b) =>
FieldName -> (a -> b) -> ALens' s a -> g s a
monoidalFieldAla    "extra-doc-files"    (VCat
-> (FilePath -> FilePathNT)
-> [FilePath]
-> List VCat FilePathNT FilePath
forall sep a b. sep -> (a -> b) -> [a] -> List sep b a
alaList' VCat
VCat FilePath -> FilePathNT
FilePathNT) ALens' PackageDescription [FilePath]
Lens' PackageDescription [FilePath]
L.extraDocFiles
  where
    packageIdentifierGrammar :: g PackageIdentifier PackageIdentifier
packageIdentifierGrammar = PackageName -> Version -> PackageIdentifier
PackageIdentifier
        (PackageName -> Version -> PackageIdentifier)
-> g PackageIdentifier PackageName
-> g PackageIdentifier (Version -> PackageIdentifier)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
<$> FieldName
-> ALens' PackageIdentifier PackageName
-> g PackageIdentifier PackageName
forall (g :: * -> * -> *) a s.
(FieldGrammar g, Parsec a, Pretty a) =>
FieldName -> ALens' s a -> g s a
uniqueField "name"    ALens' PackageIdentifier PackageName
Lens' PackageIdentifier PackageName
L.pkgName
        g PackageIdentifier (Version -> PackageIdentifier)
-> g PackageIdentifier Version
-> g PackageIdentifier PackageIdentifier
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
<*> FieldName
-> ALens' PackageIdentifier Version -> g PackageIdentifier Version
forall (g :: * -> * -> *) a s.
(FieldGrammar g, Parsec a, Pretty a) =>
FieldName -> ALens' s a -> g s a
uniqueField "version" ALens' PackageIdentifier Version
Lens' PackageIdentifier Version
L.pkgVersion

    licenseFilesGrammar :: g PackageDescription [FilePath]
licenseFilesGrammar = [FilePath] -> [FilePath] -> [FilePath]
forall a. [a] -> [a] -> [a]
(++)
        -- TODO: neither field is deprecated
        -- should we pretty print license-file if there's single license file
        -- and license-files when more
        ([FilePath] -> [FilePath] -> [FilePath])
-> g PackageDescription [FilePath]
-> g PackageDescription ([FilePath] -> [FilePath])
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
<$> FieldName
-> ([FilePath] -> List FSep FilePathNT FilePath)
-> ALens' PackageDescription [FilePath]
-> g PackageDescription [FilePath]
forall (g :: * -> * -> *) b a s.
(FieldGrammar g, Parsec b, Pretty b, Monoid a, Newtype a b) =>
FieldName -> (a -> b) -> ALens' s a -> g s a
monoidalFieldAla    "license-file"  (FSep
-> (FilePath -> FilePathNT)
-> [FilePath]
-> List FSep FilePathNT FilePath
forall sep a b. sep -> (a -> b) -> [a] -> List sep b a
alaList' FSep
FSep FilePath -> FilePathNT
FilePathNT)  ALens' PackageDescription [FilePath]
Lens' PackageDescription [FilePath]
L.licenseFiles
        g PackageDescription ([FilePath] -> [FilePath])
-> g PackageDescription [FilePath]
-> g PackageDescription [FilePath]
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
<*> FieldName
-> ([FilePath] -> List FSep FilePathNT FilePath)
-> ALens' PackageDescription [FilePath]
-> g PackageDescription [FilePath]
forall (g :: * -> * -> *) b a s.
(FieldGrammar g, Parsec b, Pretty b, Monoid a, Newtype a b) =>
FieldName -> (a -> b) -> ALens' s a -> g s a
monoidalFieldAla    "license-files"  (FSep
-> (FilePath -> FilePathNT)
-> [FilePath]
-> List FSep FilePathNT FilePath
forall sep a b. sep -> (a -> b) -> [a] -> List sep b a
alaList' FSep
FSep FilePath -> FilePathNT
FilePathNT) ALens' PackageDescription [FilePath]
Lens' PackageDescription [FilePath]
L.licenseFiles
            g PackageDescription [FilePath]
-> (g PackageDescription [FilePath]
    -> g PackageDescription [FilePath])
-> g PackageDescription [FilePath]
forall a b. a -> (a -> b) -> b
^^^ g PackageDescription [FilePath] -> g PackageDescription [FilePath]
forall (g :: * -> * -> *) s a. FieldGrammar g => g s a -> g s a
hiddenField

-------------------------------------------------------------------------------
-- Library
-------------------------------------------------------------------------------

libraryFieldGrammar
    :: (FieldGrammar g, Applicative (g Library), Applicative (g BuildInfo))
    => LibraryName
    -> g Library Library
libraryFieldGrammar :: LibraryName -> g Library Library
libraryFieldGrammar n :: LibraryName
n = LibraryName
-> [ModuleName]
-> [ModuleReexport]
-> [ModuleName]
-> Bool
-> LibraryVisibility
-> BuildInfo
-> Library
Library LibraryName
n
    ([ModuleName]
 -> [ModuleReexport]
 -> [ModuleName]
 -> Bool
 -> LibraryVisibility
 -> BuildInfo
 -> Library)
-> g Library [ModuleName]
-> g Library
     ([ModuleReexport]
      -> [ModuleName]
      -> Bool
      -> LibraryVisibility
      -> BuildInfo
      -> Library)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
<$> FieldName
-> ([ModuleName] -> List VCat (MQuoted ModuleName) ModuleName)
-> ALens' Library [ModuleName]
-> g Library [ModuleName]
forall (g :: * -> * -> *) b a s.
(FieldGrammar g, Parsec b, Pretty b, Monoid a, Newtype a b) =>
FieldName -> (a -> b) -> ALens' s a -> g s a
monoidalFieldAla  "exposed-modules"    (VCat
-> (ModuleName -> MQuoted ModuleName)
-> [ModuleName]
-> List VCat (MQuoted ModuleName) ModuleName
forall sep a b. sep -> (a -> b) -> [a] -> List sep b a
alaList' VCat
VCat ModuleName -> MQuoted ModuleName
forall a. a -> MQuoted a
MQuoted) ALens' Library [ModuleName]
Lens' Library [ModuleName]
L.exposedModules
    g Library
  ([ModuleReexport]
   -> [ModuleName]
   -> Bool
   -> LibraryVisibility
   -> BuildInfo
   -> Library)
-> g Library [ModuleReexport]
-> g Library
     ([ModuleName] -> Bool -> LibraryVisibility -> BuildInfo -> Library)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
<*> FieldName
-> ([ModuleReexport]
    -> List CommaVCat (Identity ModuleReexport) ModuleReexport)
-> ALens' Library [ModuleReexport]
-> g Library [ModuleReexport]
forall (g :: * -> * -> *) b a s.
(FieldGrammar g, Parsec b, Pretty b, Monoid a, Newtype a b) =>
FieldName -> (a -> b) -> ALens' s a -> g s a
monoidalFieldAla  "reexported-modules" (CommaVCat
-> [ModuleReexport]
-> List CommaVCat (Identity ModuleReexport) ModuleReexport
forall sep a. sep -> [a] -> List sep (Identity a) a
alaList  CommaVCat
CommaVCat)    ALens' Library [ModuleReexport]
Lens' Library [ModuleReexport]
L.reexportedModules
    g Library
  ([ModuleName] -> Bool -> LibraryVisibility -> BuildInfo -> Library)
-> g Library [ModuleName]
-> g Library (Bool -> LibraryVisibility -> BuildInfo -> Library)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
<*> FieldName
-> ([ModuleName] -> List VCat (MQuoted ModuleName) ModuleName)
-> ALens' Library [ModuleName]
-> g Library [ModuleName]
forall (g :: * -> * -> *) b a s.
(FieldGrammar g, Parsec b, Pretty b, Monoid a, Newtype a b) =>
FieldName -> (a -> b) -> ALens' s a -> g s a
monoidalFieldAla  "signatures"         (VCat
-> (ModuleName -> MQuoted ModuleName)
-> [ModuleName]
-> List VCat (MQuoted ModuleName) ModuleName
forall sep a b. sep -> (a -> b) -> [a] -> List sep b a
alaList' VCat
VCat ModuleName -> MQuoted ModuleName
forall a. a -> MQuoted a
MQuoted) ALens' Library [ModuleName]
Lens' Library [ModuleName]
L.signatures
        g Library [ModuleName]
-> (g Library [ModuleName] -> g Library [ModuleName])
-> g Library [ModuleName]
forall a b. a -> (a -> b) -> b
^^^ CabalSpecVersion
-> [ModuleName] -> g Library [ModuleName] -> g Library [ModuleName]
forall (g :: * -> * -> *) a s.
FieldGrammar g =>
CabalSpecVersion -> a -> g s a -> g s a
availableSince CabalSpecVersion
CabalSpecV2_0 []
    g Library (Bool -> LibraryVisibility -> BuildInfo -> Library)
-> g Library Bool
-> g Library (LibraryVisibility -> BuildInfo -> Library)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
<*> FieldName -> ALens' Library Bool -> Bool -> g Library Bool
forall (g :: * -> * -> *) s.
FieldGrammar g =>
FieldName -> ALens' s Bool -> Bool -> g s Bool
booleanFieldDef   "exposed"                                    ALens' Library Bool
Lens' Library Bool
L.libExposed Bool
True
    g Library (LibraryVisibility -> BuildInfo -> Library)
-> g Library LibraryVisibility -> g Library (BuildInfo -> Library)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
<*> g Library LibraryVisibility
visibilityField
    g Library (BuildInfo -> Library)
-> g Library BuildInfo -> g Library Library
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
<*> ALens' Library BuildInfo
-> g BuildInfo BuildInfo -> g Library BuildInfo
forall (g :: * -> * -> *) a b c.
FieldGrammar g =>
ALens' a b -> g b c -> g a c
blurFieldGrammar ALens' Library BuildInfo
Lens' Library BuildInfo
L.libBuildInfo g BuildInfo BuildInfo
forall (g :: * -> * -> *).
(FieldGrammar g, Applicative (g BuildInfo)) =>
g BuildInfo BuildInfo
buildInfoFieldGrammar
  where
    visibilityField :: g Library LibraryVisibility
visibilityField = case LibraryName
n of
        -- nameless/"main" libraries are public
        LMainLibName -> LibraryVisibility -> g Library LibraryVisibility
forall (f :: * -> *) a. Applicative f => a -> f a
pure LibraryVisibility
LibraryVisibilityPublic
        -- named libraries have the field
        LSubLibName _ ->
            FieldName
-> ALens' Library LibraryVisibility
-> LibraryVisibility
-> g Library LibraryVisibility
forall (g :: * -> * -> *) s a.
(FieldGrammar g, Functor (g s), Parsec a, Pretty a, Eq a) =>
FieldName -> ALens' s a -> a -> g s a
optionalFieldDef "visibility" ALens' Library LibraryVisibility
Lens' Library LibraryVisibility
L.libVisibility LibraryVisibility
LibraryVisibilityPrivate
            g Library LibraryVisibility
-> (g Library LibraryVisibility -> g Library LibraryVisibility)
-> g Library LibraryVisibility
forall a b. a -> (a -> b) -> b
^^^ CabalSpecVersion
-> LibraryVisibility
-> g Library LibraryVisibility
-> g Library LibraryVisibility
forall (g :: * -> * -> *) a s.
FieldGrammar g =>
CabalSpecVersion -> a -> g s a -> g s a
availableSince CabalSpecVersion
CabalSpecV3_0 LibraryVisibility
LibraryVisibilityPrivate

{-# SPECIALIZE libraryFieldGrammar :: LibraryName -> ParsecFieldGrammar' Library #-}
{-# SPECIALIZE libraryFieldGrammar :: LibraryName -> PrettyFieldGrammar' Library #-}

-------------------------------------------------------------------------------
-- Foreign library
-------------------------------------------------------------------------------

foreignLibFieldGrammar
    :: (FieldGrammar g, Applicative (g ForeignLib), Applicative (g BuildInfo))
    => UnqualComponentName -> g ForeignLib ForeignLib
foreignLibFieldGrammar :: UnqualComponentName -> g ForeignLib ForeignLib
foreignLibFieldGrammar n :: UnqualComponentName
n = UnqualComponentName
-> ForeignLibType
-> [ForeignLibOption]
-> BuildInfo
-> Maybe LibVersionInfo
-> Maybe Version
-> [FilePath]
-> ForeignLib
ForeignLib UnqualComponentName
n
    (ForeignLibType
 -> [ForeignLibOption]
 -> BuildInfo
 -> Maybe LibVersionInfo
 -> Maybe Version
 -> [FilePath]
 -> ForeignLib)
-> g ForeignLib ForeignLibType
-> g ForeignLib
     ([ForeignLibOption]
      -> BuildInfo
      -> Maybe LibVersionInfo
      -> Maybe Version
      -> [FilePath]
      -> ForeignLib)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
<$> FieldName
-> ALens' ForeignLib ForeignLibType
-> ForeignLibType
-> g ForeignLib ForeignLibType
forall (g :: * -> * -> *) s a.
(FieldGrammar g, Functor (g s), Parsec a, Pretty a, Eq a) =>
FieldName -> ALens' s a -> a -> g s a
optionalFieldDef "type"                                         ALens' ForeignLib ForeignLibType
Lens' ForeignLib ForeignLibType
L.foreignLibType ForeignLibType
ForeignLibTypeUnknown
    g ForeignLib
  ([ForeignLibOption]
   -> BuildInfo
   -> Maybe LibVersionInfo
   -> Maybe Version
   -> [FilePath]
   -> ForeignLib)
-> g ForeignLib [ForeignLibOption]
-> g ForeignLib
     (BuildInfo
      -> Maybe LibVersionInfo
      -> Maybe Version
      -> [FilePath]
      -> ForeignLib)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
<*> FieldName
-> ([ForeignLibOption]
    -> List FSep (Identity ForeignLibOption) ForeignLibOption)
-> ALens' ForeignLib [ForeignLibOption]
-> g ForeignLib [ForeignLibOption]
forall (g :: * -> * -> *) b a s.
(FieldGrammar g, Parsec b, Pretty b, Monoid a, Newtype a b) =>
FieldName -> (a -> b) -> ALens' s a -> g s a
monoidalFieldAla "options"           (FSep
-> [ForeignLibOption]
-> List FSep (Identity ForeignLibOption) ForeignLibOption
forall sep a. sep -> [a] -> List sep (Identity a) a
alaList FSep
FSep)             ALens' ForeignLib [ForeignLibOption]
Lens' ForeignLib [ForeignLibOption]
L.foreignLibOptions
    g ForeignLib
  (BuildInfo
   -> Maybe LibVersionInfo
   -> Maybe Version
   -> [FilePath]
   -> ForeignLib)
-> g ForeignLib BuildInfo
-> g ForeignLib
     (Maybe LibVersionInfo -> Maybe Version -> [FilePath] -> ForeignLib)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
<*> ALens' ForeignLib BuildInfo
-> g BuildInfo BuildInfo -> g ForeignLib BuildInfo
forall (g :: * -> * -> *) a b c.
FieldGrammar g =>
ALens' a b -> g b c -> g a c
blurFieldGrammar ALens' ForeignLib BuildInfo
Lens' ForeignLib BuildInfo
L.foreignLibBuildInfo g BuildInfo BuildInfo
forall (g :: * -> * -> *).
(FieldGrammar g, Applicative (g BuildInfo)) =>
g BuildInfo BuildInfo
buildInfoFieldGrammar
    g ForeignLib
  (Maybe LibVersionInfo -> Maybe Version -> [FilePath] -> ForeignLib)
-> g ForeignLib (Maybe LibVersionInfo)
-> g ForeignLib (Maybe Version -> [FilePath] -> ForeignLib)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
<*> FieldName
-> ALens' ForeignLib (Maybe LibVersionInfo)
-> g ForeignLib (Maybe LibVersionInfo)
forall (g :: * -> * -> *) a s.
(FieldGrammar g, Parsec a, Pretty a) =>
FieldName -> ALens' s (Maybe a) -> g s (Maybe a)
optionalField    "lib-version-info"                             ALens' ForeignLib (Maybe LibVersionInfo)
Lens' ForeignLib (Maybe LibVersionInfo)
L.foreignLibVersionInfo
    g ForeignLib (Maybe Version -> [FilePath] -> ForeignLib)
-> g ForeignLib (Maybe Version)
-> g ForeignLib ([FilePath] -> ForeignLib)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
<*> FieldName
-> ALens' ForeignLib (Maybe Version)
-> g ForeignLib (Maybe Version)
forall (g :: * -> * -> *) a s.
(FieldGrammar g, Parsec a, Pretty a) =>
FieldName -> ALens' s (Maybe a) -> g s (Maybe a)
optionalField    "lib-version-linux"                            ALens' ForeignLib (Maybe Version)
Lens' ForeignLib (Maybe Version)
L.foreignLibVersionLinux
    g ForeignLib ([FilePath] -> ForeignLib)
-> g ForeignLib [FilePath] -> g ForeignLib ForeignLib
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
<*> FieldName
-> ([FilePath] -> List FSep FilePathNT FilePath)
-> ALens' ForeignLib [FilePath]
-> g ForeignLib [FilePath]
forall (g :: * -> * -> *) b a s.
(FieldGrammar g, Parsec b, Pretty b, Monoid a, Newtype a b) =>
FieldName -> (a -> b) -> ALens' s a -> g s a
monoidalFieldAla "mod-def-file"      (FSep
-> (FilePath -> FilePathNT)
-> [FilePath]
-> List FSep FilePathNT FilePath
forall sep a b. sep -> (a -> b) -> [a] -> List sep b a
alaList' FSep
FSep FilePath -> FilePathNT
FilePathNT) ALens' ForeignLib [FilePath]
Lens' ForeignLib [FilePath]
L.foreignLibModDefFile
{-# SPECIALIZE foreignLibFieldGrammar :: UnqualComponentName -> ParsecFieldGrammar' ForeignLib #-}
{-# SPECIALIZE foreignLibFieldGrammar :: UnqualComponentName -> PrettyFieldGrammar' ForeignLib #-}

-------------------------------------------------------------------------------
-- Executable
-------------------------------------------------------------------------------

executableFieldGrammar
    :: (FieldGrammar g, Applicative (g Executable), Applicative (g BuildInfo))
    => UnqualComponentName -> g Executable Executable
executableFieldGrammar :: UnqualComponentName -> g Executable Executable
executableFieldGrammar n :: UnqualComponentName
n = UnqualComponentName
-> FilePath -> ExecutableScope -> BuildInfo -> Executable
Executable UnqualComponentName
n
    -- main-is is optional as conditional blocks don't have it
    (FilePath -> ExecutableScope -> BuildInfo -> Executable)
-> g Executable FilePath
-> g Executable (ExecutableScope -> BuildInfo -> Executable)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
<$> FieldName
-> (FilePath -> FilePathNT)
-> ALens' Executable FilePath
-> FilePath
-> g Executable FilePath
forall (g :: * -> * -> *) b a s.
(FieldGrammar g, Parsec b, Pretty b, Newtype a b, Eq a) =>
FieldName -> (a -> b) -> ALens' s a -> a -> g s a
optionalFieldDefAla "main-is" FilePath -> FilePathNT
FilePathNT ALens' Executable FilePath
Lens' Executable FilePath
L.modulePath ""
    g Executable (ExecutableScope -> BuildInfo -> Executable)
-> g Executable ExecutableScope
-> g Executable (BuildInfo -> Executable)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
<*> FieldName
-> ALens' Executable ExecutableScope
-> ExecutableScope
-> g Executable ExecutableScope
forall (g :: * -> * -> *) s a.
(FieldGrammar g, Functor (g s), Parsec a, Pretty a, Eq a) =>
FieldName -> ALens' s a -> a -> g s a
optionalFieldDef    "scope"              ALens' Executable ExecutableScope
Lens' Executable ExecutableScope
L.exeScope ExecutableScope
ExecutablePublic
        g Executable ExecutableScope
-> (g Executable ExecutableScope -> g Executable ExecutableScope)
-> g Executable ExecutableScope
forall a b. a -> (a -> b) -> b
^^^ CabalSpecVersion
-> ExecutableScope
-> g Executable ExecutableScope
-> g Executable ExecutableScope
forall (g :: * -> * -> *) a s.
FieldGrammar g =>
CabalSpecVersion -> a -> g s a -> g s a
availableSince CabalSpecVersion
CabalSpecV2_0 ExecutableScope
ExecutablePublic
    g Executable (BuildInfo -> Executable)
-> g Executable BuildInfo -> g Executable Executable
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
<*> ALens' Executable BuildInfo
-> g BuildInfo BuildInfo -> g Executable BuildInfo
forall (g :: * -> * -> *) a b c.
FieldGrammar g =>
ALens' a b -> g b c -> g a c
blurFieldGrammar ALens' Executable BuildInfo
forall a. HasBuildInfo a => Lens' a BuildInfo
L.buildInfo g BuildInfo BuildInfo
forall (g :: * -> * -> *).
(FieldGrammar g, Applicative (g BuildInfo)) =>
g BuildInfo BuildInfo
buildInfoFieldGrammar
{-# SPECIALIZE executableFieldGrammar :: UnqualComponentName -> ParsecFieldGrammar' Executable #-}
{-# SPECIALIZE executableFieldGrammar :: UnqualComponentName -> PrettyFieldGrammar' Executable #-}

-------------------------------------------------------------------------------
-- TestSuite
-------------------------------------------------------------------------------

-- | An intermediate type just used for parsing the test-suite stanza.
-- After validation it is converted into the proper 'TestSuite' type.
data TestSuiteStanza = TestSuiteStanza
    { TestSuiteStanza -> Maybe TestType
_testStanzaTestType   :: Maybe TestType
    , TestSuiteStanza -> Maybe FilePath
_testStanzaMainIs     :: Maybe FilePath
    , TestSuiteStanza -> Maybe ModuleName
_testStanzaTestModule :: Maybe ModuleName
    , TestSuiteStanza -> BuildInfo
_testStanzaBuildInfo  :: BuildInfo
    }

instance L.HasBuildInfo TestSuiteStanza where
    buildInfo :: LensLike f TestSuiteStanza TestSuiteStanza BuildInfo BuildInfo
buildInfo = LensLike f TestSuiteStanza TestSuiteStanza BuildInfo BuildInfo
Lens' TestSuiteStanza BuildInfo
testStanzaBuildInfo

testStanzaTestType :: Lens' TestSuiteStanza (Maybe TestType)
testStanzaTestType :: LensLike
  f TestSuiteStanza TestSuiteStanza (Maybe TestType) (Maybe TestType)
testStanzaTestType f :: Maybe TestType -> f (Maybe TestType)
f s :: TestSuiteStanza
s = (Maybe TestType -> TestSuiteStanza)
-> f (Maybe TestType) -> f TestSuiteStanza
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
fmap (\x :: Maybe TestType
x -> TestSuiteStanza
s { _testStanzaTestType :: Maybe TestType
_testStanzaTestType = Maybe TestType
x }) (Maybe TestType -> f (Maybe TestType)
f (TestSuiteStanza -> Maybe TestType
_testStanzaTestType TestSuiteStanza
s))
{-# INLINE testStanzaTestType #-}

testStanzaMainIs :: Lens' TestSuiteStanza (Maybe FilePath)
testStanzaMainIs :: LensLike
  f TestSuiteStanza TestSuiteStanza (Maybe FilePath) (Maybe FilePath)
testStanzaMainIs f :: Maybe FilePath -> f (Maybe FilePath)
f s :: TestSuiteStanza
s = (Maybe FilePath -> TestSuiteStanza)
-> f (Maybe FilePath) -> f TestSuiteStanza
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
fmap (\x :: Maybe FilePath
x -> TestSuiteStanza
s { _testStanzaMainIs :: Maybe FilePath
_testStanzaMainIs = Maybe FilePath
x }) (Maybe FilePath -> f (Maybe FilePath)
f (TestSuiteStanza -> Maybe FilePath
_testStanzaMainIs TestSuiteStanza
s))
{-# INLINE testStanzaMainIs #-}

testStanzaTestModule :: Lens' TestSuiteStanza (Maybe ModuleName)
testStanzaTestModule :: LensLike
  f
  TestSuiteStanza
  TestSuiteStanza
  (Maybe ModuleName)
  (Maybe ModuleName)
testStanzaTestModule f :: Maybe ModuleName -> f (Maybe ModuleName)
f s :: TestSuiteStanza
s = (Maybe ModuleName -> TestSuiteStanza)
-> f (Maybe ModuleName) -> f TestSuiteStanza
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
fmap (\x :: Maybe ModuleName
x -> TestSuiteStanza
s { _testStanzaTestModule :: Maybe ModuleName
_testStanzaTestModule = Maybe ModuleName
x }) (Maybe ModuleName -> f (Maybe ModuleName)
f (TestSuiteStanza -> Maybe ModuleName
_testStanzaTestModule TestSuiteStanza
s))
{-# INLINE testStanzaTestModule #-}

testStanzaBuildInfo :: Lens' TestSuiteStanza BuildInfo
testStanzaBuildInfo :: LensLike f TestSuiteStanza TestSuiteStanza BuildInfo BuildInfo
testStanzaBuildInfo f :: BuildInfo -> f BuildInfo
f s :: TestSuiteStanza
s = (BuildInfo -> TestSuiteStanza) -> f BuildInfo -> f TestSuiteStanza
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
fmap (\x :: BuildInfo
x -> TestSuiteStanza
s { _testStanzaBuildInfo :: BuildInfo
_testStanzaBuildInfo = BuildInfo
x }) (BuildInfo -> f BuildInfo
f (TestSuiteStanza -> BuildInfo
_testStanzaBuildInfo TestSuiteStanza
s))
{-# INLINE testStanzaBuildInfo #-}

testSuiteFieldGrammar
    :: (FieldGrammar g, Applicative (g TestSuiteStanza), Applicative (g BuildInfo))
    => g TestSuiteStanza TestSuiteStanza
testSuiteFieldGrammar :: g TestSuiteStanza TestSuiteStanza
testSuiteFieldGrammar = Maybe TestType
-> Maybe FilePath
-> Maybe ModuleName
-> BuildInfo
-> TestSuiteStanza
TestSuiteStanza
    (Maybe TestType
 -> Maybe FilePath
 -> Maybe ModuleName
 -> BuildInfo
 -> TestSuiteStanza)
-> g TestSuiteStanza (Maybe TestType)
-> g TestSuiteStanza
     (Maybe FilePath
      -> Maybe ModuleName -> BuildInfo -> TestSuiteStanza)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
<$> FieldName
-> ALens' TestSuiteStanza (Maybe TestType)
-> g TestSuiteStanza (Maybe TestType)
forall (g :: * -> * -> *) a s.
(FieldGrammar g, Parsec a, Pretty a) =>
FieldName -> ALens' s (Maybe a) -> g s (Maybe a)
optionalField    "type"                   ALens' TestSuiteStanza (Maybe TestType)
Lens' TestSuiteStanza (Maybe TestType)
testStanzaTestType
    g TestSuiteStanza
  (Maybe FilePath
   -> Maybe ModuleName -> BuildInfo -> TestSuiteStanza)
-> g TestSuiteStanza (Maybe FilePath)
-> g TestSuiteStanza
     (Maybe ModuleName -> BuildInfo -> TestSuiteStanza)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
<*> FieldName
-> (FilePath -> FilePathNT)
-> ALens' TestSuiteStanza (Maybe FilePath)
-> g TestSuiteStanza (Maybe FilePath)
forall (g :: * -> * -> *) b a s.
(FieldGrammar g, Parsec b, Pretty b, Newtype a b) =>
FieldName -> (a -> b) -> ALens' s (Maybe a) -> g s (Maybe a)
optionalFieldAla "main-is"     FilePath -> FilePathNT
FilePathNT ALens' TestSuiteStanza (Maybe FilePath)
Lens' TestSuiteStanza (Maybe FilePath)
testStanzaMainIs
    g TestSuiteStanza
  (Maybe ModuleName -> BuildInfo -> TestSuiteStanza)
-> g TestSuiteStanza (Maybe ModuleName)
-> g TestSuiteStanza (BuildInfo -> TestSuiteStanza)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
<*> FieldName
-> ALens' TestSuiteStanza (Maybe ModuleName)
-> g TestSuiteStanza (Maybe ModuleName)
forall (g :: * -> * -> *) a s.
(FieldGrammar g, Parsec a, Pretty a) =>
FieldName -> ALens' s (Maybe a) -> g s (Maybe a)
optionalField    "test-module"            ALens' TestSuiteStanza (Maybe ModuleName)
Lens' TestSuiteStanza (Maybe ModuleName)
testStanzaTestModule
    g TestSuiteStanza (BuildInfo -> TestSuiteStanza)
-> g TestSuiteStanza BuildInfo -> g TestSuiteStanza TestSuiteStanza
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
<*> ALens' TestSuiteStanza BuildInfo
-> g BuildInfo BuildInfo -> g TestSuiteStanza BuildInfo
forall (g :: * -> * -> *) a b c.
FieldGrammar g =>
ALens' a b -> g b c -> g a c
blurFieldGrammar ALens' TestSuiteStanza BuildInfo
Lens' TestSuiteStanza BuildInfo
testStanzaBuildInfo g BuildInfo BuildInfo
forall (g :: * -> * -> *).
(FieldGrammar g, Applicative (g BuildInfo)) =>
g BuildInfo BuildInfo
buildInfoFieldGrammar

validateTestSuite :: Position -> TestSuiteStanza -> ParseResult TestSuite
validateTestSuite :: Position -> TestSuiteStanza -> ParseResult TestSuite
validateTestSuite pos :: Position
pos stanza :: TestSuiteStanza
stanza = case TestSuiteStanza -> Maybe TestType
_testStanzaTestType TestSuiteStanza
stanza of
    Nothing -> TestSuite -> ParseResult TestSuite
forall (m :: * -> *) a. Monad m => a -> m a
return (TestSuite -> ParseResult TestSuite)
-> TestSuite -> ParseResult TestSuite
forall a b. (a -> b) -> a -> b
$
        TestSuite
emptyTestSuite { testBuildInfo :: BuildInfo
testBuildInfo = TestSuiteStanza -> BuildInfo
_testStanzaBuildInfo TestSuiteStanza
stanza }

    Just tt :: TestType
tt@(TestTypeUnknown _ _) ->
        TestSuite -> ParseResult TestSuite
forall (f :: * -> *) a. Applicative f => a -> f a
pure TestSuite
emptyTestSuite
            { testInterface :: TestSuiteInterface
testInterface = TestType -> TestSuiteInterface
TestSuiteUnsupported TestType
tt
            , testBuildInfo :: BuildInfo
testBuildInfo = TestSuiteStanza -> BuildInfo
_testStanzaBuildInfo TestSuiteStanza
stanza
            }

    Just tt :: TestType
tt | TestType
tt TestType -> [TestType] -> Bool
forall (t :: * -> *) a. (Foldable t, Eq a) => a -> t a -> Bool
`notElem` [TestType]
knownTestTypes ->
        TestSuite -> ParseResult TestSuite
forall (f :: * -> *) a. Applicative f => a -> f a
pure TestSuite
emptyTestSuite
            { testInterface :: TestSuiteInterface
testInterface = TestType -> TestSuiteInterface
TestSuiteUnsupported TestType
tt
            , testBuildInfo :: BuildInfo
testBuildInfo = TestSuiteStanza -> BuildInfo
_testStanzaBuildInfo TestSuiteStanza
stanza
            }

    Just tt :: TestType
tt@(TestTypeExe ver :: Version
ver) -> case TestSuiteStanza -> Maybe FilePath
_testStanzaMainIs TestSuiteStanza
stanza of
        Nothing   -> do
            Position -> FilePath -> ParseResult ()
parseFailure Position
pos (FilePath -> TestType -> FilePath
forall a. Pretty a => FilePath -> a -> FilePath
missingField "main-is" TestType
tt)
            TestSuite -> ParseResult TestSuite
forall (f :: * -> *) a. Applicative f => a -> f a
pure TestSuite
emptyTestSuite
        Just file :: FilePath
file -> do
            Bool -> ParseResult () -> ParseResult ()
forall (f :: * -> *). Applicative f => Bool -> f () -> f ()
when (Maybe ModuleName -> Bool
forall a. Maybe a -> Bool
isJust (TestSuiteStanza -> Maybe ModuleName
_testStanzaTestModule TestSuiteStanza
stanza)) (ParseResult () -> ParseResult ())
-> ParseResult () -> ParseResult ()
forall a b. (a -> b) -> a -> b
$
                Position -> PWarnType -> FilePath -> ParseResult ()
parseWarning Position
pos PWarnType
PWTExtraBenchmarkModule (FilePath -> TestType -> FilePath
forall a. Pretty a => FilePath -> a -> FilePath
extraField "test-module" TestType
tt)
            TestSuite -> ParseResult TestSuite
forall (f :: * -> *) a. Applicative f => a -> f a
pure TestSuite
emptyTestSuite
                { testInterface :: TestSuiteInterface
testInterface = Version -> FilePath -> TestSuiteInterface
TestSuiteExeV10 Version
ver FilePath
file
                , testBuildInfo :: BuildInfo
testBuildInfo = TestSuiteStanza -> BuildInfo
_testStanzaBuildInfo TestSuiteStanza
stanza
                }

    Just tt :: TestType
tt@(TestTypeLib ver :: Version
ver) -> case TestSuiteStanza -> Maybe ModuleName
_testStanzaTestModule TestSuiteStanza
stanza of
         Nothing      -> do
             Position -> FilePath -> ParseResult ()
parseFailure Position
pos (FilePath -> TestType -> FilePath
forall a. Pretty a => FilePath -> a -> FilePath
missingField "test-module" TestType
tt)
             TestSuite -> ParseResult TestSuite
forall (f :: * -> *) a. Applicative f => a -> f a
pure TestSuite
emptyTestSuite
         Just module_ :: ModuleName
module_ -> do
            Bool -> ParseResult () -> ParseResult ()
forall (f :: * -> *). Applicative f => Bool -> f () -> f ()
when (Maybe FilePath -> Bool
forall a. Maybe a -> Bool
isJust (TestSuiteStanza -> Maybe FilePath
_testStanzaMainIs TestSuiteStanza
stanza)) (ParseResult () -> ParseResult ())
-> ParseResult () -> ParseResult ()
forall a b. (a -> b) -> a -> b
$
                Position -> PWarnType -> FilePath -> ParseResult ()
parseWarning Position
pos PWarnType
PWTExtraMainIs (FilePath -> TestType -> FilePath
forall a. Pretty a => FilePath -> a -> FilePath
extraField "main-is" TestType
tt)
            TestSuite -> ParseResult TestSuite
forall (f :: * -> *) a. Applicative f => a -> f a
pure TestSuite
emptyTestSuite
                { testInterface :: TestSuiteInterface
testInterface = Version -> ModuleName -> TestSuiteInterface
TestSuiteLibV09 Version
ver ModuleName
module_
                , testBuildInfo :: BuildInfo
testBuildInfo = TestSuiteStanza -> BuildInfo
_testStanzaBuildInfo TestSuiteStanza
stanza
                }

  where
    missingField :: FilePath -> a -> FilePath
missingField name :: FilePath
name tt :: a
tt = "The '" FilePath -> FilePath -> FilePath
forall a. [a] -> [a] -> [a]
++ FilePath
name FilePath -> FilePath -> FilePath
forall a. [a] -> [a] -> [a]
++ "' field is required for the "
                        FilePath -> FilePath -> FilePath
forall a. [a] -> [a] -> [a]
++ a -> FilePath
forall a. Pretty a => a -> FilePath
prettyShow a
tt FilePath -> FilePath -> FilePath
forall a. [a] -> [a] -> [a]
++ " test suite type."

    extraField :: FilePath -> a -> FilePath
extraField   name :: FilePath
name tt :: a
tt = "The '" FilePath -> FilePath -> FilePath
forall a. [a] -> [a] -> [a]
++ FilePath
name FilePath -> FilePath -> FilePath
forall a. [a] -> [a] -> [a]
++ "' field is not used for the '"
                        FilePath -> FilePath -> FilePath
forall a. [a] -> [a] -> [a]
++ a -> FilePath
forall a. Pretty a => a -> FilePath
prettyShow a
tt FilePath -> FilePath -> FilePath
forall a. [a] -> [a] -> [a]
++ "' test suite type."

unvalidateTestSuite :: TestSuite -> TestSuiteStanza
unvalidateTestSuite :: TestSuite -> TestSuiteStanza
unvalidateTestSuite t :: TestSuite
t = TestSuiteStanza :: Maybe TestType
-> Maybe FilePath
-> Maybe ModuleName
-> BuildInfo
-> TestSuiteStanza
TestSuiteStanza
    { _testStanzaTestType :: Maybe TestType
_testStanzaTestType   = Maybe TestType
ty
    , _testStanzaMainIs :: Maybe FilePath
_testStanzaMainIs     = Maybe FilePath
ma
    , _testStanzaTestModule :: Maybe ModuleName
_testStanzaTestModule = Maybe ModuleName
mo
    , _testStanzaBuildInfo :: BuildInfo
_testStanzaBuildInfo  = TestSuite -> BuildInfo
testBuildInfo TestSuite
t
    }
  where
    (ty :: Maybe TestType
ty, ma :: Maybe FilePath
ma, mo :: Maybe ModuleName
mo) = case TestSuite -> TestSuiteInterface
testInterface TestSuite
t of
        TestSuiteExeV10 ver :: Version
ver file :: FilePath
file -> (TestType -> Maybe TestType
forall a. a -> Maybe a
Just (TestType -> Maybe TestType) -> TestType -> Maybe TestType
forall a b. (a -> b) -> a -> b
$ Version -> TestType
TestTypeExe Version
ver, FilePath -> Maybe FilePath
forall a. a -> Maybe a
Just FilePath
file, Maybe ModuleName
forall a. Maybe a
Nothing)
        TestSuiteLibV09 ver :: Version
ver modu :: ModuleName
modu -> (TestType -> Maybe TestType
forall a. a -> Maybe a
Just (TestType -> Maybe TestType) -> TestType -> Maybe TestType
forall a b. (a -> b) -> a -> b
$ Version -> TestType
TestTypeLib Version
ver, Maybe FilePath
forall a. Maybe a
Nothing, ModuleName -> Maybe ModuleName
forall a. a -> Maybe a
Just ModuleName
modu)
        _                        -> (Maybe TestType
forall a. Maybe a
Nothing, Maybe FilePath
forall a. Maybe a
Nothing, Maybe ModuleName
forall a. Maybe a
Nothing)

-------------------------------------------------------------------------------
-- Benchmark
-------------------------------------------------------------------------------

-- | An intermediate type just used for parsing the benchmark stanza.
-- After validation it is converted into the proper 'Benchmark' type.
data BenchmarkStanza = BenchmarkStanza
    { BenchmarkStanza -> Maybe BenchmarkType
_benchmarkStanzaBenchmarkType   :: Maybe BenchmarkType
    , BenchmarkStanza -> Maybe FilePath
_benchmarkStanzaMainIs          :: Maybe FilePath
    , BenchmarkStanza -> Maybe ModuleName
_benchmarkStanzaBenchmarkModule :: Maybe ModuleName
    , BenchmarkStanza -> BuildInfo
_benchmarkStanzaBuildInfo       :: BuildInfo
    }

instance L.HasBuildInfo BenchmarkStanza where
    buildInfo :: LensLike f BenchmarkStanza BenchmarkStanza BuildInfo BuildInfo
buildInfo = LensLike f BenchmarkStanza BenchmarkStanza BuildInfo BuildInfo
Lens' BenchmarkStanza BuildInfo
benchmarkStanzaBuildInfo

benchmarkStanzaBenchmarkType :: Lens' BenchmarkStanza (Maybe BenchmarkType)
benchmarkStanzaBenchmarkType :: LensLike
  f
  BenchmarkStanza
  BenchmarkStanza
  (Maybe BenchmarkType)
  (Maybe BenchmarkType)
benchmarkStanzaBenchmarkType f :: Maybe BenchmarkType -> f (Maybe BenchmarkType)
f s :: BenchmarkStanza
s = (Maybe BenchmarkType -> BenchmarkStanza)
-> f (Maybe BenchmarkType) -> f BenchmarkStanza
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
fmap (\x :: Maybe BenchmarkType
x -> BenchmarkStanza
s { _benchmarkStanzaBenchmarkType :: Maybe BenchmarkType
_benchmarkStanzaBenchmarkType = Maybe BenchmarkType
x }) (Maybe BenchmarkType -> f (Maybe BenchmarkType)
f (BenchmarkStanza -> Maybe BenchmarkType
_benchmarkStanzaBenchmarkType BenchmarkStanza
s))
{-# INLINE benchmarkStanzaBenchmarkType #-}

benchmarkStanzaMainIs :: Lens' BenchmarkStanza (Maybe FilePath)
benchmarkStanzaMainIs :: LensLike
  f BenchmarkStanza BenchmarkStanza (Maybe FilePath) (Maybe FilePath)
benchmarkStanzaMainIs f :: Maybe FilePath -> f (Maybe FilePath)
f s :: BenchmarkStanza
s = (Maybe FilePath -> BenchmarkStanza)
-> f (Maybe FilePath) -> f BenchmarkStanza
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
fmap (\x :: Maybe FilePath
x -> BenchmarkStanza
s { _benchmarkStanzaMainIs :: Maybe FilePath
_benchmarkStanzaMainIs = Maybe FilePath
x }) (Maybe FilePath -> f (Maybe FilePath)
f (BenchmarkStanza -> Maybe FilePath
_benchmarkStanzaMainIs BenchmarkStanza
s))
{-# INLINE benchmarkStanzaMainIs #-}

benchmarkStanzaBenchmarkModule :: Lens' BenchmarkStanza (Maybe ModuleName)
benchmarkStanzaBenchmarkModule :: LensLike
  f
  BenchmarkStanza
  BenchmarkStanza
  (Maybe ModuleName)
  (Maybe ModuleName)
benchmarkStanzaBenchmarkModule f :: Maybe ModuleName -> f (Maybe ModuleName)
f s :: BenchmarkStanza
s = (Maybe ModuleName -> BenchmarkStanza)
-> f (Maybe ModuleName) -> f BenchmarkStanza
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
fmap (\x :: Maybe ModuleName
x -> BenchmarkStanza
s { _benchmarkStanzaBenchmarkModule :: Maybe ModuleName
_benchmarkStanzaBenchmarkModule = Maybe ModuleName
x }) (Maybe ModuleName -> f (Maybe ModuleName)
f (BenchmarkStanza -> Maybe ModuleName
_benchmarkStanzaBenchmarkModule BenchmarkStanza
s))
{-# INLINE benchmarkStanzaBenchmarkModule #-}

benchmarkStanzaBuildInfo :: Lens' BenchmarkStanza BuildInfo
benchmarkStanzaBuildInfo :: LensLike f BenchmarkStanza BenchmarkStanza BuildInfo BuildInfo
benchmarkStanzaBuildInfo f :: BuildInfo -> f BuildInfo
f s :: BenchmarkStanza
s = (BuildInfo -> BenchmarkStanza) -> f BuildInfo -> f BenchmarkStanza
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
fmap (\x :: BuildInfo
x -> BenchmarkStanza
s { _benchmarkStanzaBuildInfo :: BuildInfo
_benchmarkStanzaBuildInfo = BuildInfo
x }) (BuildInfo -> f BuildInfo
f (BenchmarkStanza -> BuildInfo
_benchmarkStanzaBuildInfo BenchmarkStanza
s))
{-# INLINE benchmarkStanzaBuildInfo #-}

benchmarkFieldGrammar
    :: (FieldGrammar g, Applicative (g BenchmarkStanza), Applicative (g BuildInfo))
    => g BenchmarkStanza BenchmarkStanza
benchmarkFieldGrammar :: g BenchmarkStanza BenchmarkStanza
benchmarkFieldGrammar = Maybe BenchmarkType
-> Maybe FilePath
-> Maybe ModuleName
-> BuildInfo
-> BenchmarkStanza
BenchmarkStanza
    (Maybe BenchmarkType
 -> Maybe FilePath
 -> Maybe ModuleName
 -> BuildInfo
 -> BenchmarkStanza)
-> g BenchmarkStanza (Maybe BenchmarkType)
-> g BenchmarkStanza
     (Maybe FilePath
      -> Maybe ModuleName -> BuildInfo -> BenchmarkStanza)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
<$> FieldName
-> ALens' BenchmarkStanza (Maybe BenchmarkType)
-> g BenchmarkStanza (Maybe BenchmarkType)
forall (g :: * -> * -> *) a s.
(FieldGrammar g, Parsec a, Pretty a) =>
FieldName -> ALens' s (Maybe a) -> g s (Maybe a)
optionalField    "type"                        ALens' BenchmarkStanza (Maybe BenchmarkType)
Lens' BenchmarkStanza (Maybe BenchmarkType)
benchmarkStanzaBenchmarkType
    g BenchmarkStanza
  (Maybe FilePath
   -> Maybe ModuleName -> BuildInfo -> BenchmarkStanza)
-> g BenchmarkStanza (Maybe FilePath)
-> g BenchmarkStanza
     (Maybe ModuleName -> BuildInfo -> BenchmarkStanza)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
<*> FieldName
-> (FilePath -> FilePathNT)
-> ALens' BenchmarkStanza (Maybe FilePath)
-> g BenchmarkStanza (Maybe FilePath)
forall (g :: * -> * -> *) b a s.
(FieldGrammar g, Parsec b, Pretty b, Newtype a b) =>
FieldName -> (a -> b) -> ALens' s (Maybe a) -> g s (Maybe a)
optionalFieldAla "main-is"          FilePath -> FilePathNT
FilePathNT ALens' BenchmarkStanza (Maybe FilePath)
Lens' BenchmarkStanza (Maybe FilePath)
benchmarkStanzaMainIs
    g BenchmarkStanza
  (Maybe ModuleName -> BuildInfo -> BenchmarkStanza)
-> g BenchmarkStanza (Maybe ModuleName)
-> g BenchmarkStanza (BuildInfo -> BenchmarkStanza)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
<*> FieldName
-> ALens' BenchmarkStanza (Maybe ModuleName)
-> g BenchmarkStanza (Maybe ModuleName)
forall (g :: * -> * -> *) a s.
(FieldGrammar g, Parsec a, Pretty a) =>
FieldName -> ALens' s (Maybe a) -> g s (Maybe a)
optionalField    "benchmark-module"            ALens' BenchmarkStanza (Maybe ModuleName)
Lens' BenchmarkStanza (Maybe ModuleName)
benchmarkStanzaBenchmarkModule
    g BenchmarkStanza (BuildInfo -> BenchmarkStanza)
-> g BenchmarkStanza BuildInfo -> g BenchmarkStanza BenchmarkStanza
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
<*> ALens' BenchmarkStanza BuildInfo
-> g BuildInfo BuildInfo -> g BenchmarkStanza BuildInfo
forall (g :: * -> * -> *) a b c.
FieldGrammar g =>
ALens' a b -> g b c -> g a c
blurFieldGrammar ALens' BenchmarkStanza BuildInfo
Lens' BenchmarkStanza BuildInfo
benchmarkStanzaBuildInfo g BuildInfo BuildInfo
forall (g :: * -> * -> *).
(FieldGrammar g, Applicative (g BuildInfo)) =>
g BuildInfo BuildInfo
buildInfoFieldGrammar

validateBenchmark :: Position -> BenchmarkStanza -> ParseResult Benchmark
validateBenchmark :: Position -> BenchmarkStanza -> ParseResult Benchmark
validateBenchmark pos :: Position
pos stanza :: BenchmarkStanza
stanza = case BenchmarkStanza -> Maybe BenchmarkType
_benchmarkStanzaBenchmarkType BenchmarkStanza
stanza of
    Nothing -> Benchmark -> ParseResult Benchmark
forall (f :: * -> *) a. Applicative f => a -> f a
pure Benchmark
emptyBenchmark
        { benchmarkBuildInfo :: BuildInfo
benchmarkBuildInfo = BenchmarkStanza -> BuildInfo
_benchmarkStanzaBuildInfo BenchmarkStanza
stanza }

    Just tt :: BenchmarkType
tt@(BenchmarkTypeUnknown _ _) -> Benchmark -> ParseResult Benchmark
forall (f :: * -> *) a. Applicative f => a -> f a
pure Benchmark
emptyBenchmark
        { benchmarkInterface :: BenchmarkInterface
benchmarkInterface = BenchmarkType -> BenchmarkInterface
BenchmarkUnsupported BenchmarkType
tt
        , benchmarkBuildInfo :: BuildInfo
benchmarkBuildInfo = BenchmarkStanza -> BuildInfo
_benchmarkStanzaBuildInfo BenchmarkStanza
stanza
        }

    Just tt :: BenchmarkType
tt | BenchmarkType
tt BenchmarkType -> [BenchmarkType] -> Bool
forall (t :: * -> *) a. (Foldable t, Eq a) => a -> t a -> Bool
`notElem` [BenchmarkType]
knownBenchmarkTypes -> Benchmark -> ParseResult Benchmark
forall (f :: * -> *) a. Applicative f => a -> f a
pure Benchmark
emptyBenchmark
        { benchmarkInterface :: BenchmarkInterface
benchmarkInterface = BenchmarkType -> BenchmarkInterface
BenchmarkUnsupported BenchmarkType
tt
        , benchmarkBuildInfo :: BuildInfo
benchmarkBuildInfo = BenchmarkStanza -> BuildInfo
_benchmarkStanzaBuildInfo BenchmarkStanza
stanza
        }

    Just tt :: BenchmarkType
tt@(BenchmarkTypeExe ver :: Version
ver) -> case BenchmarkStanza -> Maybe FilePath
_benchmarkStanzaMainIs BenchmarkStanza
stanza of
        Nothing   -> do
            Position -> FilePath -> ParseResult ()
parseFailure Position
pos (FilePath -> BenchmarkType -> FilePath
forall a. Pretty a => FilePath -> a -> FilePath
missingField "main-is" BenchmarkType
tt)
            Benchmark -> ParseResult Benchmark
forall (f :: * -> *) a. Applicative f => a -> f a
pure Benchmark
emptyBenchmark
        Just file :: FilePath
file -> do
            Bool -> ParseResult () -> ParseResult ()
forall (f :: * -> *). Applicative f => Bool -> f () -> f ()
when (Maybe ModuleName -> Bool
forall a. Maybe a -> Bool
isJust (BenchmarkStanza -> Maybe ModuleName
_benchmarkStanzaBenchmarkModule BenchmarkStanza
stanza)) (ParseResult () -> ParseResult ())
-> ParseResult () -> ParseResult ()
forall a b. (a -> b) -> a -> b
$
                Position -> PWarnType -> FilePath -> ParseResult ()
parseWarning Position
pos PWarnType
PWTExtraBenchmarkModule (FilePath -> BenchmarkType -> FilePath
forall a. Pretty a => FilePath -> a -> FilePath
extraField "benchmark-module" BenchmarkType
tt)
            Benchmark -> ParseResult Benchmark
forall (f :: * -> *) a. Applicative f => a -> f a
pure Benchmark
emptyBenchmark
                { benchmarkInterface :: BenchmarkInterface
benchmarkInterface = Version -> FilePath -> BenchmarkInterface
BenchmarkExeV10 Version
ver FilePath
file
                , benchmarkBuildInfo :: BuildInfo
benchmarkBuildInfo = BenchmarkStanza -> BuildInfo
_benchmarkStanzaBuildInfo BenchmarkStanza
stanza
                }

  where
    missingField :: FilePath -> a -> FilePath
missingField name :: FilePath
name tt :: a
tt = "The '" FilePath -> FilePath -> FilePath
forall a. [a] -> [a] -> [a]
++ FilePath
name FilePath -> FilePath -> FilePath
forall a. [a] -> [a] -> [a]
++ "' field is required for the "
                        FilePath -> FilePath -> FilePath
forall a. [a] -> [a] -> [a]
++ a -> FilePath
forall a. Pretty a => a -> FilePath
prettyShow a
tt FilePath -> FilePath -> FilePath
forall a. [a] -> [a] -> [a]
++ " benchmark type."

    extraField :: FilePath -> a -> FilePath
extraField   name :: FilePath
name tt :: a
tt = "The '" FilePath -> FilePath -> FilePath
forall a. [a] -> [a] -> [a]
++ FilePath
name FilePath -> FilePath -> FilePath
forall a. [a] -> [a] -> [a]
++ "' field is not used for the '"
                        FilePath -> FilePath -> FilePath
forall a. [a] -> [a] -> [a]
++ a -> FilePath
forall a. Pretty a => a -> FilePath
prettyShow a
tt FilePath -> FilePath -> FilePath
forall a. [a] -> [a] -> [a]
++ "' benchmark type."

unvalidateBenchmark :: Benchmark -> BenchmarkStanza
unvalidateBenchmark :: Benchmark -> BenchmarkStanza
unvalidateBenchmark b :: Benchmark
b = BenchmarkStanza :: Maybe BenchmarkType
-> Maybe FilePath
-> Maybe ModuleName
-> BuildInfo
-> BenchmarkStanza
BenchmarkStanza
    { _benchmarkStanzaBenchmarkType :: Maybe BenchmarkType
_benchmarkStanzaBenchmarkType   = Maybe BenchmarkType
ty
    , _benchmarkStanzaMainIs :: Maybe FilePath
_benchmarkStanzaMainIs          = Maybe FilePath
ma
    , _benchmarkStanzaBenchmarkModule :: Maybe ModuleName
_benchmarkStanzaBenchmarkModule = Maybe ModuleName
forall a. Maybe a
mo
    , _benchmarkStanzaBuildInfo :: BuildInfo
_benchmarkStanzaBuildInfo       = Benchmark -> BuildInfo
benchmarkBuildInfo Benchmark
b
    }
  where
    (ty :: Maybe BenchmarkType
ty, ma :: Maybe FilePath
ma, mo :: Maybe a
mo) = case Benchmark -> BenchmarkInterface
benchmarkInterface Benchmark
b of
        BenchmarkExeV10 ver :: Version
ver ""  -> (BenchmarkType -> Maybe BenchmarkType
forall a. a -> Maybe a
Just (BenchmarkType -> Maybe BenchmarkType)
-> BenchmarkType -> Maybe BenchmarkType
forall a b. (a -> b) -> a -> b
$ Version -> BenchmarkType
BenchmarkTypeExe Version
ver, Maybe FilePath
forall a. Maybe a
Nothing,  Maybe a
forall a. Maybe a
Nothing)
        BenchmarkExeV10 ver :: Version
ver ma' :: FilePath
ma' -> (BenchmarkType -> Maybe BenchmarkType
forall a. a -> Maybe a
Just (BenchmarkType -> Maybe BenchmarkType)
-> BenchmarkType -> Maybe BenchmarkType
forall a b. (a -> b) -> a -> b
$ Version -> BenchmarkType
BenchmarkTypeExe Version
ver, FilePath -> Maybe FilePath
forall a. a -> Maybe a
Just FilePath
ma', Maybe a
forall a. Maybe a
Nothing)
        _                       -> (Maybe BenchmarkType
forall a. Maybe a
Nothing, Maybe FilePath
forall a. Maybe a
Nothing,  Maybe a
forall a. Maybe a
Nothing)

-------------------------------------------------------------------------------
-- Build info
-------------------------------------------------------------------------------

buildInfoFieldGrammar
    :: (FieldGrammar g, Applicative (g BuildInfo))
    => g BuildInfo BuildInfo
buildInfoFieldGrammar :: g BuildInfo BuildInfo
buildInfoFieldGrammar = Bool
-> [LegacyExeDependency]
-> [ExeDependency]
-> [FilePath]
-> [FilePath]
-> [FilePath]
-> [FilePath]
-> [FilePath]
-> [FilePath]
-> [PkgconfigDependency]
-> [FilePath]
-> [FilePath]
-> [FilePath]
-> [FilePath]
-> [FilePath]
-> [FilePath]
-> [FilePath]
-> [FilePath]
-> [ModuleName]
-> [ModuleName]
-> [ModuleName]
-> Maybe Language
-> [Language]
-> [Extension]
-> [Extension]
-> [Extension]
-> [FilePath]
-> [FilePath]
-> [FilePath]
-> [FilePath]
-> [FilePath]
-> [FilePath]
-> [FilePath]
-> [FilePath]
-> [FilePath]
-> [FilePath]
-> PerCompilerFlavor [FilePath]
-> PerCompilerFlavor [FilePath]
-> PerCompilerFlavor [FilePath]
-> PerCompilerFlavor [FilePath]
-> [(FilePath, FilePath)]
-> [Dependency]
-> [Mixin]
-> BuildInfo
BuildInfo
    (Bool
 -> [LegacyExeDependency]
 -> [ExeDependency]
 -> [FilePath]
 -> [FilePath]
 -> [FilePath]
 -> [FilePath]
 -> [FilePath]
 -> [FilePath]
 -> [PkgconfigDependency]
 -> [FilePath]
 -> [FilePath]
 -> [FilePath]
 -> [FilePath]
 -> [FilePath]
 -> [FilePath]
 -> [FilePath]
 -> [FilePath]
 -> [ModuleName]
 -> [ModuleName]
 -> [ModuleName]
 -> Maybe Language
 -> [Language]
 -> [Extension]
 -> [Extension]
 -> [Extension]
 -> [FilePath]
 -> [FilePath]
 -> [FilePath]
 -> [FilePath]
 -> [FilePath]
 -> [FilePath]
 -> [FilePath]
 -> [FilePath]
 -> [FilePath]
 -> [FilePath]
 -> PerCompilerFlavor [FilePath]
 -> PerCompilerFlavor [FilePath]
 -> PerCompilerFlavor [FilePath]
 -> PerCompilerFlavor [FilePath]
 -> [(FilePath, FilePath)]
 -> [Dependency]
 -> [Mixin]
 -> BuildInfo)
-> g BuildInfo Bool
-> g BuildInfo
     ([LegacyExeDependency]
      -> [ExeDependency]
      -> [FilePath]
      -> [FilePath]
      -> [FilePath]
      -> [FilePath]
      -> [FilePath]
      -> [FilePath]
      -> [PkgconfigDependency]
      -> [FilePath]
      -> [FilePath]
      -> [FilePath]
      -> [FilePath]
      -> [FilePath]
      -> [FilePath]
      -> [FilePath]
      -> [FilePath]
      -> [ModuleName]
      -> [ModuleName]
      -> [ModuleName]
      -> Maybe Language
      -> [Language]
      -> [Extension]
      -> [Extension]
      -> [Extension]
      -> [FilePath]
      -> [FilePath]
      -> [FilePath]
      -> [FilePath]
      -> [FilePath]
      -> [FilePath]
      -> [FilePath]
      -> [FilePath]
      -> [FilePath]
      -> [FilePath]
      -> PerCompilerFlavor [FilePath]
      -> PerCompilerFlavor [FilePath]
      -> PerCompilerFlavor [FilePath]
      -> PerCompilerFlavor [FilePath]
      -> [(FilePath, FilePath)]
      -> [Dependency]
      -> [Mixin]
      -> BuildInfo)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
<$> FieldName -> ALens' BuildInfo Bool -> Bool -> g BuildInfo Bool
forall (g :: * -> * -> *) s.
FieldGrammar g =>
FieldName -> ALens' s Bool -> Bool -> g s Bool
booleanFieldDef  "buildable"                                          ALens' BuildInfo Bool
forall a. HasBuildInfo a => Lens' a Bool
L.buildable Bool
True
    g BuildInfo
  ([LegacyExeDependency]
   -> [ExeDependency]
   -> [FilePath]
   -> [FilePath]
   -> [FilePath]
   -> [FilePath]
   -> [FilePath]
   -> [FilePath]
   -> [PkgconfigDependency]
   -> [FilePath]
   -> [FilePath]
   -> [FilePath]
   -> [FilePath]
   -> [FilePath]
   -> [FilePath]
   -> [FilePath]
   -> [FilePath]
   -> [ModuleName]
   -> [ModuleName]
   -> [ModuleName]
   -> Maybe Language
   -> [Language]
   -> [Extension]
   -> [Extension]
   -> [Extension]
   -> [FilePath]
   -> [FilePath]
   -> [FilePath]
   -> [FilePath]
   -> [FilePath]
   -> [FilePath]
   -> [FilePath]
   -> [FilePath]
   -> [FilePath]
   -> [FilePath]
   -> PerCompilerFlavor [FilePath]
   -> PerCompilerFlavor [FilePath]
   -> PerCompilerFlavor [FilePath]
   -> PerCompilerFlavor [FilePath]
   -> [(FilePath, FilePath)]
   -> [Dependency]
   -> [Mixin]
   -> BuildInfo)
-> g BuildInfo [LegacyExeDependency]
-> g BuildInfo
     ([ExeDependency]
      -> [FilePath]
      -> [FilePath]
      -> [FilePath]
      -> [FilePath]
      -> [FilePath]
      -> [FilePath]
      -> [PkgconfigDependency]
      -> [FilePath]
      -> [FilePath]
      -> [FilePath]
      -> [FilePath]
      -> [FilePath]
      -> [FilePath]
      -> [FilePath]
      -> [FilePath]
      -> [ModuleName]
      -> [ModuleName]
      -> [ModuleName]
      -> Maybe Language
      -> [Language]
      -> [Extension]
      -> [Extension]
      -> [Extension]
      -> [FilePath]
      -> [FilePath]
      -> [FilePath]
      -> [FilePath]
      -> [FilePath]
      -> [FilePath]
      -> [FilePath]
      -> [FilePath]
      -> [FilePath]
      -> [FilePath]
      -> PerCompilerFlavor [FilePath]
      -> PerCompilerFlavor [FilePath]
      -> PerCompilerFlavor [FilePath]
      -> PerCompilerFlavor [FilePath]
      -> [(FilePath, FilePath)]
      -> [Dependency]
      -> [Mixin]
      -> BuildInfo)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
<*> FieldName
-> ([LegacyExeDependency]
    -> List
         CommaFSep (Identity LegacyExeDependency) LegacyExeDependency)
-> ALens' BuildInfo [LegacyExeDependency]
-> g BuildInfo [LegacyExeDependency]
forall (g :: * -> * -> *) b a s.
(FieldGrammar g, Parsec b, Pretty b, Monoid a, Newtype a b) =>
FieldName -> (a -> b) -> ALens' s a -> g s a
monoidalFieldAla "build-tools"          (CommaFSep
-> [LegacyExeDependency]
-> List
     CommaFSep (Identity LegacyExeDependency) LegacyExeDependency
forall sep a. sep -> [a] -> List sep (Identity a) a
alaList  CommaFSep
CommaFSep)          ALens' BuildInfo [LegacyExeDependency]
forall a. HasBuildInfo a => Lens' a [LegacyExeDependency]
L.buildTools
        g BuildInfo [LegacyExeDependency]
-> (g BuildInfo [LegacyExeDependency]
    -> g BuildInfo [LegacyExeDependency])
-> g BuildInfo [LegacyExeDependency]
forall a b. a -> (a -> b) -> b
^^^ CabalSpecVersion
-> FilePath
-> g BuildInfo [LegacyExeDependency]
-> g BuildInfo [LegacyExeDependency]
forall (g :: * -> * -> *) s a.
FieldGrammar g =>
CabalSpecVersion -> FilePath -> g s a -> g s a
deprecatedSince CabalSpecVersion
CabalSpecV2_0
            "Please use 'build-tool-depends' field"
        g BuildInfo [LegacyExeDependency]
-> (g BuildInfo [LegacyExeDependency]
    -> g BuildInfo [LegacyExeDependency])
-> g BuildInfo [LegacyExeDependency]
forall a b. a -> (a -> b) -> b
^^^ CabalSpecVersion
-> FilePath
-> g BuildInfo [LegacyExeDependency]
-> g BuildInfo [LegacyExeDependency]
forall (g :: * -> * -> *) s a.
FieldGrammar g =>
CabalSpecVersion -> FilePath -> g s a -> g s a
removedIn CabalSpecVersion
CabalSpecV3_0
            "Please use 'build-tool-depends' field."
    g BuildInfo
  ([ExeDependency]
   -> [FilePath]
   -> [FilePath]
   -> [FilePath]
   -> [FilePath]
   -> [FilePath]
   -> [FilePath]
   -> [PkgconfigDependency]
   -> [FilePath]
   -> [FilePath]
   -> [FilePath]
   -> [FilePath]
   -> [FilePath]
   -> [FilePath]
   -> [FilePath]
   -> [FilePath]
   -> [ModuleName]
   -> [ModuleName]
   -> [ModuleName]
   -> Maybe Language
   -> [Language]
   -> [Extension]
   -> [Extension]
   -> [Extension]
   -> [FilePath]
   -> [FilePath]
   -> [FilePath]
   -> [FilePath]
   -> [FilePath]
   -> [FilePath]
   -> [FilePath]
   -> [FilePath]
   -> [FilePath]
   -> [FilePath]
   -> PerCompilerFlavor [FilePath]
   -> PerCompilerFlavor [FilePath]
   -> PerCompilerFlavor [FilePath]
   -> PerCompilerFlavor [FilePath]
   -> [(FilePath, FilePath)]
   -> [Dependency]
   -> [Mixin]
   -> BuildInfo)
-> g BuildInfo [ExeDependency]
-> g BuildInfo
     ([FilePath]
      -> [FilePath]
      -> [FilePath]
      -> [FilePath]
      -> [FilePath]
      -> [FilePath]
      -> [PkgconfigDependency]
      -> [FilePath]
      -> [FilePath]
      -> [FilePath]
      -> [FilePath]
      -> [FilePath]
      -> [FilePath]
      -> [FilePath]
      -> [FilePath]
      -> [ModuleName]
      -> [ModuleName]
      -> [ModuleName]
      -> Maybe Language
      -> [Language]
      -> [Extension]
      -> [Extension]
      -> [Extension]
      -> [FilePath]
      -> [FilePath]
      -> [FilePath]
      -> [FilePath]
      -> [FilePath]
      -> [FilePath]
      -> [FilePath]
      -> [FilePath]
      -> [FilePath]
      -> [FilePath]
      -> PerCompilerFlavor [FilePath]
      -> PerCompilerFlavor [FilePath]
      -> PerCompilerFlavor [FilePath]
      -> PerCompilerFlavor [FilePath]
      -> [(FilePath, FilePath)]
      -> [Dependency]
      -> [Mixin]
      -> BuildInfo)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
<*> FieldName
-> ([ExeDependency]
    -> List CommaFSep (Identity ExeDependency) ExeDependency)
-> ALens' BuildInfo [ExeDependency]
-> g BuildInfo [ExeDependency]
forall (g :: * -> * -> *) b a s.
(FieldGrammar g, Parsec b, Pretty b, Monoid a, Newtype a b) =>
FieldName -> (a -> b) -> ALens' s a -> g s a
monoidalFieldAla "build-tool-depends"   (CommaFSep
-> [ExeDependency]
-> List CommaFSep (Identity ExeDependency) ExeDependency
forall sep a. sep -> [a] -> List sep (Identity a) a
alaList  CommaFSep
CommaFSep)          ALens' BuildInfo [ExeDependency]
forall a. HasBuildInfo a => Lens' a [ExeDependency]
L.buildToolDepends
        -- {- ^^^ availableSince [2,0] [] -}
        -- here, we explicitly want to recognise build-tool-depends for all Cabal files
        -- as otherwise cabal new-build cannot really work.
        --
        -- I.e. we don't want trigger unknown field warning
    g BuildInfo
  ([FilePath]
   -> [FilePath]
   -> [FilePath]
   -> [FilePath]
   -> [FilePath]
   -> [FilePath]
   -> [PkgconfigDependency]
   -> [FilePath]
   -> [FilePath]
   -> [FilePath]
   -> [FilePath]
   -> [FilePath]
   -> [FilePath]
   -> [FilePath]
   -> [FilePath]
   -> [ModuleName]
   -> [ModuleName]
   -> [ModuleName]
   -> Maybe Language
   -> [Language]
   -> [Extension]
   -> [Extension]
   -> [Extension]
   -> [FilePath]
   -> [FilePath]
   -> [FilePath]
   -> [FilePath]
   -> [FilePath]
   -> [FilePath]
   -> [FilePath]
   -> [FilePath]
   -> [FilePath]
   -> [FilePath]
   -> PerCompilerFlavor [FilePath]
   -> PerCompilerFlavor [FilePath]
   -> PerCompilerFlavor [FilePath]
   -> PerCompilerFlavor [FilePath]
   -> [(FilePath, FilePath)]
   -> [Dependency]
   -> [Mixin]
   -> BuildInfo)
-> g BuildInfo [FilePath]
-> g BuildInfo
     ([FilePath]
      -> [FilePath]
      -> [FilePath]
      -> [FilePath]
      -> [FilePath]
      -> [PkgconfigDependency]
      -> [FilePath]
      -> [FilePath]
      -> [FilePath]
      -> [FilePath]
      -> [FilePath]
      -> [FilePath]
      -> [FilePath]
      -> [FilePath]
      -> [ModuleName]
      -> [ModuleName]
      -> [ModuleName]
      -> Maybe Language
      -> [Language]
      -> [Extension]
      -> [Extension]
      -> [Extension]
      -> [FilePath]
      -> [FilePath]
      -> [FilePath]
      -> [FilePath]
      -> [FilePath]
      -> [FilePath]
      -> [FilePath]
      -> [FilePath]
      -> [FilePath]
      -> [FilePath]
      -> PerCompilerFlavor [FilePath]
      -> PerCompilerFlavor [FilePath]
      -> PerCompilerFlavor [FilePath]
      -> PerCompilerFlavor [FilePath]
      -> [(FilePath, FilePath)]
      -> [Dependency]
      -> [Mixin]
      -> BuildInfo)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
<*> FieldName
-> ([FilePath] -> List NoCommaFSep Token' FilePath)
-> ALens' BuildInfo [FilePath]
-> g BuildInfo [FilePath]
forall (g :: * -> * -> *) b a s.
(FieldGrammar g, Parsec b, Pretty b, Monoid a, Newtype a b) =>
FieldName -> (a -> b) -> ALens' s a -> g s a
monoidalFieldAla "cpp-options"          (NoCommaFSep
-> (FilePath -> Token')
-> [FilePath]
-> List NoCommaFSep Token' FilePath
forall sep a b. sep -> (a -> b) -> [a] -> List sep b a
alaList' NoCommaFSep
NoCommaFSep FilePath -> Token'
Token') ALens' BuildInfo [FilePath]
forall a. HasBuildInfo a => Lens' a [FilePath]
L.cppOptions
    g BuildInfo
  ([FilePath]
   -> [FilePath]
   -> [FilePath]
   -> [FilePath]
   -> [FilePath]
   -> [PkgconfigDependency]
   -> [FilePath]
   -> [FilePath]
   -> [FilePath]
   -> [FilePath]
   -> [FilePath]
   -> [FilePath]
   -> [FilePath]
   -> [FilePath]
   -> [ModuleName]
   -> [ModuleName]
   -> [ModuleName]
   -> Maybe Language
   -> [Language]
   -> [Extension]
   -> [Extension]
   -> [Extension]
   -> [FilePath]
   -> [FilePath]
   -> [FilePath]
   -> [FilePath]
   -> [FilePath]
   -> [FilePath]
   -> [FilePath]
   -> [FilePath]
   -> [FilePath]
   -> [FilePath]
   -> PerCompilerFlavor [FilePath]
   -> PerCompilerFlavor [FilePath]
   -> PerCompilerFlavor [FilePath]
   -> PerCompilerFlavor [FilePath]
   -> [(FilePath, FilePath)]
   -> [Dependency]
   -> [Mixin]
   -> BuildInfo)
-> g BuildInfo [FilePath]
-> g BuildInfo
     ([FilePath]
      -> [FilePath]
      -> [FilePath]
      -> [FilePath]
      -> [PkgconfigDependency]
      -> [FilePath]
      -> [FilePath]
      -> [FilePath]
      -> [FilePath]
      -> [FilePath]
      -> [FilePath]
      -> [FilePath]
      -> [FilePath]
      -> [ModuleName]
      -> [ModuleName]
      -> [ModuleName]
      -> Maybe Language
      -> [Language]
      -> [Extension]
      -> [Extension]
      -> [Extension]
      -> [FilePath]
      -> [FilePath]
      -> [FilePath]
      -> [FilePath]
      -> [FilePath]
      -> [FilePath]
      -> [FilePath]
      -> [FilePath]
      -> [FilePath]
      -> [FilePath]
      -> PerCompilerFlavor [FilePath]
      -> PerCompilerFlavor [FilePath]
      -> PerCompilerFlavor [FilePath]
      -> PerCompilerFlavor [FilePath]
      -> [(FilePath, FilePath)]
      -> [Dependency]
      -> [Mixin]
      -> BuildInfo)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
<*> FieldName
-> ([FilePath] -> List NoCommaFSep Token' FilePath)
-> ALens' BuildInfo [FilePath]
-> g BuildInfo [FilePath]
forall (g :: * -> * -> *) b a s.
(FieldGrammar g, Parsec b, Pretty b, Monoid a, Newtype a b) =>
FieldName -> (a -> b) -> ALens' s a -> g s a
monoidalFieldAla "asm-options"          (NoCommaFSep
-> (FilePath -> Token')
-> [FilePath]
-> List NoCommaFSep Token' FilePath
forall sep a b. sep -> (a -> b) -> [a] -> List sep b a
alaList' NoCommaFSep
NoCommaFSep FilePath -> Token'
Token') ALens' BuildInfo [FilePath]
forall a. HasBuildInfo a => Lens' a [FilePath]
L.asmOptions
        g BuildInfo [FilePath]
-> (g BuildInfo [FilePath] -> g BuildInfo [FilePath])
-> g BuildInfo [FilePath]
forall a b. a -> (a -> b) -> b
^^^ CabalSpecVersion
-> [FilePath] -> g BuildInfo [FilePath] -> g BuildInfo [FilePath]
forall (g :: * -> * -> *) a s.
FieldGrammar g =>
CabalSpecVersion -> a -> g s a -> g s a
availableSince CabalSpecVersion
CabalSpecV3_0 []
    g BuildInfo
  ([FilePath]
   -> [FilePath]
   -> [FilePath]
   -> [FilePath]
   -> [PkgconfigDependency]
   -> [FilePath]
   -> [FilePath]
   -> [FilePath]
   -> [FilePath]
   -> [FilePath]
   -> [FilePath]
   -> [FilePath]
   -> [FilePath]
   -> [ModuleName]
   -> [ModuleName]
   -> [ModuleName]
   -> Maybe Language
   -> [Language]
   -> [Extension]
   -> [Extension]
   -> [Extension]
   -> [FilePath]
   -> [FilePath]
   -> [FilePath]
   -> [FilePath]
   -> [FilePath]
   -> [FilePath]
   -> [FilePath]
   -> [FilePath]
   -> [FilePath]
   -> [FilePath]
   -> PerCompilerFlavor [FilePath]
   -> PerCompilerFlavor [FilePath]
   -> PerCompilerFlavor [FilePath]
   -> PerCompilerFlavor [FilePath]
   -> [(FilePath, FilePath)]
   -> [Dependency]
   -> [Mixin]
   -> BuildInfo)
-> g BuildInfo [FilePath]
-> g BuildInfo
     ([FilePath]
      -> [FilePath]
      -> [FilePath]
      -> [PkgconfigDependency]
      -> [FilePath]
      -> [FilePath]
      -> [FilePath]
      -> [FilePath]
      -> [FilePath]
      -> [FilePath]
      -> [FilePath]
      -> [FilePath]
      -> [ModuleName]
      -> [ModuleName]
      -> [ModuleName]
      -> Maybe Language
      -> [Language]
      -> [Extension]
      -> [Extension]
      -> [Extension]
      -> [FilePath]
      -> [FilePath]
      -> [FilePath]
      -> [FilePath]
      -> [FilePath]
      -> [FilePath]
      -> [FilePath]
      -> [FilePath]
      -> [FilePath]
      -> [FilePath]
      -> PerCompilerFlavor [FilePath]
      -> PerCompilerFlavor [FilePath]
      -> PerCompilerFlavor [FilePath]
      -> PerCompilerFlavor [FilePath]
      -> [(FilePath, FilePath)]
      -> [Dependency]
      -> [Mixin]
      -> BuildInfo)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
<*> FieldName
-> ([FilePath] -> List NoCommaFSep Token' FilePath)
-> ALens' BuildInfo [FilePath]
-> g BuildInfo [FilePath]
forall (g :: * -> * -> *) b a s.
(FieldGrammar g, Parsec b, Pretty b, Monoid a, Newtype a b) =>
FieldName -> (a -> b) -> ALens' s a -> g s a
monoidalFieldAla "cmm-options"          (NoCommaFSep
-> (FilePath -> Token')
-> [FilePath]
-> List NoCommaFSep Token' FilePath
forall sep a b. sep -> (a -> b) -> [a] -> List sep b a
alaList' NoCommaFSep
NoCommaFSep FilePath -> Token'
Token') ALens' BuildInfo [FilePath]
forall a. HasBuildInfo a => Lens' a [FilePath]
L.cmmOptions
        g BuildInfo [FilePath]
-> (g BuildInfo [FilePath] -> g BuildInfo [FilePath])
-> g BuildInfo [FilePath]
forall a b. a -> (a -> b) -> b
^^^ CabalSpecVersion
-> [FilePath] -> g BuildInfo [FilePath] -> g BuildInfo [FilePath]
forall (g :: * -> * -> *) a s.
FieldGrammar g =>
CabalSpecVersion -> a -> g s a -> g s a
availableSince CabalSpecVersion
CabalSpecV3_0 []
    g BuildInfo
  ([FilePath]
   -> [FilePath]
   -> [FilePath]
   -> [PkgconfigDependency]
   -> [FilePath]
   -> [FilePath]
   -> [FilePath]
   -> [FilePath]
   -> [FilePath]
   -> [FilePath]
   -> [FilePath]
   -> [FilePath]
   -> [ModuleName]
   -> [ModuleName]
   -> [ModuleName]
   -> Maybe Language
   -> [Language]
   -> [Extension]
   -> [Extension]
   -> [Extension]
   -> [FilePath]
   -> [FilePath]
   -> [FilePath]
   -> [FilePath]
   -> [FilePath]
   -> [FilePath]
   -> [FilePath]
   -> [FilePath]
   -> [FilePath]
   -> [FilePath]
   -> PerCompilerFlavor [FilePath]
   -> PerCompilerFlavor [FilePath]
   -> PerCompilerFlavor [FilePath]
   -> PerCompilerFlavor [FilePath]
   -> [(FilePath, FilePath)]
   -> [Dependency]
   -> [Mixin]
   -> BuildInfo)
-> g BuildInfo [FilePath]
-> g BuildInfo
     ([FilePath]
      -> [FilePath]
      -> [PkgconfigDependency]
      -> [FilePath]
      -> [FilePath]
      -> [FilePath]
      -> [FilePath]
      -> [FilePath]
      -> [FilePath]
      -> [FilePath]
      -> [FilePath]
      -> [ModuleName]
      -> [ModuleName]
      -> [ModuleName]
      -> Maybe Language
      -> [Language]
      -> [Extension]
      -> [Extension]
      -> [Extension]
      -> [FilePath]
      -> [FilePath]
      -> [FilePath]
      -> [FilePath]
      -> [FilePath]
      -> [FilePath]
      -> [FilePath]
      -> [FilePath]
      -> [FilePath]
      -> [FilePath]
      -> PerCompilerFlavor [FilePath]
      -> PerCompilerFlavor [FilePath]
      -> PerCompilerFlavor [FilePath]
      -> PerCompilerFlavor [FilePath]
      -> [(FilePath, FilePath)]
      -> [Dependency]
      -> [Mixin]
      -> BuildInfo)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
<*> FieldName
-> ([FilePath] -> List NoCommaFSep Token' FilePath)
-> ALens' BuildInfo [FilePath]
-> g BuildInfo [FilePath]
forall (g :: * -> * -> *) b a s.
(FieldGrammar g, Parsec b, Pretty b, Monoid a, Newtype a b) =>
FieldName -> (a -> b) -> ALens' s a -> g s a
monoidalFieldAla "cc-options"           (NoCommaFSep
-> (FilePath -> Token')
-> [FilePath]
-> List NoCommaFSep Token' FilePath
forall sep a b. sep -> (a -> b) -> [a] -> List sep b a
alaList' NoCommaFSep
NoCommaFSep FilePath -> Token'
Token') ALens' BuildInfo [FilePath]
forall a. HasBuildInfo a => Lens' a [FilePath]
L.ccOptions
    g BuildInfo
  ([FilePath]
   -> [FilePath]
   -> [PkgconfigDependency]
   -> [FilePath]
   -> [FilePath]
   -> [FilePath]
   -> [FilePath]
   -> [FilePath]
   -> [FilePath]
   -> [FilePath]
   -> [FilePath]
   -> [ModuleName]
   -> [ModuleName]
   -> [ModuleName]
   -> Maybe Language
   -> [Language]
   -> [Extension]
   -> [Extension]
   -> [Extension]
   -> [FilePath]
   -> [FilePath]
   -> [FilePath]
   -> [FilePath]
   -> [FilePath]
   -> [FilePath]
   -> [FilePath]
   -> [FilePath]
   -> [FilePath]
   -> [FilePath]
   -> PerCompilerFlavor [FilePath]
   -> PerCompilerFlavor [FilePath]
   -> PerCompilerFlavor [FilePath]
   -> PerCompilerFlavor [FilePath]
   -> [(FilePath, FilePath)]
   -> [Dependency]
   -> [Mixin]
   -> BuildInfo)
-> g BuildInfo [FilePath]
-> g BuildInfo
     ([FilePath]
      -> [PkgconfigDependency]
      -> [FilePath]
      -> [FilePath]
      -> [FilePath]
      -> [FilePath]
      -> [FilePath]
      -> [FilePath]
      -> [FilePath]
      -> [FilePath]
      -> [ModuleName]
      -> [ModuleName]
      -> [ModuleName]
      -> Maybe Language
      -> [Language]
      -> [Extension]
      -> [Extension]
      -> [Extension]
      -> [FilePath]
      -> [FilePath]
      -> [FilePath]
      -> [FilePath]
      -> [FilePath]
      -> [FilePath]
      -> [FilePath]
      -> [FilePath]
      -> [FilePath]
      -> [FilePath]
      -> PerCompilerFlavor [FilePath]
      -> PerCompilerFlavor [FilePath]
      -> PerCompilerFlavor [FilePath]
      -> PerCompilerFlavor [FilePath]
      -> [(FilePath, FilePath)]
      -> [Dependency]
      -> [Mixin]
      -> BuildInfo)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
<*> FieldName
-> ([FilePath] -> List NoCommaFSep Token' FilePath)
-> ALens' BuildInfo [FilePath]
-> g BuildInfo [FilePath]
forall (g :: * -> * -> *) b a s.
(FieldGrammar g, Parsec b, Pretty b, Monoid a, Newtype a b) =>
FieldName -> (a -> b) -> ALens' s a -> g s a
monoidalFieldAla "cxx-options"          (NoCommaFSep
-> (FilePath -> Token')
-> [FilePath]
-> List NoCommaFSep Token' FilePath
forall sep a b. sep -> (a -> b) -> [a] -> List sep b a
alaList' NoCommaFSep
NoCommaFSep FilePath -> Token'
Token') ALens' BuildInfo [FilePath]
forall a. HasBuildInfo a => Lens' a [FilePath]
L.cxxOptions
        g BuildInfo [FilePath]
-> (g BuildInfo [FilePath] -> g BuildInfo [FilePath])
-> g BuildInfo [FilePath]
forall a b. a -> (a -> b) -> b
^^^ CabalSpecVersion
-> [FilePath] -> g BuildInfo [FilePath] -> g BuildInfo [FilePath]
forall (g :: * -> * -> *) a s.
FieldGrammar g =>
CabalSpecVersion -> a -> g s a -> g s a
availableSince CabalSpecVersion
CabalSpecV2_2 []
    g BuildInfo
  ([FilePath]
   -> [PkgconfigDependency]
   -> [FilePath]
   -> [FilePath]
   -> [FilePath]
   -> [FilePath]
   -> [FilePath]
   -> [FilePath]
   -> [FilePath]
   -> [FilePath]
   -> [ModuleName]
   -> [ModuleName]
   -> [ModuleName]
   -> Maybe Language
   -> [Language]
   -> [Extension]
   -> [Extension]
   -> [Extension]
   -> [FilePath]
   -> [FilePath]
   -> [FilePath]
   -> [FilePath]
   -> [FilePath]
   -> [FilePath]
   -> [FilePath]
   -> [FilePath]
   -> [FilePath]
   -> [FilePath]
   -> PerCompilerFlavor [FilePath]
   -> PerCompilerFlavor [FilePath]
   -> PerCompilerFlavor [FilePath]
   -> PerCompilerFlavor [FilePath]
   -> [(FilePath, FilePath)]
   -> [Dependency]
   -> [Mixin]
   -> BuildInfo)
-> g BuildInfo [FilePath]
-> g BuildInfo
     ([PkgconfigDependency]
      -> [FilePath]
      -> [FilePath]
      -> [FilePath]
      -> [FilePath]
      -> [FilePath]
      -> [FilePath]
      -> [FilePath]
      -> [FilePath]
      -> [ModuleName]
      -> [ModuleName]
      -> [ModuleName]
      -> Maybe Language
      -> [Language]
      -> [Extension]
      -> [Extension]
      -> [Extension]
      -> [FilePath]
      -> [FilePath]
      -> [FilePath]
      -> [FilePath]
      -> [FilePath]
      -> [FilePath]
      -> [FilePath]
      -> [FilePath]
      -> [FilePath]
      -> [FilePath]
      -> PerCompilerFlavor [FilePath]
      -> PerCompilerFlavor [FilePath]
      -> PerCompilerFlavor [FilePath]
      -> PerCompilerFlavor [FilePath]
      -> [(FilePath, FilePath)]
      -> [Dependency]
      -> [Mixin]
      -> BuildInfo)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
<*> FieldName
-> ([FilePath] -> List NoCommaFSep Token' FilePath)
-> ALens' BuildInfo [FilePath]
-> g BuildInfo [FilePath]
forall (g :: * -> * -> *) b a s.
(FieldGrammar g, Parsec b, Pretty b, Monoid a, Newtype a b) =>
FieldName -> (a -> b) -> ALens' s a -> g s a
monoidalFieldAla "ld-options"           (NoCommaFSep
-> (FilePath -> Token')
-> [FilePath]
-> List NoCommaFSep Token' FilePath
forall sep a b. sep -> (a -> b) -> [a] -> List sep b a
alaList' NoCommaFSep
NoCommaFSep FilePath -> Token'
Token') ALens' BuildInfo [FilePath]
forall a. HasBuildInfo a => Lens' a [FilePath]
L.ldOptions
    g BuildInfo
  ([PkgconfigDependency]
   -> [FilePath]
   -> [FilePath]
   -> [FilePath]
   -> [FilePath]
   -> [FilePath]
   -> [FilePath]
   -> [FilePath]
   -> [FilePath]
   -> [ModuleName]
   -> [ModuleName]
   -> [ModuleName]
   -> Maybe Language
   -> [Language]
   -> [Extension]
   -> [Extension]
   -> [Extension]
   -> [FilePath]
   -> [FilePath]
   -> [FilePath]
   -> [FilePath]
   -> [FilePath]
   -> [FilePath]
   -> [FilePath]
   -> [FilePath]
   -> [FilePath]
   -> [FilePath]
   -> PerCompilerFlavor [FilePath]
   -> PerCompilerFlavor [FilePath]
   -> PerCompilerFlavor [FilePath]
   -> PerCompilerFlavor [FilePath]
   -> [(FilePath, FilePath)]
   -> [Dependency]
   -> [Mixin]
   -> BuildInfo)
-> g BuildInfo [PkgconfigDependency]
-> g BuildInfo
     ([FilePath]
      -> [FilePath]
      -> [FilePath]
      -> [FilePath]
      -> [FilePath]
      -> [FilePath]
      -> [FilePath]
      -> [FilePath]
      -> [ModuleName]
      -> [ModuleName]
      -> [ModuleName]
      -> Maybe Language
      -> [Language]
      -> [Extension]
      -> [Extension]
      -> [Extension]
      -> [FilePath]
      -> [FilePath]
      -> [FilePath]
      -> [FilePath]
      -> [FilePath]
      -> [FilePath]
      -> [FilePath]
      -> [FilePath]
      -> [FilePath]
      -> [FilePath]
      -> PerCompilerFlavor [FilePath]
      -> PerCompilerFlavor [FilePath]
      -> PerCompilerFlavor [FilePath]
      -> PerCompilerFlavor [FilePath]
      -> [(FilePath, FilePath)]
      -> [Dependency]
      -> [Mixin]
      -> BuildInfo)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
<*> FieldName
-> ([PkgconfigDependency]
    -> List
         CommaFSep (Identity PkgconfigDependency) PkgconfigDependency)
-> ALens' BuildInfo [PkgconfigDependency]
-> g BuildInfo [PkgconfigDependency]
forall (g :: * -> * -> *) b a s.
(FieldGrammar g, Parsec b, Pretty b, Monoid a, Newtype a b) =>
FieldName -> (a -> b) -> ALens' s a -> g s a
monoidalFieldAla "pkgconfig-depends"    (CommaFSep
-> [PkgconfigDependency]
-> List
     CommaFSep (Identity PkgconfigDependency) PkgconfigDependency
forall sep a. sep -> [a] -> List sep (Identity a) a
alaList  CommaFSep
CommaFSep)          ALens' BuildInfo [PkgconfigDependency]
forall a. HasBuildInfo a => Lens' a [PkgconfigDependency]
L.pkgconfigDepends
    g BuildInfo
  ([FilePath]
   -> [FilePath]
   -> [FilePath]
   -> [FilePath]
   -> [FilePath]
   -> [FilePath]
   -> [FilePath]
   -> [FilePath]
   -> [ModuleName]
   -> [ModuleName]
   -> [ModuleName]
   -> Maybe Language
   -> [Language]
   -> [Extension]
   -> [Extension]
   -> [Extension]
   -> [FilePath]
   -> [FilePath]
   -> [FilePath]
   -> [FilePath]
   -> [FilePath]
   -> [FilePath]
   -> [FilePath]
   -> [FilePath]
   -> [FilePath]
   -> [FilePath]
   -> PerCompilerFlavor [FilePath]
   -> PerCompilerFlavor [FilePath]
   -> PerCompilerFlavor [FilePath]
   -> PerCompilerFlavor [FilePath]
   -> [(FilePath, FilePath)]
   -> [Dependency]
   -> [Mixin]
   -> BuildInfo)
-> g BuildInfo [FilePath]
-> g BuildInfo
     ([FilePath]
      -> [FilePath]
      -> [FilePath]
      -> [FilePath]
      -> [FilePath]
      -> [FilePath]
      -> [FilePath]
      -> [ModuleName]
      -> [ModuleName]
      -> [ModuleName]
      -> Maybe Language
      -> [Language]
      -> [Extension]
      -> [Extension]
      -> [Extension]
      -> [FilePath]
      -> [FilePath]
      -> [FilePath]
      -> [FilePath]
      -> [FilePath]
      -> [FilePath]
      -> [FilePath]
      -> [FilePath]
      -> [FilePath]
      -> [FilePath]
      -> PerCompilerFlavor [FilePath]
      -> PerCompilerFlavor [FilePath]
      -> PerCompilerFlavor [FilePath]
      -> PerCompilerFlavor [FilePath]
      -> [(FilePath, FilePath)]
      -> [Dependency]
      -> [Mixin]
      -> BuildInfo)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
<*> FieldName
-> ([FilePath] -> List FSep Token FilePath)
-> ALens' BuildInfo [FilePath]
-> g BuildInfo [FilePath]
forall (g :: * -> * -> *) b a s.
(FieldGrammar g, Parsec b, Pretty b, Monoid a, Newtype a b) =>
FieldName -> (a -> b) -> ALens' s a -> g s a
monoidalFieldAla "frameworks"           (FSep
-> (FilePath -> Token) -> [FilePath] -> List FSep Token FilePath
forall sep a b. sep -> (a -> b) -> [a] -> List sep b a
alaList' FSep
FSep FilePath -> Token
Token)         ALens' BuildInfo [FilePath]
forall a. HasBuildInfo a => Lens' a [FilePath]
L.frameworks
    g BuildInfo
  ([FilePath]
   -> [FilePath]
   -> [FilePath]
   -> [FilePath]
   -> [FilePath]
   -> [FilePath]
   -> [FilePath]
   -> [ModuleName]
   -> [ModuleName]
   -> [ModuleName]
   -> Maybe Language
   -> [Language]
   -> [Extension]
   -> [Extension]
   -> [Extension]
   -> [FilePath]
   -> [FilePath]
   -> [FilePath]
   -> [FilePath]
   -> [FilePath]
   -> [FilePath]
   -> [FilePath]
   -> [FilePath]
   -> [FilePath]
   -> [FilePath]
   -> PerCompilerFlavor [FilePath]
   -> PerCompilerFlavor [FilePath]
   -> PerCompilerFlavor [FilePath]
   -> PerCompilerFlavor [FilePath]
   -> [(FilePath, FilePath)]
   -> [Dependency]
   -> [Mixin]
   -> BuildInfo)
-> g BuildInfo [FilePath]
-> g BuildInfo
     ([FilePath]
      -> [FilePath]
      -> [FilePath]
      -> [FilePath]
      -> [FilePath]
      -> [FilePath]
      -> [ModuleName]
      -> [ModuleName]
      -> [ModuleName]
      -> Maybe Language
      -> [Language]
      -> [Extension]
      -> [Extension]
      -> [Extension]
      -> [FilePath]
      -> [FilePath]
      -> [FilePath]
      -> [FilePath]
      -> [FilePath]
      -> [FilePath]
      -> [FilePath]
      -> [FilePath]
      -> [FilePath]
      -> [FilePath]
      -> PerCompilerFlavor [FilePath]
      -> PerCompilerFlavor [FilePath]
      -> PerCompilerFlavor [FilePath]
      -> PerCompilerFlavor [FilePath]
      -> [(FilePath, FilePath)]
      -> [Dependency]
      -> [Mixin]
      -> BuildInfo)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
<*> FieldName
-> ([FilePath] -> List FSep FilePathNT FilePath)
-> ALens' BuildInfo [FilePath]
-> g BuildInfo [FilePath]
forall (g :: * -> * -> *) b a s.
(FieldGrammar g, Parsec b, Pretty b, Monoid a, Newtype a b) =>
FieldName -> (a -> b) -> ALens' s a -> g s a
monoidalFieldAla "extra-framework-dirs" (FSep
-> (FilePath -> FilePathNT)
-> [FilePath]
-> List FSep FilePathNT FilePath
forall sep a b. sep -> (a -> b) -> [a] -> List sep b a
alaList' FSep
FSep FilePath -> FilePathNT
FilePathNT)    ALens' BuildInfo [FilePath]
forall a. HasBuildInfo a => Lens' a [FilePath]
L.extraFrameworkDirs
    g BuildInfo
  ([FilePath]
   -> [FilePath]
   -> [FilePath]
   -> [FilePath]
   -> [FilePath]
   -> [FilePath]
   -> [ModuleName]
   -> [ModuleName]
   -> [ModuleName]
   -> Maybe Language
   -> [Language]
   -> [Extension]
   -> [Extension]
   -> [Extension]
   -> [FilePath]
   -> [FilePath]
   -> [FilePath]
   -> [FilePath]
   -> [FilePath]
   -> [FilePath]
   -> [FilePath]
   -> [FilePath]
   -> [FilePath]
   -> [FilePath]
   -> PerCompilerFlavor [FilePath]
   -> PerCompilerFlavor [FilePath]
   -> PerCompilerFlavor [FilePath]
   -> PerCompilerFlavor [FilePath]
   -> [(FilePath, FilePath)]
   -> [Dependency]
   -> [Mixin]
   -> BuildInfo)
-> g BuildInfo [FilePath]
-> g BuildInfo
     ([FilePath]
      -> [FilePath]
      -> [FilePath]
      -> [FilePath]
      -> [FilePath]
      -> [ModuleName]
      -> [ModuleName]
      -> [ModuleName]
      -> Maybe Language
      -> [Language]
      -> [Extension]
      -> [Extension]
      -> [Extension]
      -> [FilePath]
      -> [FilePath]
      -> [FilePath]
      -> [FilePath]
      -> [FilePath]
      -> [FilePath]
      -> [FilePath]
      -> [FilePath]
      -> [FilePath]
      -> [FilePath]
      -> PerCompilerFlavor [FilePath]
      -> PerCompilerFlavor [FilePath]
      -> PerCompilerFlavor [FilePath]
      -> PerCompilerFlavor [FilePath]
      -> [(FilePath, FilePath)]
      -> [Dependency]
      -> [Mixin]
      -> BuildInfo)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
<*> FieldName
-> ([FilePath] -> List VCat FilePathNT FilePath)
-> ALens' BuildInfo [FilePath]
-> g BuildInfo [FilePath]
forall (g :: * -> * -> *) b a s.
(FieldGrammar g, Parsec b, Pretty b, Monoid a, Newtype a b) =>
FieldName -> (a -> b) -> ALens' s a -> g s a
monoidalFieldAla "asm-sources"          (VCat
-> (FilePath -> FilePathNT)
-> [FilePath]
-> List VCat FilePathNT FilePath
forall sep a b. sep -> (a -> b) -> [a] -> List sep b a
alaList' VCat
VCat FilePath -> FilePathNT
FilePathNT)    ALens' BuildInfo [FilePath]
forall a. HasBuildInfo a => Lens' a [FilePath]
L.asmSources
        g BuildInfo [FilePath]
-> (g BuildInfo [FilePath] -> g BuildInfo [FilePath])
-> g BuildInfo [FilePath]
forall a b. a -> (a -> b) -> b
^^^ CabalSpecVersion
-> [FilePath] -> g BuildInfo [FilePath] -> g BuildInfo [FilePath]
forall (g :: * -> * -> *) a s.
FieldGrammar g =>
CabalSpecVersion -> a -> g s a -> g s a
availableSince CabalSpecVersion
CabalSpecV3_0 []
    g BuildInfo
  ([FilePath]
   -> [FilePath]
   -> [FilePath]
   -> [FilePath]
   -> [FilePath]
   -> [ModuleName]
   -> [ModuleName]
   -> [ModuleName]
   -> Maybe Language
   -> [Language]
   -> [Extension]
   -> [Extension]
   -> [Extension]
   -> [FilePath]
   -> [FilePath]
   -> [FilePath]
   -> [FilePath]
   -> [FilePath]
   -> [FilePath]
   -> [FilePath]
   -> [FilePath]
   -> [FilePath]
   -> [FilePath]
   -> PerCompilerFlavor [FilePath]
   -> PerCompilerFlavor [FilePath]
   -> PerCompilerFlavor [FilePath]
   -> PerCompilerFlavor [FilePath]
   -> [(FilePath, FilePath)]
   -> [Dependency]
   -> [Mixin]
   -> BuildInfo)
-> g BuildInfo [FilePath]
-> g BuildInfo
     ([FilePath]
      -> [FilePath]
      -> [FilePath]
      -> [FilePath]
      -> [ModuleName]
      -> [ModuleName]
      -> [ModuleName]
      -> Maybe Language
      -> [Language]
      -> [Extension]
      -> [Extension]
      -> [Extension]
      -> [FilePath]
      -> [FilePath]
      -> [FilePath]
      -> [FilePath]
      -> [FilePath]
      -> [FilePath]
      -> [FilePath]
      -> [FilePath]
      -> [FilePath]
      -> [FilePath]
      -> PerCompilerFlavor [FilePath]
      -> PerCompilerFlavor [FilePath]
      -> PerCompilerFlavor [FilePath]
      -> PerCompilerFlavor [FilePath]
      -> [(FilePath, FilePath)]
      -> [Dependency]
      -> [Mixin]
      -> BuildInfo)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
<*> FieldName
-> ([FilePath] -> List VCat FilePathNT FilePath)
-> ALens' BuildInfo [FilePath]
-> g BuildInfo [FilePath]
forall (g :: * -> * -> *) b a s.
(FieldGrammar g, Parsec b, Pretty b, Monoid a, Newtype a b) =>
FieldName -> (a -> b) -> ALens' s a -> g s a
monoidalFieldAla "cmm-sources"          (VCat
-> (FilePath -> FilePathNT)
-> [FilePath]
-> List VCat FilePathNT FilePath
forall sep a b. sep -> (a -> b) -> [a] -> List sep b a
alaList' VCat
VCat FilePath -> FilePathNT
FilePathNT)    ALens' BuildInfo [FilePath]
forall a. HasBuildInfo a => Lens' a [FilePath]
L.cmmSources
        g BuildInfo [FilePath]
-> (g BuildInfo [FilePath] -> g BuildInfo [FilePath])
-> g BuildInfo [FilePath]
forall a b. a -> (a -> b) -> b
^^^ CabalSpecVersion
-> [FilePath] -> g BuildInfo [FilePath] -> g BuildInfo [FilePath]
forall (g :: * -> * -> *) a s.
FieldGrammar g =>
CabalSpecVersion -> a -> g s a -> g s a
availableSince CabalSpecVersion
CabalSpecV3_0 []
    g BuildInfo
  ([FilePath]
   -> [FilePath]
   -> [FilePath]
   -> [FilePath]
   -> [ModuleName]
   -> [ModuleName]
   -> [ModuleName]
   -> Maybe Language
   -> [Language]
   -> [Extension]
   -> [Extension]
   -> [Extension]
   -> [FilePath]
   -> [FilePath]
   -> [FilePath]
   -> [FilePath]
   -> [FilePath]
   -> [FilePath]
   -> [FilePath]
   -> [FilePath]
   -> [FilePath]
   -> [FilePath]
   -> PerCompilerFlavor [FilePath]
   -> PerCompilerFlavor [FilePath]
   -> PerCompilerFlavor [FilePath]
   -> PerCompilerFlavor [FilePath]
   -> [(FilePath, FilePath)]
   -> [Dependency]
   -> [Mixin]
   -> BuildInfo)
-> g BuildInfo [FilePath]
-> g BuildInfo
     ([FilePath]
      -> [FilePath]
      -> [FilePath]
      -> [ModuleName]
      -> [ModuleName]
      -> [ModuleName]
      -> Maybe Language
      -> [Language]
      -> [Extension]
      -> [Extension]
      -> [Extension]
      -> [FilePath]
      -> [FilePath]
      -> [FilePath]
      -> [FilePath]
      -> [FilePath]
      -> [FilePath]
      -> [FilePath]
      -> [FilePath]
      -> [FilePath]
      -> [FilePath]
      -> PerCompilerFlavor [FilePath]
      -> PerCompilerFlavor [FilePath]
      -> PerCompilerFlavor [FilePath]
      -> PerCompilerFlavor [FilePath]
      -> [(FilePath, FilePath)]
      -> [Dependency]
      -> [Mixin]
      -> BuildInfo)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
<*> FieldName
-> ([FilePath] -> List VCat FilePathNT FilePath)
-> ALens' BuildInfo [FilePath]
-> g BuildInfo [FilePath]
forall (g :: * -> * -> *) b a s.
(FieldGrammar g, Parsec b, Pretty b, Monoid a, Newtype a b) =>
FieldName -> (a -> b) -> ALens' s a -> g s a
monoidalFieldAla "c-sources"            (VCat
-> (FilePath -> FilePathNT)
-> [FilePath]
-> List VCat FilePathNT FilePath
forall sep a b. sep -> (a -> b) -> [a] -> List sep b a
alaList' VCat
VCat FilePath -> FilePathNT
FilePathNT)    ALens' BuildInfo [FilePath]
forall a. HasBuildInfo a => Lens' a [FilePath]
L.cSources
    g BuildInfo
  ([FilePath]
   -> [FilePath]
   -> [FilePath]
   -> [ModuleName]
   -> [ModuleName]
   -> [ModuleName]
   -> Maybe Language
   -> [Language]
   -> [Extension]
   -> [Extension]
   -> [Extension]
   -> [FilePath]
   -> [FilePath]
   -> [FilePath]
   -> [FilePath]
   -> [FilePath]
   -> [FilePath]
   -> [FilePath]
   -> [FilePath]
   -> [FilePath]
   -> [FilePath]
   -> PerCompilerFlavor [FilePath]
   -> PerCompilerFlavor [FilePath]
   -> PerCompilerFlavor [FilePath]
   -> PerCompilerFlavor [FilePath]
   -> [(FilePath, FilePath)]
   -> [Dependency]
   -> [Mixin]
   -> BuildInfo)
-> g BuildInfo [FilePath]
-> g BuildInfo
     ([FilePath]
      -> [FilePath]
      -> [ModuleName]
      -> [ModuleName]
      -> [ModuleName]
      -> Maybe Language
      -> [Language]
      -> [Extension]
      -> [Extension]
      -> [Extension]
      -> [FilePath]
      -> [FilePath]
      -> [FilePath]
      -> [FilePath]
      -> [FilePath]
      -> [FilePath]
      -> [FilePath]
      -> [FilePath]
      -> [FilePath]
      -> [FilePath]
      -> PerCompilerFlavor [FilePath]
      -> PerCompilerFlavor [FilePath]
      -> PerCompilerFlavor [FilePath]
      -> PerCompilerFlavor [FilePath]
      -> [(FilePath, FilePath)]
      -> [Dependency]
      -> [Mixin]
      -> BuildInfo)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
<*> FieldName
-> ([FilePath] -> List VCat FilePathNT FilePath)
-> ALens' BuildInfo [FilePath]
-> g BuildInfo [FilePath]
forall (g :: * -> * -> *) b a s.
(FieldGrammar g, Parsec b, Pretty b, Monoid a, Newtype a b) =>
FieldName -> (a -> b) -> ALens' s a -> g s a
monoidalFieldAla "cxx-sources"          (VCat
-> (FilePath -> FilePathNT)
-> [FilePath]
-> List VCat FilePathNT FilePath
forall sep a b. sep -> (a -> b) -> [a] -> List sep b a
alaList' VCat
VCat FilePath -> FilePathNT
FilePathNT)    ALens' BuildInfo [FilePath]
forall a. HasBuildInfo a => Lens' a [FilePath]
L.cxxSources
        g BuildInfo [FilePath]
-> (g BuildInfo [FilePath] -> g BuildInfo [FilePath])
-> g BuildInfo [FilePath]
forall a b. a -> (a -> b) -> b
^^^ CabalSpecVersion
-> [FilePath] -> g BuildInfo [FilePath] -> g BuildInfo [FilePath]
forall (g :: * -> * -> *) a s.
FieldGrammar g =>
CabalSpecVersion -> a -> g s a -> g s a
availableSince CabalSpecVersion
CabalSpecV2_2 []
    g BuildInfo
  ([FilePath]
   -> [FilePath]
   -> [ModuleName]
   -> [ModuleName]
   -> [ModuleName]
   -> Maybe Language
   -> [Language]
   -> [Extension]
   -> [Extension]
   -> [Extension]
   -> [FilePath]
   -> [FilePath]
   -> [FilePath]
   -> [FilePath]
   -> [FilePath]
   -> [FilePath]
   -> [FilePath]
   -> [FilePath]
   -> [FilePath]
   -> [FilePath]
   -> PerCompilerFlavor [FilePath]
   -> PerCompilerFlavor [FilePath]
   -> PerCompilerFlavor [FilePath]
   -> PerCompilerFlavor [FilePath]
   -> [(FilePath, FilePath)]
   -> [Dependency]
   -> [Mixin]
   -> BuildInfo)
-> g BuildInfo [FilePath]
-> g BuildInfo
     ([FilePath]
      -> [ModuleName]
      -> [ModuleName]
      -> [ModuleName]
      -> Maybe Language
      -> [Language]
      -> [Extension]
      -> [Extension]
      -> [Extension]
      -> [FilePath]
      -> [FilePath]
      -> [FilePath]
      -> [FilePath]
      -> [FilePath]
      -> [FilePath]
      -> [FilePath]
      -> [FilePath]
      -> [FilePath]
      -> [FilePath]
      -> PerCompilerFlavor [FilePath]
      -> PerCompilerFlavor [FilePath]
      -> PerCompilerFlavor [FilePath]
      -> PerCompilerFlavor [FilePath]
      -> [(FilePath, FilePath)]
      -> [Dependency]
      -> [Mixin]
      -> BuildInfo)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
<*> FieldName
-> ([FilePath] -> List VCat FilePathNT FilePath)
-> ALens' BuildInfo [FilePath]
-> g BuildInfo [FilePath]
forall (g :: * -> * -> *) b a s.
(FieldGrammar g, Parsec b, Pretty b, Monoid a, Newtype a b) =>
FieldName -> (a -> b) -> ALens' s a -> g s a
monoidalFieldAla "js-sources"           (VCat
-> (FilePath -> FilePathNT)
-> [FilePath]
-> List VCat FilePathNT FilePath
forall sep a b. sep -> (a -> b) -> [a] -> List sep b a
alaList' VCat
VCat FilePath -> FilePathNT
FilePathNT)    ALens' BuildInfo [FilePath]
forall a. HasBuildInfo a => Lens' a [FilePath]
L.jsSources
    g BuildInfo
  ([FilePath]
   -> [ModuleName]
   -> [ModuleName]
   -> [ModuleName]
   -> Maybe Language
   -> [Language]
   -> [Extension]
   -> [Extension]
   -> [Extension]
   -> [FilePath]
   -> [FilePath]
   -> [FilePath]
   -> [FilePath]
   -> [FilePath]
   -> [FilePath]
   -> [FilePath]
   -> [FilePath]
   -> [FilePath]
   -> [FilePath]
   -> PerCompilerFlavor [FilePath]
   -> PerCompilerFlavor [FilePath]
   -> PerCompilerFlavor [FilePath]
   -> PerCompilerFlavor [FilePath]
   -> [(FilePath, FilePath)]
   -> [Dependency]
   -> [Mixin]
   -> BuildInfo)
-> g BuildInfo [FilePath]
-> g BuildInfo
     ([ModuleName]
      -> [ModuleName]
      -> [ModuleName]
      -> Maybe Language
      -> [Language]
      -> [Extension]
      -> [Extension]
      -> [Extension]
      -> [FilePath]
      -> [FilePath]
      -> [FilePath]
      -> [FilePath]
      -> [FilePath]
      -> [FilePath]
      -> [FilePath]
      -> [FilePath]
      -> [FilePath]
      -> [FilePath]
      -> PerCompilerFlavor [FilePath]
      -> PerCompilerFlavor [FilePath]
      -> PerCompilerFlavor [FilePath]
      -> PerCompilerFlavor [FilePath]
      -> [(FilePath, FilePath)]
      -> [Dependency]
      -> [Mixin]
      -> BuildInfo)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
<*> g BuildInfo [FilePath]
forall (g :: * -> * -> *).
(FieldGrammar g, Applicative (g BuildInfo)) =>
g BuildInfo [FilePath]
hsSourceDirsGrammar
    g BuildInfo
  ([ModuleName]
   -> [ModuleName]
   -> [ModuleName]
   -> Maybe Language
   -> [Language]
   -> [Extension]
   -> [Extension]
   -> [Extension]
   -> [FilePath]
   -> [FilePath]
   -> [FilePath]
   -> [FilePath]
   -> [FilePath]
   -> [FilePath]
   -> [FilePath]
   -> [FilePath]
   -> [FilePath]
   -> [FilePath]
   -> PerCompilerFlavor [FilePath]
   -> PerCompilerFlavor [FilePath]
   -> PerCompilerFlavor [FilePath]
   -> PerCompilerFlavor [FilePath]
   -> [(FilePath, FilePath)]
   -> [Dependency]
   -> [Mixin]
   -> BuildInfo)
-> g BuildInfo [ModuleName]
-> g BuildInfo
     ([ModuleName]
      -> [ModuleName]
      -> Maybe Language
      -> [Language]
      -> [Extension]
      -> [Extension]
      -> [Extension]
      -> [FilePath]
      -> [FilePath]
      -> [FilePath]
      -> [FilePath]
      -> [FilePath]
      -> [FilePath]
      -> [FilePath]
      -> [FilePath]
      -> [FilePath]
      -> [FilePath]
      -> PerCompilerFlavor [FilePath]
      -> PerCompilerFlavor [FilePath]
      -> PerCompilerFlavor [FilePath]
      -> PerCompilerFlavor [FilePath]
      -> [(FilePath, FilePath)]
      -> [Dependency]
      -> [Mixin]
      -> BuildInfo)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
<*> FieldName
-> ([ModuleName] -> List VCat (MQuoted ModuleName) ModuleName)
-> ALens' BuildInfo [ModuleName]
-> g BuildInfo [ModuleName]
forall (g :: * -> * -> *) b a s.
(FieldGrammar g, Parsec b, Pretty b, Monoid a, Newtype a b) =>
FieldName -> (a -> b) -> ALens' s a -> g s a
monoidalFieldAla "other-modules"        (VCat
-> (ModuleName -> MQuoted ModuleName)
-> [ModuleName]
-> List VCat (MQuoted ModuleName) ModuleName
forall sep a b. sep -> (a -> b) -> [a] -> List sep b a
alaList' VCat
VCat ModuleName -> MQuoted ModuleName
forall a. a -> MQuoted a
MQuoted)       ALens' BuildInfo [ModuleName]
forall a. HasBuildInfo a => Lens' a [ModuleName]
L.otherModules
    g BuildInfo
  ([ModuleName]
   -> [ModuleName]
   -> Maybe Language
   -> [Language]
   -> [Extension]
   -> [Extension]
   -> [Extension]
   -> [FilePath]
   -> [FilePath]
   -> [FilePath]
   -> [FilePath]
   -> [FilePath]
   -> [FilePath]
   -> [FilePath]
   -> [FilePath]
   -> [FilePath]
   -> [FilePath]
   -> PerCompilerFlavor [FilePath]
   -> PerCompilerFlavor [FilePath]
   -> PerCompilerFlavor [FilePath]
   -> PerCompilerFlavor [FilePath]
   -> [(FilePath, FilePath)]
   -> [Dependency]
   -> [Mixin]
   -> BuildInfo)
-> g BuildInfo [ModuleName]
-> g BuildInfo
     ([ModuleName]
      -> Maybe Language
      -> [Language]
      -> [Extension]
      -> [Extension]
      -> [Extension]
      -> [FilePath]
      -> [FilePath]
      -> [FilePath]
      -> [FilePath]
      -> [FilePath]
      -> [FilePath]
      -> [FilePath]
      -> [FilePath]
      -> [FilePath]
      -> [FilePath]
      -> PerCompilerFlavor [FilePath]
      -> PerCompilerFlavor [FilePath]
      -> PerCompilerFlavor [FilePath]
      -> PerCompilerFlavor [FilePath]
      -> [(FilePath, FilePath)]
      -> [Dependency]
      -> [Mixin]
      -> BuildInfo)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
<*> FieldName
-> ([ModuleName] -> List VCat (MQuoted ModuleName) ModuleName)
-> ALens' BuildInfo [ModuleName]
-> g BuildInfo [ModuleName]
forall (g :: * -> * -> *) b a s.
(FieldGrammar g, Parsec b, Pretty b, Monoid a, Newtype a b) =>
FieldName -> (a -> b) -> ALens' s a -> g s a
monoidalFieldAla "virtual-modules"      (VCat
-> (ModuleName -> MQuoted ModuleName)
-> [ModuleName]
-> List VCat (MQuoted ModuleName) ModuleName
forall sep a b. sep -> (a -> b) -> [a] -> List sep b a
alaList' VCat
VCat ModuleName -> MQuoted ModuleName
forall a. a -> MQuoted a
MQuoted)       ALens' BuildInfo [ModuleName]
forall a. HasBuildInfo a => Lens' a [ModuleName]
L.virtualModules
        g BuildInfo [ModuleName]
-> (g BuildInfo [ModuleName] -> g BuildInfo [ModuleName])
-> g BuildInfo [ModuleName]
forall a b. a -> (a -> b) -> b
^^^ CabalSpecVersion
-> [ModuleName]
-> g BuildInfo [ModuleName]
-> g BuildInfo [ModuleName]
forall (g :: * -> * -> *) a s.
FieldGrammar g =>
CabalSpecVersion -> a -> g s a -> g s a
availableSince CabalSpecVersion
CabalSpecV2_2 []
    g BuildInfo
  ([ModuleName]
   -> Maybe Language
   -> [Language]
   -> [Extension]
   -> [Extension]
   -> [Extension]
   -> [FilePath]
   -> [FilePath]
   -> [FilePath]
   -> [FilePath]
   -> [FilePath]
   -> [FilePath]
   -> [FilePath]
   -> [FilePath]
   -> [FilePath]
   -> [FilePath]
   -> PerCompilerFlavor [FilePath]
   -> PerCompilerFlavor [FilePath]
   -> PerCompilerFlavor [FilePath]
   -> PerCompilerFlavor [FilePath]
   -> [(FilePath, FilePath)]
   -> [Dependency]
   -> [Mixin]
   -> BuildInfo)
-> g BuildInfo [ModuleName]
-> g BuildInfo
     (Maybe Language
      -> [Language]
      -> [Extension]
      -> [Extension]
      -> [Extension]
      -> [FilePath]
      -> [FilePath]
      -> [FilePath]
      -> [FilePath]
      -> [FilePath]
      -> [FilePath]
      -> [FilePath]
      -> [FilePath]
      -> [FilePath]
      -> [FilePath]
      -> PerCompilerFlavor [FilePath]
      -> PerCompilerFlavor [FilePath]
      -> PerCompilerFlavor [FilePath]
      -> PerCompilerFlavor [FilePath]
      -> [(FilePath, FilePath)]
      -> [Dependency]
      -> [Mixin]
      -> BuildInfo)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
<*> FieldName
-> ([ModuleName] -> List VCat (MQuoted ModuleName) ModuleName)
-> ALens' BuildInfo [ModuleName]
-> g BuildInfo [ModuleName]
forall (g :: * -> * -> *) b a s.
(FieldGrammar g, Parsec b, Pretty b, Monoid a, Newtype a b) =>
FieldName -> (a -> b) -> ALens' s a -> g s a
monoidalFieldAla "autogen-modules"      (VCat
-> (ModuleName -> MQuoted ModuleName)
-> [ModuleName]
-> List VCat (MQuoted ModuleName) ModuleName
forall sep a b. sep -> (a -> b) -> [a] -> List sep b a
alaList' VCat
VCat ModuleName -> MQuoted ModuleName
forall a. a -> MQuoted a
MQuoted)       ALens' BuildInfo [ModuleName]
forall a. HasBuildInfo a => Lens' a [ModuleName]
L.autogenModules
    g BuildInfo
  (Maybe Language
   -> [Language]
   -> [Extension]
   -> [Extension]
   -> [Extension]
   -> [FilePath]
   -> [FilePath]
   -> [FilePath]
   -> [FilePath]
   -> [FilePath]
   -> [FilePath]
   -> [FilePath]
   -> [FilePath]
   -> [FilePath]
   -> [FilePath]
   -> PerCompilerFlavor [FilePath]
   -> PerCompilerFlavor [FilePath]
   -> PerCompilerFlavor [FilePath]
   -> PerCompilerFlavor [FilePath]
   -> [(FilePath, FilePath)]
   -> [Dependency]
   -> [Mixin]
   -> BuildInfo)
-> g BuildInfo (Maybe Language)
-> g BuildInfo
     ([Language]
      -> [Extension]
      -> [Extension]
      -> [Extension]
      -> [FilePath]
      -> [FilePath]
      -> [FilePath]
      -> [FilePath]
      -> [FilePath]
      -> [FilePath]
      -> [FilePath]
      -> [FilePath]
      -> [FilePath]
      -> [FilePath]
      -> PerCompilerFlavor [FilePath]
      -> PerCompilerFlavor [FilePath]
      -> PerCompilerFlavor [FilePath]
      -> PerCompilerFlavor [FilePath]
      -> [(FilePath, FilePath)]
      -> [Dependency]
      -> [Mixin]
      -> BuildInfo)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
<*> FieldName
-> (Language -> MQuoted Language)
-> ALens' BuildInfo (Maybe Language)
-> g BuildInfo (Maybe Language)
forall (g :: * -> * -> *) b a s.
(FieldGrammar g, Parsec b, Pretty b, Newtype a b) =>
FieldName -> (a -> b) -> ALens' s (Maybe a) -> g s (Maybe a)
optionalFieldAla "default-language"     Language -> MQuoted Language
forall a. a -> MQuoted a
MQuoted                       ALens' BuildInfo (Maybe Language)
forall a. HasBuildInfo a => Lens' a (Maybe Language)
L.defaultLanguage
    g BuildInfo
  ([Language]
   -> [Extension]
   -> [Extension]
   -> [Extension]
   -> [FilePath]
   -> [FilePath]
   -> [FilePath]
   -> [FilePath]
   -> [FilePath]
   -> [FilePath]
   -> [FilePath]
   -> [FilePath]
   -> [FilePath]
   -> [FilePath]
   -> PerCompilerFlavor [FilePath]
   -> PerCompilerFlavor [FilePath]
   -> PerCompilerFlavor [FilePath]
   -> PerCompilerFlavor [FilePath]
   -> [(FilePath, FilePath)]
   -> [Dependency]
   -> [Mixin]
   -> BuildInfo)
-> g BuildInfo [Language]
-> g BuildInfo
     ([Extension]
      -> [Extension]
      -> [Extension]
      -> [FilePath]
      -> [FilePath]
      -> [FilePath]
      -> [FilePath]
      -> [FilePath]
      -> [FilePath]
      -> [FilePath]
      -> [FilePath]
      -> [FilePath]
      -> [FilePath]
      -> PerCompilerFlavor [FilePath]
      -> PerCompilerFlavor [FilePath]
      -> PerCompilerFlavor [FilePath]
      -> PerCompilerFlavor [FilePath]
      -> [(FilePath, FilePath)]
      -> [Dependency]
      -> [Mixin]
      -> BuildInfo)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
<*> FieldName
-> ([Language] -> List FSep (MQuoted Language) Language)
-> ALens' BuildInfo [Language]
-> g BuildInfo [Language]
forall (g :: * -> * -> *) b a s.
(FieldGrammar g, Parsec b, Pretty b, Monoid a, Newtype a b) =>
FieldName -> (a -> b) -> ALens' s a -> g s a
monoidalFieldAla "other-languages"      (FSep
-> (Language -> MQuoted Language)
-> [Language]
-> List FSep (MQuoted Language) Language
forall sep a b. sep -> (a -> b) -> [a] -> List sep b a
alaList' FSep
FSep Language -> MQuoted Language
forall a. a -> MQuoted a
MQuoted)       ALens' BuildInfo [Language]
forall a. HasBuildInfo a => Lens' a [Language]
L.otherLanguages
    g BuildInfo
  ([Extension]
   -> [Extension]
   -> [Extension]
   -> [FilePath]
   -> [FilePath]
   -> [FilePath]
   -> [FilePath]
   -> [FilePath]
   -> [FilePath]
   -> [FilePath]
   -> [FilePath]
   -> [FilePath]
   -> [FilePath]
   -> PerCompilerFlavor [FilePath]
   -> PerCompilerFlavor [FilePath]
   -> PerCompilerFlavor [FilePath]
   -> PerCompilerFlavor [FilePath]
   -> [(FilePath, FilePath)]
   -> [Dependency]
   -> [Mixin]
   -> BuildInfo)
-> g BuildInfo [Extension]
-> g BuildInfo
     ([Extension]
      -> [Extension]
      -> [FilePath]
      -> [FilePath]
      -> [FilePath]
      -> [FilePath]
      -> [FilePath]
      -> [FilePath]
      -> [FilePath]
      -> [FilePath]
      -> [FilePath]
      -> [FilePath]
      -> PerCompilerFlavor [FilePath]
      -> PerCompilerFlavor [FilePath]
      -> PerCompilerFlavor [FilePath]
      -> PerCompilerFlavor [FilePath]
      -> [(FilePath, FilePath)]
      -> [Dependency]
      -> [Mixin]
      -> BuildInfo)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
<*> FieldName
-> ([Extension] -> List FSep (MQuoted Extension) Extension)
-> ALens' BuildInfo [Extension]
-> g BuildInfo [Extension]
forall (g :: * -> * -> *) b a s.
(FieldGrammar g, Parsec b, Pretty b, Monoid a, Newtype a b) =>
FieldName -> (a -> b) -> ALens' s a -> g s a
monoidalFieldAla "default-extensions"   (FSep
-> (Extension -> MQuoted Extension)
-> [Extension]
-> List FSep (MQuoted Extension) Extension
forall sep a b. sep -> (a -> b) -> [a] -> List sep b a
alaList' FSep
FSep Extension -> MQuoted Extension
forall a. a -> MQuoted a
MQuoted)       ALens' BuildInfo [Extension]
forall a. HasBuildInfo a => Lens' a [Extension]
L.defaultExtensions
    g BuildInfo
  ([Extension]
   -> [Extension]
   -> [FilePath]
   -> [FilePath]
   -> [FilePath]
   -> [FilePath]
   -> [FilePath]
   -> [FilePath]
   -> [FilePath]
   -> [FilePath]
   -> [FilePath]
   -> [FilePath]
   -> PerCompilerFlavor [FilePath]
   -> PerCompilerFlavor [FilePath]
   -> PerCompilerFlavor [FilePath]
   -> PerCompilerFlavor [FilePath]
   -> [(FilePath, FilePath)]
   -> [Dependency]
   -> [Mixin]
   -> BuildInfo)
-> g BuildInfo [Extension]
-> g BuildInfo
     ([Extension]
      -> [FilePath]
      -> [FilePath]
      -> [FilePath]
      -> [FilePath]
      -> [FilePath]
      -> [FilePath]
      -> [FilePath]
      -> [FilePath]
      -> [FilePath]
      -> [FilePath]
      -> PerCompilerFlavor [FilePath]
      -> PerCompilerFlavor [FilePath]
      -> PerCompilerFlavor [FilePath]
      -> PerCompilerFlavor [FilePath]
      -> [(FilePath, FilePath)]
      -> [Dependency]
      -> [Mixin]
      -> BuildInfo)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
<*> FieldName
-> ([Extension] -> List FSep (MQuoted Extension) Extension)
-> ALens' BuildInfo [Extension]
-> g BuildInfo [Extension]
forall (g :: * -> * -> *) b a s.
(FieldGrammar g, Parsec b, Pretty b, Monoid a, Newtype a b) =>
FieldName -> (a -> b) -> ALens' s a -> g s a
monoidalFieldAla "other-extensions"     (FSep
-> (Extension -> MQuoted Extension)
-> [Extension]
-> List FSep (MQuoted Extension) Extension
forall sep a b. sep -> (a -> b) -> [a] -> List sep b a
alaList' FSep
FSep Extension -> MQuoted Extension
forall a. a -> MQuoted a
MQuoted)       ALens' BuildInfo [Extension]
forall a. HasBuildInfo a => Lens' a [Extension]
L.otherExtensions
    g BuildInfo
  ([Extension]
   -> [FilePath]
   -> [FilePath]
   -> [FilePath]
   -> [FilePath]
   -> [FilePath]
   -> [FilePath]
   -> [FilePath]
   -> [FilePath]
   -> [FilePath]
   -> [FilePath]
   -> PerCompilerFlavor [FilePath]
   -> PerCompilerFlavor [FilePath]
   -> PerCompilerFlavor [FilePath]
   -> PerCompilerFlavor [FilePath]
   -> [(FilePath, FilePath)]
   -> [Dependency]
   -> [Mixin]
   -> BuildInfo)
-> g BuildInfo [Extension]
-> g BuildInfo
     ([FilePath]
      -> [FilePath]
      -> [FilePath]
      -> [FilePath]
      -> [FilePath]
      -> [FilePath]
      -> [FilePath]
      -> [FilePath]
      -> [FilePath]
      -> [FilePath]
      -> PerCompilerFlavor [FilePath]
      -> PerCompilerFlavor [FilePath]
      -> PerCompilerFlavor [FilePath]
      -> PerCompilerFlavor [FilePath]
      -> [(FilePath, FilePath)]
      -> [Dependency]
      -> [Mixin]
      -> BuildInfo)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
<*> FieldName
-> ([Extension] -> List FSep (MQuoted Extension) Extension)
-> ALens' BuildInfo [Extension]
-> g BuildInfo [Extension]
forall (g :: * -> * -> *) b a s.
(FieldGrammar g, Parsec b, Pretty b, Monoid a, Newtype a b) =>
FieldName -> (a -> b) -> ALens' s a -> g s a
monoidalFieldAla "extensions"           (FSep
-> (Extension -> MQuoted Extension)
-> [Extension]
-> List FSep (MQuoted Extension) Extension
forall sep a b. sep -> (a -> b) -> [a] -> List sep b a
alaList' FSep
FSep Extension -> MQuoted Extension
forall a. a -> MQuoted a
MQuoted)       ALens' BuildInfo [Extension]
forall a. HasBuildInfo a => Lens' a [Extension]
L.oldExtensions
        g BuildInfo [Extension]
-> (g BuildInfo [Extension] -> g BuildInfo [Extension])
-> g BuildInfo [Extension]
forall a b. a -> (a -> b) -> b
^^^ CabalSpecVersion
-> FilePath -> g BuildInfo [Extension] -> g BuildInfo [Extension]
forall (g :: * -> * -> *) s a.
FieldGrammar g =>
CabalSpecVersion -> FilePath -> g s a -> g s a
deprecatedSince CabalSpecVersion
CabalSpecV1_12
            "Please use 'default-extensions' or 'other-extensions' fields."
        g BuildInfo [Extension]
-> (g BuildInfo [Extension] -> g BuildInfo [Extension])
-> g BuildInfo [Extension]
forall a b. a -> (a -> b) -> b
^^^ CabalSpecVersion
-> FilePath -> g BuildInfo [Extension] -> g BuildInfo [Extension]
forall (g :: * -> * -> *) s a.
FieldGrammar g =>
CabalSpecVersion -> FilePath -> g s a -> g s a
removedIn CabalSpecVersion
CabalSpecV3_0
            "Please use 'default-extensions' or 'other-extensions' fields."
    g BuildInfo
  ([FilePath]
   -> [FilePath]
   -> [FilePath]
   -> [FilePath]
   -> [FilePath]
   -> [FilePath]
   -> [FilePath]
   -> [FilePath]
   -> [FilePath]
   -> [FilePath]
   -> PerCompilerFlavor [FilePath]
   -> PerCompilerFlavor [FilePath]
   -> PerCompilerFlavor [FilePath]
   -> PerCompilerFlavor [FilePath]
   -> [(FilePath, FilePath)]
   -> [Dependency]
   -> [Mixin]
   -> BuildInfo)
-> g BuildInfo [FilePath]
-> g BuildInfo
     ([FilePath]
      -> [FilePath]
      -> [FilePath]
      -> [FilePath]
      -> [FilePath]
      -> [FilePath]
      -> [FilePath]
      -> [FilePath]
      -> [FilePath]
      -> PerCompilerFlavor [FilePath]
      -> PerCompilerFlavor [FilePath]
      -> PerCompilerFlavor [FilePath]
      -> PerCompilerFlavor [FilePath]
      -> [(FilePath, FilePath)]
      -> [Dependency]
      -> [Mixin]
      -> BuildInfo)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
<*> FieldName
-> ([FilePath] -> List VCat Token FilePath)
-> ALens' BuildInfo [FilePath]
-> g BuildInfo [FilePath]
forall (g :: * -> * -> *) b a s.
(FieldGrammar g, Parsec b, Pretty b, Monoid a, Newtype a b) =>
FieldName -> (a -> b) -> ALens' s a -> g s a
monoidalFieldAla "extra-libraries"      (VCat
-> (FilePath -> Token) -> [FilePath] -> List VCat Token FilePath
forall sep a b. sep -> (a -> b) -> [a] -> List sep b a
alaList' VCat
VCat FilePath -> Token
Token)         ALens' BuildInfo [FilePath]
forall a. HasBuildInfo a => Lens' a [FilePath]
L.extraLibs
    g BuildInfo
  ([FilePath]
   -> [FilePath]
   -> [FilePath]
   -> [FilePath]
   -> [FilePath]
   -> [FilePath]
   -> [FilePath]
   -> [FilePath]
   -> [FilePath]
   -> PerCompilerFlavor [FilePath]
   -> PerCompilerFlavor [FilePath]
   -> PerCompilerFlavor [FilePath]
   -> PerCompilerFlavor [FilePath]
   -> [(FilePath, FilePath)]
   -> [Dependency]
   -> [Mixin]
   -> BuildInfo)
-> g BuildInfo [FilePath]
-> g BuildInfo
     ([FilePath]
      -> [FilePath]
      -> [FilePath]
      -> [FilePath]
      -> [FilePath]
      -> [FilePath]
      -> [FilePath]
      -> [FilePath]
      -> PerCompilerFlavor [FilePath]
      -> PerCompilerFlavor [FilePath]
      -> PerCompilerFlavor [FilePath]
      -> PerCompilerFlavor [FilePath]
      -> [(FilePath, FilePath)]
      -> [Dependency]
      -> [Mixin]
      -> BuildInfo)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
<*> FieldName
-> ([FilePath] -> List VCat Token FilePath)
-> ALens' BuildInfo [FilePath]
-> g BuildInfo [FilePath]
forall (g :: * -> * -> *) b a s.
(FieldGrammar g, Parsec b, Pretty b, Monoid a, Newtype a b) =>
FieldName -> (a -> b) -> ALens' s a -> g s a
monoidalFieldAla "extra-ghci-libraries" (VCat
-> (FilePath -> Token) -> [FilePath] -> List VCat Token FilePath
forall sep a b. sep -> (a -> b) -> [a] -> List sep b a
alaList' VCat
VCat FilePath -> Token
Token)         ALens' BuildInfo [FilePath]
forall a. HasBuildInfo a => Lens' a [FilePath]
L.extraGHCiLibs
    g BuildInfo
  ([FilePath]
   -> [FilePath]
   -> [FilePath]
   -> [FilePath]
   -> [FilePath]
   -> [FilePath]
   -> [FilePath]
   -> [FilePath]
   -> PerCompilerFlavor [FilePath]
   -> PerCompilerFlavor [FilePath]
   -> PerCompilerFlavor [FilePath]
   -> PerCompilerFlavor [FilePath]
   -> [(FilePath, FilePath)]
   -> [Dependency]
   -> [Mixin]
   -> BuildInfo)
-> g BuildInfo [FilePath]
-> g BuildInfo
     ([FilePath]
      -> [FilePath]
      -> [FilePath]
      -> [FilePath]
      -> [FilePath]
      -> [FilePath]
      -> [FilePath]
      -> PerCompilerFlavor [FilePath]
      -> PerCompilerFlavor [FilePath]
      -> PerCompilerFlavor [FilePath]
      -> PerCompilerFlavor [FilePath]
      -> [(FilePath, FilePath)]
      -> [Dependency]
      -> [Mixin]
      -> BuildInfo)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
<*> FieldName
-> ([FilePath] -> List VCat Token FilePath)
-> ALens' BuildInfo [FilePath]
-> g BuildInfo [FilePath]
forall (g :: * -> * -> *) b a s.
(FieldGrammar g, Parsec b, Pretty b, Monoid a, Newtype a b) =>
FieldName -> (a -> b) -> ALens' s a -> g s a
monoidalFieldAla "extra-bundled-libraries" (VCat
-> (FilePath -> Token) -> [FilePath] -> List VCat Token FilePath
forall sep a b. sep -> (a -> b) -> [a] -> List sep b a
alaList' VCat
VCat FilePath -> Token
Token)      ALens' BuildInfo [FilePath]
forall a. HasBuildInfo a => Lens' a [FilePath]
L.extraBundledLibs
    g BuildInfo
  ([FilePath]
   -> [FilePath]
   -> [FilePath]
   -> [FilePath]
   -> [FilePath]
   -> [FilePath]
   -> [FilePath]
   -> PerCompilerFlavor [FilePath]
   -> PerCompilerFlavor [FilePath]
   -> PerCompilerFlavor [FilePath]
   -> PerCompilerFlavor [FilePath]
   -> [(FilePath, FilePath)]
   -> [Dependency]
   -> [Mixin]
   -> BuildInfo)
-> g BuildInfo [FilePath]
-> g BuildInfo
     ([FilePath]
      -> [FilePath]
      -> [FilePath]
      -> [FilePath]
      -> [FilePath]
      -> [FilePath]
      -> PerCompilerFlavor [FilePath]
      -> PerCompilerFlavor [FilePath]
      -> PerCompilerFlavor [FilePath]
      -> PerCompilerFlavor [FilePath]
      -> [(FilePath, FilePath)]
      -> [Dependency]
      -> [Mixin]
      -> BuildInfo)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
<*> FieldName
-> ([FilePath] -> List VCat Token FilePath)
-> ALens' BuildInfo [FilePath]
-> g BuildInfo [FilePath]
forall (g :: * -> * -> *) b a s.
(FieldGrammar g, Parsec b, Pretty b, Monoid a, Newtype a b) =>
FieldName -> (a -> b) -> ALens' s a -> g s a
monoidalFieldAla "extra-library-flavours" (VCat
-> (FilePath -> Token) -> [FilePath] -> List VCat Token FilePath
forall sep a b. sep -> (a -> b) -> [a] -> List sep b a
alaList' VCat
VCat FilePath -> Token
Token)       ALens' BuildInfo [FilePath]
forall a. HasBuildInfo a => Lens' a [FilePath]
L.extraLibFlavours
    g BuildInfo
  ([FilePath]
   -> [FilePath]
   -> [FilePath]
   -> [FilePath]
   -> [FilePath]
   -> [FilePath]
   -> PerCompilerFlavor [FilePath]
   -> PerCompilerFlavor [FilePath]
   -> PerCompilerFlavor [FilePath]
   -> PerCompilerFlavor [FilePath]
   -> [(FilePath, FilePath)]
   -> [Dependency]
   -> [Mixin]
   -> BuildInfo)
-> g BuildInfo [FilePath]
-> g BuildInfo
     ([FilePath]
      -> [FilePath]
      -> [FilePath]
      -> [FilePath]
      -> [FilePath]
      -> PerCompilerFlavor [FilePath]
      -> PerCompilerFlavor [FilePath]
      -> PerCompilerFlavor [FilePath]
      -> PerCompilerFlavor [FilePath]
      -> [(FilePath, FilePath)]
      -> [Dependency]
      -> [Mixin]
      -> BuildInfo)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
<*> FieldName
-> ([FilePath] -> List VCat Token FilePath)
-> ALens' BuildInfo [FilePath]
-> g BuildInfo [FilePath]
forall (g :: * -> * -> *) b a s.
(FieldGrammar g, Parsec b, Pretty b, Monoid a, Newtype a b) =>
FieldName -> (a -> b) -> ALens' s a -> g s a
monoidalFieldAla "extra-dynamic-library-flavours" (VCat
-> (FilePath -> Token) -> [FilePath] -> List VCat Token FilePath
forall sep a b. sep -> (a -> b) -> [a] -> List sep b a
alaList' VCat
VCat FilePath -> Token
Token) ALens' BuildInfo [FilePath]
forall a. HasBuildInfo a => Lens' a [FilePath]
L.extraDynLibFlavours
        g BuildInfo [FilePath]
-> (g BuildInfo [FilePath] -> g BuildInfo [FilePath])
-> g BuildInfo [FilePath]
forall a b. a -> (a -> b) -> b
^^^ CabalSpecVersion
-> [FilePath] -> g BuildInfo [FilePath] -> g BuildInfo [FilePath]
forall (g :: * -> * -> *) a s.
FieldGrammar g =>
CabalSpecVersion -> a -> g s a -> g s a
availableSince CabalSpecVersion
CabalSpecV3_0 []
    g BuildInfo
  ([FilePath]
   -> [FilePath]
   -> [FilePath]
   -> [FilePath]
   -> [FilePath]
   -> PerCompilerFlavor [FilePath]
   -> PerCompilerFlavor [FilePath]
   -> PerCompilerFlavor [FilePath]
   -> PerCompilerFlavor [FilePath]
   -> [(FilePath, FilePath)]
   -> [Dependency]
   -> [Mixin]
   -> BuildInfo)
-> g BuildInfo [FilePath]
-> g BuildInfo
     ([FilePath]
      -> [FilePath]
      -> [FilePath]
      -> [FilePath]
      -> PerCompilerFlavor [FilePath]
      -> PerCompilerFlavor [FilePath]
      -> PerCompilerFlavor [FilePath]
      -> PerCompilerFlavor [FilePath]
      -> [(FilePath, FilePath)]
      -> [Dependency]
      -> [Mixin]
      -> BuildInfo)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
<*> FieldName
-> ([FilePath] -> List FSep FilePathNT FilePath)
-> ALens' BuildInfo [FilePath]
-> g BuildInfo [FilePath]
forall (g :: * -> * -> *) b a s.
(FieldGrammar g, Parsec b, Pretty b, Monoid a, Newtype a b) =>
FieldName -> (a -> b) -> ALens' s a -> g s a
monoidalFieldAla "extra-lib-dirs"       (FSep
-> (FilePath -> FilePathNT)
-> [FilePath]
-> List FSep FilePathNT FilePath
forall sep a b. sep -> (a -> b) -> [a] -> List sep b a
alaList' FSep
FSep FilePath -> FilePathNT
FilePathNT)    ALens' BuildInfo [FilePath]
forall a. HasBuildInfo a => Lens' a [FilePath]
L.extraLibDirs
    g BuildInfo
  ([FilePath]
   -> [FilePath]
   -> [FilePath]
   -> [FilePath]
   -> PerCompilerFlavor [FilePath]
   -> PerCompilerFlavor [FilePath]
   -> PerCompilerFlavor [FilePath]
   -> PerCompilerFlavor [FilePath]
   -> [(FilePath, FilePath)]
   -> [Dependency]
   -> [Mixin]
   -> BuildInfo)
-> g BuildInfo [FilePath]
-> g BuildInfo
     ([FilePath]
      -> [FilePath]
      -> [FilePath]
      -> PerCompilerFlavor [FilePath]
      -> PerCompilerFlavor [FilePath]
      -> PerCompilerFlavor [FilePath]
      -> PerCompilerFlavor [FilePath]
      -> [(FilePath, FilePath)]
      -> [Dependency]
      -> [Mixin]
      -> BuildInfo)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
<*> FieldName
-> ([FilePath] -> List FSep FilePathNT FilePath)
-> ALens' BuildInfo [FilePath]
-> g BuildInfo [FilePath]
forall (g :: * -> * -> *) b a s.
(FieldGrammar g, Parsec b, Pretty b, Monoid a, Newtype a b) =>
FieldName -> (a -> b) -> ALens' s a -> g s a
monoidalFieldAla "include-dirs"         (FSep
-> (FilePath -> FilePathNT)
-> [FilePath]
-> List FSep FilePathNT FilePath
forall sep a b. sep -> (a -> b) -> [a] -> List sep b a
alaList' FSep
FSep FilePath -> FilePathNT
FilePathNT)    ALens' BuildInfo [FilePath]
forall a. HasBuildInfo a => Lens' a [FilePath]
L.includeDirs
    g BuildInfo
  ([FilePath]
   -> [FilePath]
   -> [FilePath]
   -> PerCompilerFlavor [FilePath]
   -> PerCompilerFlavor [FilePath]
   -> PerCompilerFlavor [FilePath]
   -> PerCompilerFlavor [FilePath]
   -> [(FilePath, FilePath)]
   -> [Dependency]
   -> [Mixin]
   -> BuildInfo)
-> g BuildInfo [FilePath]
-> g BuildInfo
     ([FilePath]
      -> [FilePath]
      -> PerCompilerFlavor [FilePath]
      -> PerCompilerFlavor [FilePath]
      -> PerCompilerFlavor [FilePath]
      -> PerCompilerFlavor [FilePath]
      -> [(FilePath, FilePath)]
      -> [Dependency]
      -> [Mixin]
      -> BuildInfo)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
<*> FieldName
-> ([FilePath] -> List FSep FilePathNT FilePath)
-> ALens' BuildInfo [FilePath]
-> g BuildInfo [FilePath]
forall (g :: * -> * -> *) b a s.
(FieldGrammar g, Parsec b, Pretty b, Monoid a, Newtype a b) =>
FieldName -> (a -> b) -> ALens' s a -> g s a
monoidalFieldAla "includes"             (FSep
-> (FilePath -> FilePathNT)
-> [FilePath]
-> List FSep FilePathNT FilePath
forall sep a b. sep -> (a -> b) -> [a] -> List sep b a
alaList' FSep
FSep FilePath -> FilePathNT
FilePathNT)    ALens' BuildInfo [FilePath]
forall a. HasBuildInfo a => Lens' a [FilePath]
L.includes
    g BuildInfo
  ([FilePath]
   -> [FilePath]
   -> PerCompilerFlavor [FilePath]
   -> PerCompilerFlavor [FilePath]
   -> PerCompilerFlavor [FilePath]
   -> PerCompilerFlavor [FilePath]
   -> [(FilePath, FilePath)]
   -> [Dependency]
   -> [Mixin]
   -> BuildInfo)
-> g BuildInfo [FilePath]
-> g BuildInfo
     ([FilePath]
      -> PerCompilerFlavor [FilePath]
      -> PerCompilerFlavor [FilePath]
      -> PerCompilerFlavor [FilePath]
      -> PerCompilerFlavor [FilePath]
      -> [(FilePath, FilePath)]
      -> [Dependency]
      -> [Mixin]
      -> BuildInfo)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
<*> FieldName
-> ([FilePath] -> List FSep FilePathNT FilePath)
-> ALens' BuildInfo [FilePath]
-> g BuildInfo [FilePath]
forall (g :: * -> * -> *) b a s.
(FieldGrammar g, Parsec b, Pretty b, Monoid a, Newtype a b) =>
FieldName -> (a -> b) -> ALens' s a -> g s a
monoidalFieldAla "autogen-includes"     (FSep
-> (FilePath -> FilePathNT)
-> [FilePath]
-> List FSep FilePathNT FilePath
forall sep a b. sep -> (a -> b) -> [a] -> List sep b a
alaList' FSep
FSep FilePath -> FilePathNT
FilePathNT)    ALens' BuildInfo [FilePath]
forall a. HasBuildInfo a => Lens' a [FilePath]
L.autogenIncludes
        g BuildInfo [FilePath]
-> (g BuildInfo [FilePath] -> g BuildInfo [FilePath])
-> g BuildInfo [FilePath]
forall a b. a -> (a -> b) -> b
^^^ CabalSpecVersion
-> [FilePath] -> g BuildInfo [FilePath] -> g BuildInfo [FilePath]
forall (g :: * -> * -> *) a s.
FieldGrammar g =>
CabalSpecVersion -> a -> g s a -> g s a
availableSince CabalSpecVersion
CabalSpecV3_0 []
    g BuildInfo
  ([FilePath]
   -> PerCompilerFlavor [FilePath]
   -> PerCompilerFlavor [FilePath]
   -> PerCompilerFlavor [FilePath]
   -> PerCompilerFlavor [FilePath]
   -> [(FilePath, FilePath)]
   -> [Dependency]
   -> [Mixin]
   -> BuildInfo)
-> g BuildInfo [FilePath]
-> g BuildInfo
     (PerCompilerFlavor [FilePath]
      -> PerCompilerFlavor [FilePath]
      -> PerCompilerFlavor [FilePath]
      -> PerCompilerFlavor [FilePath]
      -> [(FilePath, FilePath)]
      -> [Dependency]
      -> [Mixin]
      -> BuildInfo)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
<*> FieldName
-> ([FilePath] -> List FSep FilePathNT FilePath)
-> ALens' BuildInfo [FilePath]
-> g BuildInfo [FilePath]
forall (g :: * -> * -> *) b a s.
(FieldGrammar g, Parsec b, Pretty b, Monoid a, Newtype a b) =>
FieldName -> (a -> b) -> ALens' s a -> g s a
monoidalFieldAla "install-includes"     (FSep
-> (FilePath -> FilePathNT)
-> [FilePath]
-> List FSep FilePathNT FilePath
forall sep a b. sep -> (a -> b) -> [a] -> List sep b a
alaList' FSep
FSep FilePath -> FilePathNT
FilePathNT)    ALens' BuildInfo [FilePath]
forall a. HasBuildInfo a => Lens' a [FilePath]
L.installIncludes
    g BuildInfo
  (PerCompilerFlavor [FilePath]
   -> PerCompilerFlavor [FilePath]
   -> PerCompilerFlavor [FilePath]
   -> PerCompilerFlavor [FilePath]
   -> [(FilePath, FilePath)]
   -> [Dependency]
   -> [Mixin]
   -> BuildInfo)
-> g BuildInfo (PerCompilerFlavor [FilePath])
-> g BuildInfo
     (PerCompilerFlavor [FilePath]
      -> PerCompilerFlavor [FilePath]
      -> PerCompilerFlavor [FilePath]
      -> [(FilePath, FilePath)]
      -> [Dependency]
      -> [Mixin]
      -> BuildInfo)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
<*> g BuildInfo (PerCompilerFlavor [FilePath])
forall (g :: * -> * -> *).
(FieldGrammar g, Applicative (g BuildInfo)) =>
g BuildInfo (PerCompilerFlavor [FilePath])
optionsFieldGrammar
    g BuildInfo
  (PerCompilerFlavor [FilePath]
   -> PerCompilerFlavor [FilePath]
   -> PerCompilerFlavor [FilePath]
   -> [(FilePath, FilePath)]
   -> [Dependency]
   -> [Mixin]
   -> BuildInfo)
-> g BuildInfo (PerCompilerFlavor [FilePath])
-> g BuildInfo
     (PerCompilerFlavor [FilePath]
      -> PerCompilerFlavor [FilePath]
      -> [(FilePath, FilePath)]
      -> [Dependency]
      -> [Mixin]
      -> BuildInfo)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
<*> g BuildInfo (PerCompilerFlavor [FilePath])
forall (g :: * -> * -> *).
(FieldGrammar g, Applicative (g BuildInfo)) =>
g BuildInfo (PerCompilerFlavor [FilePath])
profOptionsFieldGrammar
    g BuildInfo
  (PerCompilerFlavor [FilePath]
   -> PerCompilerFlavor [FilePath]
   -> [(FilePath, FilePath)]
   -> [Dependency]
   -> [Mixin]
   -> BuildInfo)
-> g BuildInfo (PerCompilerFlavor [FilePath])
-> g BuildInfo
     (PerCompilerFlavor [FilePath]
      -> [(FilePath, FilePath)] -> [Dependency] -> [Mixin] -> BuildInfo)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
<*> g BuildInfo (PerCompilerFlavor [FilePath])
forall (g :: * -> * -> *).
(FieldGrammar g, Applicative (g BuildInfo)) =>
g BuildInfo (PerCompilerFlavor [FilePath])
sharedOptionsFieldGrammar
    g BuildInfo
  (PerCompilerFlavor [FilePath]
   -> [(FilePath, FilePath)] -> [Dependency] -> [Mixin] -> BuildInfo)
-> g BuildInfo (PerCompilerFlavor [FilePath])
-> g BuildInfo
     ([(FilePath, FilePath)] -> [Dependency] -> [Mixin] -> BuildInfo)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
<*> PerCompilerFlavor [FilePath]
-> g BuildInfo (PerCompilerFlavor [FilePath])
forall (f :: * -> *) a. Applicative f => a -> f a
pure PerCompilerFlavor [FilePath]
forall a. Monoid a => a
mempty -- static-options ???
    g BuildInfo
  ([(FilePath, FilePath)] -> [Dependency] -> [Mixin] -> BuildInfo)
-> g BuildInfo [(FilePath, FilePath)]
-> g BuildInfo ([Dependency] -> [Mixin] -> BuildInfo)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
<*> FieldName
-> ALens' BuildInfo [(FilePath, FilePath)]
-> g BuildInfo [(FilePath, FilePath)]
forall (g :: * -> * -> *) s.
FieldGrammar g =>
FieldName
-> ALens' s [(FilePath, FilePath)] -> g s [(FilePath, FilePath)]
prefixedFields   "x-"                                                 ALens' BuildInfo [(FilePath, FilePath)]
forall a. HasBuildInfo a => Lens' a [(FilePath, FilePath)]
L.customFieldsBI
    g BuildInfo ([Dependency] -> [Mixin] -> BuildInfo)
-> g BuildInfo [Dependency] -> g BuildInfo ([Mixin] -> BuildInfo)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
<*> FieldName
-> ([Dependency]
    -> List CommaVCat (Identity Dependency) Dependency)
-> ALens' BuildInfo [Dependency]
-> g BuildInfo [Dependency]
forall (g :: * -> * -> *) b a s.
(FieldGrammar g, Parsec b, Pretty b, Monoid a, Newtype a b) =>
FieldName -> (a -> b) -> ALens' s a -> g s a
monoidalFieldAla "build-depends"        (CommaVCat
-> [Dependency] -> List CommaVCat (Identity Dependency) Dependency
forall sep a. sep -> [a] -> List sep (Identity a) a
alaList  CommaVCat
CommaVCat)          ALens' BuildInfo [Dependency]
forall a. HasBuildInfo a => Lens' a [Dependency]
L.targetBuildDepends
    g BuildInfo ([Mixin] -> BuildInfo)
-> g BuildInfo [Mixin] -> g BuildInfo BuildInfo
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
<*> FieldName
-> ([Mixin] -> List CommaVCat (Identity Mixin) Mixin)
-> ALens' BuildInfo [Mixin]
-> g BuildInfo [Mixin]
forall (g :: * -> * -> *) b a s.
(FieldGrammar g, Parsec b, Pretty b, Monoid a, Newtype a b) =>
FieldName -> (a -> b) -> ALens' s a -> g s a
monoidalFieldAla "mixins"               (CommaVCat -> [Mixin] -> List CommaVCat (Identity Mixin) Mixin
forall sep a. sep -> [a] -> List sep (Identity a) a
alaList  CommaVCat
CommaVCat)          ALens' BuildInfo [Mixin]
forall a. HasBuildInfo a => Lens' a [Mixin]
L.mixins
        g BuildInfo [Mixin]
-> (g BuildInfo [Mixin] -> g BuildInfo [Mixin])
-> g BuildInfo [Mixin]
forall a b. a -> (a -> b) -> b
^^^ CabalSpecVersion
-> [Mixin] -> g BuildInfo [Mixin] -> g BuildInfo [Mixin]
forall (g :: * -> * -> *) a s.
FieldGrammar g =>
CabalSpecVersion -> a -> g s a -> g s a
availableSince CabalSpecVersion
CabalSpecV2_0 []
{-# SPECIALIZE buildInfoFieldGrammar :: ParsecFieldGrammar' BuildInfo #-}
{-# SPECIALIZE buildInfoFieldGrammar :: PrettyFieldGrammar' BuildInfo #-}

hsSourceDirsGrammar
    :: (FieldGrammar g, Applicative (g BuildInfo))
    => g BuildInfo [FilePath]
hsSourceDirsGrammar :: g BuildInfo [FilePath]
hsSourceDirsGrammar = [FilePath] -> [FilePath] -> [FilePath]
forall a. [a] -> [a] -> [a]
(++)
    ([FilePath] -> [FilePath] -> [FilePath])
-> g BuildInfo [FilePath] -> g BuildInfo ([FilePath] -> [FilePath])
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
<$> FieldName
-> ([FilePath] -> List FSep FilePathNT FilePath)
-> ALens' BuildInfo [FilePath]
-> g BuildInfo [FilePath]
forall (g :: * -> * -> *) b a s.
(FieldGrammar g, Parsec b, Pretty b, Monoid a, Newtype a b) =>
FieldName -> (a -> b) -> ALens' s a -> g s a
monoidalFieldAla "hs-source-dirs" (FSep
-> (FilePath -> FilePathNT)
-> [FilePath]
-> List FSep FilePathNT FilePath
forall sep a b. sep -> (a -> b) -> [a] -> List sep b a
alaList' FSep
FSep FilePath -> FilePathNT
FilePathNT) ALens' BuildInfo [FilePath]
forall a. HasBuildInfo a => Lens' a [FilePath]
L.hsSourceDirs
    g BuildInfo ([FilePath] -> [FilePath])
-> g BuildInfo [FilePath] -> g BuildInfo [FilePath]
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
<*> FieldName
-> ([FilePath] -> List FSep FilePathNT FilePath)
-> ALens' BuildInfo [FilePath]
-> g BuildInfo [FilePath]
forall (g :: * -> * -> *) b a s.
(FieldGrammar g, Parsec b, Pretty b, Monoid a, Newtype a b) =>
FieldName -> (a -> b) -> ALens' s a -> g s a
monoidalFieldAla "hs-source-dir"  (FSep
-> (FilePath -> FilePathNT)
-> [FilePath]
-> List FSep FilePathNT FilePath
forall sep a b. sep -> (a -> b) -> [a] -> List sep b a
alaList' FSep
FSep FilePath -> FilePathNT
FilePathNT) ALens' BuildInfo [FilePath]
forall (f :: * -> *). Functor f => LensLike' f BuildInfo [FilePath]
wrongLens
        --- https://github.com/haskell/cabal/commit/49e3cdae3bdf21b017ccd42e66670ca402e22b44
        g BuildInfo [FilePath]
-> (g BuildInfo [FilePath] -> g BuildInfo [FilePath])
-> g BuildInfo [FilePath]
forall a b. a -> (a -> b) -> b
^^^ CabalSpecVersion
-> FilePath -> g BuildInfo [FilePath] -> g BuildInfo [FilePath]
forall (g :: * -> * -> *) s a.
FieldGrammar g =>
CabalSpecVersion -> FilePath -> g s a -> g s a
deprecatedSince CabalSpecVersion
CabalSpecV1_2 "Please use 'hs-source-dirs'"
        g BuildInfo [FilePath]
-> (g BuildInfo [FilePath] -> g BuildInfo [FilePath])
-> g BuildInfo [FilePath]
forall a b. a -> (a -> b) -> b
^^^ CabalSpecVersion
-> FilePath -> g BuildInfo [FilePath] -> g BuildInfo [FilePath]
forall (g :: * -> * -> *) s a.
FieldGrammar g =>
CabalSpecVersion -> FilePath -> g s a -> g s a
removedIn CabalSpecVersion
CabalSpecV3_0 "Please use 'hs-source-dirs' field."
  where
    -- TODO: make pretty printer aware of CabalSpecVersion
    wrongLens :: Functor f => LensLike' f BuildInfo [FilePath]
    wrongLens :: LensLike' f BuildInfo [FilePath]
wrongLens f :: [FilePath] -> f [FilePath]
f bi :: BuildInfo
bi = (\fps :: [FilePath]
fps -> ASetter BuildInfo BuildInfo [FilePath] [FilePath]
-> [FilePath] -> BuildInfo -> BuildInfo
forall s t a b. ASetter s t a b -> b -> s -> t
set ASetter BuildInfo BuildInfo [FilePath] [FilePath]
forall a. HasBuildInfo a => Lens' a [FilePath]
L.hsSourceDirs [FilePath]
fps BuildInfo
bi) ([FilePath] -> BuildInfo) -> f [FilePath] -> f BuildInfo
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
<$> [FilePath] -> f [FilePath]
f []

optionsFieldGrammar
    :: (FieldGrammar g, Applicative (g BuildInfo))
    => g BuildInfo (PerCompilerFlavor [String])
optionsFieldGrammar :: g BuildInfo (PerCompilerFlavor [FilePath])
optionsFieldGrammar = [FilePath] -> [FilePath] -> PerCompilerFlavor [FilePath]
forall v. v -> v -> PerCompilerFlavor v
PerCompilerFlavor
    ([FilePath] -> [FilePath] -> PerCompilerFlavor [FilePath])
-> g BuildInfo [FilePath]
-> g BuildInfo ([FilePath] -> PerCompilerFlavor [FilePath])
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
<$> FieldName
-> ([FilePath] -> List NoCommaFSep Token' FilePath)
-> ALens' BuildInfo [FilePath]
-> g BuildInfo [FilePath]
forall (g :: * -> * -> *) b a s.
(FieldGrammar g, Parsec b, Pretty b, Monoid a, Newtype a b) =>
FieldName -> (a -> b) -> ALens' s a -> g s a
monoidalFieldAla "ghc-options"   (NoCommaFSep
-> (FilePath -> Token')
-> [FilePath]
-> List NoCommaFSep Token' FilePath
forall sep a b. sep -> (a -> b) -> [a] -> List sep b a
alaList' NoCommaFSep
NoCommaFSep FilePath -> Token'
Token') (CompilerFlavor -> ALens' BuildInfo [FilePath]
extract CompilerFlavor
GHC)
    g BuildInfo ([FilePath] -> PerCompilerFlavor [FilePath])
-> g BuildInfo [FilePath]
-> g BuildInfo (PerCompilerFlavor [FilePath])
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
<*> FieldName
-> ([FilePath] -> List NoCommaFSep Token' FilePath)
-> ALens' BuildInfo [FilePath]
-> g BuildInfo [FilePath]
forall (g :: * -> * -> *) b a s.
(FieldGrammar g, Parsec b, Pretty b, Monoid a, Newtype a b) =>
FieldName -> (a -> b) -> ALens' s a -> g s a
monoidalFieldAla "ghcjs-options" (NoCommaFSep
-> (FilePath -> Token')
-> [FilePath]
-> List NoCommaFSep Token' FilePath
forall sep a b. sep -> (a -> b) -> [a] -> List sep b a
alaList' NoCommaFSep
NoCommaFSep FilePath -> Token'
Token') (CompilerFlavor -> ALens' BuildInfo [FilePath]
extract CompilerFlavor
GHCJS)
    -- NOTE: Hugs, NHC and JHC are not supported anymore, but these
    -- fields are kept around so that we can still parse legacy .cabal
    -- files that have them.
    g BuildInfo (PerCompilerFlavor [FilePath])
-> g BuildInfo () -> g BuildInfo (PerCompilerFlavor [FilePath])
forall (f :: * -> *) a b. Applicative f => f a -> f b -> f a
<*  FieldName -> g BuildInfo ()
forall (g :: * -> * -> *) s. FieldGrammar g => FieldName -> g s ()
knownField "jhc-options"
    g BuildInfo (PerCompilerFlavor [FilePath])
-> g BuildInfo () -> g BuildInfo (PerCompilerFlavor [FilePath])
forall (f :: * -> *) a b. Applicative f => f a -> f b -> f a
<*  FieldName -> g BuildInfo ()
forall (g :: * -> * -> *) s. FieldGrammar g => FieldName -> g s ()
knownField "hugs-options"
    g BuildInfo (PerCompilerFlavor [FilePath])
-> g BuildInfo () -> g BuildInfo (PerCompilerFlavor [FilePath])
forall (f :: * -> *) a b. Applicative f => f a -> f b -> f a
<*  FieldName -> g BuildInfo ()
forall (g :: * -> * -> *) s. FieldGrammar g => FieldName -> g s ()
knownField "nhc98-options"
  where
    extract :: CompilerFlavor -> ALens' BuildInfo [String]
    extract :: CompilerFlavor -> ALens' BuildInfo [FilePath]
extract flavor :: CompilerFlavor
flavor = LensLike
  (Pretext [FilePath] [FilePath])
  BuildInfo
  BuildInfo
  (PerCompilerFlavor [FilePath])
  (PerCompilerFlavor [FilePath])
forall a. HasBuildInfo a => Lens' a (PerCompilerFlavor [FilePath])
L.options LensLike
  (Pretext [FilePath] [FilePath])
  BuildInfo
  BuildInfo
  (PerCompilerFlavor [FilePath])
  (PerCompilerFlavor [FilePath])
-> (([FilePath] -> Pretext [FilePath] [FilePath] [FilePath])
    -> PerCompilerFlavor [FilePath]
    -> Pretext [FilePath] [FilePath] (PerCompilerFlavor [FilePath]))
-> ALens' BuildInfo [FilePath]
forall b c a. (b -> c) -> (a -> b) -> a -> c
. CompilerFlavor
-> ([FilePath] -> Pretext [FilePath] [FilePath] [FilePath])
-> PerCompilerFlavor [FilePath]
-> Pretext [FilePath] [FilePath] (PerCompilerFlavor [FilePath])
forall (f :: * -> *) v.
(Functor f, Monoid v) =>
CompilerFlavor -> LensLike' f (PerCompilerFlavor v) v
lookupLens CompilerFlavor
flavor

profOptionsFieldGrammar
    :: (FieldGrammar g, Applicative (g BuildInfo))
    => g BuildInfo (PerCompilerFlavor [String])
profOptionsFieldGrammar :: g BuildInfo (PerCompilerFlavor [FilePath])
profOptionsFieldGrammar = [FilePath] -> [FilePath] -> PerCompilerFlavor [FilePath]
forall v. v -> v -> PerCompilerFlavor v
PerCompilerFlavor
    ([FilePath] -> [FilePath] -> PerCompilerFlavor [FilePath])
-> g BuildInfo [FilePath]
-> g BuildInfo ([FilePath] -> PerCompilerFlavor [FilePath])
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
<$> FieldName
-> ([FilePath] -> List NoCommaFSep Token' FilePath)
-> ALens' BuildInfo [FilePath]
-> g BuildInfo [FilePath]
forall (g :: * -> * -> *) b a s.
(FieldGrammar g, Parsec b, Pretty b, Monoid a, Newtype a b) =>
FieldName -> (a -> b) -> ALens' s a -> g s a
monoidalFieldAla "ghc-prof-options"   (NoCommaFSep
-> (FilePath -> Token')
-> [FilePath]
-> List NoCommaFSep Token' FilePath
forall sep a b. sep -> (a -> b) -> [a] -> List sep b a
alaList' NoCommaFSep
NoCommaFSep FilePath -> Token'
Token') (CompilerFlavor -> ALens' BuildInfo [FilePath]
extract CompilerFlavor
GHC)
    g BuildInfo ([FilePath] -> PerCompilerFlavor [FilePath])
-> g BuildInfo [FilePath]
-> g BuildInfo (PerCompilerFlavor [FilePath])
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
<*> FieldName
-> ([FilePath] -> List NoCommaFSep Token' FilePath)
-> ALens' BuildInfo [FilePath]
-> g BuildInfo [FilePath]
forall (g :: * -> * -> *) b a s.
(FieldGrammar g, Parsec b, Pretty b, Monoid a, Newtype a b) =>
FieldName -> (a -> b) -> ALens' s a -> g s a
monoidalFieldAla "ghcjs-prof-options" (NoCommaFSep
-> (FilePath -> Token')
-> [FilePath]
-> List NoCommaFSep Token' FilePath
forall sep a b. sep -> (a -> b) -> [a] -> List sep b a
alaList' NoCommaFSep
NoCommaFSep FilePath -> Token'
Token') (CompilerFlavor -> ALens' BuildInfo [FilePath]
extract CompilerFlavor
GHCJS)
  where
    extract :: CompilerFlavor -> ALens' BuildInfo [String]
    extract :: CompilerFlavor -> ALens' BuildInfo [FilePath]
extract flavor :: CompilerFlavor
flavor = LensLike
  (Pretext [FilePath] [FilePath])
  BuildInfo
  BuildInfo
  (PerCompilerFlavor [FilePath])
  (PerCompilerFlavor [FilePath])
forall a. HasBuildInfo a => Lens' a (PerCompilerFlavor [FilePath])
L.profOptions LensLike
  (Pretext [FilePath] [FilePath])
  BuildInfo
  BuildInfo
  (PerCompilerFlavor [FilePath])
  (PerCompilerFlavor [FilePath])
-> (([FilePath] -> Pretext [FilePath] [FilePath] [FilePath])
    -> PerCompilerFlavor [FilePath]
    -> Pretext [FilePath] [FilePath] (PerCompilerFlavor [FilePath]))
-> ALens' BuildInfo [FilePath]
forall b c a. (b -> c) -> (a -> b) -> a -> c
. CompilerFlavor
-> ([FilePath] -> Pretext [FilePath] [FilePath] [FilePath])
-> PerCompilerFlavor [FilePath]
-> Pretext [FilePath] [FilePath] (PerCompilerFlavor [FilePath])
forall (f :: * -> *) v.
(Functor f, Monoid v) =>
CompilerFlavor -> LensLike' f (PerCompilerFlavor v) v
lookupLens CompilerFlavor
flavor

sharedOptionsFieldGrammar
    :: (FieldGrammar g, Applicative (g BuildInfo))
    => g BuildInfo (PerCompilerFlavor [String])
sharedOptionsFieldGrammar :: g BuildInfo (PerCompilerFlavor [FilePath])
sharedOptionsFieldGrammar = [FilePath] -> [FilePath] -> PerCompilerFlavor [FilePath]
forall v. v -> v -> PerCompilerFlavor v
PerCompilerFlavor
    ([FilePath] -> [FilePath] -> PerCompilerFlavor [FilePath])
-> g BuildInfo [FilePath]
-> g BuildInfo ([FilePath] -> PerCompilerFlavor [FilePath])
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
<$> FieldName
-> ([FilePath] -> List NoCommaFSep Token' FilePath)
-> ALens' BuildInfo [FilePath]
-> g BuildInfo [FilePath]
forall (g :: * -> * -> *) b a s.
(FieldGrammar g, Parsec b, Pretty b, Monoid a, Newtype a b) =>
FieldName -> (a -> b) -> ALens' s a -> g s a
monoidalFieldAla "ghc-shared-options"   (NoCommaFSep
-> (FilePath -> Token')
-> [FilePath]
-> List NoCommaFSep Token' FilePath
forall sep a b. sep -> (a -> b) -> [a] -> List sep b a
alaList' NoCommaFSep
NoCommaFSep FilePath -> Token'
Token') (CompilerFlavor -> ALens' BuildInfo [FilePath]
extract CompilerFlavor
GHC)
    g BuildInfo ([FilePath] -> PerCompilerFlavor [FilePath])
-> g BuildInfo [FilePath]
-> g BuildInfo (PerCompilerFlavor [FilePath])
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
<*> FieldName
-> ([FilePath] -> List NoCommaFSep Token' FilePath)
-> ALens' BuildInfo [FilePath]
-> g BuildInfo [FilePath]
forall (g :: * -> * -> *) b a s.
(FieldGrammar g, Parsec b, Pretty b, Monoid a, Newtype a b) =>
FieldName -> (a -> b) -> ALens' s a -> g s a
monoidalFieldAla "ghcjs-shared-options" (NoCommaFSep
-> (FilePath -> Token')
-> [FilePath]
-> List NoCommaFSep Token' FilePath
forall sep a b. sep -> (a -> b) -> [a] -> List sep b a
alaList' NoCommaFSep
NoCommaFSep FilePath -> Token'
Token') (CompilerFlavor -> ALens' BuildInfo [FilePath]
extract CompilerFlavor
GHCJS)
  where
    extract :: CompilerFlavor -> ALens' BuildInfo [String]
    extract :: CompilerFlavor -> ALens' BuildInfo [FilePath]
extract flavor :: CompilerFlavor
flavor = LensLike
  (Pretext [FilePath] [FilePath])
  BuildInfo
  BuildInfo
  (PerCompilerFlavor [FilePath])
  (PerCompilerFlavor [FilePath])
forall a. HasBuildInfo a => Lens' a (PerCompilerFlavor [FilePath])
L.sharedOptions LensLike
  (Pretext [FilePath] [FilePath])
  BuildInfo
  BuildInfo
  (PerCompilerFlavor [FilePath])
  (PerCompilerFlavor [FilePath])
-> (([FilePath] -> Pretext [FilePath] [FilePath] [FilePath])
    -> PerCompilerFlavor [FilePath]
    -> Pretext [FilePath] [FilePath] (PerCompilerFlavor [FilePath]))
-> ALens' BuildInfo [FilePath]
forall b c a. (b -> c) -> (a -> b) -> a -> c
. CompilerFlavor
-> ([FilePath] -> Pretext [FilePath] [FilePath] [FilePath])
-> PerCompilerFlavor [FilePath]
-> Pretext [FilePath] [FilePath] (PerCompilerFlavor [FilePath])
forall (f :: * -> *) v.
(Functor f, Monoid v) =>
CompilerFlavor -> LensLike' f (PerCompilerFlavor v) v
lookupLens CompilerFlavor
flavor

lookupLens :: (Functor f, Monoid v) => CompilerFlavor -> LensLike' f (PerCompilerFlavor v) v
lookupLens :: CompilerFlavor -> LensLike' f (PerCompilerFlavor v) v
lookupLens k :: CompilerFlavor
k f :: v -> f v
f p :: PerCompilerFlavor v
p@(PerCompilerFlavor ghc :: v
ghc ghcjs :: v
ghcjs)
    | CompilerFlavor
k CompilerFlavor -> CompilerFlavor -> Bool
forall a. Eq a => a -> a -> Bool
== CompilerFlavor
GHC   = (\n :: v
n -> v -> v -> PerCompilerFlavor v
forall v. v -> v -> PerCompilerFlavor v
PerCompilerFlavor v
n v
ghcjs) (v -> PerCompilerFlavor v) -> f v -> f (PerCompilerFlavor v)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
<$> v -> f v
f v
ghc
    | CompilerFlavor
k CompilerFlavor -> CompilerFlavor -> Bool
forall a. Eq a => a -> a -> Bool
== CompilerFlavor
GHCJS = (\n :: v
n -> v -> v -> PerCompilerFlavor v
forall v. v -> v -> PerCompilerFlavor v
PerCompilerFlavor v
ghc v
n) (v -> PerCompilerFlavor v) -> f v -> f (PerCompilerFlavor v)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
<$> v -> f v
f v
ghcjs
    | Bool
otherwise  = PerCompilerFlavor v
p PerCompilerFlavor v -> f v -> f (PerCompilerFlavor v)
forall (f :: * -> *) a b. Functor f => a -> f b -> f a
<$ v -> f v
f v
forall a. Monoid a => a
mempty

-------------------------------------------------------------------------------
-- Flag
-------------------------------------------------------------------------------

flagFieldGrammar
    :: (FieldGrammar g, Applicative (g Flag))
    =>  FlagName -> g Flag Flag
flagFieldGrammar :: FlagName -> g Flag Flag
flagFieldGrammar name :: FlagName
name = FlagName -> FilePath -> Bool -> Bool -> Flag
MkFlag FlagName
name
    (FilePath -> Bool -> Bool -> Flag)
-> g Flag FilePath -> g Flag (Bool -> Bool -> Flag)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
<$> FieldName -> ALens' Flag FilePath -> g Flag FilePath
forall (g :: * -> * -> *) s.
FieldGrammar g =>
FieldName -> ALens' s FilePath -> g s FilePath
freeTextFieldDef    "description"          ALens' Flag FilePath
Lens' Flag FilePath
L.flagDescription
    g Flag (Bool -> Bool -> Flag)
-> g Flag Bool -> g Flag (Bool -> Flag)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
<*> FieldName -> ALens' Flag Bool -> Bool -> g Flag Bool
forall (g :: * -> * -> *) s.
FieldGrammar g =>
FieldName -> ALens' s Bool -> Bool -> g s Bool
booleanFieldDef     "default"              ALens' Flag Bool
Lens' Flag Bool
L.flagDefault     Bool
True
    g Flag (Bool -> Flag) -> g Flag Bool -> g Flag Flag
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
<*> FieldName -> ALens' Flag Bool -> Bool -> g Flag Bool
forall (g :: * -> * -> *) s.
FieldGrammar g =>
FieldName -> ALens' s Bool -> Bool -> g s Bool
booleanFieldDef     "manual"               ALens' Flag Bool
Lens' Flag Bool
L.flagManual      Bool
False
{-# SPECIALIZE flagFieldGrammar :: FlagName -> ParsecFieldGrammar' Flag #-}
{-# SPECIALIZE flagFieldGrammar :: FlagName -> PrettyFieldGrammar' Flag #-}

-------------------------------------------------------------------------------
-- SourceRepo
-------------------------------------------------------------------------------

sourceRepoFieldGrammar
    :: (FieldGrammar g, Applicative (g SourceRepo))
    => RepoKind -> g SourceRepo SourceRepo
sourceRepoFieldGrammar :: RepoKind -> g SourceRepo SourceRepo
sourceRepoFieldGrammar kind :: RepoKind
kind = RepoKind
-> Maybe RepoType
-> Maybe FilePath
-> Maybe FilePath
-> Maybe FilePath
-> Maybe FilePath
-> Maybe FilePath
-> SourceRepo
SourceRepo RepoKind
kind
    (Maybe RepoType
 -> Maybe FilePath
 -> Maybe FilePath
 -> Maybe FilePath
 -> Maybe FilePath
 -> Maybe FilePath
 -> SourceRepo)
-> g SourceRepo (Maybe RepoType)
-> g SourceRepo
     (Maybe FilePath
      -> Maybe FilePath
      -> Maybe FilePath
      -> Maybe FilePath
      -> Maybe FilePath
      -> SourceRepo)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
<$> FieldName
-> ALens' SourceRepo (Maybe RepoType)
-> g SourceRepo (Maybe RepoType)
forall (g :: * -> * -> *) a s.
(FieldGrammar g, Parsec a, Pretty a) =>
FieldName -> ALens' s (Maybe a) -> g s (Maybe a)
optionalField    "type"                ALens' SourceRepo (Maybe RepoType)
Lens' SourceRepo (Maybe RepoType)
L.repoType
    g SourceRepo
  (Maybe FilePath
   -> Maybe FilePath
   -> Maybe FilePath
   -> Maybe FilePath
   -> Maybe FilePath
   -> SourceRepo)
-> g SourceRepo (Maybe FilePath)
-> g SourceRepo
     (Maybe FilePath
      -> Maybe FilePath
      -> Maybe FilePath
      -> Maybe FilePath
      -> SourceRepo)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
<*> FieldName
-> ALens' SourceRepo (Maybe FilePath)
-> g SourceRepo (Maybe FilePath)
forall (g :: * -> * -> *) s.
FieldGrammar g =>
FieldName -> ALens' s (Maybe FilePath) -> g s (Maybe FilePath)
freeTextField    "location"            ALens' SourceRepo (Maybe FilePath)
Lens' SourceRepo (Maybe FilePath)
L.repoLocation
    g SourceRepo
  (Maybe FilePath
   -> Maybe FilePath
   -> Maybe FilePath
   -> Maybe FilePath
   -> SourceRepo)
-> g SourceRepo (Maybe FilePath)
-> g SourceRepo
     (Maybe FilePath -> Maybe FilePath -> Maybe FilePath -> SourceRepo)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
<*> FieldName
-> (FilePath -> Token)
-> ALens' SourceRepo (Maybe FilePath)
-> g SourceRepo (Maybe FilePath)
forall (g :: * -> * -> *) b a s.
(FieldGrammar g, Parsec b, Pretty b, Newtype a b) =>
FieldName -> (a -> b) -> ALens' s (Maybe a) -> g s (Maybe a)
optionalFieldAla "module"   FilePath -> Token
Token      ALens' SourceRepo (Maybe FilePath)
Lens' SourceRepo (Maybe FilePath)
L.repoModule
    g SourceRepo
  (Maybe FilePath -> Maybe FilePath -> Maybe FilePath -> SourceRepo)
-> g SourceRepo (Maybe FilePath)
-> g SourceRepo (Maybe FilePath -> Maybe FilePath -> SourceRepo)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
<*> FieldName
-> (FilePath -> Token)
-> ALens' SourceRepo (Maybe FilePath)
-> g SourceRepo (Maybe FilePath)
forall (g :: * -> * -> *) b a s.
(FieldGrammar g, Parsec b, Pretty b, Newtype a b) =>
FieldName -> (a -> b) -> ALens' s (Maybe a) -> g s (Maybe a)
optionalFieldAla "branch"   FilePath -> Token
Token      ALens' SourceRepo (Maybe FilePath)
Lens' SourceRepo (Maybe FilePath)
L.repoBranch
    g SourceRepo (Maybe FilePath -> Maybe FilePath -> SourceRepo)
-> g SourceRepo (Maybe FilePath)
-> g SourceRepo (Maybe FilePath -> SourceRepo)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
<*> FieldName
-> (FilePath -> Token)
-> ALens' SourceRepo (Maybe FilePath)
-> g SourceRepo (Maybe FilePath)
forall (g :: * -> * -> *) b a s.
(FieldGrammar g, Parsec b, Pretty b, Newtype a b) =>
FieldName -> (a -> b) -> ALens' s (Maybe a) -> g s (Maybe a)
optionalFieldAla "tag"      FilePath -> Token
Token      ALens' SourceRepo (Maybe FilePath)
Lens' SourceRepo (Maybe FilePath)
L.repoTag
    g SourceRepo (Maybe FilePath -> SourceRepo)
-> g SourceRepo (Maybe FilePath) -> g SourceRepo SourceRepo
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
<*> FieldName
-> (FilePath -> FilePathNT)
-> ALens' SourceRepo (Maybe FilePath)
-> g SourceRepo (Maybe FilePath)
forall (g :: * -> * -> *) b a s.
(FieldGrammar g, Parsec b, Pretty b, Newtype a b) =>
FieldName -> (a -> b) -> ALens' s (Maybe a) -> g s (Maybe a)
optionalFieldAla "subdir"   FilePath -> FilePathNT
FilePathNT ALens' SourceRepo (Maybe FilePath)
Lens' SourceRepo (Maybe FilePath)
L.repoSubdir
{-# SPECIALIZE sourceRepoFieldGrammar :: RepoKind -> ParsecFieldGrammar' SourceRepo #-}
{-# SPECIALIZE sourceRepoFieldGrammar :: RepoKind ->PrettyFieldGrammar' SourceRepo #-}

-------------------------------------------------------------------------------
-- SetupBuildInfo
-------------------------------------------------------------------------------

setupBInfoFieldGrammar
    :: (FieldGrammar g, Functor (g SetupBuildInfo))
    => Bool -> g SetupBuildInfo SetupBuildInfo
setupBInfoFieldGrammar :: Bool -> g SetupBuildInfo SetupBuildInfo
setupBInfoFieldGrammar def :: Bool
def = ([Dependency] -> Bool -> SetupBuildInfo)
-> Bool -> [Dependency] -> SetupBuildInfo
forall a b c. (a -> b -> c) -> b -> a -> c
flip [Dependency] -> Bool -> SetupBuildInfo
SetupBuildInfo Bool
def
    ([Dependency] -> SetupBuildInfo)
-> g SetupBuildInfo [Dependency] -> g SetupBuildInfo SetupBuildInfo
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
<$> FieldName
-> ([Dependency]
    -> List CommaVCat (Identity Dependency) Dependency)
-> ALens' SetupBuildInfo [Dependency]
-> g SetupBuildInfo [Dependency]
forall (g :: * -> * -> *) b a s.
(FieldGrammar g, Parsec b, Pretty b, Monoid a, Newtype a b) =>
FieldName -> (a -> b) -> ALens' s a -> g s a
monoidalFieldAla "setup-depends" (CommaVCat
-> [Dependency] -> List CommaVCat (Identity Dependency) Dependency
forall sep a. sep -> [a] -> List sep (Identity a) a
alaList CommaVCat
CommaVCat) ALens' SetupBuildInfo [Dependency]
Lens' SetupBuildInfo [Dependency]
L.setupDepends
{-# SPECIALIZE setupBInfoFieldGrammar :: Bool -> ParsecFieldGrammar' SetupBuildInfo #-}
{-# SPECIALIZE setupBInfoFieldGrammar :: Bool ->PrettyFieldGrammar' SetupBuildInfo #-}