Add `instance Random DiffTime`
Open
- Dominant language
- Haskell
- Stars
- 59
- Forks
- 56
- PR merge metrics
- No merged PRs in 30d
Description
```haskell
instance Random DiffTime where
random :: (RandomGen g) => g -> (DiffTime, g)
random g =
let (i, g') = random g
in (picosecondsToDiffTime $ fromIntegral (i :: Integer), g')
randomR :: RandomGen g => (DiffTime, DiffTime) -> g -> (DiffTime, g)
randomR (a, b) g =
let (i, g') = randomR (diffTimeToPicoseconds a, diffTimeToPicoseconds b) g
in (picosecondsToDiffTime i, g')
```
Note that the instance can't go into `time` because of `random -> splitmix -> time` dependency chain.
Contributor guide
No contributing guide indexed for this repository
Assessment
This issue has not been assessed yet.