ListLike-4.7.8.1: 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 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 CharString Source # 
Instance details

Defined in Data.ListLike.CharString

StringLike CharStringLazy Source # 
Instance details

Defined in Data.ListLike.CharString

StringLike Chars Source # 
Instance details

Defined in Data.ListLike.Chars

Methods

toString :: Chars -> String Source #

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

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

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

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

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

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

fromText :: Text -> Chars Source #

fromLazyText :: Text -> Chars 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 Builder Source # 
Instance details

Defined in Data.ListLike.Text.Builder

Methods

toString :: Builder -> String Source #

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

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

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

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

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

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

fromText :: Text -> Builder Source #

fromLazyText :: Text -> Builder Source #

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 String Source # 
Instance details

Defined in Data.ListLike.Instances

Methods

toString :: String -> String Source #

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

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

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

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

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

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

fromText :: Text -> String Source #

fromLazyText :: Text -> String 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

Methods

toString :: DList Char -> String Source #

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

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

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

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

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

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

fromText :: Text -> DList Char Source #

fromLazyText :: Text -> DList Char Source #

StringLike (FMList Char) Source # 
Instance details

Defined in Data.ListLike.FMList

Methods

toString :: FMList Char -> String Source #

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

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

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

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

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

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

fromText :: Text -> FMList Char Source #

fromLazyText :: Text -> FMList Char Source #

StringLike (UTF8 ByteString) Source # 
Instance details

Defined in Data.ListLike.UTF8

Methods

toString :: UTF8 ByteString -> String Source #

lines :: ListLike full (UTF8 ByteString) => UTF8 ByteString -> full Source #

words :: ListLike full (UTF8 ByteString) => UTF8 ByteString -> full Source #

unlines :: ListLike full (UTF8 ByteString) => full -> UTF8 ByteString Source #

unwords :: ListLike full (UTF8 ByteString) => full -> UTF8 ByteString Source #

show :: Show a => a -> UTF8 ByteString Source #

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

fromText :: Text -> UTF8 ByteString Source #

fromLazyText :: Text -> UTF8 ByteString Source #

StringLike (UTF8 ByteString) Source # 
Instance details

Defined in Data.ListLike.UTF8

Methods

toString :: UTF8 ByteString -> String Source #

lines :: ListLike full (UTF8 ByteString) => UTF8 ByteString -> full Source #

words :: ListLike full (UTF8 ByteString) => UTF8 ByteString -> full Source #

unlines :: ListLike full (UTF8 ByteString) => full -> UTF8 ByteString Source #

unwords :: ListLike full (UTF8 ByteString) => full -> UTF8 ByteString Source #

show :: Show a => a -> UTF8 ByteString Source #

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

fromText :: Text -> UTF8 ByteString Source #

fromLazyText :: Text -> UTF8 ByteString Source #

StringLike (Vector Char) Source # 
Instance details

Defined in Data.ListLike.Vector.Vector

Methods

toString :: Vector Char -> String Source #

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

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

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

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

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

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

fromText :: Text -> Vector Char Source #

fromLazyText :: Text -> Vector Char Source #

StringLike (Vector Char) Source # 
Instance details

Defined in Data.ListLike.Vector.Storable

Methods

toString :: Vector Char -> String Source #

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

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

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

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

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

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

fromText :: Text -> Vector Char Source #

fromLazyText :: Text -> Vector Char Source #

StringLike (Vector Char) Source # 
Instance details

Defined in Data.ListLike.Vector.Unboxed

Methods

toString :: Vector Char -> String Source #

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

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

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

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

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

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

fromText :: Text -> Vector Char Source #

fromLazyText :: Text -> Vector Char Source #

(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 #

(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 #