HORIZON HASKELLDocslts/ghc-9.14.x7a6c33e2026-10-12Search packagesCtrl K
Theme: |

GHC 9.14.1 · lts/ghc-9.14.x · 7a6c33e · 2026-10-12

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.