I want to use this occasion to mention a bit of experience I gathered in the past. In my opinion, one should avoid trying to over-use types to capture programming errors. It rarely pays if you try to target *imaginary* programming errors.
Many programmers think that program verification means to verify that a program is "100%" correct (whatever it means). I thought likewise but I now think that program verification is just some form of static debugging; it is meant to make a programmer more productive than if one solely relies on dynamic debugging. Too many programmers gave up ATS because they tried to do too much with types. Instead of relying on typechecking to flush out potential bugs, they fought against typechecking futilely. On Wednesday, June 22, 2016 at 11:59:53 PM UTC-4, Kiwamu Okabe wrote: > > Hi Hongwei, > > On Wed, Jun 22, 2016 at 1:33 PM, Hongwei Xi <[email protected] > <javascript:>> wrote: > > Or you can turn chss_p into a predicate: > > > > stacst chss_p : (int) -> bool > > > > Please take a look at the following code: > > > > > https://github.com/githwxi/ATS-Postiats-test/blob/master/contrib/hwxi/TEST30/test37.dats > > > Thanks. However this style needs injecting `{s:int | chss_p(s)}` into > every function... > > > There are many ways to address this issue. I don't feel it is worth the > > effort right now because > > I don't see that anyone would be using a type like chss(10). If it turns > out > > to be a real problem, > > then you can always try to fix it later. Right now, this is all > *imaginary*. > > Yes, you are right. This issue should occur when following: > > * Application's function is introduced with a bad state number such > like `chss(10)`, and... > * All of system API called by the function has a bad state number. > > Then I think that such error caused by bad state number is rare case. > > Thanks, > -- > Kiwamu Okabe at METASEPI DESIGN > -- You received this message because you are subscribed to the Google Groups "ats-lang-users" group. To unsubscribe from this group and stop receiving emails from it, send an email to [email protected]. To post to this group, send email to [email protected]. Visit this group at https://groups.google.com/group/ats-lang-users. To view this discussion on the web visit https://groups.google.com/d/msgid/ats-lang-users/01b7cd86-3d09-4349-bbd5-e01f8d56ac41%40googlegroups.com.
