Data.ListLike.String

ListLike-4.5.1: Generic support for list-like structures

Copyright | Copyright (C) 2007 John Goerzen
License | BSD3
Maintainer | John Lato <jwlato@gmail.com>
Stability | provisional
Portability | portable
Safe Haskell | Safe
Language | Haskell98

Data.ListLike.String

Description

String-like functions

Written by John Goerzen, jgoerzen@complete.org

Synopsis

- class StringLike s where

# Documentation

class StringLike s where #

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 #

Converts the structure to a `String`

fromString :: String -> s #

Converts a `String` to a list

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

Breaks a string into a list of strings

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

Breaks a string into a list of words

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

Joins lines

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

Joins words

Instances

StringLike CharStringLazy # |
Methods toString :: CharStringLazy -> String # fromString :: String -> CharStringLazy # lines :: ListLike full CharStringLazy => CharStringLazy -> full # words :: ListLike full CharStringLazy => CharStringLazy -> full # unlines :: ListLike full CharStringLazy => full -> CharStringLazy # unwords :: ListLike full CharStringLazy => full -> CharStringLazy #
StringLike CharString # |
Methods toString :: CharString -> String # fromString :: String -> CharString # lines :: ListLike full CharString => CharString -> full # words :: ListLike full CharString => CharString -> full # unlines :: ListLike full CharString => full -> CharString # unwords :: ListLike full CharString => full -> CharString #
StringLike Chars # |
Methods toString :: Chars -> String # fromString :: String -> Chars # lines :: ListLike full Chars => Chars -> full # words :: ListLike full Chars => Chars -> full # unlines :: ListLike full Chars => full -> Chars # unwords :: ListLike full Chars => full -> Chars #