hw-diagnostics 0.0.0.2 → 0.0.0.3
raw patch · 3 files changed
+14/−11 lines, 3 filesdep ~basePVP: minor bump suggested
API additions: PVP suggests at least a minor version bump
Dependency ranges changed: base
API changes (from Hackage documentation)
+ HaskellWorks.Diagnostics.Time: measureIO :: IO a -> IO a
Files
- README.md +1/−1
- hw-diagnostics.cabal +7/−7
- src/HaskellWorks/Diagnostics/Time.hs +6/−3
README.md view
@@ -1,4 +1,4 @@ # hw-diagnostics-[](https://circleci.com/gh/haskell-works/hw-diagnostics/tree/v0.0-branch)+[](https://circleci.com/gh/haskell-works/hw-diagnostics/tree/0.0-branch) Simple facilities for debugging code
hw-diagnostics.cabal view
@@ -1,5 +1,5 @@ name: hw-diagnostics-version: 0.0.0.2+version: 0.0.0.3 synopsis: Conduits for tokenizing streams. description: Please see README.md homepage: http://github.com/haskell-works/hw-diagnostics#readme@@ -11,13 +11,13 @@ category: Data, Conduit build-type: Simple extra-source-files: README.md-cabal-version: >= 1.10+cabal-version: >= 1.22 executable hw-diagnostics-example hs-source-dirs: app main-is: Main.hs ghc-options: -threaded -rtsopts -with-rtsopts=-N -Wall- build-depends: base >= 4 && < 5+ build-depends: base >= 4 && < 5 , hw-diagnostics default-language: Haskell2010 @@ -25,18 +25,18 @@ hs-source-dirs: src exposed-modules: HaskellWorks.Diagnostics , HaskellWorks.Diagnostics.Time- build-depends: base >= 4 && < 5+ build-depends: base >= 4 && < 5 default-language: Haskell2010- ghc-options: -rtsopts -with-rtsopts=-N -Wall+ ghc-options: -Wall test-suite hw-diagnostics-test type: exitcode-stdio-1.0 hs-source-dirs: test main-is: Spec.hs other-modules: HaskellWorks.DiagnosticsSpec- build-depends: base- , hspec >= 1.3+ build-depends: base >= 4 && < 5+ , hspec >= 1.3 , QuickCheck ghc-options: -threaded -rtsopts -with-rtsopts=-N -Wall default-language: Haskell2010
src/HaskellWorks/Diagnostics/Time.hs view
@@ -5,9 +5,12 @@ import System.CPUTime measure :: a -> IO a-measure a = do+measure a = measureIO (return a)++measureIO :: IO a -> IO a+measureIO a = do start <- getCPUTime- let !b = a+ !b <- a end <- getCPUTime- print (end - start)+ putStrLn $ show ((end - start) `div` 1000000000) ++ " ms" return b