gen_gleam/modules

Types

pub type Import {
  Import(
    module: String,
    types: List(TypeDef),
    functions: List(NamedFunction),
  )
}

Constructors

  • Import(
      module: String,
      types: List(TypeDef),
      functions: List(NamedFunction),
    )
pub type Module =
  List(RootStatement)
pub type Modules =
  Dict(String, Module)
pub type RootStatement {
  ImportRoot(Import)
  TypeRoot(TypeDef)
  FunctionRoot(NamedFunction)
}

Constructors

  • ImportRoot(Import)
  • TypeRoot(TypeDef)
  • FunctionRoot(NamedFunction)

Functions

pub fn function_root(
  name: String,
  arguments: List(Argument),
  return_type: Option(GleamType),
  statements: List(GleamStatement),
) -> RootStatement
pub fn generate_function_def(
  function_def: NamedFunction,
) -> String
pub fn generate_import_def(import_: Import) -> String
pub fn generate_package(
  modules: Dict(String, List(RootStatement)),
  directory: String,
) -> Nil
pub fn generate_root(root: RootStatement) -> String
pub fn import_root(import_: Import) -> RootStatement
pub fn import_statement(
  modules: Dict(String, List(RootStatement)),
  module_name: String,
  types: List(String),
  functions: List(String),
) -> Result(#(Import, List(TypeDef), List(NamedFunction)), Nil)
pub fn module(
  modules: Dict(String, List(RootStatement)),
  name: String,
  module: List(RootStatement),
) -> Dict(String, List(RootStatement))
pub fn type_root(type_def: TypeDef) -> RootStatement
Search Document