Copyright | Copyright (C) 2007 John Goerzen |
---|---|
License | BSD3 |
Maintainer | John Lato <jwlato@gmail.com> |
Stability | provisional |
Portability | portable |
Safe Haskell | Safe |
Language | Haskell98 |
String-like functions
Written by John Goerzen, jgoerzen@complete.org
- class StringLike s where
Documentation
class 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
.
toString :: s -> String Source #
Converts the structure to a String
fromString :: String -> s Source #
Converts a String
to a list
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