I'd like to make a CLI using the Haskell library optparse-generic. The documentation shows an example for positional arguments, and another for options (e.g. --flag=True), but I can't figure out how to combine the two. I've tried something like this:
data CLI = CLI Options Files deriving (Generic, Show)
data Files = Files [String] deriving (Generic, Show)
data Options = Options { colorMap :: String <?> "Color mapping to use."
} deriving (Generic, Show)
instance ParseRecord CLI
But that doesn't seem to be legal.