diff options
author | defanor <defanor@uberspace.net> | 2017-12-03 19:06:33 +0300 |
---|---|---|
committer | defanor <defanor@uberspace.net> | 2017-12-03 19:06:33 +0300 |
commit | 2dfe2f8648a6748234514bcd9d61e5e1a1d1fb72 (patch) | |
tree | d4a80b112a836c153eefcbd63d25e3eeb02e8d7d /Example.hs | |
parent | ac125877105ed69fd0a198a09c331f16124751f3 (diff) |
Refactor
Add annotations, fix -Wall warnings, lint, etc.
Diffstat (limited to 'Example.hs')
-rw-r--r-- | Example.hs | 10 |
1 files changed, 3 insertions, 7 deletions
@@ -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) |