on master help sign in
Get the String module working properly
commit385f4002696058753c43620328a1916ca49fa1de authorEvan Czaplicki <info@elm-lang.org> dateWed 2 Oct 2013, 17:41 (13 years ago) parent0703f48
2 files changed+30−30
libraries/Native/String.js+4−4 libraries/String.elm+26−26
libraries/Native/String.js+4−4
@@ -92,10 +92,10 @@ Elm.Native.String.make = function(elm) {
9292 }
9393
9494 function toUpper(str) {
95− return str.toUpper();
95+ return str.toUpperCase();
9696 }
9797 function toLower(str) {
98− return str.toLower();
98+ return str.toLowerCase();
9999 }
100100
101101 function any(pred, str) {
@@ -111,7 +111,7 @@ Elm.Native.String.make = function(elm) {
111111 return true;
112112 }
113113
114− return {
114+ return Elm.Native.String.values = {
115115 isEmpty: isEmpty,
116116 cons: F2(cons),
117117 uncons: uncons,
@@ -141,6 +141,6 @@ Elm.Native.String.make = function(elm) {
141141 toLower: toLower,
142142
143143 any: F2(any),
144− all: F2(all),
144+ all: F2(all)
145145 };
146146};
libraries/String.elm+26−26
@@ -2,130 +2,130 @@ module String where
22{-| A built-in representation of String for effecient string manipulation.
33-}
44
5−import Native.String as Native
5+import Native.String
66import Maybe (Maybe)
77
88{-|
99-}
1010isEmpty : String
11−isEmpty = Native.isEmpty
11+isEmpty = Native.String.isEmpty
1212
1313{-|
1414-}
1515cons : Char -> String -> String
16−cons = Native.cons
16+cons = Native.String.cons
1717
1818{-|
1919-}
2020uncons : String -> Maybe (Char, String)
21−uncons = Native.uncons
21+uncons = Native.String.uncons
2222
2323{-|
2424-}
2525map : (Char -> Char) -> String -> String
26−map = Native.map
26+map = Native.String.map
2727
2828{-|
2929-}
3030filter : (Char -> Bool) -> String -> String
31−filter = Native.filter
31+filter = Native.String.filter
3232
3333{-|
3434-}
3535reverse : String -> String
36−reverse = Native.reverse
36+reverse = Native.String.reverse
3737
3838{-|
3939-}
4040foldl : (Char -> b -> b) -> b -> String -> b
41−foldl = Native.foldl
41+foldl = Native.String.foldl
4242
4343{-|
4444-}
4545foldr : (Char -> b -> b) -> b -> String -> b
46−foldr = Native.foldr
46+foldr = Native.String.foldr
4747
4848{-|
4949-}
5050split : String -> String -> [String]
51−split = Native.split
51+split = Native.String.split
5252
5353{-|
5454-}
5555join : String -> [String] -> String
56−join = Native.join
56+join = Native.String.join
5757
5858{-|
5959-}
6060repeat : Int -> String -> String
61−repeat = Native.repeat
61+repeat = Native.String.repeat
6262
6363{-|
6464-}
6565center : Int -> Char -> String -> String
66−center = Native.center
66+center = Native.String.center
6767
6868{-|
6969-}
7070justifyLeft : Int -> Char -> String -> String
71−justifyLeft = Native.justifyLeft
71+justifyLeft = Native.String.justifyLeft
7272
7373{-|
7474-}
7575justifyRight : Int -> Char -> String -> String
76−justifyRight = Native.justifyRight
76+justifyRight = Native.String.justifyRight
7777
7878{-|
7979-}
8080trim : String -> String
81−trim = Native.trim
81+trim = Native.String.trim
8282
8383{-|
8484-}
8585trimLeft : String -> String
86−trimLeft = Native.trimLeft
86+trimLeft = Native.String.trimLeft
8787
8888{-|
8989-}
9090trimRight : String -> String
91−trimRight = Native.trimRight
91+trimRight = Native.String.trimRight
9292
9393{-|
9494-}
9595words : String -> [String]
96−words = Native.words
96+words = Native.String.words
9797
9898{-|
9999-}
100100unwords : [String] -> String
101−unwords = Native.unwords
101+unwords = Native.String.unwords
102102
103103{-|
104104-}
105105lines : String -> [String]
106−lines = Native.lines
106+lines = Native.String.lines
107107
108108{-|
109109-}
110110unlines : [String] -> String
111−unlines = Native.unlines
111+unlines = Native.String.unlines
112112
113113{-|
114114-}
115115toUpper : String -> String
116−toUpper = Native.toUpper
116+toUpper = Native.String.toUpper
117117
118118{-|
119119-}
120120toLower : String -> String
121−toLower = Native.toLower
121+toLower = Native.String.toLower
122122
123123{-|
124124-}
125125any : (Char -> Bool) -> String -> Bool
126−any = Native.any
126+any = Native.String.any
127127
128128{-|
129129-}
130130all : (Char -> Bool) -> String -> Bool
131−all = Native.all
131+all = Native.String.all