Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

Except that it allows for an arbitrary modulus. For instance, you can have:

  type Whatever_Name is mod 10;
Removing restrictions is nice, lets the language and its type system actually express parts of the program logic unlike the inexpressive type system C provides.


Ok that's nice. Would one call that a dependent type ? I guess I would naively implement this by appending %10 to all assignments to a Whatever_Name.


No. Dependent types go further and allow you to do things like express that the length of an output vector/array is the same as some input number. That is, depends on some value (as in a runtime value). This mod type is fixed at compile time.




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: