diff options
author | evuez <helloevuez@gmail.com> | 2021-02-23 14:12:57 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2021-02-23 13:12:57 +0000 |
commit | 3464cbb286b4f17cbfd4239aa5ddcfd1bf6a871c (patch) | |
tree | f57a3965e03c0843b5899d29a33223c22a7b883b /src/gleam_stdlib.erl | |
parent | 9424ebf22a18a46b871a5236457d4b08aca6b7cf (diff) | |
download | gleam_stdlib-3464cbb286b4f17cbfd4239aa5ddcfd1bf6a871c.tar.gz gleam_stdlib-3464cbb286b4f17cbfd4239aa5ddcfd1bf6a871c.zip |
Add dynamic.tuple{3,4,5,6} (#165)
Diffstat (limited to 'src/gleam_stdlib.erl')
-rw-r--r-- | src/gleam_stdlib.erl | 15 |
1 files changed, 14 insertions, 1 deletions
diff --git a/src/gleam_stdlib.erl b/src/gleam_stdlib.erl index e8cc7e4..10d3752 100644 --- a/src/gleam_stdlib.erl +++ b/src/gleam_stdlib.erl @@ -8,7 +8,8 @@ decode_thunk/1, decode_atom/1, decode_list/1, decode_field/2, decode_element/2, parse_int/1, parse_float/1, compare_strings/2, string_pop_grapheme/1, string_starts_with/2, string_ends_with/2, - string_pad/4, decode_tuple2/1, decode_map/1, bit_string_int_to_u32/1, + string_pad/4, decode_tuple2/1, decode_tuple3/1, decode_tuple4/1, + decode_tuple5/1, decode_tuple6/1, decode_map/1, bit_string_int_to_u32/1, bit_string_int_from_u32/1, bit_string_append/2, bit_string_part_/3, decode_bit_string/1, compile_regex/2, regex_match/2, regex_split/2, regex_scan/2, base_decode64/1, wrap_list/1, rescue/1, get_line/1]). @@ -56,6 +57,18 @@ classify(_) -> "some other type". decode_tuple2({_, _} = T) -> {ok, T}; decode_tuple2(Data) -> decode_error_msg("a 2 element tuple", Data). +decode_tuple3({_, _, _} = T) -> {ok, T}; +decode_tuple3(Data) -> decode_error_msg("a 3 element tuple", Data). + +decode_tuple4({_, _, _, _} = T) -> {ok, T}; +decode_tuple4(Data) -> decode_error_msg("a 4 element tuple", Data). + +decode_tuple5({_, _, _, _, _} = T) -> {ok, T}; +decode_tuple5(Data) -> decode_error_msg("a 5 element tuple", Data). + +decode_tuple6({_, _, _, _, _, _} = T) -> {ok, T}; +decode_tuple6(Data) -> decode_error_msg("a 6 element tuple", Data). + decode_map(Data) when is_map(Data) -> {ok, Data}; decode_map(Data) -> decode_error_msg("a map", Data). |