Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in / Register
Toggle navigation
GHC
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Locked Files
Issues
4,269
Issues
4,269
List
Boards
Labels
Service Desk
Milestones
Iterations
Merge Requests
413
Merge Requests
413
Requirements
Requirements
List
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Security & Compliance
Security & Compliance
Dependency List
License Compliance
Operations
Operations
Incidents
Environments
Analytics
Analytics
CI / CD
Code Review
Insights
Issue
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Glasgow Haskell Compiler
GHC
Commits
a2567e99
Commit
a2567e99
authored
Dec 28, 2020
by
Oleg Grenrus
Committed by
Marge Bot
Jan 10, 2021
1
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Correct more doctests
parent
4d1ea2c3
Pipeline
#29727
failed with stages
in 424 minutes and 31 seconds
Changes
9
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Showing
9 changed files
with
33 additions
and
20 deletions
+33
-20
libraries/base/Data/Bifoldable.hs
libraries/base/Data/Bifoldable.hs
+1
-0
libraries/base/Data/Bifunctor.hs
libraries/base/Data/Bifunctor.hs
+1
-0
libraries/base/Data/Foldable.hs
libraries/base/Data/Foldable.hs
+4
-0
libraries/base/Data/Functor.hs
libraries/base/Data/Functor.hs
+1
-1
libraries/base/Data/Traversable.hs
libraries/base/Data/Traversable.hs
+3
-9
libraries/base/GHC/Base.hs
libraries/base/GHC/Base.hs
+4
-1
libraries/base/GHC/Float.hs
libraries/base/GHC/Float.hs
+1
-1
libraries/base/GHC/List.hs
libraries/base/GHC/List.hs
+16
-8
libraries/base/Numeric.hs
libraries/base/Numeric.hs
+2
-0
No files found.
libraries/base/Data/Bifoldable.hs
View file @
a2567e99
...
...
@@ -58,6 +58,7 @@ import GHC.Generics (K1(..))
-- $setup
-- >>> import Prelude
-- >>> import Data.Char
-- >>> import Data.Monoid (Product (..), Sum (..))
-- >>> data BiList a b = BiList [a] [b]
-- >>> instance Bifoldable BiList where bifoldr f g z (BiList as bs) = foldr f (foldr g z bs) as
...
...
libraries/base/Data/Bifunctor.hs
View file @
a2567e99
...
...
@@ -22,6 +22,7 @@ import GHC.Generics ( K1(..) )
-- $setup
-- >>> import Prelude
-- >>> import Data.Char (toUpper)
-- | A bifunctor is a type constructor that takes
-- two type arguments and is a functor in /both/ arguments. That
...
...
libraries/base/Data/Foldable.hs
View file @
a2567e99
...
...
@@ -116,6 +116,10 @@ import GHC.Base hiding ( foldr )
import
GHC.Generics
import
GHC.Num
(
Num
(
..
)
)
-- $setup
-- >>> import Prelude
-- >>> import Data.Monoid (Product (..), Sum (..))
infix
4
`
elem
`,
`
notElem
`
-- XXX: Missing haddock feature. Links to anchors in other modules
...
...
libraries/base/Data/Functor.hs
View file @
a2567e99
...
...
@@ -25,7 +25,7 @@
-- Nothing -- (Int -> String) -> Maybe Int -> Maybe String
--
-- >>> fmap show [1,2,3] -- (a -> b) -> f a -> f b
-- ["1",
"2", "3"]
-- (Int -> String) -> [Int] -> [String]
-- ["1",
"2","3"]
-- (Int -> String) -> [Int] -> [String]
--
-- >>> fmap show [] -- (a -> b) -> f a -> f b
-- [] -- (Int -> String) -> [Int] -> [String]
...
...
libraries/base/Data/Traversable.hs
View file @
a2567e99
...
...
@@ -167,15 +167,9 @@ class (Functor t, Foldable t) => Traversable t where
--
-- ==== __Examples__
--
-- 'mapM' is 'traverse' for 'Monad', and the following example shows
-- how 'mapM' can apply an 'IO' action to a 'List' to produce a
-- structured result.
--
-- Basic usage:
--
-- >>> import System.IO
-- >>> mapM (openTempFile ".") ["t1", "t2"]
-- [("./t169980-3",{handle: ./t169980-3}),("./t269980-4",{handle: ./t269980-4})]
-- 'mapM' is literally a 'traverse' with a type signature restricted
-- to 'Monad'. Its implementation may be more efficient due to additional
-- power of 'Monad'.
--
mapM
::
Monad
m
=>
(
a
->
m
b
)
->
t
a
->
m
(
t
b
)
{-# INLINE mapM #-}
-- See Note [Inline default methods]
...
...
libraries/base/GHC/Base.hs
View file @
a2567e99
...
...
@@ -129,6 +129,9 @@ import {-# SOURCE #-} Data.Semigroup.Internal ( stimesDefault
,
stimesIdempotentMonoid
)
-- $setup
-- >>> import GHC.Num
infixr
9
.
infixr
5
++
infixl
4
<$
...
...
@@ -216,7 +219,7 @@ class Semigroup a where
-- The default definition should be sufficient, but this can be
-- overridden for efficiency.
--
-- >>> import Data.List.NonEmpty
-- >>> import Data.List.NonEmpty
(NonEmpty (..))
-- >>> sconcat $ "Hello" :| [" ", "Haskell", "!"]
-- "Hello Haskell!"
sconcat
::
NonEmpty
a
->
a
...
...
libraries/base/GHC/Float.hs
View file @
a2567e99
...
...
@@ -71,7 +71,7 @@ import GHC.Num.BigNat
infixr
8
**
-- $setup
-- >>> import
GHC.Num
-- >>> import
Prelude
------------------------------------------------------------------------
-- Standard numeric classes
...
...
libraries/base/GHC/List.hs
View file @
a2567e99
...
...
@@ -42,7 +42,15 @@ infixl 9 !!
infix
4
`
elem
`,
`
notElem
`
-- $setup
-- >>> import GHC.Base
-- >>> import Prelude (Num (..), Ord (..), Int, Double, odd, not, undefined)
-- >>> import Control.DeepSeq (force)
--
-- -- compiled versions are uninterruptible.
-- https://gitlab.haskell.org/ghc/ghc/-/issues/367
--
-- >>> let or = foldr (||) False
-- >>> let and = foldr (&&) True
--------------------------------------------------------------
-- List-manipulation functions
...
...
@@ -506,8 +514,8 @@ match on everything past the :, which is just the tail of scanl.
-- False
-- >>> foldr1 (||) [False, False, True, True]
-- True
-- >>> foldr1 (+) [1..]
-- *
Hangs forever *
-- >>> fo
rce $ fo
ldr1 (+) [1..]
-- *
** Exception: stack overflow
foldr1
::
(
a
->
a
->
a
)
->
[
a
]
->
a
foldr1
f
=
go
where
go
[
x
]
=
x
...
...
@@ -593,7 +601,7 @@ remove the cause for the chain of evaluations, and all is well.
-- [False,False,True,True]
-- >>> scanr1 (||) [True, True, False, False]
-- [True,True,False,False]
-- >>> scanr1 (+) [1..]
-- >>>
force $
scanr1 (+) [1..]
-- * Hangs forever *
scanr1
::
(
a
->
a
->
a
)
->
[
a
]
->
[
a
]
scanr1
_
[]
=
[]
...
...
@@ -656,9 +664,9 @@ minimum xs = foldl1' min xs
-- the consumer doesn't force each iterate. See 'iterate'' for a strict
-- variant of this function.
--
-- >>> iterate not True
-- >>>
take 10 $
iterate not True
-- [True,False,True,False...
-- >>> iterate (+3) 42
-- >>>
take 10 $
iterate (+3) 42
-- [42,45,48,51,54,57,60,63...
{-# NOINLINE [1] iterate #-}
iterate
::
(
a
->
a
)
->
a
->
[
a
]
...
...
@@ -701,7 +709,7 @@ iterate'FB c f x0 = go x0
-- | 'repeat' @x@ is an infinite list, with @x@ the value of every element.
--
-- >>> repeat 17
-- >>>
take 20 $
repeat 17
--[17,17,17,17,17,17,17,17,17...
repeat
::
a
->
[
a
]
{-# INLINE [0] repeat #-}
...
...
@@ -739,9 +747,9 @@ replicate n x = take n (repeat x)
--
-- >>> cycle []
-- *** Exception: Prelude.cycle: empty list
-- >>> cycle [42]
-- >>>
take 20 $
cycle [42]
-- [42,42,42,42,42,42,42,42,42,42...
-- >>> cycle [2, 5, 7]
-- >>>
take 20 $
cycle [2, 5, 7]
-- [2,5,7,2,5,7,2,5,7,2,5,7...
cycle
::
[
a
]
->
[
a
]
cycle
[]
=
errorEmptyList
"cycle"
...
...
libraries/base/Numeric.hs
View file @
a2567e99
...
...
@@ -72,6 +72,8 @@ import GHC.Show
import
Text.ParserCombinators.ReadP
(
ReadP
,
readP_to_S
,
pfail
)
import
qualified
Text.Read.Lex
as
L
-- $setup
-- >>> import Prelude
-- -----------------------------------------------------------------------------
-- Reading
...
...
Marge Bot
💬
@marge-bot
mentioned in merge request
!4752 (closed)
·
Jan 10, 2021
mentioned in merge request
!4752 (closed)
mentioned in merge request !4752
Toggle commit list
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment