-
Notifications
You must be signed in to change notification settings - Fork 5
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add timed and test with GHC 9.8 (#11)
- Loading branch information
Showing
4 changed files
with
45 additions
and
20 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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,5 @@ | ||
name: monad-time | ||
version: 0.4.0.0 | ||
version: 0.4.1.0 | ||
synopsis: Type class for monads which carry | ||
the notion of the current time. | ||
description: 'MonadTime' type class for monads | ||
|
@@ -14,14 +14,16 @@ category: Control | |
build-type: Simple | ||
cabal-version: >=1.10 | ||
extra-source-files: README.md CHANGELOG.md | ||
tested-with: GHC ==8.8.4 || ==8.10.7 || ==9.0.2 || ==9.2.8 || ==9.4.5 || ==9.6.2 | ||
tested-with: GHC ==8.8.4 || ==8.10.7 || ==9.0.2 || ==9.2.8 || ==9.4.8 || ==9.6.4 | ||
|| ==9.8.1 | ||
|
||
source-repository head | ||
type: git | ||
location: [email protected]:scrive/monad-time.git | ||
|
||
library | ||
exposed-modules: Control.Monad.Time | ||
Control.Monad.Time.Utils | ||
|
||
build-depends: base >=4.13 && < 5, | ||
mtl, | ||
|
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,13 @@ | ||
module Control.Monad.Time.Utils | ||
( timed | ||
) where | ||
|
||
import Control.Monad.Time | ||
|
||
-- | Measure how much time a monadic action takes. | ||
timed :: MonadTime m => m r -> m (r, Double) | ||
timed mr = do | ||
t1 <- monotonicTime | ||
r <- mr | ||
t2 <- monotonicTime | ||
r `seq` pure (r, t2 - t1) |