// Sample Gleam program — samplefiles.com import gleam/float import gleam/io import gleam/list pub type Customer { Customer(id: Int, name: String, balance: Float) } pub fn is_vip(customer: Customer) -> Bool { customer.balance >=. 10_000.0 } pub fn main() { let customers = [ Customer(1, "Ada", 12_500.0), Customer(2, "Grace", 830.5), Customer(3, "Linus", 10_000.0), ] list.each(customers, fn(c) { let tag = case is_vip(c) { True -> " VIP" False -> "" } io.println(c.name <> " " <> float.to_string(c.balance) <> tag) }) let total = list.fold(customers, 0.0, fn(acc, c) { acc +. c.balance }) io.println("Total: " <> float.to_string(total)) }