Suor/funcy

Question: should numpy arrays support be incorporated or streamlined?

Closed this issue · 2 comments

I have a small function always available to me:

  `def lmap(fn,lst):   return list(map(fn,lst))`

So then given numpy arrays coll1,coll2,coll3 we can use this library as:

 merge(lmap(lambda x: x.tolist(),[coll1,coll2,coll3]))

Given that my primary intention for this library is to apply it to numpy.array's is there a possible way to cleanly introduce that conversion (along the lines of scala implicits) so that it would be automatically "picked up" and applied to any of the methods in the library?

Suor commented

Not sure I understand the example. What is merge()? Will this work:

merge(x.tolist() for x in [coll1, coll2, coll3])

No need to use funcy here.

As more general answer I may say that I would like to avoid making funcy know about numpy or any other lib. If you still need some glue you might write your own small helper functions and ship them with your project.

Suor commented

Reopen if that is not solved.