jonathanknowles / jonathanknowles/monoidmap
Generalised transformation functions.
- Dominant language
- Haskell
- Stars
- 21
- Forks
- 1
- PR merge metrics
- No merged PRs in 30d
Description
Consider adding the following functions:
## `withMap`
```hs
withMap
:: MonoidNull v2
=> (Map k1 v1 -> Map k2 v2)
-> (MonoidMap k1 v1 -> MonoidMap k2 v2)
withMap f = fromMap . f . toMap
```
## `withMapKeys`
Applies a transformation that is guaranteed to neither create nor modify values, avoiding the need to perform a post-processing step that removes `null` values.
```hs
withMapKeys
:: (forall x. Map k1 x -> Map k2 x)
-> (MonoidMap k1 v -> MonoidMap k2 v)
withMapKeys f (MonoidMap m) = MonoidMap (f m)
```
See: 3deb419d221b90ad8593954758b083ad9ca7ff92
Contributor guide
No contributing guide indexed for this repository
Assessment
This issue has not been assessed yet.