stare#
gleam add stare@1
import gleam/io
import stare
pub fn main() -> Nil {
let assert Ok(code) = stare.module(
imports: [
stare.import_(
module: ["gleam", "io"],
types: [],
constructors: [],
functions: [],
alias: None,
),
],
functions: [
stare.function(
name: "main",
public: True,
parameters: [],
return_type: Some(type_.nil()),
statements: [
stare.function_call(
module: Some("io"),
function: "println",
arguments: [stare.value(value.string("Hello World!"))],
),
],
),
],
)
io.println(code)
// import gleam/io
//
// pub fn main() -> Nil {
// io.println("Hello World!")
//}
}
Further documentation can be found at https://hexdocs.pm/stare.
Development#
gleam run # Run the project
gleam test # Run the tests