Current section
Files
Jump to
Current section
Files
src/touch_grass.erl
-module(touch_grass).
-compile([no_auto_import, nowarn_unused_vars, nowarn_unused_function, nowarn_nomatch, inline]).
-define(FILEPATH, "src/touch_grass.gleam").
-export([abort/0, copy/0, decode_json/0, download/0, fetch/0, flip/0, paste/0, print/0, alert/0, prompt/0, random/0, visit/0, map/2, replace/2]).
-if(?OTP_RELEASE >= 27).
-define(MODULEDOC(Str), -moduledoc(Str)).
-define(DOC(Str), -doc(Str)).
-else.
-define(MODULEDOC(Str), -compile([])).
-define(DOC(Str), -compile([])).
-endif.
-file("src/touch_grass.gleam", 17).
-spec abort() -> touch_grass@interface:interface(binary(), any(), any()).
abort() ->
{interface,
<<"Abort"/utf8>>,
touch_grass@abort:lift(),
touch_grass@abort:lower(),
fun eyg@interpreter@cast:as_string/1}.
-file("src/touch_grass.gleam", 26).
-spec copy() -> touch_grass@interface:interface(binary(), any(), any()).
copy() ->
{interface,
<<"Copy"/utf8>>,
touch_grass@copy:lift(),
touch_grass@copy:lower(),
fun touch_grass@copy:decode/1}.
-file("src/touch_grass.gleam", 30).
-spec decode_json() -> touch_grass@interface:interface(bitstring(), any(), any()).
decode_json() ->
{interface,
<<"DecodeJSON"/utf8>>,
touch_grass@decode_json:lift(),
touch_grass@decode_json:lower(),
fun eyg@interpreter@cast:as_binary/1}.
-file("src/touch_grass.gleam", 39).
-spec download() -> touch_grass@interface:interface(touch_grass@download:input(), any(), any()).
download() ->
{interface,
<<"Download"/utf8>>,
touch_grass@download:lift(),
touch_grass@download:lower(),
fun touch_grass@download:decode/1}.
-file("src/touch_grass.gleam", 43).
-spec fetch() -> touch_grass@interface:interface(gleam@http@request:request(bitstring()), any(), any()).
fetch() ->
{interface,
<<"Fetch"/utf8>>,
touch_grass@fetch:lift(),
touch_grass@fetch:lower(),
fun touch_grass@http:request_to_gleam/1}.
-file("src/touch_grass.gleam", 47).
-spec flip() -> touch_grass@interface:interface(nil, any(), any()).
flip() ->
{interface,
<<"Flip"/utf8>>,
touch_grass@flip:lift(),
touch_grass@flip:lower(),
fun touch_grass@flip:decode/1}.
-file("src/touch_grass.gleam", 51).
-spec paste() -> touch_grass@interface:interface(nil, any(), any()).
paste() ->
{interface,
<<"Paste"/utf8>>,
touch_grass@paste:lift(),
touch_grass@paste:lower(),
fun touch_grass@paste:decode/1}.
-file("src/touch_grass.gleam", 55).
-spec print() -> touch_grass@interface:interface(binary(), any(), any()).
print() ->
{interface,
<<"Print"/utf8>>,
touch_grass@print:lift(),
touch_grass@print:lower(),
fun eyg@interpreter@cast:as_string/1}.
-file("src/touch_grass.gleam", 22).
?DOC(" alert is the same interface as Print but show to the user in a browser context\n").
-spec alert() -> touch_grass@interface:interface(binary(), any(), any()).
alert() ->
{interface,
<<"Alert"/utf8>>,
touch_grass@print:lift(),
touch_grass@print:lower(),
fun eyg@interpreter@cast:as_string/1}.
-file("src/touch_grass.gleam", 59).
-spec prompt() -> touch_grass@interface:interface(binary(), any(), any()).
prompt() ->
{interface,
<<"Prompt"/utf8>>,
touch_grass@prompt:lift(),
touch_grass@prompt:lower(),
fun touch_grass@prompt:decode/1}.
-file("src/touch_grass.gleam", 63).
-spec random() -> touch_grass@interface:interface(integer(), any(), any()).
random() ->
{interface,
<<"Random"/utf8>>,
touch_grass@random:lift(),
touch_grass@random:lower(),
fun touch_grass@random:decode/1}.
-file("src/touch_grass.gleam", 67).
-spec visit() -> touch_grass@interface:interface(gleam@uri:uri(), any(), any()).
visit() ->
{interface,
<<"Visit"/utf8>>,
touch_grass@visit:lift(),
touch_grass@visit:lower(),
fun touch_grass@uri:uri_to_gleam/1}.
-file("src/touch_grass.gleam", 71).
-spec map(touch_grass@interface:interface(OIA, OIB, OIC), fun((OIA) -> OIG)) -> touch_grass@interface:interface(OIG, OIB, OIC).
map(Interface, F) ->
{interface, _, _, _, Decode} = Interface,
Decode@1 = eyg@interpreter@cast:map(Decode, F),
{interface,
erlang:element(2, Interface),
erlang:element(3, Interface),
erlang:element(4, Interface),
Decode@1}.
-file("src/touch_grass.gleam", 77).
-spec replace(touch_grass@interface:interface(nil, OIK, OIL), OIP) -> touch_grass@interface:interface(OIP, OIK, OIL).
replace(Interface, Value) ->
{interface, _, _, _, Decode} = Interface,
Decode@1 = eyg@interpreter@cast:map(Decode, fun(_) -> Value end),
{interface,
erlang:element(2, Interface),
erlang:element(3, Interface),
erlang:element(4, Interface),
Decode@1}.