Skip to content

Commit

Permalink
Merge branch 'master' into doc-haddock
Browse files Browse the repository at this point in the history
  • Loading branch information
andreasabel authored May 4, 2022
2 parents a7c2a4d + 63841fb commit bb4a340
Show file tree
Hide file tree
Showing 59 changed files with 85 additions and 83 deletions.
2 changes: 1 addition & 1 deletion Cabal-QuickCheck/src/Test/QuickCheck/GenericArbitrary.hs
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ import Test.QuickCheck
import Control.Applicative (pure, (<$>), (<*>))
#endif

-- Generic arbitary for non-recursive types
-- Generic arbitrary for non-recursive types
genericArbitrary :: (Generic a, GArbitrary (Rep a)) => Gen a
genericArbitrary = fmap to garbitrary

Expand Down
2 changes: 1 addition & 1 deletion Cabal-described/src/Distribution/Utils/CharSet.hs
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
{-# LANGUAGE CPP #-}
-- | Sets of characters.
--
-- Using this is more efficint than 'RE.Type.Alt':ng individual characters.
-- Using this is more efficient than 'RE.Type.Alt':ng individual characters.
module Distribution.Utils.CharSet (
-- * Set of characters
CharSet,
Expand Down
4 changes: 2 additions & 2 deletions Cabal-syntax/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -32,8 +32,8 @@ Cabal's users what their most pressing problems are with Cabal and
[Hackage]. You may have a favourite Cabal bug or limitation. Look at
Cabal's [bug tracker]. Ensure that the problem is reported there and
adequately described. Comment on the issue to report how much of a
problem the bug is for you. Subscribe to the issues's notifications to
discussed requirements and keep informed on progress. For feature
problem the bug is for you. Subscribe to the issue's notifications to
discuss requirements and keep informed on progress. For feature
requests, it is helpful if there is a description of how you would
expect to interact with the new feature.

Expand Down
2 changes: 1 addition & 1 deletion Cabal-syntax/src/Distribution/Compat/CharParsing.hs
Original file line number Diff line number Diff line change
Expand Up @@ -346,7 +346,7 @@ munch1 :: CharParsing m => (Char -> Bool) -> m String
munch1 = some . satisfy
{-# INLINE munch1 #-}

-- | Greedely munch characters while predicate holds.
-- | Greedily munch characters while predicate holds.
-- Always succeeds.
munch :: CharParsing m => (Char -> Bool) -> m String
munch = many . satisfy
Expand Down
2 changes: 1 addition & 1 deletion Cabal-syntax/src/Distribution/Compat/Newtype.hs
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
{-# LANGUAGE FlexibleInstances #-}
{-# LANGUAGE FunctionalDependencies #-}
-- | Per Conor McBride, the 'Newtype' typeclass represents the packing and
-- unpacking of a newtype, and allows you to operatate under that newtype with
-- unpacking of a newtype, and allows you to operate under that newtype with
-- functions such as 'ala'.
module Distribution.Compat.Newtype (
Newtype (..),
Expand Down
2 changes: 1 addition & 1 deletion Cabal-syntax/src/Distribution/FieldGrammar.hs
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ module Distribution.FieldGrammar (
PrettyFieldGrammar,
PrettyFieldGrammar',
prettyFieldGrammar,
-- * Auxlilary
-- * Auxiliary
(^^^),
Section(..),
Fields,
Expand Down
2 changes: 1 addition & 1 deletion Cabal-syntax/src/Distribution/Fields.hs
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
-- | Utilitiies to work with @.cabal@ like file structure.
-- | Utilities to work with @.cabal@ like file structure.
module Distribution.Fields (
-- * Types
Field(..),
Expand Down
2 changes: 1 addition & 1 deletion Cabal-syntax/src/Distribution/PackageDescription/Parsec.hs
Original file line number Diff line number Diff line change
Expand Up @@ -855,7 +855,7 @@ libFieldNames :: [FieldName]
libFieldNames = fieldGrammarKnownFieldList (libraryFieldGrammar LMainLibName)

-------------------------------------------------------------------------------
-- Suplementary build information
-- Supplementary build information
-------------------------------------------------------------------------------

parseHookedBuildInfo :: BS.ByteString -> ParseResult HookedBuildInfo
Expand Down
2 changes: 1 addition & 1 deletion Cabal-syntax/src/Distribution/System.hs
Original file line number Diff line number Diff line change
Expand Up @@ -231,7 +231,7 @@ instance Pretty Platform where
pretty (Platform arch os) = pretty arch <<>> Disp.char '-' <<>> pretty os

instance Parsec Platform where
-- TODO: there are ambigious platforms like: `arch-word-os`
-- TODO: there are ambiguous platforms like: `arch-word-os`
-- which could be parsed as
-- * Platform "arch-word" "os"
-- * Platform "arch" "word-os"
Expand Down
2 changes: 1 addition & 1 deletion Cabal-syntax/src/Distribution/Types/BuildInfo.hs
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ data BuildInfo = BuildInfo {
-- field directly.
buildToolDepends :: [ExeDependency],
cppOptions :: [String], -- ^ options for pre-processing Haskell code
asmOptions :: [String], -- ^ options for assmebler
asmOptions :: [String], -- ^ options for assembler
cmmOptions :: [String], -- ^ options for C-- compiler
ccOptions :: [String], -- ^ options for C compiler
cxxOptions :: [String], -- ^ options for C++ compiler
Expand Down
2 changes: 1 addition & 1 deletion Cabal-syntax/src/Distribution/Types/VersionInterval.hs
Original file line number Diff line number Diff line change
Expand Up @@ -102,7 +102,7 @@ stage1 = cataVersionRange alg where
-- intersection: pairwise intersect. Strip empty intervals. Sort to restore the invariant.
alg (IntersectVersionRangesF v1 v2) = mapMaybe nonEmptyInterval $ liftA2 intersectInterval (stage2and3 v1) (stage2and3 v2)

-- | Creck that interval is non-empty
-- | Check that interval is non-empty
nonEmptyInterval :: VersionInterval -> Maybe VersionInterval
nonEmptyInterval i | nonEmptyVI i = Just i
nonEmptyInterval _ = Nothing
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -112,7 +112,7 @@ versionIntervals (VersionIntervals is) = is
type VersionInterval = (LowerBound, UpperBound)

data LowerBound
= LowerBound Version !Bound -- ^ Either exlusive @(v,..@ or inclusive @[v,..@.
= LowerBound Version !Bound -- ^ Either exclusive @(v,..@ or inclusive @[v,..@.
deriving (Eq, Show)

data UpperBound
Expand Down
4 changes: 2 additions & 2 deletions Cabal-syntax/src/Distribution/Utils/Structured.hs
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
--
-- Copyright: (c) 2019 Oleg Grenrus
--
-- Structurally tag binary serialisaton stream.
-- Structurally tag binary serialisation stream.
-- Useful when most 'Binary' instances are 'Generic' derived.
--
-- Say you have a data type
Expand Down Expand Up @@ -121,7 +121,7 @@ import qualified Data.Foldable
type TypeName = String
type ConstructorName = String

-- | A sematic version of a data type. Usually 0.
-- | A semantic version of a data type. Usually 0.
type TypeVersion = Word32

-- | Structure of a datatype.
Expand Down
2 changes: 1 addition & 1 deletion Cabal-tests/Cabal-tests.cabal
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ maintainer: [email protected]
homepage: http://www.haskell.org/cabal/
bug-reports: https://github.com/haskell/cabal/issues
synopsis: Tests for Cabal library
description: The tests are external for development flows convinience.
description: The tests are external for development flows convenience.
category: Distribution
build-type: Simple

Expand Down
2 changes: 1 addition & 1 deletion Cabal-tests/tests/Test/Laws.hs
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ monoid_2 :: (Eq a, Data.Monoid.Monoid a) => a -> a -> a -> Bool
monoid_2 x y z = (x `mappend` y) `mappend` z
== x `mappend` (y `mappend` z)

-- | The 'mconcat' definition. It can be overidden for the sake of efficiency
-- | The 'mconcat' definition. It can be overridden for the sake of efficiency
-- but it must still satisfy the property given by the default definition:
--
-- > mconcat = foldr mappend mempty
Expand Down
2 changes: 1 addition & 1 deletion Cabal-tests/tests/cbits/rpmvercmp.c
Original file line number Diff line number Diff line change
Expand Up @@ -132,7 +132,7 @@ int rmpvercmp_impl(const char *a, const char *b, char *str1, char *str2) {
}

/* this catches the case where all numeric and alpha segments have */
/* compared identically but the segment sepparating characters were */
/* compared identically but the segment separating characters were */
/* different */
if ((!*one) && (!*two)) return 0;

Expand Down
2 changes: 1 addition & 1 deletion Cabal/src/Distribution/PackageDescription/Check.hs
Original file line number Diff line number Diff line change
Expand Up @@ -1554,7 +1554,7 @@ checkPathsModuleExtensions pd

-- | Checks GHC options from all ghc-*-options fields from the given BuildInfo
-- and reports flags that are OK during development process, but are
-- unacceptable in a distrubuted package
-- unacceptable in a distributed package
checkDevelopmentOnlyFlagsBuildInfo :: BuildInfo -> [PackageCheck]
checkDevelopmentOnlyFlagsBuildInfo bi =
checkDevelopmentOnlyFlagsOptions "ghc-options" (hcOptions GHC bi)
Expand Down
2 changes: 1 addition & 1 deletion Cabal/src/Distribution/Simple/Build/Macros.hs
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
-- numbers.
--
-- TODO Figure out what to do about backpack and internal libraries. It is very
-- suspecious that this stuff works with munged package identifiers
-- suspicious that this stuff works with munged package identifiers
module Distribution.Simple.Build.Macros (
generateCabalMacrosHeader,
generatePackageVersionMacros,
Expand Down
2 changes: 1 addition & 1 deletion Cabal/src/Distribution/Simple/BuildToolDepends.hs
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ import Distribution.PackageDescription
-- | Desugar a "build-tools" entry into proper a executable dependency if
-- possible.
--
-- An entry can be so desguared in two cases:
-- An entry can be so desugared in two cases:
--
-- 1. The name in build-tools matches a locally defined executable. The
-- executable dependency produced is on that exe in the current package.
Expand Down
2 changes: 1 addition & 1 deletion Cabal/src/Distribution/Simple/Configure.hs
Original file line number Diff line number Diff line change
Expand Up @@ -1160,7 +1160,7 @@ configureCoverage verbosity cfg comp = do
computeEffectiveProfiling :: ConfigFlags -> (Bool {- lib -}, Bool {- exe -})
computeEffectiveProfiling cfg =
-- The --profiling flag sets the default for both libs and exes,
-- but can be overidden by --library-profiling, or the old deprecated
-- but can be overridden by --library-profiling, or the old deprecated
-- --executable-profiling flag.
--
-- The --profiling-detail and --library-profiling-detail flags behave
Expand Down
2 changes: 1 addition & 1 deletion Cabal/src/Distribution/Simple/Utils.hs
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ module Distribution.Simple.Utils (
-- ** 'IOData' re-export
--
-- These types are re-exported from
-- "Distribution.Utils.IOData" for convience as they're
-- "Distribution.Utils.IOData" for convenience as they're
-- exposed in the API of 'rawSystemStdInOut'
IOData(..),
KnownIODataMode (..),
Expand Down
4 changes: 2 additions & 2 deletions Cabal/src/Distribution/Utils/NubList.hs
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
{-# LANGUAGE ScopedTypeVariables #-}
module Distribution.Utils.NubList
( NubList -- opaque
, toNubList -- smart construtor
, toNubList -- smart constructor
, fromNubList
, overNubList

Expand Down Expand Up @@ -39,7 +39,7 @@ overNubList :: Ord a => ([a] -> [a]) -> NubList a -> NubList a
overNubList f (NubList list) = toNubList . f $ list

-- | Monoid operations on NubLists.
-- For a valid Monoid instance we need to satistfy the required monoid laws;
-- For a valid Monoid instance we need to satisfy the required monoid laws;
-- identity, associativity and closure.
--
-- Identity : by inspection:
Expand Down
2 changes: 1 addition & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -202,7 +202,7 @@ SPHINX_FLAGS:=-n -W --keep-going -E
SPHINX_HTML_OUTDIR:=dist-newstyle/doc/users-guide
USERGUIDE_STAMP:=$(SPHINX_HTML_OUTDIR)/index.html

# do pip install everytime so we have up to date requirements when we build
# do pip install every time so we have up to date requirements when we build
users-guide: .python-sphinx-virtualenv $(USERGUIDE_STAMP)
$(USERGUIDE_STAMP) : doc/*.rst
mkdir -p $(SPHINX_HTML_OUTDIR)
Expand Down
2 changes: 1 addition & 1 deletion cabal-dev-scripts/src/GenUtils.hs
Original file line number Diff line number Diff line change
Expand Up @@ -89,7 +89,7 @@ instance Ord OrdT where
| otherwise = compare a b

-------------------------------------------------------------------------------
-- Commmons
-- Commons
-------------------------------------------------------------------------------

header :: String
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -94,7 +94,7 @@ data FlaggedDep qpn =
-- | Dependencies which are always enabled, for the component 'comp'.
| Simple (LDep qpn) Component

-- | Conversatively flatten out flagged dependencies
-- | Conservatively flatten out flagged dependencies
--
-- NOTE: We do not filter out duplicates.
flattenFlaggedDeps :: FlaggedDeps qpn -> [(LDep qpn, Component)]
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -225,7 +225,7 @@ makeCanonical lg qpn@(Q pp _) i =
-- | Link the dependencies of linked parents.
--
-- When we decide to link one package against another we walk through the
-- package's direct depedencies and make sure that they're all linked to each
-- package's direct dependencies and make sure that they're all linked to each
-- other by merging their link groups (or creating new singleton link groups if
-- they don't have link groups yet). We do not need to do this recursively,
-- because having the direct dependencies in a link group means that we must
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -30,12 +30,12 @@ allKnownExtensions = enabledExtensions ++ disabledExtensions
enabledExtensions = map (prettyShow . EnableExtension) knownExtensions
disabledExtensions = map (prettyShow . DisableExtension) knownExtensions

-- Measure the levenshtein distance between two strings
-- Measure the Levenshtein distance between two strings
distance :: String -> String -> Int
distance = levenshteinDistance defaultEditCosts

-- Given an `unknownElement` and a list of `elements` return the element
-- from the list with the closest levenshtein distance to the `unknownElement`
-- from the list with the closest Levenshtein distance to the `unknownElement`
mostSimilarElement :: String -> [String] -> String
mostSimilarElement unknownElement elements = fst . minimumBy (comparing snd) . map mapDist $ elements
where
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -171,7 +171,7 @@ mergeBuckets xs@(x:xs') ys@(y:ys') =
EQ -> y : mergeBuckets xs' ys'
LT -> x : mergeBuckets xs' ys

-- | Override-merge oftwo indexes.
-- | Override-merge of two indexes.
--
-- Packages from the second mask packages of the same exact name
-- (case-sensitively) from the first.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ shouldSuggestExtension =
, ("NoLamdaCase", "NoLambdaCase")
]

-- Given x misspelled language should suggest y langauge
-- Given x misspelled language should suggest y language
shouldSuggestLanguage :: [(String, String)]
shouldSuggestLanguage =
[ ("GHC2020", "GHC2021")
Expand Down
6 changes: 3 additions & 3 deletions cabal-install/cabal-install.cabal
Original file line number Diff line number Diff line change
Expand Up @@ -211,16 +211,16 @@ library
edit-distance >= 0.2.2 && < 0.3,
exceptions >= 0.10.4 && < 0.11,
filepath >= 1.4.0.0 && < 1.5,
hashable >= 1.0 && < 1.4,
HTTP >= 4000.1.5 && < 4000.4,
hashable >= 1.0 && < 1.5,
HTTP >= 4000.1.5 && < 4000.5,
mtl >= 2.0 && < 2.3,
network-uri >= 2.6.0.2 && < 2.7,
pretty >= 1.1 && < 1.2,
process >= 1.2.3.0 && < 1.7,
random >= 1.2 && < 1.3,
stm >= 2.0 && < 2.6,
tar >= 0.5.0.3 && < 0.6,
time >= 1.5.0.1 && < 1.11,
time >= 1.5.0.1 && < 1.12,
zlib >= 0.5.3 && < 0.7,
hackage-security >= 0.6.2.0 && < 0.7,
text >= 1.2.3 && < 1.3,
Expand Down
2 changes: 1 addition & 1 deletion cabal-install/src/Distribution/Client/Check.hs
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,7 @@ check verbosity = do
-- ghc-options: -Wall -Werror
-- checkPackages will yield a warning on the last line, but it
-- would not on each individual branch.
-- Hovever, this is the same way hackage does it, so we will yield
-- However, this is the same way hackage does it, so we will yield
-- the exact same errors as it will.
let pkg_desc = flattenPackageDescription ppd
ioChecks <- checkPackageFiles verbosity pkg_desc "."
Expand Down
12 changes: 6 additions & 6 deletions cabal-install/src/Distribution/Client/CmdErrorMessages.hs
Original file line number Diff line number Diff line change
Expand Up @@ -94,7 +94,7 @@ sortGroupOn key = map (\(x:|xs) -> (key x, x:xs))


----------------------------------------------------
-- Renderering for a few project and package types
-- Rendering for a few project and package types
--

renderTargetSelector :: TargetSelector -> String
Expand Down Expand Up @@ -201,7 +201,7 @@ renderComponentKind Plural ckind = case ckind of


-------------------------------------------------------
-- Renderering error messages for TargetProblem
-- Rendering error messages for TargetProblem
--

-- | Default implementation of 'reportTargetProblems' simply renders one problem per line.
Expand Down Expand Up @@ -302,7 +302,7 @@ renderTargetProblem verb _ (TargetProblemNoSuchComponent pkgid cname) =


------------------------------------------------------------
-- Renderering error messages for TargetProblemNoneEnabled
-- Rendering error messages for TargetProblemNoneEnabled
--

-- | Several commands have a @TargetProblemNoneEnabled@ problem constructor.
Expand Down Expand Up @@ -370,7 +370,7 @@ renderTargetProblemNoneEnabled verb targetSelector targets =
)

------------------------------------------------------------
-- Renderering error messages for TargetProblemNoneEnabled
-- Rendering error messages for TargetProblemNoneEnabled
--

-- | Several commands have a @TargetProblemNoTargets@ problem constructor.
Expand Down Expand Up @@ -405,7 +405,7 @@ renderTargetProblemNoTargets verb targetSelector =
error $ "renderTargetProblemNoTargets: " ++ show ts

-----------------------------------------------------------
-- Renderering error messages for CannotPruneDependencies
-- Rendering error messages for CannotPruneDependencies
--

renderCannotPruneDependencies :: CannotPruneDependencies -> String
Expand Down Expand Up @@ -436,7 +436,7 @@ renderCannotPruneDependencies (CannotPruneDependencies brokenPackages) =
++ " (name of library, executable, test-suite or benchmark)\n"
++ " - build Data.Foo -- module name\n"
++ " - build Data/Foo.hsc -- file name\n\n"
++ "An ambigious target can be qualified by package, component\n"
++ "An ambiguous target can be qualified by package, component\n"
++ "and/or component kind (lib|exe|test|bench|flib)\n"
++ " - build foo:tests -- component qualified by package\n"
++ " - build tests:Data.Foo -- module qualified by component\n"
Expand Down
12 changes: 7 additions & 5 deletions cabal-install/src/Distribution/Client/CmdHaddock.hs
Original file line number Diff line number Diff line change
Expand Up @@ -187,12 +187,14 @@ selectComponentTarget :: SubComponentTarget
selectComponentTarget = selectComponentTargetBasic

reportBuildDocumentationTargetProblems :: Verbosity -> [TargetProblem'] -> IO a
reportBuildDocumentationTargetProblems verbosity problems =
reportBuildDocumentationTargetProblems verbosity problems =
case problems of
[TargetProblemNoneEnabled _ _] -> do
notice verbosity $
"No documentation was generated as this package does not contain a library. "
++ "Perhaps you want to use the --haddock-executables, --haddock-tests, --haddock-benchmarks or "
++ "--haddock-internal flags."
notice verbosity $ unwords
[ "No documentation was generated as this package does not contain a library."
, "Perhaps you want to use the --haddock-all flag, or one or more of the"
, "--haddock-executables, --haddock-tests, --haddock-benchmarks or"
, "--haddock-internal flags."
]
System.Exit.exitSuccess
_ -> reportTargetProblems verbosity "build documentation for" problems
2 changes: 1 addition & 1 deletion cabal-install/src/Distribution/Client/Compat/Semaphore.hs
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ import Data.Typeable (Typeable)
import Data.List.NonEmpty (NonEmpty (..))
import qualified Data.List.NonEmpty as NE

-- | 'QSem' is a quantity semaphore in which the resource is aqcuired
-- | 'QSem' is a quantity semaphore in which the resource is acquired
-- and released in units of one. It provides guaranteed FIFO ordering
-- for satisfying blocked `waitQSem` calls.
--
Expand Down
Loading

0 comments on commit bb4a340

Please sign in to comment.