Closed imranypatel closed 3 years ago
Thanks for reaching out. I'm fixing that example. It was written a long time ago when I wanted the code to look the same as F#. But now the code follows Python conventions. That means that all module names are lowercase. So a module Seq
in F# becomes seq
in Python. So the right way to do this now:
>>> from expression.collections import seq
>>> xs = seq.of_iterable([1, 2, 3])
>>> ys = xs.pipe(
seq.map(lambda x: x + 1),
seq.filter(lambda x: x < 3)
)
Also note that Expression also have a fluent syntax (similar to https://github.com/fsprojects/FSharp.Core.Fluent) which you can use (or combine with the example above)
>>> from expression.collections import Seq
>>> xs = Seq([1, 2, 3])
>>> ys = xs.map(lambda x: x + 1).filter(lambda x: x < 3)
Having some background in F# and just a beginner in Python, thought Expression lib worth exploring.
Using Ref https://cognitedata.github.io/Expression/expression/collections/seq.html and trying something as simple as:
resulting in error:
Any help?