HORIZON HASKELLDocslts/ghc-10.0.x8fef28d2026-11-02Search packagesCtrl K
Theme: |

GHC 10.0.0.20260917 · lts/ghc-10.0.x · 8fef28d · 2026-11-02

Moduleslugify-0.1.0.2Haskell2010

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.

Contents
  1. Slug modes
  2. Character tests
  3. Slug algorithms
Synopsis
  • Packageslugify-0.1.0.2
  • Exports7
  • LanguageHaskell2010
  • LicenceBSD-3-Clause
  • SourceSlugify.hs

Slug modes

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

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

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.