navid/haze / d6acf09bc499a6d4d8924bf8dbf28b2328524044754531c5b811ad0b8a5beb4c / samples/baseline_2/orders.hz
orders.hz
← samples/baseline_2 · 294 bytes · raw · download
// Module `orders`: a small domain model.
const BIG_ORDER i32 = 100 // private: not visible outside this file
pub type Order {
id i32
qty i32
price i32
}
pub pure fn total(o Order) i32 => o.qty * o.price
pub pure fn is_big(o Order) bool => total(o) >= BIG_ORDER