Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
C
cleanplatform
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
21
Issues
21
List
Boards
Labels
Milestones
Merge Requests
3
Merge Requests
3
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
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
cleananditasks
cleanplatform
Commits
44d69fee
Commit
44d69fee
authored
May 21, 2019
by
Steffen Michels
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Data.Map: remove foldlStrict
parent
abb84e35
Pipeline
#23461
passed with stage
in 3 minutes and 57 seconds
Changes
2
Pipelines
1
Hide whitespace changes
Inline
Sidebyside
Showing
2 changed files
with
6 additions
and
14 deletions
+6
14
src/libraries/OSIndependent/Data/Map.dcl
src/libraries/OSIndependent/Data/Map.dcl
+0
2
src/libraries/OSIndependent/Data/Map.icl
src/libraries/OSIndependent/Data/Map.icl
+6
12
No files found.
src/libraries/OSIndependent/Data/Map.dcl
View file @
44d69fee
...
...
@@ 438,8 +438,6 @@ union :: !(Map k a) !(Map k a) > Map k a  < k
mergeWithKey
::
!(
k
a
b
>
Maybe
c
)
!((
Map
k
a
)
>
Map
k
c
)
!((
Map
k
b
)
>
Map
k
c
)
!(
Map
k
a
)
!(
Map
k
b
)
>
Map
k
c

<
k
foldlStrict
::
!(
a
b
>
a
)
!
a
![
b
]
>
a
/**
* Removes the values at given key positions. The mapping itself can be spine unique.
*
...
...
src/libraries/OSIndependent/Data/Map.icl
View file @
44d69fee
...
...
@@ 557,10 +557,10 @@ union t1 Tip = t1
union
t1
t2
=
hedgeUnion
Nothing
Nothing
t1
t2
unions
::
![
Map
k
a
]
>
Map
k
a

<
k
unions
ts
=
foldl
Strict
union
newMap
ts
unions
ts
=
foldl
union
newMap
ts
unionsWith
::
!(
a
a
>
a
)
![
Map
k
a
]
>
Map
k
a

<
k
unionsWith
f
ts
=
foldl
Strict
(
unionWith
f
)
newMap
ts
unionsWith
f
ts
=
foldl
(
unionWith
f
)
newMap
ts
unionWith
::
!(
a
a
>
a
)
!(
Map
k
a
)
!(
Map
k
a
)
>
Map
k
a

<
k
unionWith
f
m1
m2
=
unionWithKey
(
appUnion
f
)
m1
m2
...
...
@@ 1088,9 +1088,9 @@ foldr` f z` (Bin _ _ x l r) = foldr` f (f x (foldr` f z` r)) l
//
// > let f len a = len + (length a)
// > foldl f 0 (fromList [(5,"a"), (3,"bbb")]) == 4
foldl
::
!(
a
b
>
a
)
!
a
!(
Map
k
b
)
>
a
/*
foldl :: !(a b > a) !a !(Map k b) > a
foldl f z` Tip = z`
foldl
f
z`
(
Bin
_
_
x
l
r
)
=
foldl
f
(
f
(
foldl
f
z`
l
)
x
)
r
foldl f z` (Bin _ _ x l r) = foldl f (f (foldl f z` l) x) r
*/
//  /O(n)/. A strict version of 'foldl`. Each application of the operator is
// evaluated before using the result in the next application. This
...
...
@@ 1200,7 +1200,7 @@ fromList [(kx0, x0) : xs0]
not_ordered
kx
[(
ky
,_)
:
_]
=
kx
>=
ky
fromList`
::
!(
Map
a
b
)
!
u
:[
v
:(!
a
,
!
b
)]
>
Map
a
b

==
a
&
<
a
,
[
u
<=
v
]
fromList`
t0
xs
=
foldl
Strict
ins
t0
xs
fromList`
t0
xs
=
foldl
ins
t0
xs
where
ins
t
(
k
,
x
)
=
put
k
x
t
go
::
!
Int
!(
Map
a
b
)
!
u
:[
v
:(!
a
,
!
b
)]
>
Map
a
b

==
a
&
<
a
,
[
u
<=
v
]
...
...
@@ 1244,7 +1244,7 @@ fromListWith f xs :== fromListWithKey (\_ x y > f x y) xs
// > fromListWithKey f [] == newMap
fromListWithKey
::
!(
k
a
a
>
a
)
![(!
k
,
!
a
)]
>
Map
k
a

<
k
fromListWithKey
f
xs
=
foldl
Strict
(
ins
f
)
newMap
xs
fromListWithKey
f
xs
=
foldl
(
ins
f
)
newMap
xs
where
ins
::
!(
k
a
a
>
a
)
!(
Map
k
a
)
!(!
k
,
!
a
)
>
Map
k
a

<
k
ins
f
t
(
k
,
x
)
=
putWithKey
f
k
x
t
...
...
@@ 1963,12 +1963,6 @@ validmapSize t
(
Just
n
,
Just
m
)

n
+
m
+1
==
sz
>
Just
sz
_
>
Nothing
foldlStrict
::
!(
a
b
>
a
)
!
a
![
b
]
>
a
foldlStrict
f
acc
[]
=
acc
foldlStrict
f
acc
[
x
:
xs
]
#!
z`
=
f
acc
x
=
foldlStrict
f
z`
xs
//  /O(1)/. Decompose a map into pieces based on the structure of the underlying
// tree. This function is useful for consuming a map in parallel.
//
...
...
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