summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorHenningThielemann <>2019-08-13 19:06:00 (GMT)
committerhdiff <hdiff@hdiff.luite.com>2019-08-13 19:06:00 (GMT)
commitf09c81e302d1884690666e2ea53644ce08924eeb (patch)
tree71bde620d9a339b0c60cf475974d0dcde37d12d2
parent6fef33ce9cab1d37dd099c1731c895a71f2a6bf4 (diff)
version 0.2.4.3HEAD0.2.4.3master
-rw-r--r--classify-frog.cabal10
-rw-r--r--src/Option.hs19
2 files changed, 11 insertions, 18 deletions
diff --git a/classify-frog.cabal b/classify-frog.cabal
index 50e248c..d8666d4 100644
--- a/classify-frog.cabal
+++ b/classify-frog.cabal
@@ -1,5 +1,5 @@
Name: classify-frog
-Version: 0.2.4.2
+Version: 0.2.4.3
License: BSD3
License-File: LICENSE
Author: Henning Thielemann <haskell@henning-thielemann.de>
@@ -42,7 +42,7 @@ Data-Files:
model/diclo/hmm-supervised.csv
Source-Repository this
- Tag: 0.2.4.2
+ Tag: 0.2.4.3
Type: darcs
Location: http://hub.darcs.net/thielema/classify-frog
@@ -120,7 +120,7 @@ Executable classify-frog
storable-record >=0.0 && <0.1,
array >=0.4 && <0.6,
time >=1.5 && <1.9,
- Cabal >=1.14 && <3,
+ shell-utility >=0.0 && <0.1,
optparse-applicative >=0.11 && <0.15,
filemanip >=0.3.6 && <0.4,
pathtype >=0.8 && <0.9,
@@ -141,8 +141,8 @@ Executable classify-frog
SignalProcessingSpecificLLVM
SignalProcessingLLVM
Build-Depends:
- synthesizer-llvm >=0.8 && <0.9,
- llvm-extra >=0.6 && <0.8,
+ synthesizer-llvm >=0.8.2 && <0.9,
+ llvm-extra >=0.8 && <0.9,
llvm-tf >=3.0 && <3.2
Else
Hs-Source-Dirs: llvm/no
diff --git a/src/Option.hs b/src/Option.hs
index 96895cc..3960029 100644
--- a/src/Option.hs
+++ b/src/Option.hs
@@ -4,9 +4,9 @@ import qualified Feature
import qualified Parameters as Params
import qualified HiddenMarkovModel as HMM
-import qualified Distribution.Verbosity as Verbosity
-import qualified Distribution.ReadE as ReadE
-import Distribution.Verbosity (Verbosity)
+import qualified Shell.Utility.Verbosity as Verbosity
+import Shell.Utility.Verbosity (Verbosity)
+import Shell.Utility.ParseArgument (parseNumber)
import qualified Options.Applicative as OP
@@ -39,10 +39,9 @@ data Flags =
optionVerbosity :: OP.ReadM Verbosity
-optionVerbosity =
- OP.eitherReader $ ReadE.runReadE Verbosity.flagToVerbosity
+optionVerbosity = OP.eitherReader Verbosity.parse
--- cf. Distribution.Simple.Utils
+-- cf. Shell.Utility.Log
noticeAction :: Flags -> IO () -> IO ()
noticeAction flags emit =
when (verbosity flags >= Verbosity.normal) emit
@@ -98,13 +97,7 @@ path = OP.eitherReader Path.parse
numStates :: OP.Parser Int
numStates =
OP.option
- (OP.eitherReader $ \str ->
- case reads str of
- [(n, "")] ->
- if n>0
- then Right n
- else Left "not positive"
- _ -> Left "not an integer") $
+ (OP.eitherReader $ parseNumber "number of states" (0<) "positive") $
OP.long "numstates" <>
OP.metavar "NUMBER" <>
OP.help "number of states for Hidden Markov Model" <>