News for hackers. Stuff that matters.
Re:What Learning APL Taught Me About Python by marko-lev on Thursday August 17, 2023 @04:23AM (#37158714)
I like to leverage some FP to bring readability to python

  from toolz import curried, pipe

  pipe(ages,
       curried.filter(lambda age: age > 17),
       list,
       len)
This way you can follow - vertically - what happens, where, and why.

You can make your own pipe function to avoid 3rd party dependencies

  import functools
  pipe = lambda *args: functools.reduce(lambda acc, el: el(acc), args)

There are no comments on this comment yet.