diff options
author | Louis Pilfold <louis@lpil.uk> | 2021-09-11 15:01:31 +0100 |
---|---|---|
committer | Louis Pilfold <louis@lpil.uk> | 2021-09-11 15:01:31 +0100 |
commit | ebf5b1b05b7b8e928112db3061ea564530755a10 (patch) | |
tree | 9b27308e8fb413e5bedc2b1301be94a3e7497d91 | |
parent | fe9aa89e6d595599a8c33b50cb206cb71b4d8a19 (diff) | |
download | gleam_stdlib-ebf5b1b05b7b8e928112db3061ea564530755a10.tar.gz gleam_stdlib-ebf5b1b05b7b8e928112db3061ea564530755a10.zip |
Fix Erlang
-rw-r--r-- | src/gleam/dynamic.gleam | 6 | ||||
-rw-r--r-- | src/gleam_stdlib.erl | 4 |
2 files changed, 5 insertions, 5 deletions
diff --git a/src/gleam/dynamic.gleam b/src/gleam/dynamic.gleam index 8caa858..2b6d3b1 100644 --- a/src/gleam/dynamic.gleam +++ b/src/gleam/dynamic.gleam @@ -369,9 +369,9 @@ pub fn optional( if erlang { external fn decode_optional( Dynamic, - Decoder(Option(a)), - ) -> Result(a, DecodeError) = - "gleam_stdlib" "decode_optionl" + Decoder(a), + ) -> Result(Option(a), DecodeError) = + "gleam_stdlib" "decode_option" } if javascript { diff --git a/src/gleam_stdlib.erl b/src/gleam_stdlib.erl index 4c8a428..f607497 100644 --- a/src/gleam_stdlib.erl +++ b/src/gleam_stdlib.erl @@ -3,7 +3,7 @@ -export([should_equal/2, should_not_equal/2, should_be_ok/1, should_be_error/1, map_get/2, iodata_append/2, identity/1, decode_int/1, decode_bool/1, - decode_float/1, decode_thunk/1, decode_list/1, decode_optional/2, + decode_float/1, decode_thunk/1, decode_list/1, decode_option/2, decode_field/2, parse_int/1, parse_float/1, less_than/2, string_pop_grapheme/1, string_starts_with/2, wrap_list/1, string_ends_with/2, string_pad/4, decode_map/1, @@ -106,7 +106,7 @@ tuple_get(Data, Index) -> {ok, element(Index + 1, Data)}. decode_tuple(Data) when is_tuple(Data) -> {ok, Data}; decode_tuple(Data) -> decode_error_msg(<<"Tuple">>, Data). -decode_optional(Term, F) -> +decode_option(Term, F) -> Decode = fun(Inner) -> case F(Inner) of {ok, Decoded} -> {ok, {some, Decoded}}; |