diff options
author | Louis Pilfold <louis@lpil.uk> | 2019-08-18 22:23:14 +0100 |
---|---|---|
committer | Louis Pilfold <louis@lpil.uk> | 2019-08-26 11:57:25 +0100 |
commit | 3f316053c680448c4b81a2c04071f7cf81497c2b (patch) | |
tree | bcdc358b5df4c12bef7670fe5f5e3af1ea78b4c8 /src | |
parent | f90bd89adba09502b5a7ff188a910750257ef1b0 (diff) | |
download | gleam_stdlib-3f316053c680448c4b81a2c04071f7cf81497c2b.tar.gz gleam_stdlib-3f316053c680448c4b81a2c04071f7cf81497c2b.zip |
Update stdlib to new syntax
Diffstat (limited to 'src')
-rw-r--r-- | src/gleam/any.gleam | 4 | ||||
-rw-r--r-- | src/gleam/bool.gleam | 8 | ||||
-rw-r--r-- | src/gleam/float.gleam | 10 | ||||
-rw-r--r-- | src/gleam/int.gleam | 6 | ||||
-rw-r--r-- | src/gleam/list.gleam | 10 | ||||
-rw-r--r-- | src/gleam/map_dict.gleam | 2 | ||||
-rw-r--r-- | src/gleam/string.gleam | 20 | ||||
-rw-r--r-- | src/gleam/tuple.gleam | 2 |
8 files changed, 31 insertions, 31 deletions
diff --git a/src/gleam/any.gleam b/src/gleam/any.gleam index ae26bc5..5f0d5e3 100644 --- a/src/gleam/any.gleam +++ b/src/gleam/any.gleam @@ -28,7 +28,7 @@ pub external fn int(Any) -> Result(Int, String) pub external fn float(Any) -> Result(Float, String) = "gleam__stdlib" "decode_float" -pub external fn atom(Any) -> Result(atom:Atom, String) +pub external fn atom(Any) -> Result(atom.Atom, String) = "gleam__stdlib" "decode_atom" pub external fn bool(Any) -> Result(Bool, String) @@ -43,7 +43,7 @@ external fn list_any(Any) -> Result(List(Any), String) = pub fn list(any, decode) { any |> list_any - |> result:then(_, list_mod:traverse(_, decode)) + |> result.then(_, list_mod.traverse(_, decode)) } pub external fn struct2(Any) -> Result(struct(Any, Any), String) diff --git a/src/gleam/bool.gleam b/src/gleam/bool.gleam index f003691..438c232 100644 --- a/src/gleam/bool.gleam +++ b/src/gleam/bool.gleam @@ -9,10 +9,10 @@ pub fn negate(bool) { pub fn compare(a, b) { case struct(a, b) { - | struct(True, True) -> order:Eq - | struct(True, False) -> order:Gt - | struct(False, False) -> order:Eq - | struct(False, True) -> order:Lt + | struct(True, True) -> order.Eq + | struct(True, False) -> order.Gt + | struct(False, False) -> order.Eq + | struct(False, True) -> order.Lt } } diff --git a/src/gleam/float.gleam b/src/gleam/float.gleam index 65be088..4b6d589 100644 --- a/src/gleam/float.gleam +++ b/src/gleam/float.gleam @@ -9,17 +9,17 @@ pub external fn parse(String) -> Result(Float, NotAFloat) = pub fn to_string(f) { f - |> iodata:from_float - |> iodata:to_string + |> iodata.from_float + |> iodata.to_string } pub fn compare(a, b) { case a == b { - | True -> order:Eq + | True -> order.Eq | False -> case a <. b { - | True -> order:Lt - | False -> order:Gt + | True -> order.Lt + | False -> order.Gt } } } diff --git a/src/gleam/int.gleam b/src/gleam/int.gleam index c4fbf6f..2fed6bd 100644 --- a/src/gleam/int.gleam +++ b/src/gleam/int.gleam @@ -11,11 +11,11 @@ pub external fn to_base_string(Int, Int) -> String = "erlang" "integer_to_binary pub fn compare(a, b) { case a == b { - | True -> order:Eq + | True -> order.Eq | False -> case a < b { - | True -> order:Lt - | False -> order:Gt + | True -> order.Lt + | False -> order.Gt } } } diff --git a/src/gleam/list.gleam b/src/gleam/list.gleam index f0adb44..7b13760 100644 --- a/src/gleam/list.gleam +++ b/src/gleam/list.gleam @@ -238,7 +238,7 @@ fn merge_sort(a, b, compare) { | struct(_, []) -> a | struct([ax | ar], [bx | br]) -> case compare(ax, bx) { - | order:Lt -> [ax | merge_sort(ar, b, compare)] + | order.Lt -> [ax | merge_sort(ar, b, compare)] | _ -> [bx | merge_sort(a, br, compare)] } } @@ -264,10 +264,10 @@ pub fn sort(list, compare) { } pub fn range(start, stop) { - case int:compare(start, stop) { - | order:Eq -> [] - | order:Gt -> [start | range(start - 1, stop)] - | order:Lt -> [start | range(start + 1, stop)] + case int.compare(start, stop) { + | order.Eq -> [] + | order.Gt -> [start | range(start - 1, stop)] + | order.Lt -> [start | range(start + 1, stop)] } } diff --git a/src/gleam/map_dict.gleam b/src/gleam/map_dict.gleam index e77e861..5e24816 100644 --- a/src/gleam/map_dict.gleam +++ b/src/gleam/map_dict.gleam @@ -73,7 +73,7 @@ pub fn delete(map, key) { } pub fn drop(map, keys) { - list:fold(keys, map, fn(key, acc) { + list.fold(keys, map, fn(key, acc) { delete(acc, key) }) } diff --git a/src/gleam/string.gleam b/src/gleam/string.gleam index cc759a6..10de2b7 100644 --- a/src/gleam/string.gleam +++ b/src/gleam/string.gleam @@ -12,25 +12,25 @@ pub external fn uppercase(String) -> String = "string" "uppercase" pub fn reverse(string) { string - |> iodata:new - |> iodata:reverse - |> iodata:to_string + |> iodata.new + |> iodata.reverse + |> iodata.to_string } pub fn split(string, on) { string - |> iodata:new - |> iodata:split(_, on) - |> list:map(_, iodata:to_string) + |> iodata.new + |> iodata.split(_, on) + |> list.map(_, iodata.to_string) } pub fn replace(string, pattern, with) { string - |> iodata:new - |> iodata:replace(_, pattern, with) - |> iodata:to_string + |> iodata.new + |> iodata.replace(_, pattern, with) + |> iodata.to_string } pub fn append(s1, s2) { - iodata:new(s1) |> iodata:append(_, s2) |> iodata:to_string(_) + iodata.new(s1) |> iodata.append(_, s2) |> iodata.to_string(_) } diff --git a/src/gleam/tuple.gleam b/src/gleam/tuple.gleam index 5260682..03ee14d 100644 --- a/src/gleam/tuple.gleam +++ b/src/gleam/tuple.gleam @@ -20,7 +20,7 @@ pub fn swap(tup) { } pub fn fetch(haystack, needle) { - list:find(haystack, fn(tuple) { + list.find(haystack, fn(tuple) { case first(tuple) == needle { | True -> tuple |> second |> Ok | False -> Error([]) |