Every story and comment from the Hacker News API, in a layout borrowed from 2001.
A comment on Things I Love About Go. Parent comment
Guard clauses in Haskell are actually boolean conditionals, and are boolean-blind.
Safe pattern-matching can be done via the function definition sugar:
f Nothing = ... f (Just x) = ...
The various functions that work with a Maybe value make it non-tedious to do things. For example, instead of:
case mx of Just x -> Just (x + 1) Nothing -> Nothing
fmap (+1) mx
There are no comments on this comment yet.
Guard clauses in Haskell are actually boolean conditionals, and are boolean-blind.
Safe pattern-matching can be done via the function definition sugar:
Which is equivalent to a "case".The various functions that work with a Maybe value make it non-tedious to do things. For example, instead of:
You can write: Additionally, (>>=), fromMaybe and many other useful functions exist, and they're all based on safe pattern-matching.