aboutsummaryrefslogtreecommitdiff
path: root/src/list.gleam
diff options
context:
space:
mode:
authorLouis Pilfold <louis@lpil.uk>2018-10-13 20:54:55 +0000
committerLouis Pilfold <louis@lpil.uk>2018-10-13 20:54:55 +0000
commit9ccf9d85a17c554f3fd78379b641467e79213413 (patch)
tree98da0ca430a59afedf3431bd91ed3a051a38e2aa /src/list.gleam
parent0e41165e9ce288a253c78e8d7a5f224cd9489535 (diff)
downloadgleam_stdlib-9ccf9d85a17c554f3fd78379b641467e79213413.tar.gz
gleam_stdlib-9ccf9d85a17c554f3fd78379b641467e79213413.zip
un-namespace enum constructors
Diffstat (limited to 'src/list.gleam')
-rw-r--r--src/list.gleam13
1 files changed, 5 insertions, 8 deletions
diff --git a/src/list.gleam b/src/list.gleam
index 8c269f9..03762db 100644
--- a/src/list.gleam
+++ b/src/list.gleam
@@ -1,12 +1,9 @@
import assert
-import result:Result:*
-import bool:Bool:*
+import result:[Ok, Error]
pub enum Error =
| Empty
-import Error:*
-
// Using the Erlang C BIF implementation.
//
pub external fn length(List(a)) => Int = 'erlang' 'length'
@@ -197,7 +194,7 @@ pub fn new() {
[]
}
-test new() {
+test new {
new() |> assert:equal(_, [])
}
@@ -205,7 +202,7 @@ pub fn flatten(lists) {
do_flatten(lists, [])
}
-test flatten() {
+test flatten {
flatten([])
|> assert:equal(_, [])
@@ -233,7 +230,7 @@ pub fn foldl(list, acc, fun) {
}
}
-test foldl() {
+test foldl {
[1, 2, 3]
|> foldl(_, [], fn(x, acc) { x :: acc })
|> assert:equal(_, [3, 2, 1])
@@ -246,7 +243,7 @@ pub fn foldr(list, acc, fun) {
}
}
-test foldr() {
+test foldr {
[1, 2, 3]
|> foldr(_, [], fn(x, acc) { x :: acc })
|> assert:equal(_, [1, 2, 3])