-module(touch_grass@download). -compile([no_auto_import, nowarn_unused_vars, nowarn_unused_function, nowarn_nomatch, inline]). -define(FILEPATH, "src/touch_grass/download.gleam"). -export([lift/0, lower/0, decode/1]). -export_type([input/0]). -if(?OTP_RELEASE >= 27). -define(MODULEDOC(Str), -moduledoc(Str)). -define(DOC(Str), -doc(Str)). -else. -define(MODULEDOC(Str), -compile([])). -define(DOC(Str), -compile([])). -endif. ?MODULEDOC( " Download is a version of save, but with a name and not a path.\n" " A separate effect is a choice instead of using a magic directory in the filesystem.\n" ). -type input() :: {input, binary(), bitstring()}. -file("src/touch_grass/download.gleam", 10). -spec lift() -> eyg@analysis@type_@isomorphic:type(any()). lift() -> {record, {row_extend, <<"name"/utf8>>, string, {row_extend, <<"content"/utf8>>, binary, empty}}}. -file("src/touch_grass/download.gleam", 14). -spec lower() -> eyg@analysis@type_@isomorphic:type(any()). lower() -> {record, empty}. -file("src/touch_grass/download.gleam", 22). -spec decode(eyg@interpreter@value:value(NCZ, NDA)) -> {ok, input()} | {error, eyg@interpreter@break:reason(NCZ, NDA)}. decode(Lift) -> gleam@result:'try'( eyg@interpreter@cast:field( <<"name"/utf8>>, fun eyg@interpreter@cast:as_string/1, Lift ), fun(Name) -> gleam@result:'try'( eyg@interpreter@cast:field( <<"content"/utf8>>, fun eyg@interpreter@cast:as_binary/1, Lift ), fun(Content) -> {ok, {input, Name, Content}} end ) end ).