-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_function/3, render/2, render_imported_module/1]). -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(NKL), fun((gleamgen@expression:expression(NKL)) -> 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", 55). -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", 63). -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", 71). -spec with_function( definition_details(), gleamgen@function:function_(NKQ, any()), fun((gleamgen@expression:expression(NKQ)) -> 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", 86). -spec with_custom_type1( definition_details(), gleamgen@types@custom:custom_type_builder(NKV, {{}, NKW}, NKY), fun((gleamgen@types@custom:custom_type(NKV, NKY), gleamgen@expression@constructor:constructor(NKV, NKW, NKY)) -> 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 => 95}) 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", 115). -spec with_custom_type2( definition_details(), gleamgen@types@custom:custom_type_builder(NLH, {{{}, NLI}, NLJ}, NLM), fun((gleamgen@types@custom:custom_type(NLH, NLM), gleamgen@expression@constructor:constructor(NLH, NLI, NLM), gleamgen@expression@constructor:constructor(NLH, NLJ, NLM)) -> 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 => 125}) 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", 144). -spec with_custom_type3( definition_details(), gleamgen@types@custom:custom_type_builder(NLY, {{{{}, NLZ}, NMA}, NMB}, NMF), fun((gleamgen@types@custom:custom_type(NLY, NMF), gleamgen@expression@constructor:constructor(NLY, NLZ, NMF), gleamgen@expression@constructor:constructor(NLY, NMA, NMF), gleamgen@expression@constructor:constructor(NLY, NMB, NMF)) -> 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 => 155}) 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", 175). -spec with_custom_type4( definition_details(), gleamgen@types@custom:custom_type_builder(NMU, {{{{{}, NMV}, NMW}, NMX}, NMY}, NND), fun((gleamgen@types@custom:custom_type(NMU, NND), gleamgen@expression@constructor:constructor(NMU, NMV, NND), gleamgen@expression@constructor:constructor(NMU, NMW, NND), gleamgen@expression@constructor:constructor(NMU, NMX, NND), gleamgen@expression@constructor:constructor(NMU, NMY, NND)) -> 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 => 187}) 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", 208). -spec with_custom_type5( definition_details(), gleamgen@types@custom:custom_type_builder(NNV, {{{{{{}, NNW}, NNX}, NNY}, NNZ}, NOA}, NOG), fun((gleamgen@types@custom:custom_type(NNV, NOG), gleamgen@expression@constructor:constructor(NNV, NNW, NOG), gleamgen@expression@constructor:constructor(NNV, NNX, NOG), gleamgen@expression@constructor:constructor(NNV, NNY, NOG), gleamgen@expression@constructor:constructor(NNV, NNZ, NOG), gleamgen@expression@constructor:constructor(NNV, NOA, NOG)) -> 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 => 225}) 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", 247). -spec with_custom_type6( definition_details(), gleamgen@types@custom:custom_type_builder(NPB, {{{{{{{}, NPC}, NPD}, NPE}, NPF}, NPG}, NPH}, NPO), fun((gleamgen@types@custom:custom_type(NPB, NPO), gleamgen@expression@constructor:constructor(NPB, NPC, NPO), gleamgen@expression@constructor:constructor(NPB, NPD, NPO), gleamgen@expression@constructor:constructor(NPB, NPE, NPO), gleamgen@expression@constructor:constructor(NPB, NPF, NPO), gleamgen@expression@constructor:constructor(NPB, NPG, NPO), gleamgen@expression@constructor:constructor(NPB, NPH, NPO)) -> 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 => 265}) 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", 289). -spec with_custom_type7( definition_details(), gleamgen@types@custom:custom_type_builder(NQM, {{{{{{{{}, NQN}, NQO}, NQP}, NQQ}, NQR}, NQS}, NQT}, NRB), fun((gleamgen@types@custom:custom_type(NQM, NRB), gleamgen@expression@constructor:constructor(NQM, NQN, NRB), gleamgen@expression@constructor:constructor(NQM, NQO, NRB), gleamgen@expression@constructor:constructor(NQM, NQP, NRB), gleamgen@expression@constructor:constructor(NQM, NQQ, NRB), gleamgen@expression@constructor:constructor(NQM, NQR, NRB), gleamgen@expression@constructor:constructor(NQM, NQS, NRB), gleamgen@expression@constructor:constructor(NQM, NQT, NRB)) -> 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 => 308}) 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", 340). -spec with_custom_type8( definition_details(), gleamgen@types@custom:custom_type_builder(NSC, {{{{{{{{{}, NSD}, NSE}, NSF}, NSG}, NSH}, NSI}, NSJ}, NSK}, NST), fun((gleamgen@types@custom:custom_type(NSC, NST), gleamgen@expression@constructor:constructor(NSC, NSD, NST), gleamgen@expression@constructor:constructor(NSC, NSE, NST), gleamgen@expression@constructor:constructor(NSC, NSF, NST), gleamgen@expression@constructor:constructor(NSC, NSG, NST), gleamgen@expression@constructor:constructor(NSC, NSH, NST), gleamgen@expression@constructor:constructor(NSC, NSI, NST), gleamgen@expression@constructor:constructor(NSC, NSJ, NST), gleamgen@expression@constructor:constructor(NSC, NSK, NST)) -> 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 => 360}) 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", 394). -spec with_custom_type9( definition_details(), gleamgen@types@custom:custom_type_builder(NTX, {{{{{{{{{{}, NTY}, NTZ}, NUA}, NUB}, NUC}, NUD}, NUE}, NUF}, NUG}, NUQ), fun((gleamgen@types@custom:custom_type(NTX, NUQ), gleamgen@expression@constructor:constructor(NTX, NTY, NUQ), gleamgen@expression@constructor:constructor(NTX, NTZ, NUQ), gleamgen@expression@constructor:constructor(NTX, NUA, NUQ), gleamgen@expression@constructor:constructor(NTX, NUB, NUQ), gleamgen@expression@constructor:constructor(NTX, NUC, NUQ), gleamgen@expression@constructor:constructor(NTX, NUD, NUQ), gleamgen@expression@constructor:constructor(NTX, NUE, NUQ), gleamgen@expression@constructor:constructor(NTX, NUF, NUQ), gleamgen@expression@constructor:constructor(NTX, NUG, NUQ)) -> 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 => 415}) 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", 453). -spec with_custom_type_unchecked( definition_details(), gleamgen@types@custom:custom_type_builder(NVX, gleamgen@types:unchecked(), NVY), fun((gleamgen@types@custom:custom_type(NVX, NVY), list(gleamgen@expression@constructor:constructor(NVX, gleamgen@types:unchecked(), NVY))) -> 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", 479). -spec with_type_alias( definition_details(), gleamgen@types:generated_type(NWI), fun((gleamgen@types:generated_type(NWI)) -> 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", 494). -spec eof() -> module_(). eof() -> {module, [], []}. -file("/home/weasel/gleam/testing_gleamgen/gleamgen/src/gleamgen/module.gleam", 590). -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", 604). -spec render_function( gleamgen@function:function_(gleamgen@types:unchecked(), gleamgen@types:unchecked()), gleamgen@render:context(), binary() ) -> gleamgen@render:rendered(). render_function(Func, Context, Name) -> Rendered_args = begin _pipe = erlang:element(2, Func), _pipe@1 = gleam@list:map( _pipe, fun(_capture) -> gleamgen@expression:render_attribute(_capture, Context) end ), gleamgen@render:pretty_list(_pipe@1) end, Rendered_type = gleamgen@types:render_type(erlang:element(3, Func)), Rendered_body = gleamgen@expression:render( erlang:element(4, Func), begin _record = Context, {context, erlang:element(2, _record), false} end ), _pipe@2 = glam@doc:concat( [glam@doc:from_string(<<"fn "/utf8>>), glam@doc:from_string(Name), Rendered_args, {break, <<" "/utf8>>, <<""/utf8>>}, case Rendered_type of {ok, Returned} -> glam@doc:concat( [glam@doc:from_string(<<"->"/utf8>>), {break, <<" "/utf8>>, <<""/utf8>>}, erlang:element(2, Returned), {break, <<" "/utf8>>, <<""/utf8>>}] ); {error, _} -> {concat, []} end, gleamgen@render:body(erlang:element(2, Rendered_body), true)] ), {render, _pipe@2, gleamgen@render:merge_details( begin _pipe@3 = Rendered_type, _pipe@4 = gleam@result:map( _pipe@3, fun(T) -> erlang:element(3, T) end ), gleam@result:unwrap(_pipe@4, {rendered_details, []}) end, erlang:element(3, Rendered_body) )}. -file("/home/weasel/gleam/testing_gleamgen/gleamgen/src/gleamgen/module.gleam", 498). -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 = render_function( Func, Context, 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}. -file("/home/weasel/gleam/testing_gleamgen/gleamgen/src/gleamgen/module.gleam", 641). -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, []}}.