Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in / Register
Toggle navigation
Menu
Open sidebar
Glasgow Haskell Compiler
GHC
Commits
4d85d68b
Commit
4d85d68b
authored
Mar 14, 2020
by
Paavo Parkkinen
Committed by
Marge Bot
Mar 17, 2020
Browse files
Clean up
parent
5b632dad
Changes
1
Hide whitespace changes
Inline
Side-by-side
libraries/base/Data/Semigroup.hs
View file @
4d85d68b
...
...
@@ -126,7 +126,6 @@ cycle1 xs = xs' where xs' = xs <> xs'
-- | This lets you use a difference list of a 'Semigroup' as a 'Monoid'.
--
-- >>> import Data.Semigroup
-- >>> let hello = diff "Hello, "
-- >>> appEndo hello "World!"
-- "Hello, World!"
...
...
@@ -136,9 +135,9 @@ cycle1 xs = xs' where xs' = xs <> xs'
-- "Hello, World!"
-- >>> let world = diff "World"
-- >>> let excl = diff "!"
-- >>>
print $
appEndo (hello <> (world <> excl)) mempty
-- >>> appEndo (hello <> (world <> excl)) mempty
-- "Hello, World!"
-- >>>
print $
appEndo ((hello <> world) <> excl) mempty
-- >>> appEndo ((hello <> world) <> excl) mempty
-- "Hello, World!"
diff
::
Semigroup
m
=>
m
->
Endo
m
diff
=
Endo
.
(
<>
)
...
...
Write
Preview
Supports
Markdown
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