module Data.String.Slugger (toSlug) where


--------------------------------------------------------------------------------
import qualified Data.Text as T
import qualified Data.Text.Slugger as Slugger


--------------------------------------------------------------------------------
{- | Converts to a US-ASCII, lowercase, hyphenated, URI-friendly "slug"

__Examples:__

@
toSlug "Hey there,   world!"
-- "hey-there-world"

toSlug "GARÇON - déjà , Forêt — Zoë"
-- "garcon-deja-foret-zoe"
@
-}
toSlug :: String -> String
toSlug :: String -> String
toSlug = Text -> String
T.unpack forall b c a. (b -> c) -> (a -> b) -> a -> c
. Text -> Text
Slugger.toSlug forall b c a. (b -> c) -> (a -> b) -> a -> c
. String -> Text
T.pack