Get the String module working properly
This commit is contained in:
parent
0703f48a89
commit
385f400269
2 changed files with 30 additions and 30 deletions
|
@ -92,10 +92,10 @@ Elm.Native.String.make = function(elm) {
|
|||
}
|
||||
|
||||
function toUpper(str) {
|
||||
return str.toUpper();
|
||||
return str.toUpperCase();
|
||||
}
|
||||
function toLower(str) {
|
||||
return str.toLower();
|
||||
return str.toLowerCase();
|
||||
}
|
||||
|
||||
function any(pred, str) {
|
||||
|
@ -111,7 +111,7 @@ Elm.Native.String.make = function(elm) {
|
|||
return true;
|
||||
}
|
||||
|
||||
return {
|
||||
return Elm.Native.String.values = {
|
||||
isEmpty: isEmpty,
|
||||
cons: F2(cons),
|
||||
uncons: uncons,
|
||||
|
@ -141,6 +141,6 @@ Elm.Native.String.make = function(elm) {
|
|||
toLower: toLower,
|
||||
|
||||
any: F2(any),
|
||||
all: F2(all),
|
||||
all: F2(all)
|
||||
};
|
||||
};
|
|
@ -2,130 +2,130 @@ module String where
|
|||
{-| A built-in representation of String for effecient string manipulation.
|
||||
-}
|
||||
|
||||
import Native.String as Native
|
||||
import Native.String
|
||||
import Maybe (Maybe)
|
||||
|
||||
{-|
|
||||
-}
|
||||
isEmpty : String
|
||||
isEmpty = Native.isEmpty
|
||||
isEmpty = Native.String.isEmpty
|
||||
|
||||
{-|
|
||||
-}
|
||||
cons : Char -> String -> String
|
||||
cons = Native.cons
|
||||
cons = Native.String.cons
|
||||
|
||||
{-|
|
||||
-}
|
||||
uncons : String -> Maybe (Char, String)
|
||||
uncons = Native.uncons
|
||||
uncons = Native.String.uncons
|
||||
|
||||
{-|
|
||||
-}
|
||||
map : (Char -> Char) -> String -> String
|
||||
map = Native.map
|
||||
map = Native.String.map
|
||||
|
||||
{-|
|
||||
-}
|
||||
filter : (Char -> Bool) -> String -> String
|
||||
filter = Native.filter
|
||||
filter = Native.String.filter
|
||||
|
||||
{-|
|
||||
-}
|
||||
reverse : String -> String
|
||||
reverse = Native.reverse
|
||||
reverse = Native.String.reverse
|
||||
|
||||
{-|
|
||||
-}
|
||||
foldl : (Char -> b -> b) -> b -> String -> b
|
||||
foldl = Native.foldl
|
||||
foldl = Native.String.foldl
|
||||
|
||||
{-|
|
||||
-}
|
||||
foldr : (Char -> b -> b) -> b -> String -> b
|
||||
foldr = Native.foldr
|
||||
foldr = Native.String.foldr
|
||||
|
||||
{-|
|
||||
-}
|
||||
split : String -> String -> [String]
|
||||
split = Native.split
|
||||
split = Native.String.split
|
||||
|
||||
{-|
|
||||
-}
|
||||
join : String -> [String] -> String
|
||||
join = Native.join
|
||||
join = Native.String.join
|
||||
|
||||
{-|
|
||||
-}
|
||||
repeat : Int -> String -> String
|
||||
repeat = Native.repeat
|
||||
repeat = Native.String.repeat
|
||||
|
||||
{-|
|
||||
-}
|
||||
center : Int -> Char -> String -> String
|
||||
center = Native.center
|
||||
center = Native.String.center
|
||||
|
||||
{-|
|
||||
-}
|
||||
justifyLeft : Int -> Char -> String -> String
|
||||
justifyLeft = Native.justifyLeft
|
||||
justifyLeft = Native.String.justifyLeft
|
||||
|
||||
{-|
|
||||
-}
|
||||
justifyRight : Int -> Char -> String -> String
|
||||
justifyRight = Native.justifyRight
|
||||
justifyRight = Native.String.justifyRight
|
||||
|
||||
{-|
|
||||
-}
|
||||
trim : String -> String
|
||||
trim = Native.trim
|
||||
trim = Native.String.trim
|
||||
|
||||
{-|
|
||||
-}
|
||||
trimLeft : String -> String
|
||||
trimLeft = Native.trimLeft
|
||||
trimLeft = Native.String.trimLeft
|
||||
|
||||
{-|
|
||||
-}
|
||||
trimRight : String -> String
|
||||
trimRight = Native.trimRight
|
||||
trimRight = Native.String.trimRight
|
||||
|
||||
{-|
|
||||
-}
|
||||
words : String -> [String]
|
||||
words = Native.words
|
||||
words = Native.String.words
|
||||
|
||||
{-|
|
||||
-}
|
||||
unwords : [String] -> String
|
||||
unwords = Native.unwords
|
||||
unwords = Native.String.unwords
|
||||
|
||||
{-|
|
||||
-}
|
||||
lines : String -> [String]
|
||||
lines = Native.lines
|
||||
lines = Native.String.lines
|
||||
|
||||
{-|
|
||||
-}
|
||||
unlines : [String] -> String
|
||||
unlines = Native.unlines
|
||||
unlines = Native.String.unlines
|
||||
|
||||
{-|
|
||||
-}
|
||||
toUpper : String -> String
|
||||
toUpper = Native.toUpper
|
||||
toUpper = Native.String.toUpper
|
||||
|
||||
{-|
|
||||
-}
|
||||
toLower : String -> String
|
||||
toLower = Native.toLower
|
||||
toLower = Native.String.toLower
|
||||
|
||||
{-|
|
||||
-}
|
||||
any : (Char -> Bool) -> String -> Bool
|
||||
any = Native.any
|
||||
any = Native.String.any
|
||||
|
||||
{-|
|
||||
-}
|
||||
all : (Char -> Bool) -> String -> Bool
|
||||
all = Native.all
|
||||
all = Native.String.all
|
||||
|
|
Loading…
Reference in a new issue