summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBryanOSullivan <>2014-10-04 23:24:00 (GMT)
committerhdiff <hdiff@hdiff.luite.com>2014-10-04 23:24:00 (GMT)
commit3f50b75eaed75e17507b40b0b8337ffb16b73f9e (patch)
tree6b0aa9c3fda9893a59591a70278aadfcac8fbcf0
parentec8328e06d30cf72f262fe58dae34c8891fc22db (diff)
version 1.0.2.01.0.2.0
-rw-r--r--Criterion/Main/Options.hs42
-rw-r--r--changelog.md5
-rw-r--r--criterion.cabal4
3 files changed, 29 insertions, 22 deletions
diff --git a/Criterion/Main/Options.hs b/Criterion/Main/Options.hs
index bfd6952..796c2b4 100644
--- a/Criterion/Main/Options.hs
+++ b/Criterion/Main/Options.hs
@@ -134,26 +134,29 @@ outputOption :: Maybe String -> Mod OptionFields String -> Parser (Maybe String)
outputOption file m =
optional (strOption (m <> metavar "FILE" <> maybe mempty value file))
-range :: (Show a, Read a, Ord a) => a -> a -> String -> ReadM a
-range lo hi s =
- case reads s of
- [(i, "")]
- | i >= lo && i <= hi -> return i
- | otherwise -> readerError $ show i ++ " is outside range " ++
- show (lo,hi)
- _ -> readerError $ show s ++ " is not a number"
+range :: (Show a, Read a, Ord a) => a -> a -> ReadM a
+range lo hi = do
+ s <- readerAsk
+ case reads s of
+ [(i, "")]
+ | i >= lo && i <= hi -> return i
+ | otherwise -> readerError $ show i ++ " is outside range " ++
+ show (lo,hi)
+ _ -> readerError $ show s ++ " is not a number"
-match :: String -> ReadM MatchType
-match m
- | mm `isPrefixOf` "pfx" = return Prefix
- | mm `isPrefixOf` "prefix" = return Prefix
- | mm `isPrefixOf` "glob" = return Glob
- | otherwise = readerError $
- show m ++ " is not a known match type"
- where mm = map toLower m
+match :: ReadM MatchType
+match = do
+ m <- readerAsk
+ case map toLower m of
+ mm | mm `isPrefixOf` "pfx" -> return Prefix
+ | mm `isPrefixOf` "prefix" -> return Prefix
+ | mm `isPrefixOf` "glob" -> return Glob
+ | otherwise -> readerError $
+ show m ++ " is not a known match type"
-regressParams :: String -> ReadM ([String], String)
-regressParams m = do
+regressParams :: ReadM ([String], String)
+regressParams = do
+ m <- readerAsk
let repl ',' = ' '
repl c = c
tidy = reverse . dropWhile isSpace . reverse . dropWhile isSpace
@@ -163,8 +166,7 @@ regressParams m = do
when (null ps) $
readerError "no predictors specified"
let ret = (words . map repl . drop 1 $ ps, tidy r)
- either readerError (ReadM . Right . const ()) $ uncurry validateAccessors ret
- return ret
+ either readerError (const (return ret)) $ uncurry validateAccessors ret
-- | Flesh out a command line parser.
describe :: Config -> ParserInfo Mode
diff --git a/changelog.md b/changelog.md
index f4fe5b5..f1c5131 100644
--- a/changelog.md
+++ b/changelog.md
@@ -1,3 +1,8 @@
+1.0.2.0
+
+* Bump lower bound on optparse-applicative to 0.11 to handle yet more
+ annoying API churn.
+
1.0.1.0
* Added a lower bound of 0.10 on the optparse-applicative dependency,
diff --git a/criterion.cabal b/criterion.cabal
index 060fc1d..18bc5db 100644
--- a/criterion.cabal
+++ b/criterion.cabal
@@ -1,5 +1,5 @@
name: criterion
-version: 1.0.1.0
+version: 1.0.2.0
synopsis: Robust, reliable performance measurement and analysis
license: BSD3
license-file: LICENSE
@@ -87,7 +87,7 @@ library
hastache >= 0.6.0,
mtl >= 2,
mwc-random >= 0.8.0.3,
- optparse-applicative >= 0.10,
+ optparse-applicative >= 0.11,
parsec >= 3.1.0,
statistics >= 0.13.2.1,
text >= 0.11,