<table cellspacing="0" cellpadding="0" border="0" ><tr><td valign="top" style="font: inherit;">Hi Ketil,<br><br>Good point, but I think it side-steps the question. Haskell coughs on a data value. Do we grep our data, finding and fixing the offender, or build extensive data tests into our application code?<br><br>Michael<br><br>--- On <b>Sat, 3/27/10, Ketil Malde <i>&lt;ketil@malde.org&gt;</i></b> wrote:<br><blockquote style="border-left: 2px solid rgb(16, 16, 255); margin-left: 5px; padding-left: 5px;"><br>From: Ketil Malde &lt;ketil@malde.org&gt;<br>Subject: Re: [Haskell-cafe] Testing for valid data<br>To: haskell-cafe@haskell.org<br>Date: Saturday, March 27, 2010, 5:20 PM<br><br><div class="plainMail">michael rice &lt;<a ymailto="mailto:nowgate@yahoo.com" href="/mc/compose?to=nowgate@yahoo.com">nowgate@yahoo.com</a>&gt; writes:<br><br>&gt; When I'm learning a new language I like to translate old programs into<br>&gt; the new language as a test of my
 understanding. However, many of the<br>&gt; old programs are from old programming texts, many written in the time<br>&gt; of punch-cards for batch processing, and many containing significant<br>&gt; amounts of code that only tests for valid data. Should we still be<br>&gt; writing programs in this fashion, or acknowledge the fact that better<br>&gt; tools for pre-screening data are now available and code only for the<br>&gt; problem at hand? <br><br>Hm - I remember test suites in a dynamically typed program with test<br>case upon test case checking that functions expecting integers would<br>throw an exception when given a string, and so on. Doesn't seem that<br>long ago either..<br><br>I think the whole -- well, no, but half, maybe -- point of Haskell is<br>that the static type system proves data validity throughout the<br>program.&nbsp; And half the trick of writing correct programs is to design<br>your data types to constrain the possible values to
 valid ones.<br><br>-k<br>-- <br>If I haven't seen further, it is by standing in the footprints of giants<br>_______________________________________________<br>Haskell-Cafe mailing list<br><a ymailto="mailto:Haskell-Cafe@haskell.org" href="/mc/compose?to=Haskell-Cafe@haskell.org">Haskell-Cafe@haskell.org</a><br><a href="http://www.haskell.org/mailman/listinfo/haskell-cafe" target="_blank">http://www.haskell.org/mailman/listinfo/haskell-cafe</a><br></div></blockquote></td></tr></table><br>