Re: Use of irrefutable

2000-04-25 Thread John Matthews
On Thu, 20 Apr 2000, Koen Claessen wrote: Mike Jones wrote: | lift1 f (List xs) = List $ lazyMap f xs | where | lazyMap f ~(x:xs) = f x : lazyMap f xs : | a = List [1, 2] | b = lift1 (+ 1) a : | "non-exhaustive pattern". | "irrefutable pattern failed". [snip]

Re: Use of irrefutable

2000-04-20 Thread Koen Claessen
Mike Jones wrote: | lift1 f (List xs) = List $ lazyMap f xs | where | lazyMap f ~(x:xs) = f x : lazyMap f xs : | a = List [1, 2] | b = lift1 (+ 1) a : | "non-exhaustive pattern". | "irrefutable pattern failed". Hi Mike, let me tell you how irrefutable patterns work in

Use of irrefutable

2000-04-20 Thread Frank Atanassow
Mike Jones writes: I am looking at the Hawk Signal module, where the following definition occurs: lift1 f (List xs) = List $ lazyMap f xs where lazyMap f ~(x:xs) = f x : lazyMap f xs Now setting aside how the function is used in Hawk, I ran a little experiment to

RE: Use of irrefutable

2000-04-20 Thread Mike Jones
Let me explore this a bit: lazyMap ~(x:xs) = f x : lazyMap f xs Now you tell the compiler that the list you are constructing is infinite. Moreover, you can inspect the *result* of the function before it ever evaluates its argument! What exactly do you mean by inspect the result before the

Use of irrefutable

2000-04-19 Thread Mike Jones
Hi, I have a rather naive question, being new to Haskell. I am looking at the Hawk Signal module, where the following definition occurs: lift1 f (List xs) = List $ lazyMap f xs where lazyMap f ~(x:xs) = f x : lazyMap f xs Now setting aside how the function is used in Hawk, I ran a