At the page https://en.wikibooks.org/wiki/Haskell/Denotational_semantics#Pattern_Matching there is the following exercise:
Consider a function
or
of two boolean arguments with the following properties:
- or ⊥ ⊥ = ⊥
- or True ⊥ = True
- or ⊥ True = True
- or False y = y
- or x False = x
This function is another example of joint strictness, but a much sharper one: the result is only ⊥ if both arguments are (at least when we restrict the arguments to True and ⊥). Can such a function be implemented in Haskell?
The function can be represented with the following table:
| ⊥ | False | True
------|-----------------------
⊥ | ⊥ | ⊥ | True
False | ⊥ | False | True
True | True | True | True
This function is monotone according to the definition given in https://en.wikibooks.org/wiki/Haskell/Denotational_semantics#Monotonicity, so I don't see a reason to exclude the possibility of implementing this function in Haskell. Nonetheless, I don't see a way to implement it.
What is the answer to the exercise?
PS: I get that the answer is "no, you can't". What I'm looking for is a rigorous proof. I feel I'm missing some important restriction on what functions can be defined. Definitely not all monotone functions.