News for hackers. Stuff that matters.
Re:Haskell IHP framework, from a technical and business pers... by HowardStark on Thursday November 11, 2021 @08:56AM (#29187844)
The important point isn’t that there’s a wild card, it’s that there isn’t an undefined clause. You know with compiler-assured certainty that WYSIWYG, which is a big step in code predictability.
Re:Haskell IHP framework, from a technical and business pers... by phaer on Thursday November 11, 2021 @09:00AM (#29187884)
Could you elaborate? Wouldn't it be better to i.e. throw a runtime error than to send an email with an empty subject to a user from a business perspective in most cases?
Re:Haskell IHP framework, from a technical and business pers... by amitaibu on Thursday November 11, 2021 @09:48AM (#29188367)
I tried to keep the code simple, so yeah - it was on the expense of making it more "right".

In this case I wouldn't call the command send the mail unless status was explicitly Accepted or Rejected.

But as notes above, the important part is that the compiler doesn't let me forget about all the possible cases (e.g. `Queue` in this example).