GithubHelp home page GithubHelp logo

Comments (2)

i-am-tom avatar i-am-tom commented on May 20, 2024

This is interesting! I'm pretty busy this weekend, but next week I'll take a look at some core - I've always (optimistically) assumed that GHC has some generics-specific specialising that takes place, but maybe that was naïve.

I'd also be keen to hear more about your use case - I've also assumed that the O(log n) access times for a generic rep would always be fast enough, as I thought the compiler requires that n < 62. If your application involves a lot of read/writes, though, I can imagine this might start to build up! Maybe there are some other things we can do to fuse operations?

Thanks for opening up this discussion!

from higgledy.

axman6 avatar axman6 commented on May 20, 2024

Yeah as far as I know unless you're directly producing something Rep like and then consuming it GHC should go a good job deforesting the intermediate structure, but if you expect to work with something of type HKD f a for more than that then the tree representation would have to exist in memory, which would probably be a bad thing. Particularly for memory usage, there's a hell of a lot of pointer overhead with such a nestled representation (we actually have quite a few data types at work which have dozens of fields, so if we were to use this that would affect us a lot).

We don't currently have a use case for Higgledy, I'm just really interested in the technique and could probably put it to good use in some other projects down the line.

I'll see if I can find some time on the weekend to have a play with it.

from higgledy.

Related Issues (15)

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.