johnklee / fpu

Functional programming utility
MIT License
4 stars 4 forks source link

I want function `fl` in module `fpu.flist` to support enumerate type. #73

Closed johnklee closed 11 months ago

johnklee commented 11 months ago

Currently if we pass enumerate into fl, it will be treated as a single element. e.g.:

>>> from fpu.flist import fl
>>> fl(enumerate(['A','B','C'])).head()   # Current behavior
<enumerate object at 0x7fd8ddc8ff10>
>>> fl(list(enumerate(['A','B','C']))).head()   # Expected behavior is we could have same result by `fl(enumerate(['A','B','C'])).head()`
(2, 'C')
johnklee commented 11 months ago

Fixed in this PR