This was one of the reasons I felled in love with Turbo Pascal back in the day.
Algol derived languages, while not as powerful as ML ones regarding the type system offer quite a few possibilities to ensure safer code via type definitions, ranges, enumerations and ADTs (Abstract Data Types not to confuse with Algebraic data types).
C++ also allows for this, but requires a bit of boilerplate with templates, classes and operator overloading, which is way more work than a few type declarations in Haskell or Idris.
Yes, this was exactly my feeling reading through the Idris book. In the same way that a few lines of elegant Haskell can sometimes describe functionality that takes all kinds of technically-works-but-only-the-author-understands-it C++ template abuse, a few lines of straightforward Idris can sometimes replace all kinds of Haskell "type family abuse".
all kinds of s can be elegantly described in a few lines of Haskell,
"Type-Driven Development with Idris" is the best Haskell book I've ever read.
Re:Basic Type-Level Programming in Haskell
by codygman on Friday April 28, 2017 @06:33PM
(#14223683)
With the warning that it's using Idris and strict semantics rather than lazy, I'd almost agree.
I think for Haskell specifically that http://haskellbook.com is the best.
I highly recommend buying the book and checking out Idris if you found this article interesting. Read the free "overview" chapter[1] at least.
[0] https://www.manning.com/books/type-driven-development-with-i...
[1] https://manning-content.s3.amazonaws.com/download/a/580d6ba-...