f0b02c1db99faef334320196e8f8e5d2bc0602a6
[ghc-hetmet.git] / ghc / tests / simplCore / should_run / simplrun001.hs
1 {-# OPTIONS -O #-}
2
3 -- !!! Test filter fusion
4
5 -- In GHC 4.06, the filterFB rule was back to front, which
6 -- made this program hit the "error foo" case instead of
7 -- working fine.
8
9
10 module Main where
11
12 main :: IO ()
13 main = print (length (filter (not . foo)
14                              (filter (const False) [Nothing])))
15   where foo (Just x) = x
16         foo _        = error "foo"