From 772a2f133700c158cc798434b6a8c2566e52a388 Mon Sep 17 00:00:00 2001 From: Stephen Chang Date: Fri, 17 Feb 2017 12:09:58 -0500 Subject: [PATCH] fix mlish chameneos test again --- 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 index b36a7e8..4aac14a 100644 --- 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)