ListLike-4.1.0: Generic support for list-like structures

Portabilityportable
Stabilityprovisional
MaintainerJohn Lato <jwlato@gmail.com>
Safe HaskellSafe-Inferred

Data.ListLike.String

Description

String-like functions

Written by John Goerzen, jgoerzen@complete.org

Synopsis

Documentation

class StringLike s whereSource

An extension to ListLike for those data types that are similar to a String. Minimal complete definition is toString and fromString.

Methods

toString :: s -> StringSource

Converts the structure to a String

fromString :: String -> sSource

Converts a String to a list

lines :: ListLike full s => s -> fullSource

Breaks a string into a list of strings

words :: ListLike full s => s -> fullSource

Breaks a string into a list of words

unlines :: ListLike full s => full -> sSource

Joins lines

unwords :: ListLike full s => full -> sSource

Joins words