summaryrefslogtreecommitdiff
path: root/testsuite/tests/typecheck/should_fail/tcfail069.hs
blob: 63684fa9db3c10ded4274a8013b6760cb4b620da (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
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
{- 
From: Marc van Dongen <dongen@cs.ucc.ie>
Date: Wed, 9 Apr 1997 14:06:39 +0100 (BST)

I just wanted to report that the erroneous and tiny
program added below can not be compiled within 6MB of
heap (Admitted it can be compiled with a bigger heap).
It was part of a bigger program that could not be
compiled within 20MB of heap.

[GHC 2.03 and earlier.]  Turned out to be a bug in the
error recovery mechanism.

-}

module ShouldFail where

too_much :: [Int] -> [(Int,Int)] -> [(Int,[Int])] -> Bool
too_much ds ((k,m):q1) s0
  = case (list1,list2) of
      []  -> error "foo" -- too_much ds q2m  s2m
  where list1 = ds
	list2 = ds
	{-
	list1 = [k' | k' <- ds, k == k']
        list2 = [k' | k' <- ds, m == k']
        s1   = aas s0 k
        raM  = []
        raKM = listUnion (\a b -> a) [] []
        s1k  = s1
        q1k  = raM
        s2k  = s1
        q2k  = raM
        s2m  = s1
        q2m  = raM
        s2km = foldr (flip aas) s1 raKM
        q2km = raKM
	-}

listUnion :: (v -> v -> Bool) -> [v] -> [v] -> [v]
listUnion _  _ _
  = []

aas :: (a,b) -> a -> (a,b)
aas s _
  = s