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

I am not sure, but as a Typescripter, I think I'd find refinement types easier - https://github.com/ucsd-progsys/liquidhaskell

I am not sure if they serve the same purpose or how the venn diagrams overlap on this, but in 2000 I loved the idea of the assersion in Ada, and I love even more the idea the type system can prove your number is between 1 and 10 (etc.).

I reckon it occasionally will catch a bug, but more than that is perfect documentation. I don't want delay to be an int, I want it to be a RateLimitBackoffDelaySeconds which is between >0 and <60, for example.



As I understand the nomenclature liquid types are refinement types and they are dependent types, but typically when people say "dependent types" without qualification they mean the much more powerful (and difficult) "full" dependent types where you can do stuff like returning an int or a string depending on some runtime value.

https://goto.ucsd.edu/~ucsdpl-blog/liquidtypes/2015/09/19/li...




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

Search: