4 ms·
Your brain is going to explode like mine did when you learn about Option types[1]. [1] https://en.m.wikipedia.org/wiki/Option_type https://en.m.wikipedia.org/w
by stouset 7y ago
Your brain is going to explode like mine did when you learn about Option types[1].
[1] https://en.m.wikipedia.org/wiki/Option_type https://en.m.wikipedia.org/wiki/Option_type
- ericpauley 7y agoThis doesn't really solve GP's problem, as the Nothing type is generally still equal to itself. Certainly useful for general purpose programming languages, though.
- Smaug123 7y agoThe problem is really that you're using the wrong equality type here. You get the right semantics if you use `= : A -> A -> Bool` and then apply it to a `Maybe A` and a `Maybe A` by lifting it: you end up with `Nothing` if either input was `Nothing`, and `Just answer` if both were known.