-module(gleamgen@module). -compile([no_auto_import, nowarn_unused_vars, nowarn_unused_function, nowarn_nomatch]). -export([with_constant/3, with_import/2, with_imports_unchecked/2, with_function/3, with_custom_type1/3, with_custom_type2/3, with_custom_type3/3, with_custom_type4/3, with_custom_type5/3, with_custom_type6/3, with_custom_type7/3, with_custom_type8/3, with_custom_type9/3, with_custom_type_unchecked/3, with_type_alias/3, eof/0, render_imported_module/1, render/2]). -export_type([definition/0, attribute/0, definition_details/0, definable/0, module_/0]). -type definition() :: {definition, definition_details(), definable()}. -type attribute() :: external_erlang | external_javascript | {deprecated, binary()} | internal. -type definition_details() :: {definition_details, binary(), boolean(), list(attribute())}. -type definable() :: {function, gleamgen@function:function_(gleamgen@types:unchecked(), gleamgen@types:unchecked())} | {custom_type_builder, gleamgen@types@custom:custom_type_builder(gleamgen@types:unchecked(), nil, nil)} | {constant, gleamgen@expression:expression(gleamgen@types:unchecked())} | {type_alias, gleamgen@types:generated_type(gleamgen@types:unchecked())}. -type module_() :: {module, list(definition()), list(gleamgen@import_:imported_module())}. -file("/home/weasel/gleam/testing_gleamgen/gleamgen/src/gleamgen/module.gleam", 40). -spec with_constant( definition_details(), gleamgen@expression:expression(NNR), fun((gleamgen@expression:expression(NNR)) -> module_()) ) -> module_(). with_constant(Details, Value, Handler) -> Rest = Handler( gleamgen@expression:unchecked_ident(erlang:element(2, Details)) ), _record = Rest, {module, [{definition, Details, {constant, begin _pipe = Value, gleamgen_ffi:identity(_pipe) end}} | erlang:element(2, Rest)], erlang:element(3, _record)}. -file("/home/weasel/gleam/testing_gleamgen/gleamgen/src/gleamgen/module.gleam", 52). -spec with_import( gleamgen@import_:imported_module(), fun((gleamgen@import_:imported_module()) -> module_()) ) -> module_(). with_import(Module, Handler) -> Rest = Handler(Module), _record = Rest, {module, erlang:element(2, _record), [Module | erlang:element(3, Rest)]}. -file("/home/weasel/gleam/testing_gleamgen/gleamgen/src/gleamgen/module.gleam", 60). -spec with_imports_unchecked( list(gleamgen@import_:imported_module()), fun((list(gleamgen@import_:imported_module())) -> module_()) ) -> module_(). with_imports_unchecked(Modules, Handler) -> Rest = Handler(Modules), _record = Rest, {module, erlang:element(2, _record), lists:append(lists:reverse(Modules), erlang:element(3, Rest))}. -file("/home/weasel/gleam/testing_gleamgen/gleamgen/src/gleamgen/module.gleam", 68). -spec with_function( definition_details(), gleamgen@function:function_(NNW, any()), fun((gleamgen@expression:expression(NNW)) -> module_()) ) -> module_(). with_function(Details, Func, Handler) -> Rest = Handler( gleamgen@expression:unchecked_ident(erlang:element(2, Details)) ), _record = Rest, {module, [{definition, Details, {function, begin _pipe = Func, gleamgen_ffi:identity(_pipe) end}} | erlang:element(2, Rest)], erlang:element(3, _record)}. -file("/home/weasel/gleam/testing_gleamgen/gleamgen/src/gleamgen/module.gleam", 80). -spec with_custom_type1( definition_details(), gleamgen@types@custom:custom_type_builder(NOB, {{}, NOC}, NOE), fun((gleamgen@types@custom:custom_type(NOB, NOE), gleamgen@expression@constructor:constructor(NOB, NOC, NOE)) -> module_()) ) -> module_(). with_custom_type1(Details, Type_, Handler) -> _assert_subject = erlang:element(2, Type_), [Variant1] = case _assert_subject of [_] -> _assert_subject; _assert_fail -> erlang:error(#{gleam_error => let_assert, message => <<"Pattern match failed, no pattern matched the value."/utf8>>, value => _assert_fail, module => <<"gleamgen/module"/utf8>>, function => <<"with_custom_type1"/utf8>>, line => 89}) end, Rest = Handler( {custom_type, none, erlang:element(2, Details)}, gleamgen@expression@constructor:new(Variant1) ), _record = Rest, {module, [{definition, Details, {custom_type_builder, begin _pipe = Type_, gleamgen@types@custom:to_unchecked(_pipe) end}} | erlang:element(2, Rest)], erlang:element(3, _record)}. -file("/home/weasel/gleam/testing_gleamgen/gleamgen/src/gleamgen/module.gleam", 106). -spec with_custom_type2( definition_details(), gleamgen@types@custom:custom_type_builder(NON, {{{}, NOO}, NOP}, NOS), fun((gleamgen@types@custom:custom_type(NON, NOS), gleamgen@expression@constructor:constructor(NON, NOO, NOS), gleamgen@expression@constructor:constructor(NON, NOP, NOS)) -> module_()) ) -> module_(). with_custom_type2(Details, Type_, Handler) -> _assert_subject = erlang:element(2, Type_), [Variant2, Variant1] = case _assert_subject of [_, _] -> _assert_subject; _assert_fail -> erlang:error(#{gleam_error => let_assert, message => <<"Pattern match failed, no pattern matched the value."/utf8>>, value => _assert_fail, module => <<"gleamgen/module"/utf8>>, function => <<"with_custom_type2"/utf8>>, line => 116}) end, Rest = Handler( {custom_type, none, erlang:element(2, Details)}, gleamgen@expression@constructor:new(Variant1), gleamgen@expression@constructor:new(Variant2) ), _record = Rest, {module, [{definition, Details, {custom_type_builder, begin _pipe = Type_, gleamgen@types@custom:to_unchecked(_pipe) end}} | erlang:element(2, Rest)], erlang:element(3, _record)}. -file("/home/weasel/gleam/testing_gleamgen/gleamgen/src/gleamgen/module.gleam", 132). -spec with_custom_type3( definition_details(), gleamgen@types@custom:custom_type_builder(NPE, {{{{}, NPF}, NPG}, NPH}, NPL), fun((gleamgen@types@custom:custom_type(NPE, NPL), gleamgen@expression@constructor:constructor(NPE, NPF, NPL), gleamgen@expression@constructor:constructor(NPE, NPG, NPL), gleamgen@expression@constructor:constructor(NPE, NPH, NPL)) -> module_()) ) -> module_(). with_custom_type3(Details, Type_, Handler) -> _assert_subject = erlang:element(2, Type_), [Variant3, Variant2, Variant1] = case _assert_subject of [_, _, _] -> _assert_subject; _assert_fail -> erlang:error(#{gleam_error => let_assert, message => <<"Pattern match failed, no pattern matched the value."/utf8>>, value => _assert_fail, module => <<"gleamgen/module"/utf8>>, function => <<"with_custom_type3"/utf8>>, line => 143}) end, Rest = Handler( {custom_type, none, erlang:element(2, Details)}, gleamgen@expression@constructor:new(Variant1), gleamgen@expression@constructor:new(Variant2), gleamgen@expression@constructor:new(Variant3) ), _record = Rest, {module, [{definition, Details, {custom_type_builder, begin _pipe = Type_, gleamgen@types@custom:to_unchecked(_pipe) end}} | erlang:element(2, Rest)], erlang:element(3, _record)}. -file("/home/weasel/gleam/testing_gleamgen/gleamgen/src/gleamgen/module.gleam", 160). -spec with_custom_type4( definition_details(), gleamgen@types@custom:custom_type_builder(NQA, {{{{{}, NQB}, NQC}, NQD}, NQE}, NQJ), fun((gleamgen@types@custom:custom_type(NQA, NQJ), gleamgen@expression@constructor:constructor(NQA, NQB, NQJ), gleamgen@expression@constructor:constructor(NQA, NQC, NQJ), gleamgen@expression@constructor:constructor(NQA, NQD, NQJ), gleamgen@expression@constructor:constructor(NQA, NQE, NQJ)) -> module_()) ) -> module_(). with_custom_type4(Details, Type_, Handler) -> _assert_subject = erlang:element(2, Type_), [Variant4, Variant3, Variant2, Variant1] = case _assert_subject of [_, _, _, _] -> _assert_subject; _assert_fail -> erlang:error(#{gleam_error => let_assert, message => <<"Pattern match failed, no pattern matched the value."/utf8>>, value => _assert_fail, module => <<"gleamgen/module"/utf8>>, function => <<"with_custom_type4"/utf8>>, line => 172}) end, Rest = Handler( {custom_type, none, erlang:element(2, Details)}, gleamgen@expression@constructor:new(Variant1), gleamgen@expression@constructor:new(Variant2), gleamgen@expression@constructor:new(Variant3), gleamgen@expression@constructor:new(Variant4) ), _record = Rest, {module, [{definition, Details, {custom_type_builder, begin _pipe = Type_, gleamgen@types@custom:to_unchecked(_pipe) end}} | erlang:element(2, Rest)], erlang:element(3, _record)}. -file("/home/weasel/gleam/testing_gleamgen/gleamgen/src/gleamgen/module.gleam", 190). -spec with_custom_type5( definition_details(), gleamgen@types@custom:custom_type_builder(NRB, {{{{{{}, NRC}, NRD}, NRE}, NRF}, NRG}, NRM), fun((gleamgen@types@custom:custom_type(NRB, NRM), gleamgen@expression@constructor:constructor(NRB, NRC, NRM), gleamgen@expression@constructor:constructor(NRB, NRD, NRM), gleamgen@expression@constructor:constructor(NRB, NRE, NRM), gleamgen@expression@constructor:constructor(NRB, NRF, NRM), gleamgen@expression@constructor:constructor(NRB, NRG, NRM)) -> module_()) ) -> module_(). with_custom_type5(Details, Type_, Handler) -> _assert_subject = erlang:element(2, Type_), [Variant5, Variant4, Variant3, Variant2, Variant1] = case _assert_subject of [_, _, _, _, _] -> _assert_subject; _assert_fail -> erlang:error(#{gleam_error => let_assert, message => <<"Pattern match failed, no pattern matched the value."/utf8>>, value => _assert_fail, module => <<"gleamgen/module"/utf8>>, function => <<"with_custom_type5"/utf8>>, line => 207}) end, Rest = Handler( {custom_type, none, erlang:element(2, Details)}, gleamgen@expression@constructor:new(Variant1), gleamgen@expression@constructor:new(Variant2), gleamgen@expression@constructor:new(Variant3), gleamgen@expression@constructor:new(Variant4), gleamgen@expression@constructor:new(Variant5) ), _record = Rest, {module, [{definition, Details, {custom_type_builder, begin _pipe = Type_, gleamgen@types@custom:to_unchecked(_pipe) end}} | erlang:element(2, Rest)], erlang:element(3, _record)}. -file("/home/weasel/gleam/testing_gleamgen/gleamgen/src/gleamgen/module.gleam", 226). -spec with_custom_type6( definition_details(), gleamgen@types@custom:custom_type_builder(NSH, {{{{{{{}, NSI}, NSJ}, NSK}, NSL}, NSM}, NSN}, NSU), fun((gleamgen@types@custom:custom_type(NSH, NSU), gleamgen@expression@constructor:constructor(NSH, NSI, NSU), gleamgen@expression@constructor:constructor(NSH, NSJ, NSU), gleamgen@expression@constructor:constructor(NSH, NSK, NSU), gleamgen@expression@constructor:constructor(NSH, NSL, NSU), gleamgen@expression@constructor:constructor(NSH, NSM, NSU), gleamgen@expression@constructor:constructor(NSH, NSN, NSU)) -> module_()) ) -> module_(). with_custom_type6(Details, Type_, Handler) -> _assert_subject = erlang:element(2, Type_), [Variant6, Variant5, Variant4, Variant3, Variant2, Variant1] = case _assert_subject of [_, _, _, _, _, _] -> _assert_subject; _assert_fail -> erlang:error(#{gleam_error => let_assert, message => <<"Pattern match failed, no pattern matched the value."/utf8>>, value => _assert_fail, module => <<"gleamgen/module"/utf8>>, function => <<"with_custom_type6"/utf8>>, line => 244}) end, Rest = Handler( {custom_type, none, erlang:element(2, Details)}, gleamgen@expression@constructor:new(Variant1), gleamgen@expression@constructor:new(Variant2), gleamgen@expression@constructor:new(Variant3), gleamgen@expression@constructor:new(Variant4), gleamgen@expression@constructor:new(Variant5), gleamgen@expression@constructor:new(Variant6) ), _record = Rest, {module, [{definition, Details, {custom_type_builder, begin _pipe = Type_, gleamgen@types@custom:to_unchecked(_pipe) end}} | erlang:element(2, Rest)], erlang:element(3, _record)}. -file("/home/weasel/gleam/testing_gleamgen/gleamgen/src/gleamgen/module.gleam", 265). -spec with_custom_type7( definition_details(), gleamgen@types@custom:custom_type_builder(NTS, {{{{{{{{}, NTT}, NTU}, NTV}, NTW}, NTX}, NTY}, NTZ}, NUH), fun((gleamgen@types@custom:custom_type(NTS, NUH), gleamgen@expression@constructor:constructor(NTS, NTT, NUH), gleamgen@expression@constructor:constructor(NTS, NTU, NUH), gleamgen@expression@constructor:constructor(NTS, NTV, NUH), gleamgen@expression@constructor:constructor(NTS, NTW, NUH), gleamgen@expression@constructor:constructor(NTS, NTX, NUH), gleamgen@expression@constructor:constructor(NTS, NTY, NUH), gleamgen@expression@constructor:constructor(NTS, NTZ, NUH)) -> module_()) ) -> module_(). with_custom_type7(Details, Type_, Handler) -> _assert_subject = erlang:element(2, Type_), [Variant7, Variant6, Variant5, Variant4, Variant3, Variant2, Variant1] = case _assert_subject of [_, _, _, _, _, _, _] -> _assert_subject; _assert_fail -> erlang:error(#{gleam_error => let_assert, message => <<"Pattern match failed, no pattern matched the value."/utf8>>, value => _assert_fail, module => <<"gleamgen/module"/utf8>>, function => <<"with_custom_type7"/utf8>>, line => 284}) end, Rest = Handler( {custom_type, none, erlang:element(2, Details)}, gleamgen@expression@constructor:new(Variant1), gleamgen@expression@constructor:new(Variant2), gleamgen@expression@constructor:new(Variant3), gleamgen@expression@constructor:new(Variant4), gleamgen@expression@constructor:new(Variant5), gleamgen@expression@constructor:new(Variant6), gleamgen@expression@constructor:new(Variant7) ), _record = Rest, {module, [{definition, Details, {custom_type_builder, begin _pipe = Type_, gleamgen@types@custom:to_unchecked(_pipe) end}} | erlang:element(2, Rest)], erlang:element(3, _record)}. -file("/home/weasel/gleam/testing_gleamgen/gleamgen/src/gleamgen/module.gleam", 313). -spec with_custom_type8( definition_details(), gleamgen@types@custom:custom_type_builder(NVI, {{{{{{{{{}, NVJ}, NVK}, NVL}, NVM}, NVN}, NVO}, NVP}, NVQ}, NVZ), fun((gleamgen@types@custom:custom_type(NVI, NVZ), gleamgen@expression@constructor:constructor(NVI, NVJ, NVZ), gleamgen@expression@constructor:constructor(NVI, NVK, NVZ), gleamgen@expression@constructor:constructor(NVI, NVL, NVZ), gleamgen@expression@constructor:constructor(NVI, NVM, NVZ), gleamgen@expression@constructor:constructor(NVI, NVN, NVZ), gleamgen@expression@constructor:constructor(NVI, NVO, NVZ), gleamgen@expression@constructor:constructor(NVI, NVP, NVZ), gleamgen@expression@constructor:constructor(NVI, NVQ, NVZ)) -> module_()) ) -> module_(). with_custom_type8(Details, Type_, Handler) -> _assert_subject = erlang:element(2, Type_), [Variant8, Variant7, Variant6, Variant5, Variant4, Variant3, Variant2, Variant1] = case _assert_subject of [_, _, _, _, _, _, _, _] -> _assert_subject; _assert_fail -> erlang:error(#{gleam_error => let_assert, message => <<"Pattern match failed, no pattern matched the value."/utf8>>, value => _assert_fail, module => <<"gleamgen/module"/utf8>>, function => <<"with_custom_type8"/utf8>>, line => 333}) end, Rest = Handler( {custom_type, none, erlang:element(2, Details)}, gleamgen@expression@constructor:new(Variant1), gleamgen@expression@constructor:new(Variant2), gleamgen@expression@constructor:new(Variant3), gleamgen@expression@constructor:new(Variant4), gleamgen@expression@constructor:new(Variant5), gleamgen@expression@constructor:new(Variant6), gleamgen@expression@constructor:new(Variant7), gleamgen@expression@constructor:new(Variant8) ), _record = Rest, {module, [{definition, Details, {custom_type_builder, begin _pipe = Type_, gleamgen@types@custom:to_unchecked(_pipe) end}} | erlang:element(2, Rest)], erlang:element(3, _record)}. -file("/home/weasel/gleam/testing_gleamgen/gleamgen/src/gleamgen/module.gleam", 364). -spec with_custom_type9( definition_details(), gleamgen@types@custom:custom_type_builder(NXD, {{{{{{{{{{}, NXE}, NXF}, NXG}, NXH}, NXI}, NXJ}, NXK}, NXL}, NXM}, NXW), fun((gleamgen@types@custom:custom_type(NXD, NXW), gleamgen@expression@constructor:constructor(NXD, NXE, NXW), gleamgen@expression@constructor:constructor(NXD, NXF, NXW), gleamgen@expression@constructor:constructor(NXD, NXG, NXW), gleamgen@expression@constructor:constructor(NXD, NXH, NXW), gleamgen@expression@constructor:constructor(NXD, NXI, NXW), gleamgen@expression@constructor:constructor(NXD, NXJ, NXW), gleamgen@expression@constructor:constructor(NXD, NXK, NXW), gleamgen@expression@constructor:constructor(NXD, NXL, NXW), gleamgen@expression@constructor:constructor(NXD, NXM, NXW)) -> module_()) ) -> module_(). with_custom_type9(Details, Type_, Handler) -> _assert_subject = erlang:element(2, Type_), [Variant9, Variant8, Variant7, Variant6, Variant5, Variant4, Variant3, Variant2, Variant1] = case _assert_subject of [_, _, _, _, _, _, _, _, _] -> _assert_subject; _assert_fail -> erlang:error(#{gleam_error => let_assert, message => <<"Pattern match failed, no pattern matched the value."/utf8>>, value => _assert_fail, module => <<"gleamgen/module"/utf8>>, function => <<"with_custom_type9"/utf8>>, line => 385}) end, Rest = Handler( {custom_type, none, erlang:element(2, Details)}, gleamgen@expression@constructor:new(Variant1), gleamgen@expression@constructor:new(Variant2), gleamgen@expression@constructor:new(Variant3), gleamgen@expression@constructor:new(Variant4), gleamgen@expression@constructor:new(Variant5), gleamgen@expression@constructor:new(Variant6), gleamgen@expression@constructor:new(Variant7), gleamgen@expression@constructor:new(Variant8), gleamgen@expression@constructor:new(Variant9) ), _record = Rest, {module, [{definition, Details, {custom_type_builder, begin _pipe = Type_, gleamgen@types@custom:to_unchecked(_pipe) end}} | erlang:element(2, Rest)], erlang:element(3, _record)}. -file("/home/weasel/gleam/testing_gleamgen/gleamgen/src/gleamgen/module.gleam", 420). -spec with_custom_type_unchecked( definition_details(), gleamgen@types@custom:custom_type_builder(NZD, gleamgen@types:unchecked(), NZE), fun((gleamgen@types@custom:custom_type(NZD, NZE), list(gleamgen@expression@constructor:constructor(NZD, gleamgen@types:unchecked(), NZE))) -> module_()) ) -> module_(). with_custom_type_unchecked(Details, Type_, Handler) -> Rest = Handler( {custom_type, none, erlang:element(2, Details)}, begin _pipe = erlang:element(2, Type_), _pipe@1 = lists:reverse(_pipe), gleam@list:map(_pipe@1, fun gleamgen@expression@constructor:new/1) end ), _record = Rest, {module, [{definition, Details, {custom_type_builder, begin _pipe@2 = Type_, gleamgen@types@custom:to_unchecked(_pipe@2) end}} | erlang:element(2, Rest)], erlang:element(3, _record)}. -file("/home/weasel/gleam/testing_gleamgen/gleamgen/src/gleamgen/module.gleam", 443). -spec with_type_alias( definition_details(), gleamgen@types:generated_type(NZO), fun((gleamgen@types:generated_type(NZO)) -> module_()) ) -> module_(). with_type_alias(Details, Type_, Handler) -> Rest = Handler(gleamgen@types:unchecked_ident(erlang:element(2, Details))), _record = Rest, {module, [{definition, Details, {type_alias, begin _pipe = Type_, gleamgen_ffi:identity(_pipe) end}} | erlang:element(2, Rest)], erlang:element(3, _record)}. -file("/home/weasel/gleam/testing_gleamgen/gleamgen/src/gleamgen/module.gleam", 455). -spec eof() -> module_(). eof() -> {module, [], []}. -file("/home/weasel/gleam/testing_gleamgen/gleamgen/src/gleamgen/module.gleam", 552). -spec render_attribute(attribute()) -> glam@doc:document(). render_attribute(Attribute) -> case Attribute of external_erlang -> glam@doc:from_string(<<"@external(erlang)"/utf8>>); external_javascript -> glam@doc:from_string(<<"@external(javascript)"/utf8>>); {deprecated, Reason} -> glam@doc:concat( [glam@doc:from_string(<<"@deprecated(\""/utf8>>), glam@doc:from_string(Reason), glam@doc:from_string(<<"\")"/utf8>>)] ); internal -> glam@doc:from_string(<<"@internal"/utf8>>) end. -file("/home/weasel/gleam/testing_gleamgen/gleamgen/src/gleamgen/module.gleam", 566). -spec render_imported_module(gleamgen@import_:imported_module()) -> gleamgen@render:rendered(). render_imported_module(Module) -> _pipe = glam@doc:concat( [glam@doc:from_string(<<"import "/utf8>>), glam@doc:from_string( gleam@string:join(erlang:element(2, Module), <<"/"/utf8>>) ), case erlang:element(3, Module) of {some, Alias} -> glam@doc:concat( [{break, <<" "/utf8>>, <<""/utf8>>}, glam@doc:from_string(<<"as"/utf8>>), {break, <<" "/utf8>>, <<""/utf8>>}, glam@doc:from_string(Alias)] ); none -> {concat, []} end] ), {render, _pipe, {rendered_details, []}}. -file("/home/weasel/gleam/testing_gleamgen/gleamgen/src/gleamgen/module.gleam", 459). -spec render(module_(), gleamgen@render:context()) -> gleamgen@render:rendered(). render(Module, Context) -> {Details@1, Rendered_defs} = gleam@list:map_fold( erlang:element(2, Module), {rendered_details, []}, fun(Previous_details, Def) -> {Definition, Details} = case erlang:element(3, Def) of {constant, Value} -> Rendered_expr = gleamgen@expression:render(Value, Context), {glam@doc:concat( [glam@doc:from_string(<<"const "/utf8>>), glam@doc:from_string( erlang:element(2, erlang:element(2, Def)) ), {break, <<" "/utf8>>, <<""/utf8>>}, glam@doc:from_string(<<"="/utf8>>), {break, <<" "/utf8>>, <<""/utf8>>}, erlang:element(2, Rendered_expr)] ), erlang:element(3, Rendered_expr)}; {custom_type_builder, Type_} -> Rendered_type = gleamgen@types@custom:render(Type_), {glam@doc:concat( [glam@doc:from_string(<<"type "/utf8>>), glam@doc:from_string( erlang:element(2, erlang:element(2, Def)) ), erlang:element(2, Rendered_type)] ), erlang:element(3, Rendered_type)}; {type_alias, Type_@1} -> Rendered_type@1 = gleamgen@types:render_type(Type_@1), {glam@doc:concat( [glam@doc:from_string(<<"type "/utf8>>), glam@doc:from_string( erlang:element(2, erlang:element(2, Def)) ), {break, <<" "/utf8>>, <<""/utf8>>}, glam@doc:from_string(<<"="/utf8>>), {break, <<" "/utf8>>, <<""/utf8>>}, begin _pipe = Rendered_type@1, _pipe@1 = gleam@result:map( _pipe, fun(V) -> erlang:element(2, V) end ), gleam@result:unwrap( _pipe@1, glam@doc:from_string(<<"??"/utf8>>) ) end] ), begin _pipe@2 = Rendered_type@1, _pipe@3 = gleam@result:map( _pipe@2, fun(V@1) -> erlang:element(3, V@1) end ), gleam@result:unwrap(_pipe@3, {rendered_details, []}) end}; {function, Func} -> Rendered = gleamgen@function:render( Func, Context, {some, erlang:element(2, erlang:element(2, Def))} ), {erlang:element(2, Rendered), erlang:element(3, Rendered)} end, Full_doc = begin _pipe@4 = glam@doc:join( gleam@list:map( erlang:element(4, erlang:element(2, Def)), fun render_attribute/1 ), {line, 1} ), _pipe@5 = glam@doc:append( _pipe@4, case gleam@list:is_empty( erlang:element(4, erlang:element(2, Def)) ) of true -> {concat, []}; false -> {line, 1} end ), _pipe@6 = glam@doc:append( _pipe@5, case erlang:element(3, erlang:element(2, Def)) of true -> glam@doc:concat( [glam@doc:from_string(<<"pub"/utf8>>), {break, <<" "/utf8>>, <<""/utf8>>}] ); false -> {concat, []} end ), glam@doc:append(_pipe@6, Definition) end, {gleamgen@render:merge_details(Details, Previous_details), Full_doc} end ), Rendered_imports = begin _pipe@7 = erlang:element(3, Module), _pipe@9 = gleam@list:filter( _pipe@7, fun(M) -> _pipe@8 = erlang:element(2, Details@1), gleam@list:contains(_pipe@8, gleamgen@import_:get_reference(M)) end ), _pipe@12 = gleam@list:map(_pipe@9, fun(X) -> _pipe@10 = X, _pipe@11 = render_imported_module(_pipe@10), gleamgen@render:to_string(_pipe@11) end), _pipe@13 = gleam@list:sort(_pipe@12, fun gleam@string:compare/2), _pipe@14 = gleam@list:map(_pipe@13, fun glam@doc:from_string/1), _pipe@15 = glam@doc:join(_pipe@14, {line, 1}), glam@doc:append( _pipe@15, case gleam@list:is_empty(erlang:element(3, Module)) of true -> {concat, []}; false -> glam@doc:concat([{line, 1}, {line, 1}]) end ) end, _pipe@16 = Rendered_imports, _pipe@17 = glam@doc:append( _pipe@16, glam@doc:concat_join(Rendered_defs, [{line, 1}, {line, 1}]) ), {render, _pipe@17, Details@1}.