FR
PréludeChargé par défaut — aucun import nécessaire.

String operations

Synopsis
head : String -> Maybe Char

First character of a string (Nothing if empty). Total, like List.head — oppi has no partial functions.

tail : String -> Maybe String

All characters except the first (Nothing if empty). Total, like List.tail.

reverse : String -> String

Reverse the characters of a string.

cons : Char -> String -> String

Prepend a character to a string.

toList : String -> List Char

Convert a String to a List of characters.

fromList : List Char -> String

Convert a List of characters to a String.

concat : List String -> String

Concatenate a list of strings: String.concat ["a", "b"] = "ab". The String-specific version of the general concat (Core.Monoid).

showInt : Int -> String

Convert an Int to its decimal string representation.

unlines : List String -> String

Join a list of strings, appending a newline after each one. unlines ["a", "b"] = "a\nb\n"

unwords : List String -> String

Join a list of strings with single spaces between them. unwords ["a", "b", "c"] = "a b c"