Skip to content
Snippets Groups Projects
Commit 9802e63c authored by Alice Brenon's avatar Alice Brenon
Browse files

Use the official implementation for NonEmpty which I discovered afterwards

parent caf789dc
No related branches found
No related tags found
No related merge requests found
......@@ -11,7 +11,7 @@ import Control.Applicative ((<|>))
import Data.List.NonEmpty (NonEmpty(..))
import Options.Applicative
( Parser, argument, flag', help, long, metavar, short, str, strOption, value )
import Options.Applicative.Types (oneM, manyM, fromM)
import Options.Applicative.NonEmpty (some1)
import Text.Printf (printf)
data Input = StdIn | File FilePath
......@@ -47,8 +47,4 @@ data IOConfig = IOConfig
ioConfig :: String -> Parser IOConfig
ioConfig stdinSemantics = IOConfig
<$> input stdinSemantics
<*> some output
where
-- trick needed to avoid duplicated options in help message (occurring when
-- working directly at the Applicative level)
some p = fromM ((:|) <$> oneM p <*> manyM p)
<*> some1 output
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment