How can you write a Haskell predicate that detects (without diverging) that both of these two infinite trees are unsorted?

The fair-predicates library gives an answer.

There are comments on reddit.