@@ -0,0 +1,80 @@
1+module Syntax.Case (benchmark) where
3+import Benchmark exposing (Benchmark, test, suite)
7+benchmark : Benchmark.Benchmark
9+ suite "case expressions"
10+ [ suite "simple explicit patterns"
11+ [ test "Maybe.withDefault 0 (Just 42)" (withDefault 0 (Just 42))
12+ , test "Maybe.withDefault 0 Nothing" (withDefault 0 Nothing)
13+ , test "isBlack Diamond" (isBlack Diamond)
14+ , test "evaluate basicBoolean" (\_ -> evaluate basicBoolean)
15+ , test "evaluate fancyBoolean" (\_ -> evaluate fancyBoolean)
20+-- 1 Level Deep Patterns
22+withDefault default maybe _ =
31+type Suit = Diamond | Heart | Spade | Club
52+ | And Boolean Boolean
62+ Or (Not Tru) (Or Fls (And Tru Tru))
74+ evaluate a && evaluate b
77+ evaluate a || evaluate b