ListLike-4.7.4: Generalized support for list-like structures
CopyrightCopyright (C) 2007 John Goerzen
LicenseBSD3
MaintainerJohn Lato <jwlato@gmail.com>
Stabilityprovisional
Portabilityportable
Safe HaskellNone
LanguageHaskell2010

Data.ListLike.String

Description

String-like functions

Written by John Goerzen, jgoerzen@complete.org

Synopsis

Documentation

class IsString s => 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

Methods

toString :: s -> String Source #

Converts the structure to a String

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

show :: Show a => a -> s Source #

Generalize the Show method t return any StringLike.

fromStringLike :: StringLike s' => s -> s' Source #

Deprecated: Use fromString . toString or something more efficient using local knowledge

fromText :: StringLike Text => Text -> s Source #

Override this to avoid extra String conversions.

fromLazyText :: StringLike Text => Text -> s Source #

Override this to avoid extra String conversions.

Instances

Instances details
StringLike String Source # 
Instance details

Defined in Data.ListLike.Instances

StringLike Builder Source # 
Instance details

Defined in Data.ListLike.Text.Builder

StringLike Text Source # 
Instance details

Defined in Data.ListLike.Text.TextLazy

Methods

toString :: Text -> String Source #

lines :: ListLike full Text => Text -> full Source #

words :: ListLike full Text => Text -> full Source #

unlines :: ListLike full Text => full -> Text Source #

unwords :: ListLike full Text => full -> Text Source #

show :: Show a => a -> Text Source #

fromStringLike :: StringLike s' => Text -> s' Source #

fromText :: Text0 -> Text Source #

fromLazyText :: Text -> Text Source #

StringLike Text Source # 
Instance details

Defined in Data.ListLike.Text.Text

Methods

toString :: Text -> String Source #

lines :: ListLike full Text => Text -> full Source #

words :: ListLike full Text => Text -> full Source #

unlines :: ListLike full Text => full -> Text Source #

unwords :: ListLike full Text => full -> Text Source #

show :: Show a => a -> Text Source #

fromStringLike :: StringLike s' => Text -> s' Source #

fromText :: Text -> Text Source #

fromLazyText :: Text0 -> Text Source #

StringLike CharStringLazy Source # 
Instance details

Defined in Data.ListLike.CharString

StringLike CharString Source # 
Instance details

Defined in Data.ListLike.CharString

StringLike Chars Source # 
Instance details

Defined in Data.ListLike.Chars

(Eq (v Char), Vector v Char) => StringLike (v Char) Source # 
Instance details

Defined in Data.ListLike.Vector.Generic

Methods

toString :: v Char -> String Source #

lines :: ListLike full (v Char) => v Char -> full Source #

words :: ListLike full (v Char) => v Char -> full Source #

unlines :: ListLike full (v Char) => full -> v Char Source #

unwords :: ListLike full (v Char) => full -> v Char Source #

show :: Show a => a -> v Char Source #

fromStringLike :: StringLike s' => v Char -> s' Source #

fromText :: Text -> v Char Source #

fromLazyText :: Text -> v Char Source #

StringLike (Seq Char) Source # 
Instance details

Defined in Data.ListLike.Instances

Methods

toString :: Seq Char -> String Source #

lines :: ListLike full (Seq Char) => Seq Char -> full Source #

words :: ListLike full (Seq Char) => Seq Char -> full Source #

unlines :: ListLike full (Seq Char) => full -> Seq Char Source #

unwords :: ListLike full (Seq Char) => full -> Seq Char Source #

show :: Show a => a -> Seq Char Source #

fromStringLike :: StringLike s' => Seq Char -> s' Source #

fromText :: Text -> Seq Char Source #

fromLazyText :: Text -> Seq Char Source #

StringLike (DList Char) Source # 
Instance details

Defined in Data.ListLike.DList

StringLike (FMList Char) Source # 
Instance details

Defined in Data.ListLike.FMList

StringLike (UTF8 ByteString) Source # 
Instance details

Defined in Data.ListLike.UTF8

StringLike (UTF8 ByteString) Source # 
Instance details

Defined in Data.ListLike.UTF8

StringLike (Vector Char) Source # 
Instance details

Defined in Data.ListLike.Vector.Unboxed

StringLike (Vector Char) Source # 
Instance details

Defined in Data.ListLike.Vector.Storable

StringLike (Vector Char) Source # 
Instance details

Defined in Data.ListLike.Vector.Vector

(Integral i, Ix i) => StringLike (Array i Char) Source # 
Instance details

Defined in Data.ListLike.Instances

Methods

toString :: Array i Char -> String Source #

lines :: ListLike full (Array i Char) => Array i Char -> full Source #

words :: ListLike full (Array i Char) => Array i Char -> full Source #

unlines :: ListLike full (Array i Char) => full -> Array i Char Source #

unwords :: ListLike full (Array i Char) => full -> Array i Char Source #

show :: Show a => a -> Array i Char Source #

fromStringLike :: StringLike s' => Array i Char -> s' Source #

fromText :: Text -> Array i Char Source #

fromLazyText :: Text -> Array i Char Source #