You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
one composition that seems to be missing is chaining iterators when the list of iterators is given as an iterator - similar to itertools.chain.from_iterable in python.
But of course without going through the intermediate table (or doing the reduction) - which might be large, time consuming or even infinite.
IMO, chain_from_iterable is more natural and can easily be used to implement chain = function(...) return chain_from_iterable({...}) end, but not the other way round.
list comprehensions
with this function, you can implement the bind operation of monads (i.e. Haskell's >>=) like this:
Hey,
one composition that seems to be missing is chaining iterators when the list of iterators is given as an iterator - similar to
itertools.chain.from_iterable
in python.E.g. something like this:
But of course without going through the intermediate table (or doing the reduction) - which might be large, time consuming or even infinite.
IMO,
chain_from_iterable
is more natural and can easily be used to implementchain = function(...) return chain_from_iterable({...}) end
, but not the other way round.list comprehensions
with this function, you can implement the bind operation of monads (i.e. Haskell's
>>=
) like this:which allows to write something like list comprehensions
corresponding to a generator expression such as this:
The text was updated successfully, but these errors were encountered: