[GHC] #9664: Add identity functor to base

#9664: Add identity functor to base -------------------------------------+------------------------------------- Reporter: hvr | Owner: ekmett Type: task | Status: new Priority: normal | Milestone: 7.10.1 Component: Core Libraries | Version: Keywords: | Operating System: Architecture: Unknown/Multiple | Unknown/Multiple Difficulty: Easy (less than 1 | Type of failure: hour) | None/Unknown Blocked By: | Test Case: Related Tickets: | Blocking: | Differential Revisions: -------------------------------------+------------------------------------- `base` already provides a `Const`ant functor, but the even more useful `Id`entity (or `Identity`) functor does not exist in `base` yet. This was already [https://groups.google.com/forum/#!msg/haskell-core- libraries/_nReDCbROew/Mdmf0zIloysJ proposed to the CLC back in early 2013], and already missed inclusion in GHC 7.8 However, in order to implement this, coordination with `transformers` is desirable, as `transformers` currently provides a non-transforming `Data.Functor.Identity`, and we'd like to avoid name clashes. -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/9664 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler

#9664: Add identity functor to base -------------------------------------+------------------------------------- Reporter: hvr | Owner: ekmett Type: task | Status: new Priority: normal | Milestone: 7.10.1 Component: Core | Version: Libraries | Keywords: Resolution: | Architecture: Unknown/Multiple Operating System: | Difficulty: Easy (less than 1 Unknown/Multiple | hour) Type of failure: | Blocked By: None/Unknown | Related Tickets: Test Case: | Blocking: | Differential Revisions: | -------------------------------------+------------------------------------- Comment (by ross): I suggest doing a major release of transformers at the same time as the next major GHC release, with Data.Functor.Identity removed and added to base. This version would depend on the new version of base to force an upgrade. -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/9664#comment:1 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler

I suggest doing a major release of transformers at the same time as the next major GHC release, with Data.Functor.Identity removed and added to
#9664: Add identity functor to base -------------------------------------+------------------------------------- Reporter: hvr | Owner: ekmett Type: task | Status: new Priority: normal | Milestone: 7.10.1 Component: Core | Version: Libraries | Keywords: Resolution: | Architecture: Unknown/Multiple Operating System: | Difficulty: Easy (less than 1 Unknown/Multiple | hour) Type of failure: | Blocked By: None/Unknown | Related Tickets: Test Case: | Blocking: | Differential Revisions: | -------------------------------------+------------------------------------- Comment (by hvr): Replying to [comment:1 ross]: base. This version would depend on the new version of base to force an upgrade. Terrific! I'll draft a `transformers`-patch in our locally forked repo over at http://git.haskell.org/packages/transformers.git and migrate `Data.Functor.Identity` into GHC HEAD's `base` so we can start using that in GHC HEAD. -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/9664#comment:2 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler

#9664: Add identity functor to base -------------------------------------+------------------------------------- Reporter: hvr | Owner: ekmett Type: task | Status: patch Priority: normal | Milestone: 7.10.1 Component: Core | Version: Libraries | Keywords: Resolution: | Architecture: Unknown/Multiple Operating System: | Difficulty: Easy (less than 1 Unknown/Multiple | hour) Type of failure: | Blocked By: None/Unknown | Related Tickets: Test Case: | Blocking: | Differential Revisions: Phab:D313 | -------------------------------------+------------------------------------- Changes (by hvr): * status: new => patch * differential: => Phab:D313 Comment: @ross: please take a look at http://git.haskell.org/packages/transformers.git/commitdiff/refs/heads/wip/T... ... does that look ok to you? I had to conditionally expose the `Data.Functor.Identity` module, as otherwise it gets more complicated to tweak GHC's build-system to cope with a `transformers` that would only work with GHC>=7.9 & base>=4.8, as the in-tree `transformers` packages needs to be compiled multiple times, once with the bootstrapping compiler (which is either GHC 7.6 or GHC 7.8 for GHC HEAD), and later-on on with GHC HEAD. -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/9664#comment:3 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler

#9664: Add identity functor to base -------------------------------------+------------------------------------- Reporter: hvr | Owner: ekmett Type: task | Status: patch Priority: normal | Milestone: 7.10.1 Component: Core | Version: Libraries | Keywords: Resolution: | Architecture: Unknown/Multiple Operating System: | Difficulty: Easy (less than 1 Unknown/Multiple | hour) Type of failure: | Blocked By: None/Unknown | Related Tickets: Test Case: | Blocking: | Differential Revisions: Phab:D313 | -------------------------------------+------------------------------------- Changes (by hvr): * cc: core-libraries-committee@… (added) Comment: @ross, any comments? -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/9664#comment:4 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler

#9664: Add identity functor to base -------------------------------------+------------------------------------- Reporter: hvr | Owner: ekmett Type: task | Status: patch Priority: normal | Milestone: 7.10.1 Component: Core | Version: Libraries | Keywords: Resolution: | Architecture: Unknown/Multiple Operating System: | Difficulty: Easy (less than 1 Unknown/Multiple | hour) Type of failure: | Blocked By: None/Unknown | Related Tickets: Test Case: | Blocking: | Differential Revisions: Phab:D313 | -------------------------------------+------------------------------------- Comment (by ross): Changing to have Data.Functor.Class import Data.Functor.Identity reduces the ifdefs. Ideally I'd like to avoid a release with conditional exports - is there any way to detect a GHC bootstrap build? -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/9664#comment:5 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler

Changing to have Data.Functor.Class import Data.Functor.Identity reduces
#9664: Add identity functor to base -------------------------------------+------------------------------------- Reporter: hvr | Owner: ekmett Type: task | Status: patch Priority: normal | Milestone: 7.10.1 Component: Core | Version: Libraries | Keywords: Resolution: | Architecture: Unknown/Multiple Operating System: | Difficulty: Easy (less than 1 Unknown/Multiple | hour) Type of failure: | Blocked By: None/Unknown | Related Tickets: Test Case: | Blocking: | Differential Revisions: Phab:D313 | -------------------------------------+------------------------------------- Comment (by hvr): Replying to [comment:5 ross]: the ifdefs. Sure, I can easily change that (at the cost of some minor code duplication)
Ideally I'd like to avoid a release with conditional exports - is there any way to detect a GHC bootstrap build?
As for this I'm not sure how that helps here. Assuming we have a way of setting a Cabal flag when we're bootstrapping GHC (i.e. building stage 1), how would this improve the situation of having the `Data.Functor.Identity` module conditionally exposed (which now would be depending on that Cabal flag setting rather than predicating on `impl(ghc>=7.9)`)? -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/9664#comment:6 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler

#9664: Add identity functor to base -------------------------------------+------------------------------------- Reporter: hvr | Owner: ekmett Type: task | Status: patch Priority: normal | Milestone: 7.10.1 Component: Core | Version: Libraries | Keywords: Resolution: | Architecture: Unknown/Multiple Operating System: | Difficulty: Easy (less than 1 Unknown/Multiple | hour) Type of failure: | Blocked By: None/Unknown | Related Tickets: Test Case: | Blocking: | Differential Revisions: Phab:D313 | -------------------------------------+------------------------------------- Comment (by hvr): @ross, any comments to my last comment? -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/9664#comment:7 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler

#9664: Add identity functor to base -------------------------------------+------------------------------------- Reporter: hvr | Owner: ekmett Type: task | Status: patch Priority: normal | Milestone: 7.10.1 Component: Core | Version: Libraries | Keywords: Resolution: | Architecture: Unknown/Multiple Operating System: | Difficulty: Easy (less than 1 Unknown/Multiple | hour) Type of failure: | Blocked By: None/Unknown | Related Tickets: Test Case: | Blocking: | Differential Revisions: Phab:D313 | -------------------------------------+------------------------------------- Comment (by hvr): @ross, I noticed you already reversed the Identity<->Class import-dependency in recent `transformers` commmits I've adapted http://git.haskell.org/packages/transformers.git/commitdiff/refs/heads/wip/T... which is now a rather minimal change to `transformers` (i.e. moving the `Identity.hs` file into a different source folder, and adapting `.cabal`) You write you "like to avoid a release with conditional exports". What problems do you anticipate that could occur by making use of such a conditional (non)export of `Data.Functor.Identity`? Specifically, I used `impl(ghc>=7.9)` instead of Cabal flags in order to avoid any Cabal-related problems I could think of. -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/9664#comment:8 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler

#9664: Add identity functor to base -------------------------------------+------------------------------------- Reporter: hvr | Owner: ekmett Type: task | Status: patch Priority: normal | Milestone: 7.10.1 Component: Core | Version: Libraries | Keywords: Resolution: | Architecture: Unknown/Multiple Operating System: | Difficulty: Easy (less than 1 Unknown/Multiple | hour) Type of failure: | Blocked By: None/Unknown | Related Tickets: Test Case: | Blocking: | Differential Revisions: Phab:D313 | -------------------------------------+------------------------------------- Comment (by ross): I've uploaded a new version of transformers incorporating this patch (and some others). -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/9664#comment:9 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler

#9664: Add identity functor to base
-------------------------------------+-------------------------------------
Reporter: hvr | Owner: ekmett
Type: task | Status: patch
Priority: normal | Milestone: 7.10.1
Component: Core | Version:
Libraries | Keywords:
Resolution: | Architecture: Unknown/Multiple
Operating System: | Difficulty: Easy (less than 1
Unknown/Multiple | hour)
Type of failure: | Blocked By:
None/Unknown | Related Tickets:
Test Case: |
Blocking: |
Differential Revisions: Phab:D313 |
-------------------------------------+-------------------------------------
Comment (by Herbert Valerio Riedel

#9664: Add identity functor to base -------------------------------------+------------------------------------- Reporter: hvr | Owner: ekmett Type: task | Status: closed Priority: normal | Milestone: 7.10.1 Component: Core | Version: Libraries | Keywords: Resolution: fixed | Architecture: Unknown/Multiple Operating System: | Difficulty: Easy (less than 1 Unknown/Multiple | hour) Type of failure: | Blocked By: None/Unknown | Related Tickets: Test Case: | Blocking: | Differential Revisions: Phab:D313 | -------------------------------------+------------------------------------- Changes (by thomie): * status: patch => closed * resolution: => fixed -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/9664#comment:11 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler

#9664: Add identity functor to base
-------------------------------------+-------------------------------------
Reporter: hvr | Owner: ekmett
Type: task | Status: closed
Priority: normal | Milestone: 7.10.1
Component: Core | Version:
Libraries | Keywords:
Resolution: fixed | Architecture: Unknown/Multiple
Operating System: | Difficulty: Easy (less than 1
Unknown/Multiple | hour)
Type of failure: | Blocked By:
None/Unknown | Related Tickets:
Test Case: |
Blocking: |
Differential Revisions: Phab:D313 |
-------------------------------------+-------------------------------------
Comment (by Herbert Valerio Riedel

#9664: Add identity functor to base
-------------------------------------+-------------------------------------
Reporter: hvr | Owner: ekmett
Type: task | Status: closed
Priority: normal | Milestone: 7.10.1
Component: Core Libraries | Version:
Resolution: fixed | Keywords: report-
Operating System: Unknown/Multiple | impact
Type of failure: None/Unknown | Architecture:
Blocked By: | Unknown/Multiple
Related Tickets: | Test Case:
| Blocking:
| Differential Revisions: Phab:D313
-------------------------------------+-------------------------------------
Comment (by Herbert Valerio Riedel
participants (1)
-
GHC