Current section
Files
Jump to
Current section
Files
src/gleamgen@expression@constructor.erl
-module(gleamgen@expression@constructor).
-compile([no_auto_import, nowarn_unused_vars, nowarn_unused_function, nowarn_nomatch, inline]).
-define(FILEPATH, "src/gleamgen/expression/constructor.gleam").
-export([new/2, to_expression_dynamic/1, to_expression0/1, to_expression1/1, to_expression2/1, to_expression3/1, to_expression4/1, to_expression5/1, to_expression6/1, to_expression7/1, to_expression8/1, to_expression9/1, name/1, unsafe_convert/1]).
-export_type([constructor/3]).
-if(?OTP_RELEASE >= 27).
-define(MODULEDOC(Str), -moduledoc(Str)).
-define(DOC(Str), -doc(Str)).
-else.
-define(MODULEDOC(Str), -compile([])).
-define(DOC(Str), -compile([])).
-endif.
-opaque constructor(KSY, KSZ, KTA) :: {constructor,
gleam@option:option(gleamgen@internal@import_reference:import_reference()),
gleamgen@type_@variant:variant(gleamgen@type_:dynamic_())} |
{gleam_phantom, KSY, KSZ, KTA}.
-file("src/gleamgen/expression/constructor.gleam", 44).
?DOC(false).
-spec new(
gleam@option:option(gleamgen@internal@import_reference:import_reference()),
gleamgen@type_@variant:variant(gleamgen@type_:dynamic_())
) -> constructor(any(), any(), any()).
new(Module, Variant) ->
{constructor, Module, Variant}.
-file("src/gleamgen/expression/constructor.gleam", 144).
-spec to_expression_dynamic(constructor(any(), any(), any())) -> gleamgen@expression:expression(any()).
to_expression_dynamic(Constructor) ->
case erlang:element(2, Constructor) of
{some, Module} ->
gleamgen@expression:imported_ident(
Module,
gleamgen@type_@variant:get_name(erlang:element(3, Constructor))
);
none ->
gleamgen@expression:raw(
gleamgen@type_@variant:get_name(erlang:element(3, Constructor))
)
end.
-file("src/gleamgen/expression/constructor.gleam", 51).
-spec to_expression0(constructor(KVC, {}, KVD)) -> gleamgen@expression:expression(fun(() -> gleamgen@type_@custom:custom_type(KVC, KVD))).
to_expression0(Constructor) ->
to_expression_dynamic(Constructor).
-file("src/gleamgen/expression/constructor.gleam", 57).
-spec to_expression1(constructor(KVK, {{}, KVL}, KVN)) -> gleamgen@expression:expression(fun((KVL) -> gleamgen@type_@custom:custom_type(KVK, KVN))).
to_expression1(Constructor) ->
to_expression_dynamic(Constructor).
-file("src/gleamgen/expression/constructor.gleam", 66).
-spec to_expression2(constructor(KVU, {{{}, KVV}, KVW}, KVZ)) -> gleamgen@expression:expression(fun((KVV, KVW) -> gleamgen@type_@custom:custom_type(KVU, KVZ))).
to_expression2(Constructor) ->
to_expression_dynamic(Constructor).
-file("src/gleamgen/expression/constructor.gleam", 74).
-spec to_expression3(constructor(KWG, {{{{}, KWH}, KWI}, KWJ}, KWN)) -> gleamgen@expression:expression(fun((KWH, KWI, KWJ) -> gleamgen@type_@custom:custom_type(KWG, KWN))).
to_expression3(Constructor) ->
to_expression_dynamic(Constructor).
-file("src/gleamgen/expression/constructor.gleam", 82).
-spec to_expression4(constructor(KWU, {{{{{}, KWV}, KWW}, KWX}, KWY}, KXD)) -> gleamgen@expression:expression(fun((KWV, KWW, KWX, KWY) -> gleamgen@type_@custom:custom_type(KWU, KXD))).
to_expression4(Constructor) ->
to_expression_dynamic(Constructor).
-file("src/gleamgen/expression/constructor.gleam", 90).
-spec to_expression5(
constructor(KXK, {{{{{{}, KXL}, KXM}, KXN}, KXO}, KXP}, KXV)
) -> gleamgen@expression:expression(fun((KXL, KXM, KXN, KXO, KXP) -> gleamgen@type_@custom:custom_type(KXK, KXV))).
to_expression5(Constructor) ->
to_expression_dynamic(Constructor).
-file("src/gleamgen/expression/constructor.gleam", 98).
-spec to_expression6(
constructor(KYC, {{{{{{{}, KYD}, KYE}, KYF}, KYG}, KYH}, KYI}, KYP)
) -> gleamgen@expression:expression(fun((KYD, KYE, KYF, KYG, KYH, KYI) -> gleamgen@type_@custom:custom_type(KYC, KYP))).
to_expression6(Constructor) ->
to_expression_dynamic(Constructor).
-file("src/gleamgen/expression/constructor.gleam", 106).
-spec to_expression7(
constructor(KYW, {{{{{{{{}, KYX}, KYY}, KYZ}, KZA}, KZB}, KZC}, KZD}, KZL)
) -> gleamgen@expression:expression(fun((KYX, KYY, KYZ, KZA, KZB, KZC, KZD) -> gleamgen@type_@custom:custom_type(KYW, KZL))).
to_expression7(Constructor) ->
to_expression_dynamic(Constructor).
-file("src/gleamgen/expression/constructor.gleam", 118).
-spec to_expression8(
constructor(KZS, {{{{{{{{{}, KZT}, KZU}, KZV}, KZW}, KZX}, KZY}, KZZ}, LAA}, LAJ)
) -> gleamgen@expression:expression(fun((KZT, KZU, KZV, KZW, KZX, KZY, KZZ, LAA) -> gleamgen@type_@custom:custom_type(KZS, LAJ))).
to_expression8(Constructor) ->
to_expression_dynamic(Constructor).
-file("src/gleamgen/expression/constructor.gleam", 130).
-spec to_expression9(
constructor(LAQ, {{{{{{{{{{}, LAR}, LAS}, LAT}, LAU}, LAV}, LAW}, LAX}, LAY},
LAZ}, LBJ)
) -> gleamgen@expression:expression(fun((LAR, LAS, LAT, LAU, LAV, LAW, LAX, LAY, LAZ) -> gleamgen@type_@custom:custom_type(LAQ, LBJ))).
to_expression9(Constructor) ->
to_expression_dynamic(Constructor).
-file("src/gleamgen/expression/constructor.gleam", 154).
-spec name(constructor(any(), any(), any())) -> binary().
name(Constructor) ->
gleamgen@type_@variant:get_name(erlang:element(3, Constructor)).
-file("src/gleamgen/expression/constructor.gleam", 158).
-spec unsafe_convert(constructor(LCE, any(), any())) -> constructor(LCE, any(), any()).
unsafe_convert(Constructor) ->
{constructor,
erlang:element(2, Constructor),
erlang:element(3, Constructor)}.