-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(NNU), fun((gleamgen@expression:expression(NNU)) -> 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_(NNZ, any()), fun((gleamgen@expression:expression(NNZ)) -> 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(NOE, {{}, NOF}, NOH), fun((gleamgen@types@custom:custom_type(NOE, NOH), gleamgen@expression@constructor:constructor(NOE, NOF, NOH)) -> 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(NOQ, {{{}, NOR}, NOS}, NOV), fun((gleamgen@types@custom:custom_type(NOQ, NOV), gleamgen@expression@constructor:constructor(NOQ, NOR, NOV), gleamgen@expression@constructor:constructor(NOQ, NOS, NOV)) -> 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(NPH, {{{{}, NPI}, NPJ}, NPK}, NPO), fun((gleamgen@types@custom:custom_type(NPH, NPO), gleamgen@expression@constructor:constructor(NPH, NPI, NPO), gleamgen@expression@constructor:constructor(NPH, NPJ, NPO), gleamgen@expression@constructor:constructor(NPH, NPK, NPO)) -> 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(NQD, {{{{{}, NQE}, NQF}, NQG}, NQH}, NQM), fun((gleamgen@types@custom:custom_type(NQD, NQM), gleamgen@expression@constructor:constructor(NQD, NQE, NQM), gleamgen@expression@constructor:constructor(NQD, NQF, NQM), gleamgen@expression@constructor:constructor(NQD, NQG, NQM), gleamgen@expression@constructor:constructor(NQD, NQH, NQM)) -> 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(NRE, {{{{{{}, NRF}, NRG}, NRH}, NRI}, NRJ}, NRP), fun((gleamgen@types@custom:custom_type(NRE, NRP), gleamgen@expression@constructor:constructor(NRE, NRF, NRP), gleamgen@expression@constructor:constructor(NRE, NRG, NRP), gleamgen@expression@constructor:constructor(NRE, NRH, NRP), gleamgen@expression@constructor:constructor(NRE, NRI, NRP), gleamgen@expression@constructor:constructor(NRE, NRJ, NRP)) -> 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(NSK, {{{{{{{}, NSL}, NSM}, NSN}, NSO}, NSP}, NSQ}, NSX), fun((gleamgen@types@custom:custom_type(NSK, NSX), gleamgen@expression@constructor:constructor(NSK, NSL, NSX), gleamgen@expression@constructor:constructor(NSK, NSM, NSX), gleamgen@expression@constructor:constructor(NSK, NSN, NSX), gleamgen@expression@constructor:constructor(NSK, NSO, NSX), gleamgen@expression@constructor:constructor(NSK, NSP, NSX), gleamgen@expression@constructor:constructor(NSK, NSQ, NSX)) -> 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(NTV, {{{{{{{{}, NTW}, NTX}, NTY}, NTZ}, NUA}, NUB}, NUC}, NUK), fun((gleamgen@types@custom:custom_type(NTV, NUK), gleamgen@expression@constructor:constructor(NTV, NTW, NUK), gleamgen@expression@constructor:constructor(NTV, NTX, NUK), gleamgen@expression@constructor:constructor(NTV, NTY, NUK), gleamgen@expression@constructor:constructor(NTV, NTZ, NUK), gleamgen@expression@constructor:constructor(NTV, NUA, NUK), gleamgen@expression@constructor:constructor(NTV, NUB, NUK), gleamgen@expression@constructor:constructor(NTV, NUC, NUK)) -> 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(NVL, {{{{{{{{{}, NVM}, NVN}, NVO}, NVP}, NVQ}, NVR}, NVS}, NVT}, NWC), fun((gleamgen@types@custom:custom_type(NVL, NWC), gleamgen@expression@constructor:constructor(NVL, NVM, NWC), gleamgen@expression@constructor:constructor(NVL, NVN, NWC), gleamgen@expression@constructor:constructor(NVL, NVO, NWC), gleamgen@expression@constructor:constructor(NVL, NVP, NWC), gleamgen@expression@constructor:constructor(NVL, NVQ, NWC), gleamgen@expression@constructor:constructor(NVL, NVR, NWC), gleamgen@expression@constructor:constructor(NVL, NVS, NWC), gleamgen@expression@constructor:constructor(NVL, NVT, NWC)) -> 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(NXG, {{{{{{{{{{}, NXH}, NXI}, NXJ}, NXK}, NXL}, NXM}, NXN}, NXO}, NXP}, NXZ), fun((gleamgen@types@custom:custom_type(NXG, NXZ), gleamgen@expression@constructor:constructor(NXG, NXH, NXZ), gleamgen@expression@constructor:constructor(NXG, NXI, NXZ), gleamgen@expression@constructor:constructor(NXG, NXJ, NXZ), gleamgen@expression@constructor:constructor(NXG, NXK, NXZ), gleamgen@expression@constructor:constructor(NXG, NXL, NXZ), gleamgen@expression@constructor:constructor(NXG, NXM, NXZ), gleamgen@expression@constructor:constructor(NXG, NXN, NXZ), gleamgen@expression@constructor:constructor(NXG, NXO, NXZ), gleamgen@expression@constructor:constructor(NXG, NXP, NXZ)) -> 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(NZG, gleamgen@types:unchecked(), NZH), fun((gleamgen@types@custom:custom_type(NZG, NZH), list(gleamgen@expression@constructor:constructor(NZG, gleamgen@types:unchecked(), NZH))) -> 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(NZR), fun((gleamgen@types:generated_type(NZR)) -> 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}.