hpack-0.24.0: src/Data/Aeson/Config/Util.hs
module Data.Aeson.Config.Util where
import Data.Aeson.Types (camelTo2)
hyphenize :: String -> String -> String
hyphenize name = camelTo2 '-' . dropPrefix . dropWhile (== '_')
where
dropPrefix = drop (length (dropWhile (== '_') $ reverse name))