tc242.hs 418 Bytes
Newer Older
simonpj's avatar
simonpj committed
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"