    module Data.Aeson.Config.Util where

    import           Data.Aeson.Types (camelTo2)

    hyphenize :: String -> String -> String
    hyphenize :: String -> String -> String
    hyphenize String
    name = Char -> String -> String
    camelTo2 Char
    '-' (String -> String) -> (String -> String) -> String -> String
    forall b c a. (b -> c) -> (a -> b) -> a -> c
    . String -> String
    forall {a}. [a] -> [a]
    dropPrefix (String -> String) -> (String -> String) -> String -> String
    forall b c a. (b -> c) -> (a -> b) -> a -> c
    . (Char -> Bool) -> String -> String
    forall a. (a -> Bool) -> [a] -> [a]
    dropWhile (Char -> Char -> Bool
    forall a. Eq a => a -> a -> Bool
    == Char
    '_')
      where
        dropPrefix :: [a] -> [a]
    dropPrefix = Int -> [a] -> [a]
    forall a. Int -> [a] -> [a]
    drop (String -> Int
    forall a. [a] -> Int
    forall (t :: * -> *) a. Foldable t => t a -> Int
    length ((Char -> Bool) -> String -> String
    forall a. (a -> Bool) -> [a] -> [a]
    dropWhile (Char -> Char -> Bool
    forall a. Eq a => a -> a -> Bool
    == Char
    '_') (String -> String) -> String -> String
    forall a b. (a -> b) -> a -> b
    $ String -> String
    forall {a}. [a] -> [a]
    reverse String
    name))