summaryrefslogtreecommitdiff
path: root/Example.hs
diff options
context:
space:
mode:
authordefanor <defanor@uberspace.net>2017-12-03 19:06:33 +0300
committerdefanor <defanor@uberspace.net>2017-12-03 19:06:33 +0300
commit2dfe2f8648a6748234514bcd9d61e5e1a1d1fb72 (patch)
treed4a80b112a836c153eefcbd63d25e3eeb02e8d7d /Example.hs
parentac125877105ed69fd0a198a09c331f16124751f3 (diff)
Refactor
Add annotations, fix -Wall warnings, lint, etc.
Diffstat (limited to 'Example.hs')
-rw-r--r--Example.hs10
1 files changed, 3 insertions, 7 deletions
diff --git a/Example.hs b/Example.hs
index 9230d97..9f48024 100644
--- a/Example.hs
+++ b/Example.hs
@@ -1,9 +1,5 @@
{-# LANGUAGE DeriveGeneric #-}
-
-module Main where
-
import GHC.Generics
-import Text.Megaparsec
import Coalpit
data FooArgs = FooArgs { arg1 :: Int
@@ -28,10 +24,10 @@ instance ToArgs Input
main :: IO ()
main = do
let val = Input { something = Nothing
- , fooBar = Just (Foo (FooArgs { arg1 = 1
- , arg2 = "a string"}))
+ , fooBar = Just (Foo FooArgs { arg1 = 1
+ , arg2 = "a string"})
, fooBar2 = Bar}
args = toArgs defMod val
print val
print args
- print $ parse (argParser defMod :: Parser Input) "test" args
+ print (fromArgs defMod args :: Either String Input)