Skip to content

Commit 4dc0d18

Browse files
committed
Rename stdlib native module
1 parent 7ef601e commit 4dc0d18

17 files changed

+67
-70
lines changed

gen/src/[email protected]

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -4,31 +4,31 @@
44
-export([from/1, unsafe_coerce/1, string/1, int/1, float/1, atom/1, bool/1, thunk/1, list/2, pair/1, field/2]).
55

66
from(A) ->
7-
gleam__stdlib:identity(A).
7+
gleam_stdlib:identity(A).
88

99
unsafe_coerce(A) ->
10-
gleam__stdlib:identity(A).
10+
gleam_stdlib:identity(A).
1111

1212
string(A) ->
13-
gleam__stdlib:decode_string(A).
13+
gleam_stdlib:decode_string(A).
1414

1515
int(A) ->
16-
gleam__stdlib:decode_int(A).
16+
gleam_stdlib:decode_int(A).
1717

1818
float(A) ->
19-
gleam__stdlib:decode_float(A).
19+
gleam_stdlib:decode_float(A).
2020

2121
atom(A) ->
22-
gleam__stdlib:decode_atom(A).
22+
gleam_stdlib:decode_atom(A).
2323

2424
bool(A) ->
25-
gleam__stdlib:decode_bool(A).
25+
gleam_stdlib:decode_bool(A).
2626

2727
thunk(A) ->
28-
gleam__stdlib:decode_thunk(A).
28+
gleam_stdlib:decode_thunk(A).
2929

3030
list_any(A) ->
31-
gleam__stdlib:decode_list(A).
31+
gleam_stdlib:decode_list(A).
3232

3333
list(Any, Decode) ->
3434
gleam@result:then(
@@ -37,7 +37,7 @@ list(Any, Decode) ->
3737
).
3838

3939
pair(A) ->
40-
gleam__stdlib:decode_pair(A).
40+
gleam_stdlib:decode_pair(A).
4141

4242
field(A, B) ->
43-
gleam__stdlib:decode_field(A, B).
43+
gleam_stdlib:decode_field(A, B).

gen/src/[email protected]

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,10 +4,10 @@
44
-export([from_string/1, create_from_string/1, to_string/1]).
55

66
from_string(A) ->
7-
gleam__stdlib:atom_from_string(A).
7+
gleam_stdlib:atom_from_string(A).
88

99
create_from_string(A) ->
10-
gleam__stdlib:atom_create_from_string(A).
10+
gleam_stdlib:atom_create_from_string(A).
1111

1212
to_string(A) ->
13-
gleam__stdlib:atom_to_string(A).
13+
gleam_stdlib:atom_to_string(A).

gen/src/[email protected]

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -4,22 +4,22 @@
44
-export([equal/2, not_equal/2, true/1, false/1, is_ok/1, is_error/1, fail/0]).
55

66
equal(A, B) ->
7-
gleam__stdlib:expect_equal(A, B).
7+
gleam_stdlib:expect_equal(A, B).
88

99
not_equal(A, B) ->
10-
gleam__stdlib:expect_not_equal(A, B).
10+
gleam_stdlib:expect_not_equal(A, B).
1111

1212
true(A) ->
13-
gleam__stdlib:expect_true(A).
13+
gleam_stdlib:expect_true(A).
1414

1515
false(A) ->
16-
gleam__stdlib:expect_false(A).
16+
gleam_stdlib:expect_false(A).
1717

1818
is_ok(A) ->
19-
gleam__stdlib:expect_is_ok(A).
19+
gleam_stdlib:expect_is_ok(A).
2020

2121
is_error(A) ->
22-
gleam__stdlib:expect_is_error(A).
22+
gleam_stdlib:expect_is_error(A).
2323

2424
fail() ->
2525
true(false).

gen/src/[email protected]

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
-export([parse/1, to_string/1, compare/2, ceiling/1, floor/1, round/1, truncate/1]).
55

66
parse(A) ->
7-
gleam__stdlib:parse_float(A).
7+
gleam_stdlib:parse_float(A).
88

99
to_string(F) ->
1010
gleam@iodata:to_string(gleam@iodata:from_float(F)).

gen/src/[email protected]

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
-export([parse/1, to_string/1, to_base_string/2, compare/2]).
55

66
parse(A) ->
7-
gleam__stdlib:parse_int(A).
7+
gleam_stdlib:parse_int(A).
88

99
to_string(A) ->
1010
erlang:integer_to_binary(A).

gen/src/[email protected]

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -4,25 +4,25 @@
44
-export([prepend/2, append/2, prepend_iodata/2, append_iodata/2, from_strings/1, concat/1, new/1, to_string/1, byte_size/1, from_float/1, lowercase/1, uppercase/1, reverse/1, split/2, replace/3, is_equal/2, is_empty/1]).
55

66
prepend(A, B) ->
7-
gleam__stdlib:iodata_prepend(A, B).
7+
gleam_stdlib:iodata_prepend(A, B).
88

99
append(A, B) ->
10-
gleam__stdlib:iodata_append(A, B).
10+
gleam_stdlib:iodata_append(A, B).
1111

1212
prepend_iodata(A, B) ->
13-
gleam__stdlib:iodata_prepend(A, B).
13+
gleam_stdlib:iodata_prepend(A, B).
1414

1515
append_iodata(A, B) ->
16-
gleam__stdlib:iodata_append(A, B).
16+
gleam_stdlib:iodata_append(A, B).
1717

1818
from_strings(A) ->
19-
gleam__stdlib:identity(A).
19+
gleam_stdlib:identity(A).
2020

2121
concat(A) ->
22-
gleam__stdlib:identity(A).
22+
gleam_stdlib:identity(A).
2323

2424
new(A) ->
25-
gleam__stdlib:identity(A).
25+
gleam_stdlib:identity(A).
2626

2727
to_string(A) ->
2828
erlang:iolist_to_binary(A).

gen/src/[email protected]

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ contains(List, Elem) ->
2424
head(List) ->
2525
case List of
2626
[] ->
27-
{error, {}};
27+
{error, nil};
2828

2929
[X | _] ->
3030
{ok, X}
@@ -33,7 +33,7 @@ head(List) ->
3333
tail(List) ->
3434
case List of
3535
[] ->
36-
{error, {}};
36+
{error, nil};
3737

3838
[_ | Xs] ->
3939
{ok, Xs}
@@ -172,7 +172,7 @@ fold_right(List, Acc, Fun) ->
172172
find(Haystack, F) ->
173173
case Haystack of
174174
[] ->
175-
{error, {}};
175+
{error, nil};
176176

177177
[X | Rest] ->
178178
case F(X) of
@@ -250,12 +250,12 @@ intersperse(List, Elem) ->
250250
at(List, I) ->
251251
case I < 0 of
252252
true ->
253-
{error, {}};
253+
{error, nil};
254254

255255
false ->
256256
case List of
257257
[] ->
258-
{error, {}};
258+
{error, nil};
259259

260260
[X | Rest] ->
261261
case I =:= 0 of

gen/src/[email protected]

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ new() ->
2222
maps:new().
2323

2424
fetch(A, B) ->
25-
gleam__stdlib:map_fetch(A, B).
25+
gleam_stdlib:map_fetch(A, B).
2626

2727
erl_put(A, B, C) ->
2828
maps:put(A, B, C).

src/gleam/any.gleam

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -11,35 +11,35 @@ pub external type Any;
1111

1212
// Convert any Gleam data into `Any` data.
1313
//
14-
pub external fn from(a) -> Any = "gleam__stdlib" "identity";
14+
pub external fn from(a) -> Any = "gleam_stdlib" "identity";
1515

1616
// Unsafely cast any type into any other type.
1717
//
1818
// This is an escape hatch for the type system that may be useful when wrapping
1919
// native Erlang APIs. It is to be used as a last measure only.
2020
//
21-
pub external fn unsafe_coerce(a) -> b = "gleam__stdlib" "identity";
21+
pub external fn unsafe_coerce(a) -> b = "gleam_stdlib" "identity";
2222

2323
pub external fn string(Any) -> Result(String, String)
24-
= "gleam__stdlib" "decode_string"
24+
= "gleam_stdlib" "decode_string"
2525

2626
pub external fn int(Any) -> Result(Int, String)
27-
= "gleam__stdlib" "decode_int"
27+
= "gleam_stdlib" "decode_int"
2828

2929
pub external fn float(Any) -> Result(Float, String)
30-
= "gleam__stdlib" "decode_float"
30+
= "gleam_stdlib" "decode_float"
3131

3232
pub external fn atom(Any) -> Result(atom.Atom, String)
33-
= "gleam__stdlib" "decode_atom"
33+
= "gleam_stdlib" "decode_atom"
3434

3535
pub external fn bool(Any) -> Result(Bool, String)
36-
= "gleam__stdlib" "decode_bool"
36+
= "gleam_stdlib" "decode_bool"
3737

3838
pub external fn thunk(Any) -> Result(fn() -> Any, String)
39-
= "gleam__stdlib" "decode_thunk"
39+
= "gleam_stdlib" "decode_thunk"
4040

41-
external fn list_any(Any) -> Result(List(Any), String) =
42-
"gleam__stdlib" "decode_list"
41+
external fn list_any(Any) -> Result(List(Any), String)
42+
= "gleam_stdlib" "decode_list"
4343

4444
pub fn list(any, decode) {
4545
any
@@ -48,7 +48,7 @@ pub fn list(any, decode) {
4848
}
4949

5050
pub external fn pair(Any) -> Result(pair.Pair(Any, Any), String)
51-
= "gleam__stdlib" "decode_pair"
51+
= "gleam_stdlib" "decode_pair"
5252

5353
pub external fn field(Any, a) -> Result(Any, String)
54-
= "gleam__stdlib" "decode_field"
54+
= "gleam_stdlib" "decode_field"

src/gleam/atom.gleam

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,14 +4,14 @@ pub enum AtomNotLoaded =
44
| AtomNotLoaded
55

66
pub external fn from_string(String) -> Result(Atom, AtomNotLoaded) =
7-
"gleam__stdlib" "atom_from_string";
7+
"gleam_stdlib" "atom_from_string";
88

99
// This function can create a new atom if one does not already exist for
1010
// the given string. Atoms are not garbage collected so this can result
1111
// in a memory leak if called over time on new values
1212
//
1313
pub external fn create_from_string(String) -> Atom =
14-
"gleam__stdlib" "atom_create_from_string";
14+
"gleam_stdlib" "atom_create_from_string";
1515

1616
pub external fn to_string(Atom) -> String =
17-
"gleam__stdlib" "atom_to_string";
17+
"gleam_stdlib" "atom_to_string";

0 commit comments

Comments
 (0)