-- Hoogle documentation, generated by Haddock
-- See Hoogle, http://www.haskell.org/hoogle/
-- | Merge environment variables and command line options generically
--
-- See README.md
@package panfiguration
@version 0.0
module Panfiguration.Case
data Case
Delimiter :: String -> Case
AsIs :: Case
Camel :: Case
LowerCamel :: Case
Upper :: Case -> Case
Lower :: Case -> Case
Prefixed :: String -> Case -> Case
camel :: Case
snake :: Case
pattern SNAKE :: Case
pattern KEBAB :: Case
kebab :: Case
split :: Case -> String -> [String]
join :: Case -> [String] -> String
convert :: Case -> Case -> String -> String
module Panfiguration.FromParam
class FromParam a
-- | Parse a parameter
fromParam :: FromParam a => String -> Either String a
-- | Parse a parameter
fromParam :: (FromParam a, Typeable a, Read a) => String -> Either String a
fromParamList :: FromParam a => String -> Either String [a]
-- | Merge two parameters. The Ordering indicates which side of the
-- arguments is used.
mergeParams :: FromParam a => a -> a -> (Ordering, a)
-- | A reasonable default implementation for fromParam via
-- Read
readFromParam :: forall a. (Typeable a, Read a) => String -> Either String a
-- | A newtype wrapper to distinguish confidential values. show and
-- error messages from fromParam mask its contents.
newtype Secret a
Secret :: a -> Secret a
[unSecret] :: Secret a -> a
-- | Collect all the specified parameters instead of overriding
newtype Collect a
Collect :: [a] -> Collect a
[unCollect] :: Collect a -> [a]
instance GHC.Classes.Ord a => GHC.Classes.Ord (Panfiguration.FromParam.Secret a)
instance GHC.Classes.Eq a => GHC.Classes.Eq (Panfiguration.FromParam.Secret a)
instance GHC.Base.Monoid (Panfiguration.FromParam.Collect a)
instance GHC.Base.Semigroup (Panfiguration.FromParam.Collect a)
instance GHC.Show.Show a => GHC.Show.Show (Panfiguration.FromParam.Collect a)
instance GHC.Classes.Ord a => GHC.Classes.Ord (Panfiguration.FromParam.Collect a)
instance GHC.Classes.Eq a => GHC.Classes.Eq (Panfiguration.FromParam.Collect a)
instance Panfiguration.FromParam.FromParam a => Panfiguration.FromParam.FromParam (Data.Functor.Identity.Identity a)
instance Panfiguration.FromParam.FromParam a => Panfiguration.FromParam.FromParam (Data.Functor.Const.Const a b)
instance Panfiguration.FromParam.FromParam a => Panfiguration.FromParam.FromParam (Panfiguration.FromParam.Collect a)
instance (Data.Typeable.Internal.Typeable a, Panfiguration.FromParam.FromParam a) => Panfiguration.FromParam.FromParam (Panfiguration.FromParam.Secret a)
instance Panfiguration.FromParam.FromParam GHC.Types.Bool
instance Panfiguration.FromParam.FromParam GHC.Types.Char
instance Panfiguration.FromParam.FromParam a => Panfiguration.FromParam.FromParam [a]
instance Panfiguration.FromParam.FromParam ()
instance Panfiguration.FromParam.FromParam GHC.Types.Int
instance Panfiguration.FromParam.FromParam GHC.Types.Float
instance Panfiguration.FromParam.FromParam GHC.Types.Double
instance Panfiguration.FromParam.FromParam GHC.Num.Integer.Integer
instance Panfiguration.FromParam.FromParam GHC.Num.Natural.Natural
instance Panfiguration.FromParam.FromParam Network.Socket.Types.PortNumber
instance Panfiguration.FromParam.FromParam Data.Text.Internal.Text
instance Panfiguration.FromParam.FromParam Data.ByteString.Internal.ByteString
instance Panfiguration.FromParam.FromParam a => Panfiguration.FromParam.FromParam (GHC.Maybe.Maybe a)
instance Panfiguration.FromParam.FromParam Data.Semigroup.Internal.Any
instance Panfiguration.FromParam.FromParam Data.Semigroup.Internal.All
instance GHC.Show.Show a => GHC.Show.Show (Panfiguration.FromParam.Secret a)
module Panfiguration.Core
data Panfiguration h
Panfiguration :: First Case -> First (String -> IO ()) -> [Source h] -> Panfiguration h
[fieldNameCase] :: Panfiguration h -> First Case
[loggerFunction] :: Panfiguration h -> First (String -> IO ())
[sources] :: Panfiguration h -> [Source h]
data Result a
Result :: [String] -> [String] -> Maybe a -> Result a
[resultSources] :: Result a -> [String]
[resultUsed] :: Result a -> [String]
[resultContent] :: Result a -> Maybe a
data Source h
Source :: Case -> (h (Const String) -> IO (h Result)) -> Source h
[sourceCase] :: Source h -> Case
[sourceRun] :: Source h -> h (Const String) -> IO (h Result)
-- | Set the letter case of the data declaration
declCase :: Case -> Panfiguration h
-- | Set the letter case of the sources
asCase :: Panfiguration h -> Case -> Panfiguration h
-- | Update names being used for the backends
withNames :: Panfiguration h -> (h (Const String) -> h (Const String)) -> Panfiguration h
envs :: (TraversableB h, ConstraintsB h, AllB FromParam h) => Panfiguration h
opts :: (TraversableB h, ConstraintsB h, AllB FromParam h) => Panfiguration h
defaults :: FunctorB h => h Maybe -> Panfiguration h
-- | Provide all the default values by a plain record
fullDefaults :: (BareB b, FunctorB (b Covered)) => b Bare Identity -> Panfiguration (b Covered)
logger :: (String -> IO ()) -> Panfiguration h
type Panfigurable h = (FieldNamesB h, TraversableB h, ApplicativeB h, ConstraintsB h, AllB Show h, AllB FromParam h)
-- | Parse all the relevant environment variables and command line options,
-- then merges them.
exec :: Panfigurable h => Panfiguration h -> IO (h Result)
run :: (BareB b, Panfigurable (b Covered)) => Panfiguration (b Covered) -> IO (b Bare Identity)
runMaybe :: Panfigurable h => Panfiguration h -> IO (h Maybe)
instance GHC.Classes.Ord a => GHC.Classes.Ord (Panfiguration.Core.Result a)
instance GHC.Classes.Eq a => GHC.Classes.Eq (Panfiguration.Core.Result a)
instance GHC.Show.Show a => GHC.Show.Show (Panfiguration.Core.Result a)
instance GHC.Base.Semigroup (Panfiguration.Core.Panfiguration h)
instance GHC.Base.Monoid (Panfiguration.Core.Panfiguration h)
instance Panfiguration.FromParam.FromParam a => GHC.Base.Semigroup (Panfiguration.Core.Result a)
instance Panfiguration.FromParam.FromParam a => GHC.Base.Monoid (Panfiguration.Core.Result a)
module Panfiguration
data Panfiguration h
-- | Set the letter case of the data declaration
declCase :: Case -> Panfiguration h
-- | Set the letter case of the sources
asCase :: Panfiguration h -> Case -> Panfiguration h
-- | Update names being used for the backends
withNames :: Panfiguration h -> (h (Const String) -> h (Const String)) -> Panfiguration h
envs :: (TraversableB h, ConstraintsB h, AllB FromParam h) => Panfiguration h
opts :: (TraversableB h, ConstraintsB h, AllB FromParam h) => Panfiguration h
defaults :: FunctorB h => h Maybe -> Panfiguration h
-- | Provide all the default values by a plain record
fullDefaults :: (BareB b, FunctorB (b Covered)) => b Bare Identity -> Panfiguration (b Covered)
logger :: (String -> IO ()) -> Panfiguration h
run :: (BareB b, Panfigurable (b Covered)) => Panfiguration (b Covered) -> IO (b Bare Identity)
data Case
Delimiter :: String -> Case
AsIs :: Case
Camel :: Case
LowerCamel :: Case
Upper :: Case -> Case
Lower :: Case -> Case
Prefixed :: String -> Case -> Case
camel :: Case
snake :: Case
pattern SNAKE :: Case
pattern KEBAB :: Case
kebab :: Case
class FromParam a
-- | A newtype wrapper to distinguish confidential values. show and
-- error messages from fromParam mask its contents.
newtype Secret a
Secret :: a -> Secret a
[unSecret] :: Secret a -> a
-- | Collect all the specified parameters instead of overriding
newtype Collect a
Collect :: [a] -> Collect a
[unCollect] :: Collect a -> [a]