2 From dmc@minster.york.ac.uk Tue Mar 10 17:15:20 1992
3 Via: uk.ac.york.minster; Tue, 10 Mar 92 17:15:14 GMT
4 Message-Id: <swordfish.700247842@minster.york.ac.uk>
5 From: dmc@minster.york.ac.uk
7 Date: 10 Mar 1992 17:17:21 GMT
11 I have just started using Haskell at York and have found a compilation
12 error in the code below which disappears when the last line is
16 module ShouldCompile where
18 --brack :: (Eq a) => a -> a -> [a] -> ([a],[a])
19 --brack open close = brack' open close (1 :: Int)
21 brack' :: (Eq a) => a -> a -> Int -> [a] -> ([a],[a])
22 brack' open close 0 xs = ([],xs)
23 brack' open close (n+1) [] = ([],[])
24 brack' open close (n+1) (h:t) | h == open = ([],[])
27 Is this something I have done wrong or a fault with the compiler?
33 -----------------------------------------------------------------------
34 David Cattrall Telephone +44 904 432777
35 Department of Computer Science
36 University of York JANET: dmc@uk.ac.york.minster
38 United Kingdom UUNET: uucp!ukc!minster!dmc
39 -----------------------------------------------------------------------
42 -- and this was Kevin's idea, subsequently...
44 kh (n+2) x | x > n = x * 2