- Identity and Const now have Num, Real, Integral, Fractional, Floating, RealFrac and RealFloat instances
- Identity and Const now have Bits and FiniteBits instances
- Identity and Const now have IsString instances
Details
- Reviewers
RyanGlScott hvr austin ekmett bgamari - Commits
- rGHC7b8beba76a31: Added (more) missing instances for Identity and Const
rGHC8b57cac5974c: Added (more) missing instances for Identity and Const
rGHCDIFF7b8beba76a31: Added (more) missing instances for Identity and Const
rGHCDIFF8b57cac5974c: Added (more) missing instances for Identity and Const - Trac Issues
- #11790
Diff Detail
- Repository
- rGHC Glasgow Haskell Compiler
- Branch
- master
- Lint
Lint OK - Unit
No Unit Test Coverage - Build Status
Buildable 9039 Build 11084: arc lint + arc unit
Fixed previous diff where I accidentally enabled DeriveDataTypeable unnecessarily in Data.Functor.Const
Is there a Trac ticket for this? I personally don't have any objection to adding these instances, but given that this changes base's API (albeit very slightly), it might be best to have a Trac page for it (if nothing else, to notify the CLC).
In any case, there's some other things that need to be addressed:
libraries/base/Data/String.hs | ||
---|---|---|
83 | Where is the IsString instance for Identity you claimed to add? | |
libraries/base/changelog.md | ||
144 | Is there a reason that this is chunked into three different parts? There are quite a few lines beginning with the phrase "Identity and Const now have"... I think it would be best to lump them together to make it clear they were all added in one go. |
libraries/base/changelog.md | ||
---|---|---|
144 | it's also not clear if this has any chance to make it into base-4.9 being so late... |
libraries/base/Data/String.hs | ||
---|---|---|
83 | It's in Data.Functor.Identity, in the deriving section. I would have done the same for Const, but I can't import Data.String from Data.Functor.Const, because Control.Applicative imports Const to re-export it, and Data.String transitively depends on Control.Applicative. | |
libraries/base/changelog.md | ||
144 | There's not really any real reason, I just it was better to group the Num hierarchy and the "Bits hierachy" classes in their own groupings. I can change this so that they're all on one line if you want. | |
144 | That's okay. Should I start a new section 4.10 though? I wasn't sure what the best thing to do would be. |
No objections from my side, although Edward has a better grasp of possible consequences and the general design.