on master help sign in
Rely directly on Native.Show.show when needed
10506b5Evan Czaplicki
libraries/Native/String.js−2
@@ -10,7 +10,6 @@ Elm.Native.String.make = function(elm) {
10 var Maybe = Elm.Maybe.make(elm);
10 var Maybe = Elm.Maybe.make(elm);
11 var JS = Elm.JavaScript.make(elm);
11 var JS = Elm.JavaScript.make(elm);
12 var Utils = Elm.Native.Utils.make(elm);
12 var Utils = Elm.Native.Utils.make(elm);
13− var show = Elm.Native.Show.make(elm);
14
13
15 function isEmpty(str) {
14 function isEmpty(str) {
16 return str.length === 0;
15 return str.length === 0;
@@ -244,7 +243,6 @@ Elm.Native.String.make = function(elm) {
244 endsWith: F2(endsWith),
243 endsWith: F2(endsWith),
245 indexes: F2(indexes),
244 indexes: F2(indexes),
246
245
247− show:show,
248 toInt: toInt,
246 toInt: toInt,
249 toFloat: toFloat,
247 toFloat: toFloat,
250 toList: toList,
248 toList: toList,
libraries/String.elm+2−1
@@ -28,6 +28,7 @@ Cosmetic operations such as padding with extra characters or trimming whitespace
28@docs map, filter, foldl, foldr, any, all
28@docs map, filter, foldl, foldr, any, all
29-}
29-}
30
30
31+import Native.Show
31import Native.String
32import Native.String
32import Maybe (Maybe)
33import Maybe (Maybe)
33
34
@@ -284,7 +285,7 @@ indices = Native.String.indexes
284 show [1,2] == "[1,2]"
285 show [1,2] == "[1,2]"
285-}
286-}
286show : a -> String
287show : a -> String
287−show = Native.String.show
288+show = Native.Show.show
288
289
289{-| Try to convert a string into an int, failing on improperly formatted strings.
290{-| Try to convert a string into an int, failing on improperly formatted strings.
290
291
libraries/Text.elm+2−1
@@ -30,6 +30,7 @@ import Color (Color, black)
30import Graphics.Element (Element, Three, Pos, ElementPrim, Properties)
30import Graphics.Element (Element, Three, Pos, ElementPrim, Properties)
31import Maybe (Maybe, Nothing)
31import Maybe (Maybe, Nothing)
32import JavaScript (JSString)
32import JavaScript (JSString)
33+import Native.Show
33import Native.Text
34import Native.Text
34
35
35data Text = Text
36data Text = Text
@@ -145,4 +146,4 @@ Excellent for debugging.
145-}
146-}
146asText : a -> Element
147asText : a -> Element
147asText value =
148asText value =
148− leftAligned (monospace (toText (String.show value)))
149+ leftAligned (monospace (toText (Native.Show.show value)))