Add spaceship operator for getting an ord

This commit is contained in:
greg 2018-08-24 16:29:28 -07:00
parent 8565c7dfb3
commit e125e8b440
2 changed files with 2 additions and 0 deletions

View File

@ -133,5 +133,6 @@ lazy_static! {
"<=" => (Func(bx!(Const(Nat)), bx!(Func(bx!(Const(Nat)), bx!(Const(Nat))))), (), 20),
"==" => (Func(bx!(Const(Nat)), bx!(Func(bx!(Const(Nat)), bx!(Const(Nat))))), (), 20),
"=" => (Func(bx!(Const(Nat)), bx!(Func(bx!(Const(Nat)), bx!(Const(Nat))))), (), 20),
"<=>" => (Func(bx!(Const(Nat)), bx!(Func(bx!(Const(Nat)), bx!(Const(Nat))))), (), 20),
};
}

View File

@ -57,6 +57,7 @@ impl Schala {
let prelude = r#"
type Option<T> = Some(T) | None
type Color = Red | Green | Blue
type Ord = LT | EQ | GT
"#;
let mut s = Schala::new_blank_env();
s.execute_pipeline(prelude, &EvalOptions::default());