-- Hoogle documentation, generated by Haddock -- See Hoogle, http://www.haskell.org/hoogle/ -- | Like `optparse-generic`, but with `TemplateHaskell` for faster builds -- -- Please see the README on GitHub at -- https://github.com/MercuryTechnologies/optparse-th#readme @package optparse-th @version 0.1.0.0 -- | This module is designed to provide a TemplateHaskell -- alternative to Options.Generic. module Options.TH -- | This function derives ParseRecord for you without incurring a -- Generic dependency. -- -- The main barrier here to fully supporting the library is that the API -- for ParseRecord does not expose the function that provides -- modifiers by default. So we can provide an instance of -- ParseRecord, but we can't provide a replacement of -- parseRecordWithModifiers, because that function is defined as a -- top-level that delegates directly to the generic. -- --
-- parseRecordWithModifiers -- :: (Generic a, GenericParseRecord (Rep a)) -- => Modifiers -- -> Parser -- parseRecordWithModifiers modifiers = -- fmap GHC.Generics.to (genericParseRecord modifiers) ---- -- This means that we need to shift the options to the compile-time site, -- instead of the runtime site. -- -- Likewise, we cannot provide an instance of Unwrappable, because -- it's not a class - it's a type alias for Generic stuff. So we -- need to create a separate top-level function that does the unwrap. deriveParseRecord :: Modifiers -> Name -> Q [Dec]