> We were quite surprised when a student mnaged to get away with the
> following (skeletal) definition:
>
> sumsquares n | n < 0 = error "sumsquares:n < 0"
> n | n >= 0 = n
I think this is parsed as
sumsquares n | n < 0 = error "sumsquares:n < 0" n
| n >= 0 = n
which happens to be OK since `error "..."' has any type you need.
-- Lennart
Re: Still doing Miranda-style pattern matching?
Lennart Augustsson Wed, 15 Oct 1997 21:25:04 +0200 (MET DST)
- Still doing Miranda-style pattern matching? Jan-Willem Maessen
- Re: Still doing Miranda-style pattern matching? Heribert Schuetz
- Lennart Augustsson
