commit 772a2f133700c158cc798434b6a8c2566e52a388 parent 8be9371ed2645b8ec195157b2eccdfe83d59257f Author: Stephen Chang <stchang@ccs.neu.edu> Date: Fri, 17 Feb 2017 12:09:58 -0500 fix mlish chameneos test again Diffstat:
| M | turnstile/examples/tests/mlish/chameneos.mlish | | | 13 | ++++++++++--- |
1 file changed, 10 insertions(+), 3 deletions(-)
diff --git a/turnstile/examples/tests/mlish/chameneos.mlish b/turnstile/examples/tests/mlish/chameneos.mlish @@ -118,9 +118,16 @@ ;; (list 66 0) ;; (list 67 0))) -(check-type (map (λ ([x : Result]) (proj x 0)) - (go 1000 (list Blue Red Yellow Red Yellow Blue))) - : (List Int) -> (list 333 333 333 333 334 334)) +(define res2 + (map (λ ([x : Result]) (proj x 0)) + (go 1000 (list Blue Red Yellow Red Yellow Blue)))) +(check-type res2 : (List Int)) +(define (=333/4 [x : Int] -> Bool) (or (= x 333) (= x 334))) +(define (andmap [p? : (→ X Bool)] [xs : (List X)] → Bool) + (match2 xs with + [nil -> #t] + [x :: rst -> (and (p? x) (andmap p? rst))])) +(check-type (andmap =333/4 res2) : Bool -> #t) ;; -> (list (list 333 0) ;; (list 333 0) ;; (list 333 0)