HORIZON HASKELLDocslts/ghc-9.10.x248f8f02026-10-05Search names, modules, packages, or :: a typeCtrl K

GHC 9.10.3 · lts/ghc-9.10.x · 248f8f0 · 2026-10-05

Moduleslugify-0.1.0.1Haskell2010

Text.Slugify

The module to convert text into slugs. A slug is a hyphen separated string of words. Slugs are often used to make visually pleasant URLs by transforming for example the title of an article into a slug, and use this in the URL, for more information see the Wikipedia section.

  • 1 type
  • 6 values
  • Packageslugify-0.1.0.1
  • Exports7
  • LanguageHaskell2010
  • LicenceBSD-3-Clause
  • SourceSlugify.hs

Slug modes

1 declaration
datadata SlugMode
#

The given mode to slugify a Text object.

Constructors

  • SlugAscii

    Slugify by removing diacritics and only retain ASCII characters.

  • SlugUnicode

    Slugify by allowing unicode characters.

Instances6Bounded, Enum, Eq, Ord, Read, Show

Character tests

3 declarations
valueisWordSeparator
  1. :: Char

    The given Character to check.

  2. -> Bool

    True if the given character is a separator; False otherwise.

#

Check if the given Character is a word separator, for the given slugify algorithm.

valueisWordChar
  1. :: Char

    The given Character to check.

  2. -> Bool

    True if it is a word character; False otherwise.

#

Check if the given Character is considered a word character for the slugify algorithm.

valueisRetainChar
  1. :: Char

    The given Character to check.

  2. -> Bool

    True if the given Character will be retained; False otherwise. Some of these characters will however be converted to a hyphen (-), and thus eventually will only produce a different character in the slug.

#

Check if the given character is retained by the slugify algorithm.

Slug algorithms

3 declarations
valueslugify
  1. :: Text

    The given text to convert to a slug.

  2. -> Text

    The corresponding slug.

#

Slugify the given Text object and remove diacritics and convert characters to the corresponding ASCII equivalent.

valueslugifyUnicode
  1. :: Text

    The given text to convert to a slug.

  2. -> Text

    The corresponding slug.

#

Slugify the given Text object and retain Unicode characters.