Git Product home page Git Product logo

Comments (4)

foxik avatar foxik commented on August 29, 2024

Containers should work with older GHCs (Data.Functor.Identity will be added only to base-4.8, if I look correctly), and also with other Haskell compilers (it used to be Haskell-98 with CPP and compiler-specific stuff, today probably Haskell-2010 with CPP is the right target). Therefore, the Sequence-specific Id has to stay for older GHC and non-GHC compilers.

I am not sure whether it would be worth it to use type Id = Data.Functor.Identity for GHC base-4.8 -- is there any advantage in using Data.Functor.Identity then the Functor/Monad/Applicative instances?

from containers.

treeowl avatar treeowl commented on August 29, 2024

It looks like base-4.8 is actually stealing Data.Functor.Identity away from transformers. If containers is allowed to depend on transformers for older versions, then we can use Data.Functor.Identity regardless, and get all that code out of Data.Sequence. The version in base-4.8 will have some coercion-based optimizations (e.g., fmap = coerce, (<*>) = coerce, foldMap = coerce, foldl = coerce), but I don't know if any of those will help anything in Data.Sequenceβ€”they only matter when certain sorts of polymorphism are in play.

from containers.

foxik avatar foxik commented on August 29, 2024

As containers are a boot package (https://ghc.haskell.org/trac/ghc/wiki/Commentary/Libraries), any dependency is a big burden, so adding transformers for saving 10 lines of code is definitely not going to happen.

Nevertheless, if using Data.Functor.Identity on new GHCs should bring some advantage (some speedup?), we could use it, while providing Data.Sequence.Id for other compilers.

from containers.

treeowl avatar treeowl commented on August 29, 2024

Fixed by #76

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.