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
Packages
dph
Commits
3a724748
Commit
3a724748
authored
Mar 27, 2007
by
rl@cse.unsw.edu.au
Browse files
Rewrite scanl1U
parent
39beda6b
Changes
1
Hide whitespace changes
Inline
Side-by-side
Data/Array/Parallel/Unlifted/Flat/Combinators.hs
View file @
3a724748
...
...
@@ -29,7 +29,7 @@ module Data.Array.Parallel.Unlifted.Flat.Combinators (
import
Data.Array.Parallel.Base
(
(
:*:
)(
..
),
MaybeS
(
..
),
checkNotEmpty
)
import
Data.Array.Parallel.Stream
(
mapS
,
filterS
,
foldS
,
fold1MaybeS
,
scanS
,
mapAccumS
,
mapS
,
filterS
,
foldS
,
fold1MaybeS
,
scan1S
,
scanS
,
mapAccumS
,
zipWithS
,
zipWith3S
)
import
Data.Array.Parallel.Unlifted.Flat.UArr
(
UA
,
UArr
,
...
...
@@ -100,12 +100,10 @@ scanlU f z = unstreamU . scanS f z . streamU
-- |Prefix scan of a non-empty array proceeding from left to right
--
-- FIXME: Rewrite for 'Stream's.
--
scanl1U
::
UA
a
=>
(
a
->
a
->
a
)
->
UArr
a
->
UArr
a
{-# INLINE scanl1U #-}
scanl1U
f
arr
=
checkNotEmpty
(
here
"scanl1U"
)
(
lengthU
arr
)
$
scanlU
f
(
arr
!:
0
)
(
sliceU
arr
1
(
length
U
arr
-
1
))
unstreamU
(
scan1S
f
(
stream
U
arr
))
-- |Prefix scan proceedings from left to right that needs an associative
-- combination function with its unit
...
...
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