gleamgen/types/custom

Types

pub type CustomType(repr, generics) {
  CustomType(module: option.Option(String), name: String)
}

Constructors

  • CustomType(module: option.Option(String), name: String)
pub type CustomTypeBuilder(repr, variants, generics) {
  CustomTypeBuilder(
    variants: List(Variant(Unchecked)),
    generics_list: List(String),
    generics: generics,
  )
}

Constructors

  • CustomTypeBuilder(
      variants: List(Variant(Unchecked)),
      generics_list: List(String),
      generics: generics,
    )
pub type Generics1(a) =
  #(#(), a)
pub type Generics2(a, b) =
  #(#(#(), a), b)
pub type Generics3(a, b, c) =
  #(#(#(#(), a), b), c)
pub type Generics4(a, b, c, d) =
  #(#(#(#(#(), a), b), c), d)
pub type Generics5(a, b, c, d, e) =
  #(#(#(#(#(#(), a), b), c), d), e)
pub type Generics6(a, b, c, d, e, f) =
  #(#(#(#(#(#(#(), a), b), c), d), e), f)
pub type Generics7(a, b, c, d, e, f, g) =
  #(#(#(#(#(#(#(#(), a), b), c), d), e), f), g)
pub type Generics8(a, b, c, d, e, f, g, h) =
  #(#(#(#(#(#(#(#(#(), a), b), c), d), e), f), g), h)
pub type Generics9(a, b, c, d, e, f, g, h, i) =
  #(#(#(#(#(#(#(#(#(#(), a), b), c), d), e), f), g), h), i)

Functions

pub fn new(
  typed_representation: a,
) -> CustomTypeBuilder(a, #(), #())
pub fn new_unchecked(
  typed_representation: a,
  variants: List(Variant(Unchecked)),
  generics_list: List(String),
) -> CustomTypeBuilder(a, b, List(GeneratedType(Unchecked)))
pub fn render(type_: CustomTypeBuilder(a, b, c)) -> Rendered
pub fn to_type(
  input: CustomType(a, #()),
) -> GeneratedType(CustomType(a, #()))
pub fn to_type1(
  input: CustomType(a, #(#(), GeneratedType(b))),
  type1: GeneratedType(c),
) -> GeneratedType(CustomType(a, #(#(), GeneratedType(c))))
pub fn to_type2(
  input: CustomType(
    a,
    #(#(#(), GeneratedType(b)), GeneratedType(c)),
  ),
  type1: GeneratedType(d),
  type2: GeneratedType(e),
) -> GeneratedType(
  CustomType(a, #(#(#(), GeneratedType(d)), GeneratedType(e))),
)
pub fn to_type3(
  input: CustomType(
    a,
    #(
      #(#(#(), GeneratedType(b)), GeneratedType(c)),
      GeneratedType(d),
    ),
  ),
  type1: GeneratedType(e),
  type2: GeneratedType(f),
  type3: GeneratedType(g),
) -> GeneratedType(
  CustomType(
    a,
    #(
      #(#(#(), GeneratedType(e)), GeneratedType(f)),
      GeneratedType(g),
    ),
  ),
)
pub fn to_type4(
  input: CustomType(
    a,
    #(
      #(
        #(#(#(), GeneratedType(b)), GeneratedType(c)),
        GeneratedType(d),
      ),
      GeneratedType(e),
    ),
  ),
  type1: GeneratedType(f),
  type2: GeneratedType(g),
  type3: GeneratedType(h),
  type4: GeneratedType(i),
) -> GeneratedType(
  CustomType(
    a,
    #(
      #(
        #(#(#(), GeneratedType(f)), GeneratedType(g)),
        GeneratedType(h),
      ),
      GeneratedType(i),
    ),
  ),
)
pub fn to_type5(
  input: CustomType(
    a,
    #(
      #(
        #(
          #(#(#(), GeneratedType(b)), GeneratedType(c)),
          GeneratedType(d),
        ),
        GeneratedType(e),
      ),
      GeneratedType(f),
    ),
  ),
  type1: GeneratedType(g),
  type2: GeneratedType(h),
  type3: GeneratedType(i),
  type4: GeneratedType(j),
  type5: GeneratedType(k),
) -> GeneratedType(
  CustomType(
    a,
    #(
      #(
        #(
          #(#(#(), GeneratedType(g)), GeneratedType(h)),
          GeneratedType(i),
        ),
        GeneratedType(j),
      ),
      GeneratedType(k),
    ),
  ),
)
pub fn to_unchecked(
  old: CustomTypeBuilder(a, b, c),
) -> CustomTypeBuilder(Unchecked, Nil, Nil)
pub fn with_generic(
  old: CustomTypeBuilder(a, b, c),
  generic: String,
) -> CustomTypeBuilder(a, b, #(c, GeneratedType(d)))
pub fn with_unchecked_variants(
  old: CustomTypeBuilder(a, b, c),
  variants: fn(c) -> List(Variant(Unchecked)),
) -> CustomTypeBuilder(a, Unchecked, c)
pub fn with_variant(
  old: CustomTypeBuilder(a, b, c),
  variant: fn(c) -> Variant(d),
) -> CustomTypeBuilder(a, #(b, d), c)
Search Document