on master help sign in
Get libraries compiling
commit17535831fe7e84b2dea89a7c3f7bcf999a2e8890 authorEvan Czaplicki <info@elm-lang.org> dateFri 26 Jul 2013, 00:07 (13 years ago) parentec86876
2 files changed+18−6
libraries/Char.elm+16−4 libraries/Maybe.elm+2−2
libraries/Char.elm+16−4
@@ -1,38 +1,50 @@
11
22module Char where
33
4−import Native.Char as N
4+import Native.Char as Native
55
66-- True for upper case letters.
77isUpper : Char -> Bool
8+isUpper = Native.isUpper
89
910-- True for lower case letters.
1011isLower : Char -> Bool
12+isLower = Native.isLower
1113
1214-- True for ASCII digits (`0..9`).
1315isDigit : Char -> Bool
16+isDigit = Native.isDigit
1417
1518-- True for ASCII octal digits (`0..7`).
1619isOctDigit : Char -> Bool
20+isOctDigit = Native.isOctDigit
1721
1822-- True for ASCII hexadecimal digits (`0..9a..fA..F`).
1923isHexDigit : Char -> Bool
24+isHexDigit = Native.isHexDigit
2025
2126-- Convert to upper case.
2227toUpper : Char -> Char
28+toUpper = Native.toUpper
2329
2430-- Convert to lower case.
2531toLower : Char -> Char
32+toLower = Native.toLower
2633
2734-- Convert to upper case, according to any locale-specific case mappings.
2835toLocaleUpper : Char -> Char
36+toLocaleUpper = Native.toLocaleUpper
2937
3038-- Convert to lower case, according to any locale-specific case mappings.
3139toLocaleLower : Char -> Char
40+toLocaleLower = Native.toLocaleLower
41+
42+type KeyCode = Int
3243
3344-- Convert to unicode.
34−toCode : Char -> KeyCode
45+toCode : Char -> Int
46+toCode = Native.toCode
3547
3648-- Convert from unicode.
37−fromCode : KeyCode -> Char
38−
49+fromCode : Int -> Char
50+fromCode = Native.fromCode
libraries/Maybe.elm+2−2
@@ -2,7 +2,7 @@
22module Maybe where
33
44import open Basics
5−import List as List
5+import open List
66
77-- The Maybe datatype. Useful when a computation may or may not
88-- result in a value (e.g. logarithm is defined only for positive numbers).
@@ -31,4 +31,4 @@ cons mx xs = maybe xs (\x -> x :: xs) mx
3131
3232-- Filters out Nothings and extracts the remaining values.
3333justs : [Maybe a] -> [a]
34−justs = List.foldr cons []
34+justs = foldr cons []