summaryrefslogtreecommitdiff
path: root/testsuite/tests/simplCore/should_run/simplrun001.hs
blob: 6cbbf76a9184523fa1ac746dd27a560177a102c1 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
-- !!! Test filter fusion

-- In GHC 4.06, the filterFB rule was back to front, which
-- made this program hit the "error foo" case instead of
-- working fine.


module Main where

main :: IO ()
main = print (length (filter (not . foo)
                             (filter (const False) [Nothing])))
  where foo (Just x) = x
        foo _        = error "foo"