News for hackers. Stuff that matters.
Re:Dhall: A Gateway Drug to Haskell by astrange on Tuesday June 07, 2022 @11:07PM (#31662719)
> IMO, once learned, the type checking is so helpful, everything else seems hard.

I've noticed this claim, that Haskell's type system prevents all bugs, eg at:

https://www.costarastrology.com/why-haskell/

And when they say it prevents all bugs and has no illegal states they seem to mostly mean it has ADTs.

But who is keeping me from having bugs in my numeric code? Not Haskell, making you type "fromIntegral" doesn't prevent bugs. Idris or Ada, maybe.

Re:Dhall: A Gateway Drug to Haskell by aranchelk on Wednesday June 08, 2022 @06:21AM (#31665333)
Was that my claim?

It certainly doesn’t prevent all bugs. The refrain I generally see (which I did not write here) is “if a Haskell program compiles, it probably works" Note that “probably” doesn’t mean “always” and “works” isn’t a synonym for “is absent of any and all bugs”.

Yes algebraic data types and compiler options that force you to handle all cases are a big part of it. Additionally, verifying correct record field names, needed type class instances exist, a total absence of nulls (and the forced handling of Nothing cases).

It’s also the type inference, I want the above features and I don’t want to write out type signatures before I’m ready.

The dependently typed stuff (e.g. Idris) is compelling but you do lose the inference.

Re:Dhall: A Gateway Drug to Haskell by jose_zap on Wednesday June 08, 2022 @03:07AM (#31664257)
You can use the LiquidHaskell plugin to perform extra compile time checks to numeric code.