diff options
Diffstat (limited to 'testsuite/tests/simplCore/should_compile/T18013.hs')
-rw-r--r-- | testsuite/tests/simplCore/should_compile/T18013.hs | 18 |
1 files changed, 18 insertions, 0 deletions
diff --git a/testsuite/tests/simplCore/should_compile/T18013.hs b/testsuite/tests/simplCore/should_compile/T18013.hs new file mode 100644 index 0000000000..08b0a057d2 --- /dev/null +++ b/testsuite/tests/simplCore/should_compile/T18013.hs @@ -0,0 +1,18 @@ +{-# OPTIONS_GHC -ddump-rule-firings -ddump-simpl + -dsuppress-coercions -dsuppress-uniques #-} +{-# LANGUAGE Arrows #-} + +module T18013 where + +import Control.Arrow +import T18013a + +-- We want to ensure this generates good code. Uses of (.) should be +-- specialized and inlined, and the rules defined on mkRule should fire. + +mapMaybeRule :: Rule IO a b -> Rule IO (Maybe a) (Maybe b) +mapMaybeRule f = proc v -> case v of + Just x -> do + y <- f -< x + returnA -< Just y + Nothing -> returnA -< Nothing |