Added janky map to prelude

This commit is contained in:
greg 2018-11-06 03:02:32 -08:00
parent cee5b085d5
commit 836bed1207

View File

@ -2,3 +2,12 @@
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,
}
}