Skip to content

Roadmap

Andy Brice edited this page Mar 22, 2018 · 3 revisions

Pipeable Methods and Properties

More natural syntax for chaining methods and properties in pipelines. So:

[1,2,3,2,3,3,1,2,3,2] >> f.filter(3) >> ____.length >> f.increment # -> 5

Becomes:

[1,2,3,2,3,3,1,2,3,2] >> f.filter(3).length >> f.increment # -> 5

Simple Initialization

Import and initialize without needing to manually instantiate catchers or specify the default namespace.

from pypework import f, p, m, ____

Deferred Execution

Chain together a sequence of pipeable functions with no input. To create a pipeline object which can be called or piped into later.

sanitize = f.lowercase >> f.replace(" ", "_")

"Lorem Ipsum" >> sanitize # -> "lorem_ipsum"
sanitize("Lorem Ipsum") # -> "lorem_ipsum"

Smart Argument Order Handling

Enable the Partial Function Catcher automatically detect when input is to the first argument.

100 >> p.subtract(10) # -> 90
10 >> p.subtract(100, ____) # -> 90

Unified Function Catcher

Merge the Function Catcher f and the Partial Function Catcher p into one class with no significant detriment to performance.

Ultimate Goals

Recreate the F# pipeline syntax in Python without the need for added visual cruft.

"Lorem Ipsum" |> lowercase |> replace(" ", "_") # -> "lorem_ipsum"
"Lorem Ipsum"
  |> lowercase
  |> replace(" ", "_")

 # -> "lorem_ipsum"

(Until Python hopefully implements it natively, as is currently planned for JavaScript.)

Clone this wiki locally