GithubHelp home page GithubHelp logo

Comments (11)

cartazio avatar cartazio commented on June 12, 2024 1

this and some related stuff will be in the next minor and major releases both

from vector.

cartazio avatar cartazio commented on June 12, 2024

GOOD IDEA.
I think we should totally get this into the 0.11 (we've a few other things we're keen on adding, and this totally makes sense to get into 0.11)

from vector.

dolio avatar dolio commented on June 12, 2024

It's actually difficult to be very efficient (I think). The problem is that the efficient way to build a vector is to write to a mutable vector and freeze. But when you are traversing, you have an arbitrary applicative involved blocking your ability to do efficient ST stuff. So, you can only build up ST actions as closures, or use an intermediate list/stream.

You can do better than creating a list first, of course. But it might always be a bit lackluster.

I think it's a good thing to have, though.

from vector.

glguy avatar glguy commented on June 12, 2024

I think it might look like this. Feel free to disregard the lens import, I was just using it for testing.

http://lpaste.net/119041

from vector.

yongqli avatar yongqli commented on June 12, 2024

It would also be very useful to have mapAccumL, mapAccumR, mapAccumLM, mapAccumRM, etc.

from vector.

cartazio avatar cartazio commented on June 12, 2024

Cant we define the stream / bundle version efficiently of traverse
efficiently though?
On Jan 23, 2015 4:27 AM, "yongqli" [email protected] wrote:

It would also be very useful to have mapAccumL, mapAccumR, mapAccumLM,
mapAccumRM, etc.


Reply to this email directly or view it on GitHub
#69 (comment).

from vector.

nh2 avatar nh2 commented on June 12, 2024

Without contributing anything useful so far here, I'd benefit a lot from the mapAccum* functions for vectors.

from vector.

ttuegel avatar ttuegel commented on June 12, 2024

Cant we define the stream / bundle version efficiently of traverse efficiently though?

Maybe. The trouble is that Stream and Bundle need an underlying monad, but traverse only gives us an applicative. But I think we can get away with a monad transformer that carries the applicative "along for the ride," as if it were some kind of monoidal functor.

from vector.

Daniel-Diaz avatar Daniel-Diaz commented on June 12, 2024

I am very interested in having some way of traversing vectors efficiently, especially in the way of the mapAccum* functions. Is this possible at all?

from vector.

cartazio avatar cartazio commented on June 12, 2024

@dolio now that primMonad is stackable, can we do something for mutable vectors that partially addresses this?

from vector.

cartazio avatar cartazio commented on June 12, 2024

BUMP

from vector.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.