summaryrefslogtreecommitdiff
path: root/Example.hs
diff options
context:
space:
mode:
Diffstat (limited to 'Example.hs')
-rw-r--r--Example.hs12
1 files changed, 9 insertions, 3 deletions
diff --git a/Example.hs b/Example.hs
index a9f50aa..0319bcd 100644
--- a/Example.hs
+++ b/Example.hs
@@ -17,13 +17,19 @@ data Foo = Bar Int
| Qux (Maybe Int) (Maybe Int) RecTest (Maybe Double)
deriving (Generic, Show)
-instance ToArgs Foo
instance ArgParser Foo
+instance ToArgs Foo
+
+data Wrap = Wrap { foo :: Maybe Foo, num :: Maybe Int }
+ deriving (Generic, Show)
+
+instance ArgParser Wrap
+instance ToArgs Wrap
main :: IO ()
main = do
- let val = Qux Nothing (Just 1) (RecTest Nothing (Just 2.3) Nothing) Nothing
+ let val = Wrap (Just $ Qux Nothing (Just 1) (RecTest Nothing (Just 2.3) Nothing) Nothing) (Just 1)
a = args val
print val
putStrLn a
- print $ parse (argParser :: Parser Foo) "test" a
+ print $ parse (argParser :: Parser Wrap) "test" a