26 ms·
> Your shell example ... is a lot more compositional than your Python-style example Yes, the Python equivalent would be: lines("beef.txt").filter(lambda(x): x
by marcosdumay 4y ago
> Your shell example ... is a lot more compositional than your Python-style example
Yes, the Python equivalent would be:
lines("beef.txt").filter(lambda(x): x.contains("lasagna")).sort(type="natural").remove_duplicates()
Of course, all of those things would need to be generators. Python accepts that kind of code, but most "Python developers" wouldn't think on it. Haskell is a much more natural fit for replacing Bash. (By the way, Haskell has at least one Bash replacement library that I remember, but it's hard to find).