Giter VIP home page Giter VIP logo

indexed-traversable's People

Contributors

konsumlamm avatar phadej avatar wygulmage avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar

indexed-traversable's Issues

-Wtype-equality-out-of-scope for use type equality (GHC 9.10)

There is a new warning with GHC 9.10:

src/WithIndex.hs:264:27: warning: [GHC-12003] [-Wtype-equality-out-of-scope]
    • The ‘~’ operator is out of scope.
      Assuming it to stand for an equality constraint.
    • NB: ‘~’ used to be built-in syntax but now is a regular type operator
          exported from Data.Type.Equality and Prelude.
      If you are using a custom Prelude, consider re-exporting it.
    • This will become an error in a future GHC release.
    |
264 |   default itraverse :: (i ~ Int, Applicative f) => (i -> a -> f b) -> t a -> f (t b)
    |            

expose Indexing newtype?

makes it easier to write a itraverse where the indexing type isnt an Int :)

alternatively expose the default

but parametrized over starting value and increment? (so i can plug in different types)

Support GHC 9.2

A base bump to allow 4.16 should be sufficient, at least this succeeds:

cabal install -w ghc-9.2.0 indexed-traversable --allow-newer=indexed-traversable:base

Build fails with ghc 9.0.2

Failed to build indexed-traversable-instances-0.1.1.1.
Build log (
/home/phil/.cabal/logs/ghc-9.0.2/indexed-traversable-instances-0.1.1.1-6405bb3a8c098e0325d7b52aaa3ac3275de7fa82b741b994e2e754541d89f270.log
):
Configuring library for indexed-traversable-instances-0.1.1.1..
Preprocessing library for indexed-traversable-instances-0.1.1.1..
Building library for indexed-traversable-instances-0.1.1.1..
[1 of 1] Compiling Data.Functor.WithIndex.Instances ( src/Data/Functor/WithIndex/Instances.hs, dist/build/Data/Functor/WithIndex/Instances.o, dist/build/Data/Functor/WithIndex/Instances.dyn_o )
ghc: panic! (the 'impossible' happened)
  (GHC version 9.0.2:
	Ix{Int}.index: Index (4107780713) out of range ((0,83))

Please report this as a GHC bug:  https://www.haskell.org/ghc/reportabug

cabal: Failed to build indexed-traversable-instances-0.1.1.1 (which is

I appreciate that 9.0.2 is a year out of date, but it’s the current ghc release on Debian testing / unstable. Should I report it as a ghc bug as requested, or is 9.0.2 not going to get any more patches at this point? If so I will prod the Debian ghc maintainers...

cheers, Phil

instances for other Integral indexes?

We have some Word64-indexed types, and having to scatter fromIntegral all over to compensate outweighs the convenience of using like ifor_ f xs over for_ f (xs `zip` [0..]) in a smaller number spots.

WDYT about replacing instance FunctorWithIndex Int [] with instance Integral i => FunctorWithIndex i [], and so on?

Noncanonical mappend

These warnings should be fixed at some point:

Building library for indexed-traversable-0.1.2..
...
[2 of 5] Compiling WithIndex        ( src/WithIndex.hs, dist/build/WithIndex.o, dist/build/WithIndex.dyn_o )

src/WithIndex.hs:673:3: warning: [-Wnoncanonical-monoid-instances]
    Noncanonical ‘mappend’ definition detected
    in the instance declaration for ‘Monoid (Traversed a f)’.
    ‘mappend’ will eventually be removed in favour of ‘(<>)’
    Either remove definition for ‘mappend’ (recommended) or define as ‘mappend = (<>)’
    See also: https://gitlab.haskell.org/ghc/ghc/-/wikis/proposal/semigroup-monoid
    |
673 |   Traversed ma `mappend` Traversed mb = Traversed (ma *> mb)
    |   ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

src/WithIndex.hs:694:3: warning: [-Wnoncanonical-monoid-instances]
    Noncanonical ‘mappend’ definition detected
    in the instance declaration for ‘Monoid (Sequenced a m)’.
    ‘mappend’ will eventually be removed in favour of ‘(<>)’
    Either remove definition for ‘mappend’ (recommended) or define as ‘mappend = (<>)’
    See also: https://gitlab.haskell.org/ghc/ghc/-/wikis/proposal/semigroup-monoid
    |
694 |   Sequenced ma `mappend` Sequenced mb = Sequenced (ma >> mb)
    |   ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

Please revise base bound to support GHC 9.10

This works fine, so I guess the upper bound on base should be bumped to base < 4.21:

cabal repl -z -b indexed-traversable==0.1.3 --allow-newer=indexed-traversable:base -w ~/ghc-9.10/bin/ghc-9.10.1

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.