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
13
Issues
13
List
Boards
Labels
Service Desk
Milestones
Merge Requests
0
Merge Requests
0
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
9da037d6
Verified
Commit
9da037d6
authored
Mar 31, 2020
by
Camil Staps
🚀
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Add notes on performance to Map and Set
parent
1218daf2
Pipeline
#40761
passed with stage
in 1 minute and 54 seconds
Changes
2
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
9 additions
and
0 deletions
+9
-0
src/libraries/OS-Independent/Data/Map.dcl
src/libraries/OS-Independent/Data/Map.dcl
+6
-0
src/libraries/OS-Independent/Data/Set.dcl
src/libraries/OS-Independent/Data/Set.dcl
+3
-0
No files found.
src/libraries/OS-Independent/Data/Map.dcl
View file @
9da037d6
...
...
@@ -82,6 +82,12 @@ import StdClass
* The abstract Map type provides the mapping.
* For example "Map Int String" is a mapping "from" integers "to" strings.
*
* Notes on performance:
* - For maps from `Int`, you can use Data.IntMap in many cases.
* - Avoid using tuples as keys, since strictness information is lost in their
* `<` instance. Instead, define a (local) record with strict fields where
* appropriate.
*
* @var The key type on which the data structure is indexed.
* @var The type of the values stored in the mapping.
*
...
...
src/libraries/OS-Independent/Data/Set.dcl
View file @
9da037d6
...
...
@@ -76,6 +76,9 @@ from Data.Foldable import class Foldable
/**
* A `Set a` is an unordered, uncounted collection of values of type `a`.
*
* Like with keys in `Map`, avoid tuple elements since this can be slow.
* Instead, define a (local) record with strict fields where appropriate.
*
* @invariant integrity: A.s :: Set a | Eq, genShow{|*|}, gPrint{|*|} a:
* // Check that the data structure is still correct.
* name "no_duplicates" (no_duplicates s) /\
...
...
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