import std/io @derive Eq Ord Show Debug Hash Default pub type Settings { Settings(name: String, retries: Int, verbose: Bool, tags: List) } @derive Eq Debug Hash pub type Shape { Circle(Int), Square(Int) } pub fn main :: -> () / { let defaults: Settings = default () io.println (debug defaults) io.println (show defaults) io.println (debug [Circle(1), Square(2)]) let custom = Settings(..defaults, name: "prod", retries: 3) io.println (show (custom == defaults) <> " " <> show (custom > defaults)) io.println (show (hash custom == hash Settings(..defaults, name: "prod", retries: 3))) io.println (show (hash Circle(1) == hash Square(1))) io.println (show (hash 1 >= 0)) } //> Settings { name: "", retries: 0, verbose: False, tags: [] } //> Settings(, 0, False, []) //> [Circle(1), Square(2)] //> False True //> True //> False //> True