on master help sign in
Get libraries compiling
1753583Evan Czaplicki
libraries/Char.elm+16−4
@@ -1,38 +1,50 @@
1
1
2module Char where
2module Char where
3
3
4−import Native.Char as N
4+import Native.Char as Native
5
5
6-- True for upper case letters.
6-- True for upper case letters.
7isUpper : Char -> Bool
7isUpper : Char -> Bool
8+isUpper = Native.isUpper
8
9
9-- True for lower case letters.
10-- True for lower case letters.
10isLower : Char -> Bool
11isLower : Char -> Bool
12+isLower = Native.isLower
11
13
12-- True for ASCII digits (`0..9`).
14-- True for ASCII digits (`0..9`).
13isDigit : Char -> Bool
15isDigit : Char -> Bool
16+isDigit = Native.isDigit
14
17
15-- True for ASCII octal digits (`0..7`).
18-- True for ASCII octal digits (`0..7`).
16isOctDigit : Char -> Bool
19isOctDigit : Char -> Bool
20+isOctDigit = Native.isOctDigit
17
21
18-- True for ASCII hexadecimal digits (`0..9a..fA..F`).
22-- True for ASCII hexadecimal digits (`0..9a..fA..F`).
19isHexDigit : Char -> Bool
23isHexDigit : Char -> Bool
24+isHexDigit = Native.isHexDigit
20
25
21-- Convert to upper case.
26-- Convert to upper case.
22toUpper : Char -> Char
27toUpper : Char -> Char
28+toUpper = Native.toUpper
23
29
24-- Convert to lower case.
30-- Convert to lower case.
25toLower : Char -> Char
31toLower : Char -> Char
32+toLower = Native.toLower
26
33
27-- Convert to upper case, according to any locale-specific case mappings.
34-- Convert to upper case, according to any locale-specific case mappings.
28toLocaleUpper : Char -> Char
35toLocaleUpper : Char -> Char
36+toLocaleUpper = Native.toLocaleUpper
29
37
30-- Convert to lower case, according to any locale-specific case mappings.
38-- Convert to lower case, according to any locale-specific case mappings.
31toLocaleLower : Char -> Char
39toLocaleLower : Char -> Char
40+toLocaleLower = Native.toLocaleLower
41+
42+type KeyCode = Int
32
43
33-- Convert to unicode.
44-- Convert to unicode.
34−toCode : Char -> KeyCode
45+toCode : Char -> Int
46+toCode = Native.toCode
35
47
36-- Convert from unicode.
48-- Convert from unicode.
37−fromCode : KeyCode -> Char
49+fromCode : Int -> Char
38−
50+fromCode = Native.fromCode
libraries/Maybe.elm+2−2
@@ -2,7 +2,7 @@
2module Maybe where
2module Maybe where
3
3
4import open Basics
4import open Basics
5−import List as List
5+import open List
6
6
7-- The Maybe datatype. Useful when a computation may or may not
7-- The Maybe datatype. Useful when a computation may or may not
8-- result in a value (e.g. logarithm is defined only for positive numbers).
8-- 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
31
31
32-- Filters out Nothings and extracts the remaining values.
32-- Filters out Nothings and extracts the remaining values.
33justs : [Maybe a] -> [a]
33justs : [Maybe a] -> [a]
34−justs = List.foldr cons []
34+justs = foldr cons []