-
-
Notifications
You must be signed in to change notification settings - Fork 245
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Co-authored-by: Tim <hello@timsmart.co> Co-authored-by: Tim Smart <tim.smart@arisechurch.com>
- Loading branch information
1 parent
812a4e8
commit 42a8f99
Showing
6 changed files
with
78 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
--- | ||
"effect": minor | ||
--- | ||
|
||
Added `RcMap.keys` and `MutableHashMap.keys`. | ||
|
||
These functions allow you to get a list of keys currently stored in the underlying hash map. | ||
|
||
```ts | ||
const map = MutableHashMap.make([["a", "a"], ["b", "b"], ["c", "c"]]) | ||
const keys = MutableHashMap.keys(map) // ["a", "b", "c"] | ||
``` | ||
|
||
```ts | ||
Effect.gen(function* () { | ||
const map = yield* RcMap.make({ | ||
lookup: (key) => Effect.succeed(key) | ||
}) | ||
|
||
yield* RcMap.get(map, "a") | ||
yield* RcMap.get(map, "b") | ||
yield* RcMap.get(map, "c") | ||
|
||
const keys = yield* RcMap.keys(map) // ["a", "b", "c"] | ||
}) | ||
``` |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters