cmdargs 0.10.12 → 0.10.13
raw patch · 7 files changed
+30/−8 lines, 7 filesPVP: major bump suggested
API removals or changes: PVP suggests a major version bump
API changes (from Hackage documentation)
- System.Console.CmdArgs.Annotate: instance Typeable1 Annotate
+ System.Console.CmdArgs.Annotate: instance Typeable Annotate
- System.Console.CmdArgs.Explicit: remapUpdate :: Functor f => t -> (t1 -> (t2, a -> b)) -> (t3 -> t2 -> f a) -> t3 -> t1 -> f b
+ System.Console.CmdArgs.Explicit: remapUpdate :: Functor f => t -> (t2 -> (t1, a -> b)) -> (t3 -> t1 -> f a) -> t3 -> t2 -> f b
- System.Console.CmdArgs.Implicit: class Typeable a => Data a
+ System.Console.CmdArgs.Implicit: class Typeable * a => Data a
- System.Console.CmdArgs.Implicit: class Typeable a
+ System.Console.CmdArgs.Implicit: class Typeable (a :: k)
Files
- CHANGES.txt +2/−0
- Data/Generics/Any.hs +5/−0
- LICENSE +1/−1
- README.md +1/−1
- System/Console/CmdArgs/Explicit/Type.hs +3/−0
- System/Console/CmdArgs/Test/Implicit/Tests.hs +14/−2
- cmdargs.cabal +4/−4
CHANGES.txt view
@@ -1,5 +1,7 @@ Changelog for CmdArgs +0.10.13+ #24, support Ratio in some places 0.10.12 GHC 7.2 compatibility 0.10.11
Data/Generics/Any.hs view
@@ -2,12 +2,14 @@ module Data.Generics.Any where +import Control.Exception import Control.Monad.Trans.State import qualified Data.Data as D import Data.Data hiding (toConstr, typeOf, dataTypeOf, isAlgType) import Data.List import Data.Maybe import qualified Data.Typeable.Internal as I+import System.IO.Unsafe type CtorName = String@@ -19,6 +21,8 @@ | otherwise = Nothing where y = init $ tail x +try1 :: a -> Either SomeException a+try1 = unsafePerformIO . try . evaluate --------------------------------------------------------------------- -- BASIC TYPES@@ -82,6 +86,7 @@ compose0 :: Any -> CtorName -> Any+compose0 x c | either (const False) (== c) $ try1 $ ctor x = x compose0 (Any x) c = Any $ fromConstrB err y `asTypeOf` x where Just y = readConstr (D.dataTypeOf x) c err = error $ "Data.Generics.Any: Undefined field inside compose0, " ++ c ++ " :: " ++ show (Any x)
LICENSE view
@@ -1,4 +1,4 @@-Copyright Neil Mitchell 2009-2014.+Copyright Neil Mitchell 2009-2015. All rights reserved. Redistribution and use in source and binary forms, with or without
README.md view
@@ -1,4 +1,4 @@-# CmdArgs: Easy Command Line Processing [](http://hackage.haskell.org/package/cmdargs) [](https://travis-ci.org/ndmitchell/cmdargs)+# CmdArgs: Easy Command Line Processing [](https://hackage.haskell.org/package/cmdargs) [](https://travis-ci.org/ndmitchell/cmdargs) <p> CmdArgs is a Haskell library for defining command line parsers. The two features that make it a better choice than the standard <a href="http://haskell.org/ghc/docs/latest/html/libraries/base/System-Console-GetOpt.html">getopt library</a> are:
System/Console/CmdArgs/Explicit/Type.hs view
@@ -1,3 +1,4 @@+{-# LANGUAGE CPP #-} module System.Console.CmdArgs.Explicit.Type where @@ -6,7 +7,9 @@ import Data.Char import Data.List import Data.Maybe+#if __GLASGOW_HASKELL__ < 709 import Data.Monoid+#endif -- | A name, either the name of a flag (@--/foo/@) or the name of a mode.
System/Console/CmdArgs/Test/Implicit/Tests.hs view
@@ -8,6 +8,7 @@ import System.Console.CmdArgs.Test.Implicit.Util import System.Console.CmdArgs.Quote import Data.Int+import Data.Ratio -- from bug #256 and #231@@ -392,16 +393,27 @@ ["--runtime=20"] === Test22 8000 (Just "20") fails ["bob"] +-- # 24, doesn't work with Ratio +data Test23 = Test23 {test23A :: Ratio Int} deriving (Show, Data, Typeable, Eq)++mode23 = cmdArgsMode $ Test23 {test23A = 4 % 7 }++test23 = do+ let Tester{..} = tester "Test23" mode23+ [] === Test23 (4 % 7)+ ["--test23=1,6"] === Test23 (1 % 6)++ -- For some reason, these must be at the end, otherwise the Template Haskell -- stage restriction kicks in. test = test1 >> test2 >> test3 >> test4 >> test5 >> test6 >> test7 >> test8 >> test9 >> test10 >> test11 >> test12 >> test13 >> test14 >> test15 >> test16 >> test18 >> test19 >> test20 >>- test21 >> test22+ test21 >> test22 >> test23 demos = zipWith f [1..] [toDemo mode1, toDemo mode2, toDemo mode3, toDemo mode4, toDemo mode5, toDemo mode6 ,toDemo mode7, toDemo mode8, toDemo mode9, toDemo mode10, toDemo mode11, toDemo mode12 ,toDemo mode13, toDemo mode14, toDemo mode15, toDemo mode16, toDemo mode17, toDemo mode18- ,toDemo mode19, toDemo mode20, toDemo mode21, toDemo mode22]+ ,toDemo mode19, toDemo mode20, toDemo mode21, toDemo mode22, toDemo mode23] where f i x = x{modeHelp = "Testing various corner cases (" ++ show i ++ ")"}
cmdargs.cabal view
@@ -1,13 +1,13 @@ cabal-version: >= 1.6 build-type: Simple name: cmdargs-version: 0.10.12+version: 0.10.13 license: BSD3 license-file: LICENSE category: Console author: Neil Mitchell <ndmitchell@gmail.com> maintainer: Neil Mitchell <ndmitchell@gmail.com>-copyright: Neil Mitchell 2009-2014+copyright: Neil Mitchell 2009-2015 synopsis: Command line argument processing description: This library provides an easy way to define command line parsers. Most users@@ -33,7 +33,7 @@ extra-source-files: README.md CHANGES.txt-tested-with: GHC==7.8.2, GHC==7.6.3, GHC==7.4.2+tested-with: GHC==7.10.1, GHC==7.8.4, GHC==7.6.3, GHC==7.4.2, GHC==7.2.2 source-repository head type: git@@ -49,7 +49,7 @@ library build-depends:- base == 4.*,+ base >= 4.4 && < 5, filepath, transformers >= 0.2, process >= 1.0