[GHC] #9069: -XDeriveTraversable should imply -XDeriveFunctor and -XDeriveFoldable

#9069: -XDeriveTraversable should imply -XDeriveFunctor and -XDeriveFoldable ------------------------------------+------------------------------------- Reporter: sjoerd_visscher | Owner: Type: feature request | Status: new Priority: normal | Milestone: Component: Compiler | Version: 7.8.2 Keywords: | Operating System: Unknown/Multiple Architecture: Unknown/Multiple | Type of failure: None/Unknown Difficulty: Unknown | Test Case: Blocked By: | Blocking: Related Tickets: | ------------------------------------+------------------------------------- In the discussion in #2953 it was concluded that it would be best to have separate flags for deriving Functor, Foldable and Traversable. I agree with that conclusion, but it seems that it wasn't considered to have -XDeriveTraversable imply -XDeriveFunctor and -XDeriveFoldable. I can't think of a reason not to want that. -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/9069 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler

#9069: -XDeriveTraversable should imply -XDeriveFunctor and -XDeriveFoldable -------------------------------------+------------------------------------ Reporter: sjoerd_visscher | Owner: Type: feature request | Status: new Priority: normal | Milestone: Component: Compiler | Version: 7.8.2 Resolution: | Keywords: Operating System: Unknown/Multiple | Architecture: Unknown/Multiple Type of failure: None/Unknown | Difficulty: Unknown Test Case: | Blocked By: Blocking: | Related Tickets: -------------------------------------+------------------------------------ Comment (by sjoerd_visscher): I.e. add this to the `impliedFlags` list: {{{ , (Opt_DeriveTraversable, turnOn, Opt_DeriveFunctor) , (Opt_DeriveTraversable, turnOn, Opt_DeriveFoldable) }}} -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/9069#comment:1 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler

#9069: -XDeriveTraversable should imply -XDeriveFunctor and -XDeriveFoldable -------------------------------------+------------------------------------ Reporter: sjoerd_visscher | Owner: Type: feature request | Status: patch Priority: normal | Milestone: Component: Compiler | Version: 7.8.2 Resolution: | Keywords: Operating System: Unknown/Multiple | Architecture: Unknown/Multiple Type of failure: None/Unknown | Difficulty: Unknown Test Case: | Blocked By: Blocking: | Related Tickets: -------------------------------------+------------------------------------ Changes (by sjoerd_visscher): * status: new => patch -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/9069#comment:2 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler

#9069: -XDeriveTraversable should imply -XDeriveFunctor and -XDeriveFoldable -------------------------------------+------------------------------------ Reporter: sjoerd_visscher | Owner: Type: feature request | Status: patch Priority: normal | Milestone: Component: Compiler | Version: 7.8.2 Resolution: | Keywords: Operating System: Unknown/Multiple | Architecture: Unknown/Multiple Type of failure: None/Unknown | Difficulty: Unknown Test Case: | Blocked By: Blocking: | Related Tickets: -------------------------------------+------------------------------------ Comment (by sjoerd_visscher): Note: this is my first GHC patch! -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/9069#comment:3 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler

#9069: -XDeriveTraversable should imply -XDeriveFunctor and -XDeriveFoldable -------------------------------------+------------------------------------ Reporter: sjoerd_visscher | Owner: Type: feature request | Status: patch Priority: normal | Milestone: Component: Compiler | Version: 7.8.2 Resolution: | Keywords: Operating System: Unknown/Multiple | Architecture: Unknown/Multiple Type of failure: None/Unknown | Difficulty: Unknown Test Case: | Blocked By: Blocking: | Related Tickets: -------------------------------------+------------------------------------ Comment (by simonpj): Ah -- but you forgot to update the user manual! Also can you just articulate the reasoning behind having `-XDeriveTraversable` imply the other two, and perhaps summarise that reasoning in the user-manual entry? Thanks Simon -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/9069#comment:4 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler

#9069: -XDeriveTraversable should imply -XDeriveFunctor and -XDeriveFoldable -------------------------------------+------------------------------------ Reporter: sjoerd_visscher | Owner: Type: feature request | Status: patch Priority: normal | Milestone: Component: Compiler | Version: 7.8.2 Resolution: | Keywords: Operating System: Unknown/Multiple | Architecture: Unknown/Multiple Type of failure: None/Unknown | Difficulty: Unknown Test Case: | Blocked By: Blocking: | Related Tickets: -------------------------------------+------------------------------------ Comment (by sjoerd_visscher): Right, thanks, I will do that! The main reason is that currently you have to quite a bit to just get a derived `Traversable` instance: 1. You have to add `deriving (Functor, Foldable, Traversable)` 2. You have to import `Data.Foldable` and `Data.Traversable` 3. You have to turn on 3 extensions. Item 1 is fine, we don't want any magic. Item 2 could be solved by moving `Foldable` and `Traversable` to the prelude. So the only thing that I can do right now is improve item 3. If you derive the `Traversable` instance it would be invalid to have an instance for `Functor` or `Foldable` that is not equiavalent to the derived instances, so it makes sense to turn those extensions on automatically. -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/9069#comment:5 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler

#9069: -XDeriveTraversable should imply -XDeriveFunctor and -XDeriveFoldable -------------------------------------+------------------------------------ Reporter: sjoerd_visscher | Owner: Type: feature request | Status: patch Priority: normal | Milestone: Component: Compiler | Version: 7.8.2 Resolution: | Keywords: Operating System: Unknown/Multiple | Architecture: Unknown/Multiple Type of failure: None/Unknown | Difficulty: Unknown Test Case: | Blocked By: Blocking: | Related Tickets: -------------------------------------+------------------------------------ Comment (by sjoerd_visscher): That second patch replaces the first. (I forgot to check the checkmark, and there seems to be no way to fix it afterwards.) -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/9069#comment:6 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler

#9069: -XDeriveTraversable should imply -XDeriveFunctor and -XDeriveFoldable -------------------------------------+------------------------------------ Reporter: sjoerd_visscher | Owner: Type: feature request | Status: patch Priority: normal | Milestone: Component: Compiler | Version: 7.8.2 Resolution: | Keywords: Operating System: Unknown/Multiple | Architecture: Unknown/Multiple Type of failure: None/Unknown | Difficulty: Unknown Test Case: | Blocked By: Blocking: | Related Tickets: -------------------------------------+------------------------------------ Comment (by sjoerd_visscher): By the way, how can I test the documentation? -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/9069#comment:7 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler

#9069: -XDeriveTraversable should imply -XDeriveFunctor and -XDeriveFoldable -------------------------------------+------------------------------------ Reporter: sjoerd_visscher | Owner: Type: feature request | Status: patch Priority: normal | Milestone: Component: Compiler | Version: 7.8.2 Resolution: | Keywords: Operating System: Unknown/Multiple | Architecture: Unknown/Multiple Type of failure: None/Unknown | Difficulty: Unknown Test Case: | Blocked By: Blocking: | Related Tickets: -------------------------------------+------------------------------------ Comment (by simonpj): OK, thanks. You missed the flag reference summary list [http://www.haskell.org/ghc/docs/latest/html/users_guide/flag- reference.html Section 4.20.12], where flag implications should be summarised. But that's not surprising since `DeriveTraversable` and friends aren't even listed there. Could you do us a favour? * Add the `Derive`X extensions to that table * Put the whole table in alphabetical order of extension name * Check that there are no more missing one * Check that all implications are listed. That would be a very useful service. It could be a separate patch. Meanwhile, Austin, please commit. Simon -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/9069#comment:8 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler

#9069: -XDeriveTraversable should imply -XDeriveFunctor and -XDeriveFoldable -------------------------------------+------------------------------------ Reporter: sjoerd_visscher | Owner: Type: feature request | Status: patch Priority: normal | Milestone: Component: Compiler | Version: 7.8.2 Resolution: | Keywords: Operating System: Unknown/Multiple | Architecture: Unknown/Multiple Type of failure: None/Unknown | Difficulty: Unknown Test Case: | Blocked By: Blocking: | Related Tickets: -------------------------------------+------------------------------------ Comment (by sjoerd_visscher): It might be a good idea to not to wait too long to merge the documentation patch in. Because the whole language options table is reordered any change to it will create a merge conflict. -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/9069#comment:9 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler

#9069: -XDeriveTraversable should imply -XDeriveFunctor and -XDeriveFoldable -------------------------------------+------------------------------------ Reporter: sjoerd_visscher | Owner: Type: feature request | Status: patch Priority: normal | Milestone: Component: Compiler | Version: 7.8.2 Resolution: | Keywords: Operating System: Unknown/Multiple | Architecture: Unknown/Multiple Type of failure: None/Unknown | Difficulty: Unknown Test Case: | Blocked By: Blocking: | Related Tickets: -------------------------------------+------------------------------------ Comment (by simonpj): Would someone at ZuriHac like to do this? -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/9069#comment:10 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler

#9069: -XDeriveTraversable should imply -XDeriveFunctor and -XDeriveFoldable -------------------------------------+------------------------------------ Reporter: sjoerd_visscher | Owner: Type: feature request | Status: patch Priority: normal | Milestone: Component: Compiler | Version: 7.8.2 Resolution: | Keywords: Operating System: Unknown/Multiple | Architecture: Unknown/Multiple Type of failure: None/Unknown | Difficulty: Unknown Test Case: | Blocked By: Blocking: | Related Tickets: -------------------------------------+------------------------------------ Comment (by nomeata): Will have a look. -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/9069#comment:11 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler

#9069: -XDeriveTraversable should imply -XDeriveFunctor and -XDeriveFoldable
-------------------------------------+------------------------------------
Reporter: sjoerd_visscher | Owner:
Type: feature request | Status: patch
Priority: normal | Milestone:
Component: Compiler | Version: 7.8.2
Resolution: | Keywords:
Operating System: Unknown/Multiple | Architecture: Unknown/Multiple
Type of failure: None/Unknown | Difficulty: Unknown
Test Case: | Blocked By:
Blocking: | Related Tickets:
-------------------------------------+------------------------------------
Comment (by Sjoerd Visscher

#9069: -XDeriveTraversable should imply -XDeriveFunctor and -XDeriveFoldable
-------------------------------------+------------------------------------
Reporter: sjoerd_visscher | Owner:
Type: feature request | Status: patch
Priority: normal | Milestone:
Component: Compiler | Version: 7.8.2
Resolution: | Keywords:
Operating System: Unknown/Multiple | Architecture: Unknown/Multiple
Type of failure: None/Unknown | Difficulty: Unknown
Test Case: | Blocked By:
Blocking: | Related Tickets:
-------------------------------------+------------------------------------
Comment (by Sjoerd Visscher

#9069: -XDeriveTraversable should imply -XDeriveFunctor and -XDeriveFoldable -------------------------------------+------------------------------------ Reporter: sjoerd_visscher | Owner: Type: feature request | Status: closed Priority: normal | Milestone: Component: Compiler | Version: 7.8.2 Resolution: fixed | Keywords: Operating System: Unknown/Multiple | Architecture: Unknown/Multiple Type of failure: None/Unknown | Difficulty: Unknown Test Case: | Blocked By: Blocking: | Related Tickets: -------------------------------------+------------------------------------ Changes (by nomeata): * status: patch => closed * resolution: => fixed Comment: Looked fined and validated; pushed. -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/9069#comment:14 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler

#9069: -XDeriveTraversable should imply -XDeriveFunctor and -XDeriveFoldable -------------------------------------+------------------------------------ Reporter: sjoerd_visscher | Owner: Type: feature request | Status: closed Priority: normal | Milestone: 7.10.1 Component: Compiler | Version: 7.8.2 Resolution: fixed | Keywords: Operating System: Unknown/Multiple | Architecture: Unknown/Multiple Type of failure: None/Unknown | Difficulty: Unknown Test Case: | Blocked By: Blocking: | Related Tickets: -------------------------------------+------------------------------------ Changes (by hvr): * milestone: => 7.10.1 -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/9069#comment:15 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler
participants (1)
-
GHC