trimdent-0.1.0.0: A utility for neat multiline string trimming
Safe HaskellNone
LanguageHaskell2010

Trimdent

Description

A collection of trimming and unindenting utilities.

Synopsis

Documentation

trim :: String -> String Source #

Trims whitespace characters from both ends of the text.

>>> trim " hello "
"hello"

trimdent :: String -> String Source #

Smartly unindents and trims a multiline text.

>>> trimdent "\n  def f():\n    return 1\n"
"def f():\n  return 1"

unindent :: String -> String Source #

Smartly unindents a multiline text.

>>> unindent "\n  def f():\n    return 1\n"
"\ndef f():\n  return 1\n"