3 ms·
I found it easier to read when `anySatisfy` was inlined: find :: (BitSequence -> Bool) -> BitSequence find p = if p (False : find (\s -> p (Fals
by Veedrac 8y ago
I found it easier to read when `anySatisfy` was inlined:
find :: (BitSequence -> Bool) -> BitSequence
find p =
if p (False : find (\s -> p (False : s)))
then False : find (\s -> p (False : s))
else True : find (\s -> p (True : s))
- kccqzy 8y agoThat's slightly wrong. When you substitute the definition of anySatisfy, you need to note that it uses the argument p twice, so you need to substitute both uses, not just the second one.
- Veedrac 8y agoI did, anySatisfy (\s -> p (False : s)) ==> (\s -> p (False : s)) (find (\s -> p (False : s))) ==> p (False : find (\s -> p (False : s)))