14 lines
217 B
Plaintext
14 lines
217 B
Plaintext
|
|
type Option<T> = Some(T) | None
|
|
type Color = Red | Green | Blue
|
|
type Ord = LT | EQ | GT
|
|
|
|
|
|
fn map(input: Option<T>, func: Func): Option<T> {
|
|
if input {
|
|
is Some(x) -> Some(func(x)),
|
|
is None -> None,
|
|
}
|
|
}
|
|
|