on master help sign in
Get List and Maybe compiling with the Basics module
4e1f79cEvan Czaplicki
libraries/List.elm+3−3
@@ -1,7 +1,7 @@
1
1
2module List where
2module List where
3
3
4−import Native.Utils
4+import open Basics
5import Native.List as Native
5import Native.List as Native
6
6
7-- Add an element to the front of a list `(1 :: [2,3] == [1,2,3])`
7-- Add an element to the front of a list `(1 :: [2,3] == [1,2,3])`
@@ -119,11 +119,11 @@ product = foldl (*) 1
119
119
120-- Find the maximum element in a non-empty list: `maximum [1,4,2] == 4`
120-- Find the maximum element in a non-empty list: `maximum [1,4,2] == 4`
121maximum : [comparable] -> comparable
121maximum : [comparable] -> comparable
122−maximum = foldl1 Native.Utils.max
122+maximum = foldl1 max
123
123
124-- Find the minimum element in a non-empty list: `minimum [3,2,1] == 1`
124-- Find the minimum element in a non-empty list: `minimum [3,2,1] == 1`
125minimum : [comparable] -> comparable
125minimum : [comparable] -> comparable
126−minimum = foldl1 Native.Utils.min
126+minimum = foldl1 min
127
127
128-- Split a list based on the predicate.
128-- Split a list based on the predicate.
129partition : (a -> Bool) -> [a] -> ([a],[a])
129partition : (a -> Bool) -> [a] -> ([a],[a])
libraries/Maybe.elm+1
@@ -1,6 +1,7 @@
1
1
2module Maybe where
2module Maybe where
3
3
4+import open Basics
4import List as List
5import List as List
5
6
6-- The Maybe datatype. Useful when a computation may or may not
7-- The Maybe datatype. Useful when a computation may or may not