summaryrefslogtreecommitdiff
path: root/testsuite/tests/indexed-types/should_fail/T2693.hs
blob: e9866523318aa832fd568da5d253c547bcd04c8f (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
{-# LANGUAGE TypeFamilies #-}

module T2693 where

type family TFn a :: *

-- Boiled down version
f :: Maybe ()
f = do
  let Just x = undefined :: Maybe (TFn a)
  let n = fst x + fst x
  return ()

f2 :: Maybe ()
f2 = do
  let x :: TFn a
      x = undefined 
  let n = fst x + snd x
  return ()

-- Close to the original report
data PVR a = PVR {pvrX :: Int} deriving (Eq)

g :: () -> Maybe (TFn a)
g _ = undefined

h :: Maybe ()
h = do pvs <- mapM g undefined
       let n = (map pvrX pvs) `min` (map pvrX pvs)
       undefined