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(KSV, KSW, KSX) :: {constructor,
gleam@option:option(gleamgen@internal@import_reference:import_reference()),
gleamgen@type_@variant:variant(gleamgen@type_:dynamic_())} |
{gleam_phantom, KSV, KSW, KSX}.
-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(KUZ, {}, KVA)) -> gleamgen@expression:expression(fun(() -> gleamgen@type_@custom:custom_type(KUZ, KVA))).
to_expression0(Constructor) ->
to_expression_dynamic(Constructor).
-file("src/gleamgen/expression/constructor.gleam", 57).
-spec to_expression1(constructor(KVH, {{}, KVI}, KVK)) -> gleamgen@expression:expression(fun((KVI) -> gleamgen@type_@custom:custom_type(KVH, KVK))).
to_expression1(Constructor) ->
to_expression_dynamic(Constructor).
-file("src/gleamgen/expression/constructor.gleam", 66).
-spec to_expression2(constructor(KVR, {{{}, KVS}, KVT}, KVW)) -> gleamgen@expression:expression(fun((KVS, KVT) -> gleamgen@type_@custom:custom_type(KVR, KVW))).
to_expression2(Constructor) ->
to_expression_dynamic(Constructor).
-file("src/gleamgen/expression/constructor.gleam", 74).
-spec to_expression3(constructor(KWD, {{{{}, KWE}, KWF}, KWG}, KWK)) -> gleamgen@expression:expression(fun((KWE, KWF, KWG) -> gleamgen@type_@custom:custom_type(KWD, KWK))).
to_expression3(Constructor) ->
to_expression_dynamic(Constructor).
-file("src/gleamgen/expression/constructor.gleam", 82).
-spec to_expression4(constructor(KWR, {{{{{}, KWS}, KWT}, KWU}, KWV}, KXA)) -> gleamgen@expression:expression(fun((KWS, KWT, KWU, KWV) -> gleamgen@type_@custom:custom_type(KWR, KXA))).
to_expression4(Constructor) ->
to_expression_dynamic(Constructor).
-file("src/gleamgen/expression/constructor.gleam", 90).
-spec to_expression5(
constructor(KXH, {{{{{{}, KXI}, KXJ}, KXK}, KXL}, KXM}, KXS)
) -> gleamgen@expression:expression(fun((KXI, KXJ, KXK, KXL, KXM) -> gleamgen@type_@custom:custom_type(KXH, KXS))).
to_expression5(Constructor) ->
to_expression_dynamic(Constructor).
-file("src/gleamgen/expression/constructor.gleam", 98).
-spec to_expression6(
constructor(KXZ, {{{{{{{}, KYA}, KYB}, KYC}, KYD}, KYE}, KYF}, KYM)
) -> gleamgen@expression:expression(fun((KYA, KYB, KYC, KYD, KYE, KYF) -> gleamgen@type_@custom:custom_type(KXZ, KYM))).
to_expression6(Constructor) ->
to_expression_dynamic(Constructor).
-file("src/gleamgen/expression/constructor.gleam", 106).
-spec to_expression7(
constructor(KYT, {{{{{{{{}, KYU}, KYV}, KYW}, KYX}, KYY}, KYZ}, KZA}, KZI)
) -> gleamgen@expression:expression(fun((KYU, KYV, KYW, KYX, KYY, KYZ, KZA) -> gleamgen@type_@custom:custom_type(KYT, KZI))).
to_expression7(Constructor) ->
to_expression_dynamic(Constructor).
-file("src/gleamgen/expression/constructor.gleam", 118).
-spec to_expression8(
constructor(KZP, {{{{{{{{{}, KZQ}, KZR}, KZS}, KZT}, KZU}, KZV}, KZW}, KZX}, LAG)
) -> gleamgen@expression:expression(fun((KZQ, KZR, KZS, KZT, KZU, KZV, KZW, KZX) -> gleamgen@type_@custom:custom_type(KZP, LAG))).
to_expression8(Constructor) ->
to_expression_dynamic(Constructor).
-file("src/gleamgen/expression/constructor.gleam", 130).
-spec to_expression9(
constructor(LAN, {{{{{{{{{{}, LAO}, LAP}, LAQ}, LAR}, LAS}, LAT}, LAU}, LAV},
LAW}, LBG)
) -> gleamgen@expression:expression(fun((LAO, LAP, LAQ, LAR, LAS, LAT, LAU, LAV, LAW) -> gleamgen@type_@custom:custom_type(LAN, LBG))).
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(LCB, any(), any())) -> constructor(LCB, any(), any()).
unsafe_convert(Constructor) ->
{constructor,
erlang:element(2, Constructor),
erlang:element(3, Constructor)}.