gen_gleam/types
Types
pub type Field {
Field(name: String, field_type: GleamType)
}
Constructors
-
Field(name: String, field_type: GleamType)
pub type GleamType {
AnonymousType(String)
NilType
IntType
ListType(list_type: GleamType)
VariantType(name: String, variants: List(Variant))
VariantDepType(
name: String,
dep_types: List(GleamType),
variants: List(Variant),
)
FunctionType(
argument_types: List(GleamType),
result_type: GleamType,
)
}
Constructors
-
AnonymousType(String)
-
NilType
-
IntType
-
ListType(list_type: GleamType)
-
VariantType(name: String, variants: List(Variant))
-
VariantDepType( name: String, dep_types: List(GleamType), variants: List(Variant), )
-
FunctionType( argument_types: List(GleamType), result_type: GleamType, )
pub type Variant {
Variant(name: String, fields: List(Field))
}
Constructors
-
Variant(name: String, fields: List(Field))
Functions
pub fn field(name: String, field_type: GleamType) -> Field
pub fn function(
argument_types: List(GleamType),
result_type: GleamType,
) -> GleamType
pub fn generate_type(arg_type: GleamType) -> String
pub fn generate_type_def(gleam_type: GleamType) -> String
pub fn int() -> GleamType
pub fn nil() -> GleamType
pub fn result(
ok_type: GleamType,
error_type: GleamType,
) -> GleamType
pub fn variant(name: String, fields: List(Field)) -> Variant
pub fn variant_type(
name: String,
variants: List(Variant),
) -> GleamType