[clean-list] toInt badness for Clean newbie
Marco Kesseler
m.kesseler@xs4all.nl
Mon, 28 Jun 2004 13:30:16 +0200
> >I don't think that proof will buy you much, as 90% of these
> conversions
> >are bound to happen at the edges of the system, where either
> GUI or I/O
> >provide you with raw strings.
>
> You are going too fast here. It only implies that you have to
> code some check or conversion before you do toInt. It could
> be making sure the input is exactly 4 digits, or at most 8
> digits, or whatever may be appropriate in the application.
> This could even call for a function like isInt :: String ->
> Bool that you only call at 'the edges of the system'. If you
> do that, you can complete the proof
I just think that toInt should do some of these checks itself, so that I
don't have to program them.
Regards,
Marco