aboutsummaryrefslogtreecommitdiff
path: root/gen/src/gleam@list.erl
diff options
context:
space:
mode:
authorLouis Pilfold <louis@lpil.uk>2020-01-14 11:47:31 +0000
committerLouis Pilfold <louis@lpil.uk>2020-01-14 11:47:31 +0000
commitc74e1a0898890e92ab450312910f97ed9e028ab9 (patch)
tree1b76683a50ac04fb3704684c798000beb95b5b9e /gen/src/gleam@list.erl
parent36957584a74a2e299971e0c00ff9e03d03d5a205 (diff)
downloadgleam_stdlib-c74e1a0898890e92ab450312910f97ed9e028ab9.tar.gz
gleam_stdlib-c74e1a0898890e92ab450312910f97ed9e028ab9.zip
Type annotations for gleam/list
Diffstat (limited to 'gen/src/gleam@list.erl')
-rw-r--r--gen/src/gleam@list.erl11
1 files changed, 6 insertions, 5 deletions
diff --git a/gen/src/gleam@list.erl b/gen/src/gleam@list.erl
index 1e19592..c33dab2 100644
--- a/gen/src/gleam@list.erl
+++ b/gen/src/gleam@list.erl
@@ -368,8 +368,8 @@ do_split(List, N, Taken) ->
end
end.
-split(List, Target) ->
- do_split(List, Target, []).
+split(List, Index) ->
+ do_split(List, Index, []).
do_split_while(List, F, Acc) ->
case List of
@@ -389,10 +389,11 @@ do_split_while(List, F, Acc) ->
split_while(List, Predicate) ->
do_split_while(List, Predicate, []).
-key_find(Haystack, Needle) ->
- find_map(Haystack, fun(P) -> case gleam@pair:first(P) =:= Needle of
+key_find(KeywordList, DesiredKey) ->
+ find_map(KeywordList, fun(Keyword) -> {Key, Value} = Keyword,
+ case Key =:= DesiredKey of
true ->
- {ok, gleam@pair:second(P)};
+ {ok, Value};
false ->
{error, nil}