on master help sign in
Move examples onto new line to match rest of library
commitdcbbb3bf78d6951e0623fc2e807fedb682bdbc62 authorMax Goldstein <maxgoldstein1@gmail.com> dateSun 2 Mar 2014, 18:59 (13 years ago) parent5e7ed2b
1 file changed+18−4
libraries/String.elm+18−4
libraries/String.elm+18−4
@@ -32,7 +32,11 @@ import Native.Show
3232import Native.String
3333import Maybe (Maybe)
3434
35−{-| Check if a string is empty `(isEmpty "" == True)` -}
35+{-| Check if a string is empty.
36+
37+ isEmpty "" == True
38+ isEmpty "the world" == False
39+-}
3640isEmpty : String -> Bool
3741isEmpty = Native.String.isEmpty
3842
@@ -64,7 +68,11 @@ append = Native.String.append
6468concat : [String] -> String
6569concat = Native.String.concat
6670
67−{-| Get the length of a string `(length "innumerable" == 11)` -}
71+{-| Get the length of a string.
72+
73+ length "innumerable" == 11
74+
75+-}
6876length : String -> Int
6977length = Native.String.length
7078
@@ -82,7 +90,10 @@ map = Native.String.map
8290filter : (Char -> Bool) -> String -> String
8391filter = Native.String.filter
8492
85−{-| Reverse a string. `(reverse "stressed" == "desserts")` -}
93+{-| Reverse a string.
94+
95+ reverse "stressed" == "desserts"
96+-}
8697reverse : String -> String
8798reverse = Native.String.reverse
8899
@@ -118,7 +129,10 @@ split = Native.String.split
118129join : String -> [String] -> String
119130join = Native.String.join
120131
121−{-| Repeat a string N times `(repeat 3 "ha" == "hahaha")` -}
132+{-| Repeat a string N times.
133+
134+ repeat 3 "ha" == "hahaha"
135+-}
122136repeat : Int -> String -> String
123137repeat = Native.String.repeat
124138