Copyright | Copyright (C) 2007 John Goerzen |
---|---|
License | BSD3 |
Maintainer | David Fox <dsf@seereason.com>, Andreas Abel |
Stability | stable |
Portability | portable |
Safe Haskell | None |
Language | Haskell2010 |
Data.ListLike.String
Description
String-like functions
Written by John Goerzen, jgoerzen@complete.org
Synopsis
- class IsString s => StringLike s where
- fromString :: IsString a => String -> a
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
Methods
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
Generalize the Show
method t return any StringLike
.
fromStringLike :: StringLike s' => s -> s' #
Deprecated: Use fromString . toString or something more efficient using local knowledge
Override this to avoid extra String
conversions.
fromLazyText :: Text -> s #
Override this to avoid extra String
conversions.
Instances
fromString :: IsString a => String -> a #