aboutsummaryrefslogtreecommitdiff
path: root/src/gleam__stdlib.erl
blob: e4b76f7ef2dda94806b8418c3ca3f95b908dd72f (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
-module(gleam__stdlib).
-compile(export_all).
-include_lib("eunit/include/eunit.hrl").

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, {}},
    OkFound -> OkFound
  end.

iodata_append(X, Data) -> [X | Y].
iodata_prepend(X, Data) -> [Y, X].

identity(X) -> X.