by anaphor · 6y ago · 0 comments
I would expect `isNotJust (Just foo)` to equal `False`, not `True`, and vice versa `isNotJust Nothing` to equal `True`.
The point has some validity (that you should try to encode data into the types if you can), but the example makes no sense in my opinion.
The improved way below where the Just a is unwrapped with a case allows the compiler to see whether or not x is valid.
> Is there anything wrong with the definitions and below
> and why is this not caught in the type system?
And
> ???
on the line you flagged as a bug.