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
e77852d4
Commit
e77852d4
authored
May 15, 2020
by
Peter Achten
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fixed the overly restrictive types of filter and partition in Data.Set into polymorphic types
parent
0cdb454e
Pipeline
#42467
passed with stage
in 2 minutes and 10 seconds
Changes
2
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
4 additions
and
6 deletions
+4
-6
src/libraries/OS-Independent/Data/Set.dcl
src/libraries/OS-Independent/Data/Set.dcl
+2
-4
src/libraries/OS-Independent/Data/Set.icl
src/libraries/OS-Independent/Data/Set.icl
+2
-2
No files found.
src/libraries/OS-Independent/Data/Set.dcl
View file @
e77852d4
...
...
@@ -370,8 +370,7 @@ intersections :: ![Set a] -> Set a | < a
* sort (toList (filter (pred p) xs))
* =.= sort (removeDup ('StdList'.filter (pred p) (toList xs)))
*/
filter
::
!(
a
->
Bool
)
!(
Set
a
)
->
Set
a
|
<
a
special
a
=
Int
;
a
=
String
filter
::
!(
a
->
Bool
)
!(
Set
a
)
->
Set
a
/**
* Partition the set into two sets, one with all elements that satisfy the
...
...
@@ -392,8 +391,7 @@ filter :: !(a -> Bool) !(Set a) -> Set a | < a
* (true`,false`) = (toList true, toList false)
* xs` = true` ++ false`
*/
partition
::
!(
a
->
Bool
)
!(
Set
a
)
->
(!
Set
a
,
!
Set
a
)
|
<
a
special
a
=
Int
;
a
=
String
partition
::
!(
a
->
Bool
)
!(
Set
a
)
->
(!
Set
a
,
!
Set
a
)
/**
* Split a set in elements less and elements greater than a certain pivot.
...
...
src/libraries/OS-Independent/Data/Set.icl
View file @
e77852d4
...
...
@@ -198,13 +198,13 @@ hedgeInt blo bhi (Bin _ x l r) t2
* Filter and partition
*--------------------------------------------------------------------*/
filter
::
!(
a
->
Bool
)
!(
Set
a
)
->
Set
a
|
<
a
filter
::
!(
a
->
Bool
)
!(
Set
a
)
->
Set
a
filter
p
(
Bin
_
x
l
r
)
|
p
x
=
link
x
(
filter
p
l
)
(
filter
p
r
)
|
otherwise
=
merge
(
filter
p
l
)
(
filter
p
r
)
filter
_
tip
=
tip
partition
::
!(
a
->
Bool
)
!(
Set
a
)
->
(!
Set
a
,
!
Set
a
)
|
<
a
partition
::
!(
a
->
Bool
)
!(
Set
a
)
->
(!
Set
a
,
!
Set
a
)
partition
p
(
Bin
_
x
l
r
)
#!
(
l1
,
l2
)
=
partition
p
l
#!
(
r1
,
r2
)
=
partition
p
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