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

> in a lot of cases, those types that I wrote will be replaced by more dynamic representation (e.g. strings) at some point. I would love to see a type system that lets me subtype string, restrict the domain, and automatically (with some hints from the programmer) get functions on my type based on string functions the compiler can prove would result in my type.

I've only seen type systems that work like this on numbers, and usually only a very few integers at that.



The formal notion of subtype seems to be getting some solid research attention; see e.g. https://drops.dagstuhl.de/opus/volltexte/2021/13888/pdf/LIPI...

Hopefully we see these ideas make their way into functional languages soon.




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

Search: