Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
C
clean-platform
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
15
Issues
15
List
Boards
Labels
Service Desk
Milestones
Merge Requests
2
Merge Requests
2
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Operations
Operations
Incidents
Environments
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
clean-and-itasks
clean-platform
Commits
27a49449
Commit
27a49449
authored
Oct 09, 2018
by
Steffen Michels
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix the type of Map.foldlWithKey, such that it can be used with a unique state
parent
34099538
Pipeline
#14757
passed with stage
in 1 minute and 14 seconds
Changes
2
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
2 additions
and
2 deletions
+2
-2
src/libraries/OS-Independent/Data/Map.dcl
src/libraries/OS-Independent/Data/Map.dcl
+1
-1
src/libraries/OS-Independent/Data/Map.icl
src/libraries/OS-Independent/Data/Map.icl
+1
-1
No files found.
src/libraries/OS-Independent/Data/Map.dcl
View file @
27a49449
...
...
@@ -109,7 +109,7 @@ del :: !k !(Map k a) -> Map k a | < k
delU
::
!
a
!.(
Map
a
b
)
->
u
:(!
v
:(
Maybe
b
),
!
Map
a
b
)
|
==
a
&
<
a
,
[
u
<=
v
]
// !k !w:(Map k u:v) -> x:(Maybe u:v, !y:(Map k u:v)) | == k & < k, [ w y <= u, x <= y, w <= y]
foldrWithKey
::
!(
k
v
u
:
a
->
u
:
a
)
!
u
:
a
!(
Map
k
v
)
->
u
:
a
foldlWithKey
::
!(
u
:
a
k
v
->
u
:
a
)
!
u
:
a
!(
Map
k
v
)
->
u
:
a
foldlWithKey
::
!(
.
a
->
.(
k
->
.(
v
->
.
a
)))
!.
a
!(
Map
k
v
)
->
.
a
/**
* @type (v a -> a) a (Map k v) -> a
...
...
src/libraries/OS-Independent/Data/Map.icl
View file @
27a49449
...
...
@@ -1225,7 +1225,7 @@ foldrWithKey` f z` (Bin _ kx x l r) = foldrWithKey` f (f kx x (foldrWithKey` f z
//
// > let f result k a = result ++ "(" ++ (show k) ++ ":" ++ a ++ ")"
// > foldlWithKey f "Map: " (fromList [(5,"a"), (3,"b")]) == "Map: (3:b)(5:a)"
foldlWithKey
::
!(
u
:
a
k
v
->
u
:
a
)
!
u
:
a
!(
Map
k
v
)
->
u
:
a
foldlWithKey
::
!(
.
a
->
.(
k
->
.(
v
->
.
a
)))
!.
a
!(
Map
k
v
)
->
.
a
foldlWithKey
f
z`
Tip
=
z`
foldlWithKey
f
z`
(
Bin
_
kx
x
l
r
)
=
foldlWithKey
f
(
f
(
foldlWithKey
f
z`
l
)
kx
x
)
r
...
...
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