Commit bd2d0b23 authored by Oleg Grenrus's avatar Oleg Grenrus

ShortText in GPD and IPI free text fields

parent 386aa265
......@@ -25,6 +25,7 @@ module Distribution.FieldGrammar (
takeFields,
runFieldParser,
runFieldParser',
defaultFreeTextFieldDefST,
) where
import Distribution.Compat.Prelude
......
......@@ -4,6 +4,7 @@ module Distribution.FieldGrammar.Class (
optionalField,
optionalFieldDef,
monoidalField,
defaultFreeTextFieldDefST,
) where
import Distribution.Compat.Lens
......@@ -15,6 +16,7 @@ import Distribution.Compat.Newtype (Newtype)
import Distribution.Fields.Field
import Distribution.Parsec (Parsec)
import Distribution.Pretty (Pretty)
import Distribution.Utils.ShortText
-- | 'FieldGrammar' is parametrised by
--
......@@ -79,6 +81,12 @@ class FieldGrammar g where
-> ALens' s String -- ^ lens into the field
-> g s String
-- | @since 3.2.0.0
freeTextFieldDefST
:: FieldName
-> ALens' s ShortText -- ^ lens into the field
-> g s ShortText
-- | Monoidal field.
--
-- Values are combined with 'mappend'.
......@@ -157,3 +165,15 @@ monoidalField
-> ALens' s a -- ^ lens into the field
-> g s a
monoidalField fn = monoidalFieldAla fn Identity
-- | Default implementation for 'freeTextFieldDefST'.
defaultFreeTextFieldDefST
:: (Functor (g s), FieldGrammar g)
=> FieldName
-> ALens' s ShortText -- ^ lens into the field
-> g s ShortText
defaultFreeTextFieldDefST fn l =
toShortText <$> freeTextFieldDef fn (cloneLens l . st)
where
st :: Lens' ShortText String
st f s = toShortText <$> f (fromShortText s)
......@@ -84,6 +84,8 @@ instance FieldGrammar FieldDescrs where
f s = showFreeText (aview l s)
g s = cloneLens l (const parsecFreeText) s
freeTextFieldDefST = defaultFreeTextFieldDefST
monoidalFieldAla fn _pack l = singletonF fn f g where
f s = pretty (pack' _pack (aview l s))
g s = cloneLens l (\x -> mappend x . unpack' _pack <$> P.parsec) s
......
......@@ -71,12 +71,13 @@ import Distribution.Compat.Prelude
import Distribution.Simple.Utils (fromUTF8BS)
import Prelude ()
import qualified Data.ByteString as BS
import qualified Data.List.NonEmpty as NE
import qualified Data.Map.Strict as Map
import qualified Data.Set as Set
import qualified Text.Parsec as P
import qualified Text.Parsec.Error as P
import qualified Data.ByteString as BS
import qualified Data.List.NonEmpty as NE
import qualified Data.Map.Strict as Map
import qualified Data.Set as Set
import qualified Distribution.Utils.ShortText as ShortText
import qualified Text.Parsec as P
import qualified Text.Parsec.Error as P
import Distribution.CabalSpecVersion
import Distribution.FieldGrammar.Class
......@@ -84,7 +85,7 @@ import Distribution.Fields.Field
import Distribution.Fields.ParseResult
import Distribution.Parsec
import Distribution.Parsec.FieldLineStream
import Distribution.Parsec.Position (positionRow, positionCol)
import Distribution.Parsec.Position (positionCol, positionRow)
-------------------------------------------------------------------------------
-- Auxiliary types
......@@ -234,6 +235,22 @@ instance FieldGrammar ParsecFieldGrammar where
| v >= CabalSpecV3_0 = pure (fieldlinesToFreeText3 pos fls)
| otherwise = pure (fieldlinesToFreeText fls)
-- freeTextFieldDefST = defaultFreeTextFieldDefST
freeTextFieldDefST fn _ = ParsecFG (Set.singleton fn) Set.empty parser where
parser v fields = case Map.lookup fn fields of
Nothing -> pure mempty
Just [] -> pure mempty
Just [x] -> parseOne v x
Just xs@(_:y:ys) -> do
warnMultipleSingularFields fn xs
NE.last <$> traverse (parseOne v) (y:|ys)
parseOne v (MkNamelessField pos fls) = case fls of
[] -> pure mempty
[FieldLine _ bs] -> pure (ShortText.unsafeFromUTF8BS bs)
_ | v >= CabalSpecV3_0 -> pure (ShortText.toShortText $ fieldlinesToFreeText3 pos fls)
| otherwise -> pure (ShortText.toShortText $ fieldlinesToFreeText fls)
monoidalFieldAla fn _pack _extract = ParsecFG (Set.singleton fn) Set.empty parser
where
parser v fields = case Map.lookup fn fields of
......
......@@ -72,6 +72,8 @@ instance FieldGrammar PrettyFieldGrammar where
showFT | v >= CabalSpecV3_0 = showFreeTextV3
| otherwise = showFreeText
freeTextFieldDefST = defaultFreeTextFieldDefST
monoidalFieldAla fn _pack l = PrettyFG pp
where
pp v s = ppField fn (prettyVersioned v (pack' _pack (aview l s)))
......
......@@ -101,7 +101,7 @@ parseInstalledPackageInfo s = case P.readFields s of
Left err -> Left (show err :| [])
Right fs -> case partitionFields fs of
(fs', _) -> case P.runParseResult $ parseFieldGrammar cabalSpecLatest fs' ipiFieldGrammar of
(ws, Right x) -> ws' `deepseq` x `deepseq` Right (ws', x) where
(ws, Right x) -> x `deepseq` Right (ws', x) where
ws' = map (P.showPWarning "") ws
(_, Left (_, errs)) -> Left errs' where
errs' = fmap (P.showPError "") errs
......
......@@ -28,8 +28,8 @@ import Prelude ()
import Distribution.Parsec
import Distribution.Pretty
import Distribution.Utils.ShortText
import System.FilePath (pathSeparator)
import Distribution.Utils.ShortText (ShortText, fromShortText, toShortText)
import System.FilePath (pathSeparator)
import qualified Distribution.Compat.CharParsing as P
import qualified Text.PrettyPrint as Disp
......
......@@ -73,6 +73,7 @@ import qualified System.Directory (getDirectoryContents)
import qualified System.FilePath.Windows as FilePath.Windows (isValid)
import qualified Data.Set as Set
import qualified Distribution.Utils.ShortText as ShortText
import qualified Distribution.Types.BuildInfo.Lens as L
import qualified Distribution.Types.GenericPackageDescription.Lens as L
......@@ -497,32 +498,32 @@ checkFields pkg =
++ "' use '" ++ prettyShow replacement ++ "'."
| (ext, Just replacement) <- ourDeprecatedExtensions ]
, check (null (category pkg)) $
, check (ShortText.null (category pkg)) $
PackageDistSuspicious "No 'category' field."
, check (null (maintainer pkg)) $
, check (ShortText.null (maintainer pkg)) $
PackageDistSuspicious "No 'maintainer' field."
, check (null (synopsis pkg) && null (description pkg)) $
, check (ShortText.null (synopsis pkg) && ShortText.null (description pkg)) $
PackageDistInexcusable "No 'synopsis' or 'description' field."
, check (null (description pkg) && not (null (synopsis pkg))) $
, check (ShortText.null (description pkg) && not (ShortText.null (synopsis pkg))) $
PackageDistSuspicious "No 'description' field."
, check (null (synopsis pkg) && not (null (description pkg))) $
, check (ShortText.null (synopsis pkg) && not (ShortText.null (description pkg))) $
PackageDistSuspicious "No 'synopsis' field."
--TODO: recommend the bug reports URL, author and homepage fields
--TODO: recommend not using the stability field
--TODO: recommend specifying a source repo
, check (length (synopsis pkg) >= 80) $
, check (ShortText.length (synopsis pkg) >= 80) $
PackageDistSuspicious
"The 'synopsis' field is rather long (max 80 chars is recommended)."
-- See also https://github.com/haskell/cabal/pull/3479
, check (not (null (description pkg))
&& length (description pkg) <= length (synopsis pkg)) $
, check (not (ShortText.null (description pkg))
&& ShortText.length (description pkg) <= ShortText.length (synopsis pkg)) $
PackageDistSuspicious $
"The 'description' field should be longer than the 'synopsis' "
++ "field. "
......
......@@ -76,18 +76,18 @@ packageDescriptionFieldGrammar = PackageDescription
<*> blurFieldGrammar L.package packageIdentifierGrammar
<*> optionalFieldDefAla "license" SpecLicense L.licenseRaw (Left SPDX.NONE)
<*> licenseFilesGrammar
<*> freeTextFieldDef "copyright" L.copyright
<*> freeTextFieldDef "maintainer" L.maintainer
<*> freeTextFieldDef "author" L.author
<*> freeTextFieldDef "stability" L.stability
<*> freeTextFieldDefST "copyright" L.copyright
<*> freeTextFieldDefST "maintainer" L.maintainer
<*> freeTextFieldDefST "author" L.author
<*> freeTextFieldDefST "stability" L.stability
<*> monoidalFieldAla "tested-with" (alaList' FSep TestedWith) L.testedWith
<*> freeTextFieldDef "homepage" L.homepage
<*> freeTextFieldDef "package-url" L.pkgUrl
<*> freeTextFieldDef "bug-reports" L.bugReports
<*> freeTextFieldDefST "homepage" L.homepage
<*> freeTextFieldDefST "package-url" L.pkgUrl
<*> freeTextFieldDefST "bug-reports" L.bugReports
<*> pure [] -- source-repos are stanza
<*> freeTextFieldDef "synopsis" L.synopsis
<*> freeTextFieldDef "description" L.description
<*> freeTextFieldDef "category" L.category
<*> freeTextFieldDefST "synopsis" L.synopsis
<*> freeTextFieldDefST "description" L.description
<*> freeTextFieldDefST "category" L.category
<*> prefixedFields "x-" L.customFieldsPD
<*> optionalField "build-type" L.buildTypeRaw
<*> pure Nothing -- custom-setup
......
......@@ -36,6 +36,7 @@ import Distribution.Compat.Prelude
import Prelude ()
import Control.Applicative (Const (..))
import Control.DeepSeq (deepseq)
import Control.Monad (guard)
import Control.Monad.State.Strict (StateT, execStateT)
import Control.Monad.Trans.Class (lift)
......@@ -70,9 +71,7 @@ import Distribution.Types.PackageDescription (specVersion')
import Distribution.Types.UnqualComponentName (UnqualComponentName, mkUnqualComponentName)
import Distribution.Utils.Generic (breakMaybe, unfoldrM, validateUTF8)
import Distribution.Verbosity (Verbosity)
import Distribution.Version
(LowerBound (..), Version, asVersionIntervals, mkVersion, orLaterVersion, version0,
versionNumbers)
import Distribution.Version (LowerBound (..), Version, asVersionIntervals, mkVersion, orLaterVersion, version0, versionNumbers)
import qualified Data.ByteString as BS
import qualified Data.ByteString.Char8 as BS8
......@@ -200,7 +199,7 @@ parseGenericPackageDescription' cabalVerM lexWarnings utf8WarnPos fs = do
gpd1 <- view stateGpd <$> execStateT (goSections specVer sectionFields) (SectionS gpd Map.empty)
checkForUndefinedFlags gpd1
return gpd1
gpd1 `deepseq` return gpd1
where
safeLast :: [a] -> Maybe a
safeLast = listToMaybe . reverse
......
......@@ -66,6 +66,7 @@ import Distribution.Pretty
import Distribution.Parsec (simpleParsec)
import Distribution.Utils.NubList
import Distribution.Version
import qualified Distribution.Utils.ShortText as ShortText
import Distribution.Verbosity
import Language.Haskell.Extension
......@@ -352,20 +353,23 @@ fromFlags env flags =
ghcArgs = fromMaybe [] . lookup "ghc" . haddockProgramArgs $ flags
fromPackageDescription :: HaddockTarget -> PackageDescription -> HaddockArgs
fromPackageDescription haddockTarget pkg_descr =
mempty { argInterfaceFile = Flag $ haddockName pkg_descr,
argPackageName = Flag $ packageId $ pkg_descr,
argOutputDir = Dir $
"doc" </> "html" </> haddockDirName haddockTarget pkg_descr,
argPrologue = Flag $ if null desc then synopsis pkg_descr
else desc,
argTitle = Flag $ showPkg ++ subtitle
}
where
desc = PD.description pkg_descr
showPkg = prettyShow (packageId pkg_descr)
subtitle | null (synopsis pkg_descr) = ""
| otherwise = ": " ++ synopsis pkg_descr
fromPackageDescription haddockTarget pkg_descr = mempty
{ argInterfaceFile = Flag $ haddockName pkg_descr
, argPackageName = Flag $ packageId $ pkg_descr
, argOutputDir = Dir $
"doc" </> "html" </> haddockDirName haddockTarget pkg_descr
, argPrologue = Flag $ ShortText.fromShortText $
if ShortText.null desc
then synopsis pkg_descr
else desc
, argTitle = Flag $ showPkg ++ subtitle
}
where
desc = PD.description pkg_descr
showPkg = prettyShow (packageId pkg_descr)
subtitle
| ShortText.null (synopsis pkg_descr) = ""
| otherwise = ": " ++ ShortText.fromShortText (synopsis pkg_descr)
componentGhcOptions :: Verbosity -> LocalBuildInfo
-> BuildInfo -> ComponentLocalBuildInfo -> FilePath
......
{-# LANGUAGE DeriveDataTypeable #-}
{-# LANGUAGE DeriveGeneric #-}
{-# LANGUAGE TypeFamilies #-}
{-# LANGUAGE OverloadedStrings #-}
module Distribution.Types.InstalledPackageInfo (
InstalledPackageInfo (..),
emptyInstalledPackageInfo,
......@@ -25,6 +26,7 @@ import Distribution.Types.LibraryVisibility
import Distribution.Types.MungedPackageId
import Distribution.Types.MungedPackageName
import Distribution.Version (nullVersion)
import Distribution.Utils.ShortText (ShortText)
import qualified Distribution.Package as Package
import qualified Distribution.SPDX as SPDX
......@@ -50,15 +52,15 @@ data InstalledPackageInfo
instantiatedWith :: [(ModuleName, OpenModule)],
compatPackageKey :: String,
license :: Either SPDX.License License,
copyright :: String,
maintainer :: String,
author :: String,
stability :: String,
homepage :: String,
pkgUrl :: String,
synopsis :: String,
description :: String,
category :: String,
copyright :: !ShortText,
maintainer :: !ShortText,
author :: !ShortText,
stability :: !ShortText,
homepage :: !ShortText,
pkgUrl :: !ShortText,
synopsis :: !ShortText,
description :: !ShortText,
category :: !ShortText,
-- these parts are required by an installed package only:
abiHash :: AbiHash,
indefinite :: Bool,
......
......@@ -67,15 +67,15 @@ ipiFieldGrammar = mkInstalledPackageInfo
<+> optionalFieldDefAla "instantiated-with" InstWith L.instantiatedWith []
<+> optionalFieldDefAla "key" CompatPackageKey L.compatPackageKey ""
<+> optionalFieldDefAla "license" SpecLicenseLenient L.license (Left SPDX.NONE)
<+> freeTextFieldDef "copyright" L.copyright
<+> freeTextFieldDef "maintainer" L.maintainer
<+> freeTextFieldDef "author" L.author
<+> freeTextFieldDef "stability" L.stability
<+> freeTextFieldDef "homepage" L.homepage
<+> freeTextFieldDef "package-url" L.pkgUrl
<+> freeTextFieldDef "synopsis" L.synopsis
<+> freeTextFieldDef "description" L.description
<+> freeTextFieldDef "category" L.category
<+> freeTextFieldDefST "copyright" L.copyright
<+> freeTextFieldDefST "maintainer" L.maintainer
<+> freeTextFieldDefST "author" L.author
<+> freeTextFieldDefST "stability" L.stability
<+> freeTextFieldDefST "homepage" L.homepage
<+> freeTextFieldDefST "package-url" L.pkgUrl
<+> freeTextFieldDefST "synopsis" L.synopsis
<+> freeTextFieldDefST "description" L.description
<+> freeTextFieldDefST "category" L.category
-- Installed fields
<+> optionalFieldDef "abi" L.abiHash (mkAbiHash "")
<+> booleanFieldDef "indefinite" L.indefinite False
......
......@@ -14,6 +14,8 @@ import Distribution.Package (AbiHash, ComponentId, PackageIde
import Distribution.Types.InstalledPackageInfo (AbiDependency, ExposedModule, InstalledPackageInfo)
import Distribution.Types.LibraryName (LibraryName)
import Distribution.Types.LibraryVisibility (LibraryVisibility)
import Distribution.Utils.ShortText (ShortText)
import qualified Distribution.SPDX as SPDX
import qualified Distribution.Types.InstalledPackageInfo as T
......@@ -46,39 +48,39 @@ license :: Lens' InstalledPackageInfo (Either SPDX.License License)
license f s = fmap (\x -> s { T.license = x }) (f (T.license s))
{-# INLINE license #-}
copyright :: Lens' InstalledPackageInfo String
copyright :: Lens' InstalledPackageInfo ShortText
copyright f s = fmap (\x -> s { T.copyright = x }) (f (T.copyright s))
{-# INLINE copyright #-}
maintainer :: Lens' InstalledPackageInfo String
maintainer :: Lens' InstalledPackageInfo ShortText
maintainer f s = fmap (\x -> s { T.maintainer = x }) (f (T.maintainer s))
{-# INLINE maintainer #-}
author :: Lens' InstalledPackageInfo String
author :: Lens' InstalledPackageInfo ShortText
author f s = fmap (\x -> s { T.author = x }) (f (T.author s))
{-# INLINE author #-}
stability :: Lens' InstalledPackageInfo String
stability :: Lens' InstalledPackageInfo ShortText
stability f s = fmap (\x -> s { T.stability = x }) (f (T.stability s))
{-# INLINE stability #-}
homepage :: Lens' InstalledPackageInfo String
homepage :: Lens' InstalledPackageInfo ShortText
homepage f s = fmap (\x -> s { T.homepage = x }) (f (T.homepage s))
{-# INLINE homepage #-}
pkgUrl :: Lens' InstalledPackageInfo String
pkgUrl :: Lens' InstalledPackageInfo ShortText
pkgUrl f s = fmap (\x -> s { T.pkgUrl = x }) (f (T.pkgUrl s))
{-# INLINE pkgUrl #-}
synopsis :: Lens' InstalledPackageInfo String
synopsis :: Lens' InstalledPackageInfo ShortText
synopsis f s = fmap (\x -> s { T.synopsis = x }) (f (T.synopsis s))
{-# INLINE synopsis #-}
description :: Lens' InstalledPackageInfo String
description :: Lens' InstalledPackageInfo ShortText
description f s = fmap (\x -> s { T.description = x }) (f (T.description s))
{-# INLINE description #-}
category :: Lens' InstalledPackageInfo String
category :: Lens' InstalledPackageInfo ShortText
category f s = fmap (\x -> s { T.category = x }) (f (T.category s))
{-# INLINE category #-}
......
......@@ -88,6 +88,7 @@ import Distribution.Compiler
import Distribution.License
import Distribution.Package
import Distribution.Version
import Distribution.Utils.ShortText
import qualified Distribution.SPDX as SPDX
......@@ -113,18 +114,18 @@ data PackageDescription
package :: PackageIdentifier,
licenseRaw :: Either SPDX.License License,
licenseFiles :: [FilePath],
copyright :: String,
maintainer :: String,
author :: String,
stability :: String,
copyright :: !ShortText,
maintainer :: !ShortText,
author :: !ShortText,
stability :: !ShortText,
testedWith :: [(CompilerFlavor,VersionRange)],
homepage :: String,
pkgUrl :: String,
bugReports :: String,
homepage :: !ShortText,
pkgUrl :: !ShortText,
bugReports :: !ShortText,
sourceRepos :: [SourceRepo],
synopsis :: String, -- ^A one-line summary of this package
description :: String, -- ^A more verbose description of this package
category :: String,
synopsis :: !ShortText, -- ^A one-line summary of this package
description :: !ShortText, -- ^A more verbose description of this package
category :: !ShortText,
customFieldsPD :: [(String,String)], -- ^Custom fields starting
-- with x-, stored in a
-- simple assoc-list.
......@@ -224,18 +225,18 @@ emptyPackageDescription
licenseFiles = [],
specVersionRaw = Right anyVersion,
buildTypeRaw = Nothing,
copyright = "",
maintainer = "",
author = "",
stability = "",
copyright = mempty,
maintainer = mempty,
author = mempty,
stability = mempty,
testedWith = [],
homepage = "",
pkgUrl = "",
bugReports = "",
homepage = mempty,
pkgUrl = mempty,
bugReports = mempty,
sourceRepos = [],
synopsis = "",
description = "",
category = "",
synopsis = mempty,
description = mempty,
category = mempty,
customFieldsPD = [],
setupBuildInfo = Nothing,
library = Nothing,
......
{-# LANGUAGE OverloadedStrings #-}
{-# LANGUAGE RankNTypes #-}
{-# LANGUAGE RankNTypes #-}
module Distribution.Types.PackageDescription.Lens (
PackageDescription,
module Distribution.Types.PackageDescription.Lens,
......@@ -9,27 +9,28 @@ import Distribution.Compat.Lens
import Distribution.Compat.Prelude
import Prelude ()
import Distribution.Compiler (CompilerFlavor)
import Distribution.License (License)
import Distribution.ModuleName (ModuleName)
import Distribution.Types.Benchmark (Benchmark, benchmarkModules)
import Distribution.Types.Benchmark.Lens (benchmarkName, benchmarkBuildInfo)
import Distribution.Types.BuildInfo (BuildInfo)
import Distribution.Types.BuildType (BuildType)
import Distribution.Types.ComponentName (ComponentName(..))
import Distribution.Types.Executable (Executable, exeModules)
import Distribution.Types.Executable.Lens (exeName, exeBuildInfo)
import Distribution.Types.ForeignLib (ForeignLib, foreignLibModules)
import Distribution.Types.ForeignLib.Lens (foreignLibName, foreignLibBuildInfo)
import Distribution.Types.Library (Library, explicitLibModules)
import Distribution.Types.Library.Lens (libName, libBuildInfo)
import Distribution.Types.PackageDescription (PackageDescription)
import Distribution.Types.PackageId (PackageIdentifier)
import Distribution.Types.SetupBuildInfo (SetupBuildInfo)
import Distribution.Types.SourceRepo (SourceRepo)
import Distribution.Types.TestSuite (TestSuite, testModules)
import Distribution.Types.TestSuite.Lens (testName, testBuildInfo)
import Distribution.Version (Version, VersionRange)
import Distribution.Compiler (CompilerFlavor)
import Distribution.License (License)
import Distribution.ModuleName (ModuleName)
import Distribution.Types.Benchmark (Benchmark, benchmarkModules)
import Distribution.Types.Benchmark.Lens (benchmarkBuildInfo, benchmarkName)
import Distribution.Types.BuildInfo (BuildInfo)
import Distribution.Types.BuildType (BuildType)
import Distribution.Types.ComponentName (ComponentName (..))
import Distribution.Types.Executable (Executable, exeModules)
import Distribution.Types.Executable.Lens (exeBuildInfo, exeName)
import Distribution.Types.ForeignLib (ForeignLib, foreignLibModules)
import Distribution.Types.ForeignLib.Lens (foreignLibBuildInfo, foreignLibName)
import Distribution.Types.Library (Library, explicitLibModules)
import Distribution.Types.Library.Lens (libBuildInfo, libName)
import Distribution.Types.PackageDescription (PackageDescription)
import Distribution.Types.PackageId (PackageIdentifier)
import Distribution.Types.SetupBuildInfo (SetupBuildInfo)
import Distribution.Types.SourceRepo (SourceRepo)
import Distribution.Types.TestSuite (TestSuite, testModules)
import Distribution.Types.TestSuite.Lens (testBuildInfo, testName)
import Distribution.Utils.ShortText (ShortText)
import Distribution.Version (Version, VersionRange)
import qualified Distribution.SPDX as SPDX
import qualified Distribution.Types.PackageDescription as T
......@@ -42,23 +43,23 @@ licenseRaw :: Lens' PackageDescription (Either SPDX.License License)
licenseRaw f s = fmap (\x -> s { T.licenseRaw = x }) (f (T.licenseRaw s))
{-# INLINE licenseRaw #-}
licenseFiles :: Lens' PackageDescription [String]
licenseFiles :: Lens' PackageDescription [FilePath]
licenseFiles f s = fmap (\x -> s { T.licenseFiles = x }) (f (T.licenseFiles s))
{-# INLINE licenseFiles #-}
copyright :: Lens' PackageDescription String
copyright :: Lens' PackageDescription ShortText
copyright f s = fmap (\x -> s { T.copyright = x }) (f (T.copyright s))
{-# INLINE copyright #-}
maintainer :: Lens' PackageDescription String
maintainer :: Lens' PackageDescription ShortText
maintainer f s = fmap (\x -> s { T.maintainer = x }) (f (T.maintainer s))
{-# INLINE maintainer #-}
author :: Lens' PackageDescription String
author :: Lens' PackageDescription ShortText
author f s = fmap (\x -> s { T.author = x }) (f (T.author s))
{-# INLINE author #-}
stability :: Lens' PackageDescription String
stability :: Lens' PackageDescription ShortText
stability f s = fmap (\x -> s { T.stability = x }) (f (T.stability s))
{-# INLINE stability #-}
......@@ -66,15 +67,15 @@ testedWith :: Lens' PackageDescription [(CompilerFlavor,VersionRange)]
testedWith f s = fmap (\x -> s { T.testedWith = x }) (f (T.testedWith s))
{-# INLINE testedWith #-}
homepage :: Lens' PackageDescription String
homepage :: Lens' PackageDescription ShortText
homepage f s = fmap (\x -> s { T.homepage = x }) (f (T.homepage s))
{-# INLINE homepage #-}
pkgUrl :: Lens' PackageDescription String
pkgUrl :: Lens' PackageDescription ShortText
pkgUrl f s = fmap (\x -> s { T.pkgUrl = x }) (f (T.pkgUrl s))
{-# INLINE pkgUrl #-}
bugReports :: Lens' PackageDescription String
bugReports :: Lens' PackageDescription ShortText
bugReports f s = fmap (\x -> s { T.bugReports = x }) (f (T.bugReports s))
{-# INLINE bugReports #-}
......@@ -82,15 +83,15 @@ sourceRepos :: Lens' PackageDescription [SourceRepo]
sourceRepos f s = fmap (\x -> s { T.sourceRepos = x }) (f (T.sourceRepos s))
{-# INLINE sourceRepos #-}
synopsis :: Lens' PackageDescription String
synopsis :: Lens' PackageDescription ShortText
synopsis f s = fmap (\x -> s { T.synopsis = x }) (f (T.synopsis s))
{-# INLINE synopsis #-}
description :: Lens' PackageDescription String
description :: Lens' PackageDescription ShortText
description f s = fmap (\x -> s { T.description = x }) (f (T.description s))