@@ -3,11 +3,10 @@ module String where
3are enclosed in `"double quotes"`. Strings are *not* lists of characters.
3are enclosed in `"double quotes"`. Strings are *not* lists of characters.
6−@docs isEmpty, length, cons, uncons, reverse,
6+@docs isEmpty, length, reverse, repeat
7− map, filter, foldl, foldr, any, all, repeat
9−# Split and Join
8+# Building and Splitting
10−@docs split, join, words, lines
9+@docs cons, uncons, append, concat, split, join, words, lines
12# Get Substrings
11# Get Substrings
13@docs sub, left, right, dropLeft, dropRight
12@docs sub, left, right, dropLeft, dropRight
@@ -24,6 +23,9 @@ Cosmetic operations such as padding with extra characters or trimming whitespace
24@docs toUpper, toLower,
23@docs toUpper, toLower,
25 pad, padLeft, padRight,
24 pad, padLeft, padRight,
26 trim, trimLeft, trimRight
25 trim, trimLeft, trimRight
27+# Higher-Order Functions
28+@docs map, filter, foldl, foldr, any, all
29import Native.String
31import Native.String
@@ -46,6 +48,21 @@ pattern match on strings exactly as you would with lists.
46uncons : String -> Maybe (Char, String)
48uncons : String -> Maybe (Char, String)
47uncons = Native.String.uncons
49uncons = Native.String.uncons
51+{-| Append two strings. You can also use [the `(++)` operator](/library/List.elm#++)
54+ append "butter" "fly" == "butterfly"
56+append : String -> String -> String
57+append = Native.String.append
59+{-| Concatenate many strings into one.
61+ concat ["never","the","less"] == "nevertheless"
63+concat : [String] -> String
64+concat = Native.String.concat
49{-| Get the length of a string `(length "innumerable" == 11)` -}
66{-| Get the length of a string `(length "innumerable" == 11)` -}
50length : String -> Int
67length : String -> Int
51length = Native.String.length
68length = Native.String.length