[Haskell-cafe] Some random newbie questions

Philippa Cowderoy flippa at flippac.org
Thu Jan 6 14:51:24 EST 2005


On Thu, 6 Jan 2005, Benjamin Pierce wrote:

> * As far as I can determine, there is no way to check pattern matches for
>  exhaustiveness.  Coming from OCaml, this feels like losing a significant
>  safety net!  How do people program so as not to be getting dynamic match
>  failures all the time?
>

Where not sure, a wildcard pattern at the end of the pattern list catches 
things. Myself I was always more irritated that I couldn't type things in 
such a way that the typechecker would catch it.

>  I've clearly got a lot to learn about space usage in Haskell... can
>  someone give me a hint about what is the problem here and how it might
>  best be corrected?
>

Having given the code but the briefest glance, I suspect laziness is 
biting you? If so, others will be able to give you good pointers - I've 
not really had to deal with it myself (seq and strict constructors are 
probably good places to start from what I hear though).

-- 
flippa at flippac.org

Ivanova is always right. 
I will listen to Ivanova. 
I will not ignore Ivanova's recomendations. 
Ivanova is God. 
And, if this ever happens again, Ivanova will personally rip your lungs out!


More information about the Haskell-Cafe mailing list