diff options
Diffstat (limited to 'src')
-rw-r--r-- | src/gleam/any.gleam | 4 | ||||
-rw-r--r-- | src/gleam/bool.gleam | 1 | ||||
-rw-r--r-- | src/gleam/list.gleam | 12 | ||||
-rw-r--r-- | src/gleam/map.gleam | 8 | ||||
-rw-r--r-- | src/gleam/order.gleam | 2 |
5 files changed, 12 insertions, 15 deletions
diff --git a/src/gleam/any.gleam b/src/gleam/any.gleam index 1eec6f1..6384c89 100644 --- a/src/gleam/any.gleam +++ b/src/gleam/any.gleam @@ -1,7 +1,7 @@ import gleam/list as list_mod import gleam/atom import gleam/result -import gleam/pair +import gleam/pair.{Pair} // `Any` data is data that we don"t know the type of yet. // We likely get data like this from interop with Erlang, or from @@ -47,7 +47,7 @@ pub fn list(from any, containing decoder_type) { |> result.then(_, list_mod.traverse(_, decoder_type)) } -pub external fn pair(from: Any) -> Result(pair.Pair(Any, Any), String) +pub external fn pair(from: Any) -> Result(Pair(Any, Any), String) = "gleam_stdlib" "decode_pair" pub external fn field(from: Any, named: a) -> Result(Any, String) diff --git a/src/gleam/bool.gleam b/src/gleam/bool.gleam index e1913c0..0c3b836 100644 --- a/src/gleam/bool.gleam +++ b/src/gleam/bool.gleam @@ -1,5 +1,4 @@ import gleam/order -import gleam/pair pub fn negate(bool) { case bool { diff --git a/src/gleam/list.gleam b/src/gleam/list.gleam index cd4b5ea..00d53a2 100644 --- a/src/gleam/list.gleam +++ b/src/gleam/list.gleam @@ -1,6 +1,6 @@ import gleam/int import gleam/order -import gleam/pair +import gleam/pair.{Pair} pub enum LengthMismatch = | LengthMismatch @@ -196,7 +196,7 @@ pub fn zip(xs, ys) { case xs, ys { | [], _ -> [] | _, [] -> [] - | [x | xs], [y | ys] -> [ pair.Pair(x, y) | zip(xs, ys) ] + | [x | xs], [y | ys] -> [ Pair(x, y) | zip(xs, ys) ] } } @@ -289,10 +289,10 @@ pub fn repeat(item a, times times) { fn do_split(list, n, taken) { case n <= 0 { - | True -> pair.Pair(reverse(taken), list) + | True -> Pair(reverse(taken), list) | False -> case list { - | [] -> pair.Pair(reverse(taken), []) + | [] -> Pair(reverse(taken), []) | [x | xs] -> do_split(xs, n - 1, [x | taken]) } } @@ -304,10 +304,10 @@ pub fn split(list list, on target) { fn do_split_while(list, f, acc) { case list { - | [] -> pair.Pair(reverse(acc), []) + | [] -> Pair(reverse(acc), []) | [x | xs] -> case f(x) { - | False -> pair.Pair(reverse(acc), list) + | False -> Pair(reverse(acc), list) | _ -> do_split_while(xs, f, [x | acc]) } } diff --git a/src/gleam/map.gleam b/src/gleam/map.gleam index 6a7ab47..340fb64 100644 --- a/src/gleam/map.gleam +++ b/src/gleam/map.gleam @@ -1,17 +1,17 @@ import gleam/any import gleam/result import gleam/list -import gleam/pair +import gleam/pair.{Pair} pub external type Map(key, value); pub external fn size(Map(k, v)) -> Int = "maps" "size" -pub external fn to_list(Map(key, value)) -> List(pair.Pair(key, value)) +pub external fn to_list(Map(key, value)) -> List(Pair(key, value)) = "maps" "to_list" -pub external fn from_list(List(pair.Pair(key, value))) -> Map(key, value) +pub external fn from_list(List(Pair(key, value))) -> Map(key, value) = "maps" "from_list" external fn is_key(key, Map(key, v)) -> Bool @@ -86,7 +86,7 @@ pub fn update(in map, update key, with fun) { fn do_fold(list, initial, fun) { case list { | [] -> initial - | [pair.Pair(k, v) | tail] -> do_fold(tail, fun(k, v, initial), fun) + | [Pair(k, v) | tail] -> do_fold(tail, fun(k, v, initial), fun) } } diff --git a/src/gleam/order.gleam b/src/gleam/order.gleam index 9aa04fb..bc8ee06 100644 --- a/src/gleam/order.gleam +++ b/src/gleam/order.gleam @@ -1,5 +1,3 @@ -import gleam/pair - pub enum Order = | Lt | Eq |