;; ;; Base.egi ;; (define $Bool (type {[,$val [] {[$tgt (if (and (or (not val) tgt) (or val (not tgt))) {[]} {})]}] [ [] {[ {[]}] [#t {[]}] [_ {}]}] [ [] {[ {[]}] [#f {[]}] [_ {}]}] [_ [Something] {[$tgt {tgt}]}] })) (define $or (lambda [$b1 $b2] (match b1 Bool {[ #t] [ b2]}))) (define $and (lambda [$b1 $b2] (match b1 Bool {[ b2] [ #f]}))) (define $not (lambda [$b] (match b Bool {[ #f] [ #t]}))) (define $Char (type {[,$c [] {[$tgt (if (eq-c? tgt c) {[]} {})]}] [_ [Something] {[$tgt {tgt}]}] })) (define $String (type {[,$s [] {[$tgt (if (eq-s? tgt s) {[]} {})]}] [_ [Something] {[$tgt {tgt}]}] })) (define $Order (type {[,$val [] {[$tgt (if (eq? val tgt) {[]} {})]}] [ [] {[ {[]}] [_ {}]}] [ [] {[ {[]}] [_ {}]}] [ [] {[ {[]}] [_ {}]}] [_ [Something] {[$tgt {tgt}]}] })) (define $match? (lambda [$a] (lambda [$x $y] (match x a {[,y #t] [_ #f]})))) (define $= (lambda [$a] (lambda [$x $y] (and ((match? a) x y) ((match? a) y x)))))