ListLike-4.1.1: Generic support for list-like structures

CopyrightCopyright (C) 2007 John Goerzen
LicenseBSD3
MaintainerJohn Lato <jwlato@gmail.com>
Stabilityprovisional
Portabilityportable
Safe HaskellSafe-Inferred
LanguageHaskell98

Data.ListLike.String

Description

String-like functions

Written by John Goerzen, jgoerzen@complete.org

Synopsis

Documentation

class StringLike s where Source

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

Minimal complete definition

toString, fromString

Methods

toString :: s -> String Source

Converts the structure to a String

fromString :: String -> s Source

Converts a String to a list

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

Breaks a string into a list of strings

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

Breaks a string into a list of words

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

Joins lines

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

Joins words