gsh/evaluator/types

Types

pub type ConstructorData {
  ConstructorData(name: String)
}

Constructors

  • ConstructorData(name: String)
pub type FunctionData {
  FunctionData(return_type: TypeNode)
}

Constructors

pub type ModuleData {
  ModuleData(
    types: dict.Dict(String, TypeData),
    functions: dict.Dict(String, FunctionData),
  )
}

Constructors

pub type PackageInterface {
  PackageInterface(
    name: String,
    modules: dict.Dict(String, ModuleData),
  )
}

Constructors

pub type TypeData {
  TypeData(constructors: List(ConstructorData))
}

Constructors

pub type TypeNode {
  Named(
    name: String,
    package: String,
    module: String,
    parameters: List(TypeNode),
  )
  Tuple(elements: List(TypeNode))
  Variable(id: Int)
  Fn(params: List(TypeNode), ret: TypeNode)
}

Constructors

  • Named(
      name: String,
      package: String,
      module: String,
      parameters: List(TypeNode),
    )
  • Tuple(elements: List(TypeNode))
  • Variable(id: Int)
  • Fn(params: List(TypeNode), ret: TypeNode)

Values

pub fn get_entry_type(
  json_string: String,
  module_name: String,
) -> Result(String, String)
pub fn infer_or_get_type(
  json_string: String,
  module_name: String,
  source_input: String,
) -> Result(String, Nil)
pub fn package_interface_decoder() -> decode.Decoder(
  PackageInterface,
)
pub fn render(node: TypeNode) -> String
pub fn type_node_decoder() -> decode.Decoder(TypeNode)
Search Document