Try Install Learn Blog API Packages GitHub
Pages

Modules

In Mint modules are kind of containers for a set of relatable functions. They are usually used to gather functions that relate to a specific type (like String or Number ).

module Greeter {
  fun greet (name : String) : String {
    "Hello #{name}!"
  }
}

You can call the functions of a module by using the modules name:

Greeter.greet("Joe") /* "Hello Joe" */

You can omit the name of the module if you are calling a function from an other function in the same module:

module Greeter {
  fun greet (name : String) : String {
    "Hello #{name}!"
  }

  fun greetUpperCase (name : String) : String {
    name
    |> String.toUpperCase()
    |> greet
  }
}