Code Monkey home page Code Monkey logo

Comments (4)

konsumlamm avatar konsumlamm commented on July 17, 2024 1

IF we change the implementation, I'd argue that primitive is even better suited for arrays than array, as it doesn't store boxed indices. One possible problem is if Data.Graph uses slicing (by adjusting the start/stop indices), but it looks like array doesn't even provide a function for that.

It might be possible to optimize the layout even more by using the unboxed array directly instead of a nested array, but that would require a second array to store the indices where the vertex lists start.

It seems like a massive oversight to make Graph a type alias instead of a newtype, but I'm afraid it might be too late to change that now, at least not without a big announcement and a migration strategy (even though the amount of breakage is probably small).

from containers.

treeowl avatar treeowl commented on July 17, 2024 1

@meooow25 You could attempt an impact assessment, but I'm not terribly optimistic. You might be better off exploring those ideas in another package, and try to see if you get good performance using that for, e.g., GHC.

from containers.

treeowl avatar treeowl commented on July 17, 2024

@konsumlamm, I fear the amount of breakage is likely not small, though the number of programs affected likely is. I don't think the (few) users of the module have ever shied away from using what they know about the representation.

from containers.

meooow25 avatar meooow25 commented on July 17, 2024

I doubt we can use primitive, since it's not a GHC boot library. We can make our own type for an Int array with limited operations if we really want.

@treeowl so do you think this is not practical to do, given the amount of breakage?

from containers.

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.