-- Hoogle documentation, generated by Haddock -- See Hoogle, http://www.haskell.org/hoogle/ -- | Reasonable conventions for embedding YAML configuration with Template Haskell -- -- Please see the README on GitHub at -- https://github.com/simspace/embed-config#readme @package embed-config @version 0.0.0.0 -- | Provides kebab-case instances for aeson. module Data.Yaml.Config.Kebab -- | A DerivingVia wrapper that only turns all fields into kebab-case. No -- other field processing occurs, which also means no field prefix -- stripping. newtype AesonKebab a AesonKebab :: a -> AesonKebab a -- | Default Options which sets fieldLabelModifier to use -- kebab. aesonKebabOptions :: Options -- | Convert a camelCase string to kebab-case. kebab :: String -> String -- | Gets the given identifier name as a String but converts it to -- kebab-case. Useful for -- --
-- fooBar = True -- kebabName 'fooBar == "foo-bar" --kebabName :: Name -> String -- | Gets the given identifier name as a String. -- -- If DuplicateRecordFields is enabled, detects the names in the -- form of $sel:name:Type and extracts the name. getName :: Name -> String instance (GHC.Generics.Generic a, Data.Aeson.Types.Class.GToJSON Data.Aeson.Types.Generic.Zero (GHC.Generics.Rep a), Data.Aeson.Types.Class.GToEncoding Data.Aeson.Types.Generic.Zero (GHC.Generics.Rep a)) => Data.Aeson.Types.ToJSON.ToJSON (Data.Yaml.Config.Kebab.AesonKebab a) instance (GHC.Generics.Generic a, Data.Aeson.Types.FromJSON.GFromJSON Data.Aeson.Types.Generic.Zero (GHC.Generics.Rep a)) => Data.Aeson.Types.FromJSON.FromJSON (Data.Yaml.Config.Kebab.AesonKebab a) -- | Reasonable conventions for embedding YAML configuration with Template -- Haskell module Data.Yaml.Config.Embed -- | TH function for loading config/settings.yml relative to the -- project in which the TH splice is written. -- --
-- loadConfig :: IO MyConfig -- loadConfig = $(embedConfig) --embedConfig :: Q Exp -- | TH function for loading the supplied config file path relative to the -- project in which the TH splice is written. -- --
-- loadConfig :: IO MyConfig -- loadConfig = $(embedConfigRelativeToProject "path/to/settings.yml") --embedConfigRelativeToProject :: FilePath -> Q Exp -- | Given the file content, read a YAML config file. loadFromBytes :: FromJSON a => ByteString -> IO a -- | Given the file content as an Aeson Value, read a YAML config -- file. loadFromValue :: FromJSON a => Value -> IO a -- | A DerivingVia wrapper that only turns all fields into kebab-case. No -- other field processing occurs, which also means no field prefix -- stripping. newtype AesonKebab a AesonKebab :: a -> AesonKebab a