[project @ 1997-05-26 05:42:53 by sof]
[ghc-hetmet.git] / ghc / compiler / tests / typecheck / should_fail / tcfail069.hs
1 {- 
2 From: Marc van Dongen <dongen@cs.ucc.ie>
3 Date: Wed, 9 Apr 1997 14:06:39 +0100 (BST)
4
5 I just wanted to report that the erroneous and tiny
6 program added below can not be compiled within 6MB of
7 heap (Admitted it can be compiled with a bigger heap).
8 It was part of a bigger program that could not be
9 compiled within 20MB of heap.
10
11 [GHC 2.03 and earlier.]  Turned out to be a bug in the
12 error recovery mechanism.
13
14 -}
15
16 module Too_Kuch( too_much ) where
17
18 too_much :: [Int] -> [(Int,Int)] -> [(Int,[Int])] -> Bool
19 too_much ds ((k,m):q1) s0
20   = case (list1,list2) of
21       []  -> error "foo" -- too_much ds q2m  s2m
22   where list1 = ds
23         list2 = ds
24         {-
25         list1 = [k' | k' <- ds, k == k']
26         list2 = [k' | k' <- ds, m == k']
27         s1   = aas s0 k
28         raM  = []
29         raKM = listUnion (\a b -> a) [] []
30         s1k  = s1
31         q1k  = raM
32         s2k  = s1
33         q2k  = raM
34         s2m  = s1
35         q2m  = raM
36         s2km = foldr (flip aas) s1 raKM
37         q2km = raKM
38         -}
39
40 listUnion :: (v -> v -> Bool) -> [v] -> [v] -> [v]
41 listUnion _  _ _
42   = []
43
44 aas :: (a,b) -> a -> (a,b)
45 aas s _
46   = s
47
48