dovekie is a Python library that provides SKI combinators from Combinatory Logic and common unary and binary functions that are often used with these combinators. It is the spiritual equivalent of the:
- C++
blackbirdlibrary - Rust
bluebirdlibrary
How to install:
pip3 install dovekieAnd how to use:
import operator as op
from itertools import accumulate
import dovekie as dk
def mco(xs: list[int]) -> int:
return max(accumulate(xs, dk.phi1(op.add, op.mul, dk.r)))
print(mco([1, 0, 1, 1, 1, 0, 0, 1, 1, 0])) # 3