jonathanknowles / jonathanknowles/monoidmap

Provide `NFData1` and `NFData2` instances.

Open
#278 0 comments 0 reactions 1 assignee Claimed by @jonathanknowles View on GitHub
task
Dominant language
Haskell
Stars
21
Forks
1
PR merge metrics
No merged PRs in 30d

Description

Related issue:
- #254

From `containers` version `0.8` onwards, `Map` is an instance of `NFData1` and `NFData2`:

```hs
-- | @since 0.8
instance NFData k => NFData1 (Map k) where
liftRnf rnfx = go
where
go Tip = ()
go (Bin _ kx x l r) = rnf kx `seq` rnfx x `seq` go l `seq` go r

-- | @since 0.8
instance NFData2 Map where
liftRnf2 rnfkx rnfx = go
where
go Tip = ()
go (Bin _ kx x l r) = rnfkx kx `seq` rnfx x `seq` go l `seq` go r
```

Source:
- https://github.com/haskell/containers/blob/7cd38d1e6ab98fdb96bf50496cedb5e0bd2df622/containers/src/Data/Map/Internal.hs#L4600-L4612

Contributor guide

No contributing guide indexed for this repository

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.