[GHC] #10030: packageName for GHC.Generics.Datatype

#10030: packageName for GHC.Generics.Datatype -------------------------------------+------------------------------------- Reporter: phadej | Owner: Type: feature | Status: new request | Milestone: Priority: normal | Version: 7.8.4 Component: | Operating System: Unknown/Multiple libraries/base | Type of failure: None/Unknown Keywords: | Blocked By: Architecture: | Related Tickets: Unknown/Multiple | Test Case: | Blocking: | Differential Revisions: | -------------------------------------+------------------------------------- Seems it's perfectly ok to have the data type of the same name in the same module, but different packages. Yet used in the same module: {{{ {-# LANGUAGE PackageImports #-} {-# LANGUAGE RankNTypes #-} module Data.Foo where import "void" Data.Void as A import Data.Void as B foo :: A.Void -> a foo = absurd bar :: B.Void -> a bar x = x () }}} {{{ {-# LANGUAGE RankNTypes #-} module Data.Void where type Void = forall a b. a -> b }}} https://gist.github.com/phadej/8b628d579ddf6958d937 motivated by: http://stackoverflow.com/questions/28159068/packagename- with-ghc-generics I'd propose to change `Datatype` class to be: {{{ class Datatype d where -- | The name of the datatype (unqualified) datatypeName :: t d (f :: * -> *) a -> [Char] -- | The fully-qualified name of the module where the type is declared moduleName :: t d (f :: * -> *) a -> [Char] -- | The package name of the module where the type is declared packageName :: t d (f :: * -> *) a -> [Char] -- | Marks if the datatype is actually a newtype isNewtype :: t d (f :: * -> *) a -> Bool isNewtype _ = False }}} -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/10030 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler

#10030: packageName for GHC.Generics.Datatype -------------------------------------+------------------------------------- Reporter: phadej | Owner: Type: feature request | Status: new Priority: normal | Milestone: Component: libraries/base | Version: 7.11 Resolution: | Keywords: Operating System: Unknown/Multiple | Architecture: Type of failure: None/Unknown | Unknown/Multiple Blocked By: | Test Case: Related Tickets: | Blocking: | Differential Revisions: -------------------------------------+------------------------------------- Changes (by dreixel): * version: 7.8.4 => 7.11 Comment: Sounds perfectly reasonable and straightforward to me. -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/10030#comment:1 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler

#10030: packageName for GHC.Generics.Datatype -------------------------------------+------------------------------------- Reporter: phadej | Owner: dreixel Type: feature request | Status: new Priority: normal | Milestone: Component: libraries/base | Version: 7.11 Resolution: | Keywords: Operating System: Unknown/Multiple | Architecture: Type of failure: None/Unknown | Unknown/Multiple Blocked By: | Test Case: Related Tickets: | Blocking: | Differential Revisions: -------------------------------------+------------------------------------- Changes (by simonpj): * owner: => dreixel Comment: I don't understand this ticket. Some code is given, but no wrong behaviour is explained. What happens that shouldn't happen? Pedro, Generics is your bailiwick: can you fix? Is it serious? Or just a little glitch? Could you write `unsafeCoerce`? What milestone for fixing? Simon -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/10030#comment:2 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler

#10030: packageName for GHC.Generics.Datatype -------------------------------------+------------------------------------- Reporter: phadej | Owner: dreixel Type: feature request | Status: new Priority: normal | Milestone: Component: libraries/base | Version: 7.11 Resolution: | Keywords: Operating System: Unknown/Multiple | Architecture: Type of failure: None/Unknown | Unknown/Multiple Blocked By: | Test Case: Related Tickets: | Blocking: | Differential Revisions: -------------------------------------+------------------------------------- Comment (by dreixel): It's just about adding more meta-information to the `GHC.Generics.Datatype` class, which currently does not tell you which package the datatype is coming from. It's not a bug, it's a feature request. I can implement it, but it can also be a nice little project for anyone wishing to start working with GHC. -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/10030#comment:3 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler

#10030: packageName for GHC.Generics.Datatype -------------------------------------+------------------------------------- Reporter: phadej | Owner: dreixel Type: feature request | Status: new Priority: normal | Milestone: Component: libraries/base | Version: 7.11 Resolution: | Keywords: Operating System: Unknown/Multiple | Architecture: Type of failure: None/Unknown | Unknown/Multiple Blocked By: | Test Case: Related Tickets: | Blocking: | Differential Revisions: -------------------------------------+------------------------------------- Comment (by phadej): I could take a look on this myself. -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/10030#comment:4 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler

#10030: packageName for GHC.Generics.Datatype -------------------------------------+------------------------------------- Reporter: phadej | Owner: dreixel Type: feature request | Status: patch Priority: normal | Milestone: Component: libraries/base | Version: 7.11 Resolution: | Keywords: Operating System: Unknown/Multiple | Architecture: Type of failure: None/Unknown | Unknown/Multiple Blocked By: | Test Case: Related Tickets: | Blocking: | Differential Revisions: Phab:D631 -------------------------------------+------------------------------------- Changes (by phadej): * status: new => patch * differential: => Phab:D631 -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/10030#comment:5 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler

#10030: packageName for GHC.Generics.Datatype
-------------------------------------+-------------------------------------
Reporter: phadej | Owner: dreixel
Type: feature request | Status: patch
Priority: normal | Milestone:
Component: libraries/base | Version: 7.11
Resolution: | Keywords:
Operating System: Unknown/Multiple | Architecture:
Type of failure: None/Unknown | Unknown/Multiple
Blocked By: | Test Case:
Related Tickets: | Blocking:
| Differential Revisions: Phab:D631
-------------------------------------+-------------------------------------
Comment (by Austin Seipp

#10030: packageName for GHC.Generics.Datatype -------------------------------------+------------------------------------- Reporter: phadej | Owner: dreixel Type: feature request | Status: closed Priority: normal | Milestone: 7.12.1 Component: libraries/base | Version: 7.11 Resolution: fixed | Keywords: Operating System: Unknown/Multiple | Architecture: Type of failure: None/Unknown | Unknown/Multiple Blocked By: | Test Case: Related Tickets: | Blocking: | Differential Revisions: Phab:D631 -------------------------------------+------------------------------------- Changes (by thoughtpolice): * status: patch => closed * resolution: => fixed * milestone: => 7.12.1 Comment: Merged, thanks! -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/10030#comment:7 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler

#10030: packageName for GHC.Generics.Datatype -------------------------------------+------------------------------------- Reporter: phadej | Owner: dreixel Type: feature request | Status: closed Priority: normal | Milestone: 8.0.1 Component: libraries/base | Version: 7.11 Resolution: fixed | Keywords: Generics Operating System: Unknown/Multiple | Architecture: | Unknown/Multiple Type of failure: None/Unknown | Test Case: Blocked By: | Blocking: Related Tickets: | Differential Rev(s): Phab:D631 Wiki Page: | -------------------------------------+------------------------------------- Changes (by RyanGlScott): * keywords: => Generics -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/10030#comment:9 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler
participants (1)
-
GHC