Refutability
A pattern which matches all values of its type is irrefutable while one which only matches conditionally is refutable.
For example, a pattern unpacking a tuple is irrefutable because all values of type (T, Y) will match (a, b)
let is used to define a variable. Spade infers the type of most variables from context, but you can also specReturns the value of the first branch if the condition is true, otherwise the second branch.
Note that unlike software languages, Spade does not have conditional execution. You do not conditionally assign values inside if expressiosn, you compute a value and return it.y the type with : <type> before the =. tuple: (T, Y) = ...;
match tuple {
(a, b) => {...}
}while one which matches an enum variant is refutable because the None option will not match
enum Option<T> {
Some{val: T},
None,
}
match x {
Some(x) => {...} // refutable: None not covered
...
}