packages feed

cmdargs 0.10.4 → 0.10.5

raw patch · 4 files changed

+26/−5 lines, 4 filesPVP ok

version bump matches the API change (PVP)

API changes (from Hackage documentation)

Files

Main.hs view
@@ -1,5 +1,5 @@ -module Main where+module Main(main) where  import System.Console.CmdArgs.Test.All import qualified System.Console.CmdArgs.Test.Implicit.Diffy as D
System/Console/CmdArgs/Implicit/Reader.hs view
@@ -20,7 +20,8 @@     ,readerRead :: Any -> String -> Either String Any     } --- reader tries to use the first argument to readerRead, but reader_ doesn't+-- reader has an actual value of type Any that can be inspected+-- reader_ has a value of type _|_ instead readerRead_ r = readerRead r $ error "Invariant broken: reader/reader_"  @@ -28,6 +29,14 @@ reader x | A.isList x && not (A.isString x) = do     r <- reader_ $ A.fromList x     return r{readerRead = \o s -> fmap (`A.cons` o) $ readerRead_ r s, readerFixup = A.reverse}+reader x | isAlgType x, [ctor] <- ctors x, [child] <- children x = do+    -- newtype wrapper, just forward it+    r <- reader child+    let down = head . children+    let up o c = recompose o [c]+    return r{readerFixup = \x -> up x $ readerFixup r $ down x+            ,readerRead = \x -> either Left (Right . up x) . readerRead r (down x)+            } reader x = reader_ x  
System/Console/CmdArgs/Test/Implicit/Tests.hs view
@@ -336,16 +336,28 @@     args === Test19 args  +-- #615, newtype wrappers of lists/Maybe should accumulate properly++newtype Test20A = Test20A [String] deriving (Eq,Show,Data,Typeable)+data Test20 = Test20 {test20_ :: Test20A} deriving (Eq,Show,Data,Typeable)++mode20 = cmdArgsMode $ Test20 (Test20A [] &= args)++test20 = do+    let Tester{..} = tester "Test20" mode20+    ["a","b","c"] === Test20 (Test20A ["a","b","c"])++ -- 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+       test11 >> test12 >> test13 >> test14 >> test15 >> test16 >> test18 >> test19 >> test20 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 mode19, toDemo mode20]     where f i x = x{modeHelp = "Testing various corner cases (" ++ show i ++ ")"}  
cmdargs.cabal view
@@ -1,7 +1,7 @@ cabal-version:      >= 1.6 build-type:         Simple name:               cmdargs-version:            0.10.4+version:            0.10.5 license:            BSD3 license-file:       LICENSE category:           Console