Hacker News new | ask | show | jobs
by syrak 2547 days ago
> I've never read a code base where I thought the type system was doing a good job of being a DSL for describing business requirements

Would refinement types help in that respect? For example, the F* language. https://www.fstar-lang.org/

I don't have any experience with "business" code, but my naive understanding is that application-level code is typically very monomorphic which is exactly where refinement types are useful, whereas the OP leverages polymorphism to a large extent (not necessarily), and that works well for general-purpose libraries which don't and must not care about their users' data.