harg-0.2.0.0: Haskell program configuration using higher kinded data

Safe HaskellNone
LanguageHaskell2010

Options.Harg.Util

Synopsis

Documentation

compose :: forall f g a. (Functor f, FunctorB a) => (forall x. x -> g x) -> a f -> a (Compose f g) Source #

toDummyOpts :: forall m a. (FunctorB a, Monoid m) => a Opt -> a (Compose Opt (Const m)) Source #

Convert an option parser into a dummy parser. A dummy option parser always succeeds because options always have a default value (a monoid is used here). This is useful because we want to run the parser together with the configuration parser once in order to gather JSON file paths etc., which means that we still need --help to work.

allToDummyOpts :: forall m ts xs. (Monoid m, MapAssocList xs) => AssocListF ts xs Opt -> AssocListF ts xs (Compose Opt (Const m)) Source #

Convert an association list of options in to dummy ones.

printErrAndExit :: forall a. String -> IO a Source #