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
0
Issues
0
List
Boards
Labels
Service Desk
Milestones
Iterations
Merge Requests
0
Merge Requests
0
Requirements
Requirements
List
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Security & Compliance
Security & Compliance
Dependency List
License Compliance
Operations
Operations
Incidents
Environments
Packages & Registries
Packages & Registries
Package Registry
Container Registry
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
Alex D
GHC
Commits
83ca42de
Commit
83ca42de
authored
Jul 15, 2019
by
Ben Gamari
🐢
Committed by
Marge Bot
Aug 07, 2019
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Revert "Make scanr a good producer and consumer"
This reverts commit
4e1dfc37
. Due to #16943.
parent
f1d0e49f
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
2 additions
and
18 deletions
+2
-18
libraries/base/GHC/List.hs
libraries/base/GHC/List.hs
+0
-18
libraries/base/changelog.md
libraries/base/changelog.md
+2
-0
No files found.
libraries/base/GHC/List.hs
View file @
83ca42de
...
...
@@ -385,29 +385,11 @@ foldr1 f = go
-- Note that
--
-- > head (scanr f z xs) == foldr f z xs.
{-# NOINLINE [1] scanr #-}
scanr
::
(
a
->
b
->
b
)
->
b
->
[
a
]
->
[
b
]
scanr
_
q0
[]
=
[
q0
]
scanr
f
q0
(
x
:
xs
)
=
f
x
q
:
qs
where
qs
@
(
q
:
_
)
=
scanr
f
q0
xs
{-# INLINE [0] strictUncurryScanr #-}
strictUncurryScanr
::
(
a
->
b
->
c
)
->
(
a
,
b
)
->
c
strictUncurryScanr
f
pair
=
case
pair
of
(
x
,
y
)
->
f
x
y
{-# INLINE [0] scanrFB #-}
-- See Note [Inline FB functions]
scanrFB
::
(
a
->
b
->
b
)
->
(
b
->
c
->
c
)
->
a
->
(
b
,
c
)
->
(
b
,
c
)
scanrFB
f
c
=
\
x
(
r
,
est
)
->
(
f
x
r
,
r
`
c
`
est
)
{-# RULES
"scanr" [~1] forall f q0 ls . scanr f q0 ls =
build (\c n -> strictUncurryScanr c (foldr (scanrFB f c) (q0,n) ls))
"scanrList" [1] forall f q0 ls .
strictUncurryScanr (:) (foldr (scanrFB f (:)) (q0,[]) ls) =
scanr f q0 ls
#-}
-- | \(\mathcal{O}(n)\). 'scanr1' is a variant of 'scanr' that has no starting
-- value argument.
scanr1
::
(
a
->
a
->
a
)
->
[
a
]
->
[
a
]
...
...
libraries/base/changelog.md
View file @
83ca42de
...
...
@@ -57,6 +57,8 @@
`Word`
, and
`WordN`
now throw an overflow exception for negative shift
values (instead of being undefined behaviour).
*
`scanr`
no longer participates in list fusion (due #16943)
## 4.12.0.0 *21 September 2018*
*
Bundled with GHC 8.6.1
...
...
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