aboutsummaryrefslogtreecommitdiff
path: root/src/gleam__stdlib.erl
diff options
context:
space:
mode:
authorLouis Pilfold <louis@lpil.uk>2018-11-20 19:38:41 +0000
committerLouis Pilfold <louis@lpil.uk>2018-11-20 19:38:41 +0000
commit7675e45b733608aa21dd590c78e268e28087676c (patch)
tree595fbd20f56622ee14ba7d79995d9df574122d84 /src/gleam__stdlib.erl
parent6fc9588f3dde4ad3fa0be5cbeb0c6560b6debc98 (diff)
downloadgleam_stdlib-7675e45b733608aa21dd590c78e268e28087676c.tar.gz
gleam_stdlib-7675e45b733608aa21dd590c78e268e28087676c.zip
Additional maps
Diffstat (limited to 'src/gleam__stdlib.erl')
-rw-r--r--src/gleam__stdlib.erl6
1 files changed, 6 insertions, 0 deletions
diff --git a/src/gleam__stdlib.erl b/src/gleam__stdlib.erl
index db80c1b..5942a0f 100644
--- a/src/gleam__stdlib.erl
+++ b/src/gleam__stdlib.erl
@@ -6,3 +6,9 @@ expect_equal(A, Expected) -> ?assertEqual(Expected, A).
expect_not_equal(A, Expected) -> ?assertNotEqual(Expected, A).
expect_true(A) -> ?assert(A).
expect_false(A) -> ?assertNot(A).
+
+map_fetch(Map, Key) ->
+ case maps:find(Key, Map) of
+ error -> {error, {}},
+ Found -> Found
+ end.