summaryrefslogtreecommitdiff
path: root/testsuite/tests/arrows/should_run/T3822.hs
blob: 93e6dc579720c1dd6c4e19304700de2e5b6ad837 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17

{-# LANGUAGE Arrows #-}

import Control.Arrow
import qualified Control.Category as Cat

test :: Int -> Int
test = proc x -> do
    let neg = x < 0
    case x of
        x | neg -> returnA -< 0           -- GHC panics
        --x | x < 0 -> returnA -< 0       -- GHC doesn't panic
        _       -> returnA -< 10

main = do
    print $ test (-1)
    print $ test 1