ListLike-4.7.8.2: Generalized support for list-like structures
CopyrightCopyright (C) 2007 John Goerzen
LicenseBSD3
MaintainerDavid Fox <dsf@seereason.com>, Andreas Abel
Stabilitystable
Portabilityportable
Safe HaskellSafe-Inferred
LanguageHaskell2010

Data.ListLike.String

Description

String-like functions

Written by John Goerzen, jgoerzen@complete.org

Synopsis

Documentation

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

Methods

toString :: s -> String #

Converts the structure to a String

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

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

Generalize the Show method t return any StringLike.

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

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

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

Override this to avoid extra String conversions.

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

Override this to avoid extra String conversions.

Instances

Instances details
StringLike CharString # 
Instance details

Defined in Data.ListLike.CharString

Methods

toString :: CharString -> String #

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

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

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

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

show :: Show a => a -> CharString #

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

fromText :: Text -> CharString #

fromLazyText :: Text -> CharString #

StringLike CharStringLazy # 
Instance details

Defined in Data.ListLike.CharString

StringLike Chars # 
Instance details

Defined in Data.ListLike.Chars

Methods

toString :: Chars -> String #

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

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

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

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

show :: Show a => a -> Chars #

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

fromText :: Text -> Chars #

fromLazyText :: Text -> Chars #

StringLike Text # 
Instance details

Defined in Data.ListLike.Text.Text

Methods

toString :: Text -> String #

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

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

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

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

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

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

fromText :: Text -> Text #

fromLazyText :: Text0 -> Text #

StringLike Builder # 
Instance details

Defined in Data.ListLike.Text.Builder

Methods

toString :: Builder -> String #

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

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

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

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

show :: Show a => a -> Builder #

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

fromText :: Text -> Builder #

fromLazyText :: Text -> Builder #

StringLike Text # 
Instance details

Defined in Data.ListLike.Text.TextLazy

Methods

toString :: Text -> String #

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

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

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

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

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

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

fromText :: Text0 -> Text #

fromLazyText :: Text -> Text #

StringLike String # 
Instance details

Defined in Data.ListLike.Instances

Methods

toString :: String -> String #

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

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

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

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

show :: Show a => a -> String #

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

fromText :: Text -> String #

fromLazyText :: Text -> String #

StringLike (Seq Char) # 
Instance details

Defined in Data.ListLike.Instances

Methods

toString :: Seq Char -> String #

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

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

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

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

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

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

fromText :: Text -> Seq Char #

fromLazyText :: Text -> Seq Char #

StringLike (DList Char) # 
Instance details

Defined in Data.ListLike.DList

Methods

toString :: DList Char -> String #

lines :: ListLike full (DList Char) => DList Char -> full #

words :: ListLike full (DList Char) => DList Char -> full #

unlines :: ListLike full (DList Char) => full -> DList Char #

unwords :: ListLike full (DList Char) => full -> DList Char #

show :: Show a => a -> DList Char #

fromStringLike :: StringLike s' => DList Char -> s' #

fromText :: Text -> DList Char #

fromLazyText :: Text -> DList Char #

StringLike (FMList Char) # 
Instance details

Defined in Data.ListLike.FMList

Methods

toString :: FMList Char -> String #

lines :: ListLike full (FMList Char) => FMList Char -> full #

words :: ListLike full (FMList Char) => FMList Char -> full #

unlines :: ListLike full (FMList Char) => full -> FMList Char #

unwords :: ListLike full (FMList Char) => full -> FMList Char #

show :: Show a => a -> FMList Char #

fromStringLike :: StringLike s' => FMList Char -> s' #

fromText :: Text -> FMList Char #

fromLazyText :: Text -> FMList Char #

StringLike (UTF8 ByteString) # 
Instance details

Defined in Data.ListLike.UTF8

StringLike (UTF8 ByteString) # 
Instance details

Defined in Data.ListLike.UTF8

StringLike (Vector Char) # 
Instance details

Defined in Data.ListLike.Vector.Vector

Methods

toString :: Vector Char -> String #

lines :: ListLike full (Vector Char) => Vector Char -> full #

words :: ListLike full (Vector Char) => Vector Char -> full #

unlines :: ListLike full (Vector Char) => full -> Vector Char #

unwords :: ListLike full (Vector Char) => full -> Vector Char #

show :: Show a => a -> Vector Char #

fromStringLike :: StringLike s' => Vector Char -> s' #

fromText :: Text -> Vector Char #

fromLazyText :: Text -> Vector Char #

StringLike (Vector Char) # 
Instance details

Defined in Data.ListLike.Vector.Storable

Methods

toString :: Vector Char -> String #

lines :: ListLike full (Vector Char) => Vector Char -> full #

words :: ListLike full (Vector Char) => Vector Char -> full #

unlines :: ListLike full (Vector Char) => full -> Vector Char #

unwords :: ListLike full (Vector Char) => full -> Vector Char #

show :: Show a => a -> Vector Char #

fromStringLike :: StringLike s' => Vector Char -> s' #

fromText :: Text -> Vector Char #

fromLazyText :: Text -> Vector Char #

StringLike (Vector Char) # 
Instance details

Defined in Data.ListLike.Vector.Unboxed

Methods

toString :: Vector Char -> String #

lines :: ListLike full (Vector Char) => Vector Char -> full #

words :: ListLike full (Vector Char) => Vector Char -> full #

unlines :: ListLike full (Vector Char) => full -> Vector Char #

unwords :: ListLike full (Vector Char) => full -> Vector Char #

show :: Show a => a -> Vector Char #

fromStringLike :: StringLike s' => Vector Char -> s' #

fromText :: Text -> Vector Char #

fromLazyText :: Text -> Vector Char #

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

Defined in Data.ListLike.Vector.Generic

Methods

toString :: v Char -> String #

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

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

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

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

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

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

fromText :: Text -> v Char #

fromLazyText :: Text -> v Char #

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

Defined in Data.ListLike.Instances

Methods

toString :: Array i Char -> String #

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

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

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

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

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

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

fromText :: Text -> Array i Char #

fromLazyText :: Text -> Array i Char #

fromString :: IsString a => String -> a #