From 2dfe2f8648a6748234514bcd9d61e5e1a1d1fb72 Mon Sep 17 00:00:00 2001 From: defanor Date: Sun, 3 Dec 2017 19:06:33 +0300 Subject: Refactor Add annotations, fix -Wall warnings, lint, etc. --- Example.hs | 10 +++------- 1 file changed, 3 insertions(+), 7 deletions(-) (limited to 'Example.hs') 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) -- cgit v1.2.3