3 ms·
Well, all you need to do in a macro to provide error checking is to assert or raise a condition when something is wrong. That's pretty standard. In Haskell lan
by mbrock 11y ago
Well, all you need to do in a macro to provide error checking is to assert or raise a condition when something is wrong. That's pretty standard.
In Haskell land, you can do wonderful things like Servant, the statically verified API server—but that kind of code is very advanced, and written by a shadowy cabal of type level wizards. I think there is less of a standardized way of doing this stuff than one might expect.
I'm not really sure what you mean by "standardized." Common Lisp is an actual ANSI standard... But you seem to be referring to the existence of common practices.
I'm not convinced that the problem you describe is actually a problem, and I'm not convinced that Haskell or Idris will end up being more successful in the mainstream than Lisp.
(I'm a huge fan of Haskell, Agda, and static/dependent typing, for the record.)
- lmm 11y ago> Well, all you need to do in a macro to provide error checking is to assert or raise a condition when something is wrong. That's pretty standard. Sure, but the conditions that lead you to do that can be arbitrary Turing-complete code. IIRC in unextended Haskell what you can do at type-level is more restricted; certainly you're guided towards a particular way of structuring your constraints. That in turn makes it more practical for other tools to support your constrained sublanguage. I think the future of programming lies in constrained (BWIM non-Turing-complete) languages and provably correct code. I guess we'll find out.