blob: eda338bc8a1ff0402e532ef7b44f985c049ae15b (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
|
{-# LANGUAGE ScopedTypeVariables #-}
module Bug where
f1 :: forall a. [a] -> [a]
f1 (x:xs) = xs ++ [ x :: a ] -- OK
f2 :: forall a. [a] -> [a]
f2 = \(x:xs) -> xs ++ [ x :: a ] -- OK
-- This pair is a cut-down version of Trac #2030
isSafe alts = isSafeAlts alts
isSafeAlts :: forall m . Int -> m Int
isSafeAlts x = error "urk"
where
isSafeAlt :: Int -> m Int
isSafeAlt alt = isSafe `seq` error "urk"
|