arrowfail001.hs 638 Bytes
Newer Older
1
2

{-# LANGUAGE Arrows, ExistentialQuantification #-}
3
4
5
6
7
8
9

-- Crashed GHC 6.4 with a lint error
-- because of the existential

-- Esa Pulkkinen <esa.pulkkinen@kotiposti.net>
-- Thomas Jäger <ThJaeger@gmail.com>

ross's avatar
ross committed
10
module ShouldFail where
11
12
13
14
15

class Foo a where foo :: a -> ()
data Bar = forall a. Foo a => Bar a

get :: Bar -> ()
ross's avatar
ross committed
16
17
18
19
20
21
get = proc x -> case x of Bar a -> foo -< a

-- This should be rejected because the left side of -< (here foo)
-- should be treated as being outside the scope of the proc: it can't
-- refer to the local variables x and a (this is enforced), nor the
-- existentially quantified type variable introduced by unwrapping x.