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(KTC, KTD, KTE) :: {constructor,
gleam@option:option(gleamgen@internal@import_reference:import_reference()),
gleamgen@type_@variant:variant(gleamgen@type_:dynamic_())} |
{gleam_phantom, KTC, KTD, KTE}.
-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(KVG, {}, KVH)) -> gleamgen@expression:expression(fun(() -> gleamgen@type_@custom:custom_type(KVG, KVH))).
to_expression0(Constructor) ->
to_expression_dynamic(Constructor).
-file("src/gleamgen/expression/constructor.gleam", 57).
-spec to_expression1(constructor(KVO, {{}, KVP}, KVR)) -> gleamgen@expression:expression(fun((KVP) -> gleamgen@type_@custom:custom_type(KVO, KVR))).
to_expression1(Constructor) ->
to_expression_dynamic(Constructor).
-file("src/gleamgen/expression/constructor.gleam", 66).
-spec to_expression2(constructor(KVY, {{{}, KVZ}, KWA}, KWD)) -> gleamgen@expression:expression(fun((KVZ, KWA) -> gleamgen@type_@custom:custom_type(KVY, KWD))).
to_expression2(Constructor) ->
to_expression_dynamic(Constructor).
-file("src/gleamgen/expression/constructor.gleam", 74).
-spec to_expression3(constructor(KWK, {{{{}, KWL}, KWM}, KWN}, KWR)) -> gleamgen@expression:expression(fun((KWL, KWM, KWN) -> gleamgen@type_@custom:custom_type(KWK, KWR))).
to_expression3(Constructor) ->
to_expression_dynamic(Constructor).
-file("src/gleamgen/expression/constructor.gleam", 82).
-spec to_expression4(constructor(KWY, {{{{{}, KWZ}, KXA}, KXB}, KXC}, KXH)) -> gleamgen@expression:expression(fun((KWZ, KXA, KXB, KXC) -> gleamgen@type_@custom:custom_type(KWY, KXH))).
to_expression4(Constructor) ->
to_expression_dynamic(Constructor).
-file("src/gleamgen/expression/constructor.gleam", 90).
-spec to_expression5(
constructor(KXO, {{{{{{}, KXP}, KXQ}, KXR}, KXS}, KXT}, KXZ)
) -> gleamgen@expression:expression(fun((KXP, KXQ, KXR, KXS, KXT) -> gleamgen@type_@custom:custom_type(KXO, KXZ))).
to_expression5(Constructor) ->
to_expression_dynamic(Constructor).
-file("src/gleamgen/expression/constructor.gleam", 98).
-spec to_expression6(
constructor(KYG, {{{{{{{}, KYH}, KYI}, KYJ}, KYK}, KYL}, KYM}, KYT)
) -> gleamgen@expression:expression(fun((KYH, KYI, KYJ, KYK, KYL, KYM) -> gleamgen@type_@custom:custom_type(KYG, KYT))).
to_expression6(Constructor) ->
to_expression_dynamic(Constructor).
-file("src/gleamgen/expression/constructor.gleam", 106).
-spec to_expression7(
constructor(KZA, {{{{{{{{}, KZB}, KZC}, KZD}, KZE}, KZF}, KZG}, KZH}, KZP)
) -> gleamgen@expression:expression(fun((KZB, KZC, KZD, KZE, KZF, KZG, KZH) -> gleamgen@type_@custom:custom_type(KZA, KZP))).
to_expression7(Constructor) ->
to_expression_dynamic(Constructor).
-file("src/gleamgen/expression/constructor.gleam", 118).
-spec to_expression8(
constructor(KZW, {{{{{{{{{}, KZX}, KZY}, KZZ}, LAA}, LAB}, LAC}, LAD}, LAE}, LAN)
) -> gleamgen@expression:expression(fun((KZX, KZY, KZZ, LAA, LAB, LAC, LAD, LAE) -> gleamgen@type_@custom:custom_type(KZW, LAN))).
to_expression8(Constructor) ->
to_expression_dynamic(Constructor).
-file("src/gleamgen/expression/constructor.gleam", 130).
-spec to_expression9(
constructor(LAU, {{{{{{{{{{}, LAV}, LAW}, LAX}, LAY}, LAZ}, LBA}, LBB}, LBC},
LBD}, LBN)
) -> gleamgen@expression:expression(fun((LAV, LAW, LAX, LAY, LAZ, LBA, LBB, LBC, LBD) -> gleamgen@type_@custom:custom_type(LAU, LBN))).
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(LCI, any(), any())) -> constructor(LCI, any(), any()).
unsafe_convert(Constructor) ->
{constructor,
erlang:element(2, Constructor),
erlang:element(3, Constructor)}.