String

Type

type String

Ops

Name Fixity Type Description
explode  String -> List(Char) converts string to list of characters
implode  List(Char) -> String converts list of characters to string
length  String -> Nat length of a string
leq L 20 String * String -> Boolean lexicographic less-than-or-equal
lt L 20 String * String -> Boolean lexicographic less-than
++ L 25 String * String -> String string concatenation
^ L 25 String * String -> String same as ++
concat  String * String -> String prefix op for string concatenation
concatList  List String -> String returns the concatenation of the list elements
sub  String * Nat -> Char returns the nth character in a string, counting from 0
substring  String * Nat * Nat -> String substring(s, m, n) returns the substring of s from position m through position n-1, counting from 0
map  (Char -> Char) * String -> String returns the concatenation of the results of applying the function given as first parameter to each character of the string
translate  (Char -> String) * String -> String returns the concatenation of the results of applying the function given as first parameter to each character of the string
all  (Char -> Boolean) * String true if all characters in the string satisfy the predicate given as first parameter
exists  (Char -> Boolean) * String true if some character in the string satisfies the predicate given as first parameter
newline  String the string representing a line break
toScreen  String -> () prints the string on the terminal
writeLine  String -> () same with a newline appended
compare  String * String -> Comparison compares two strings