#1913: standalone deriving breaks module hiding
-------------------------+--------------------------------------------------
Reporter: duncan | Owner:
Type: bug | Status: new
Priority: normal | Milestone:
Component: Compiler | Version: 6.8.1
Severity: normal | Keywords:
Difficulty: Unknown | Testcase:
Architecture: Unknown | Os: Unknown
-------------------------+--------------------------------------------------
Foo.hs:
{{{
module Foo ( T, t ) where
data T = T
t = T
}}}
Bar.hs:
{{{
import Foo
deriving instance Eq T
}}}
Then in ghci...
{{{
$ ghci Bar.hs -XStandaloneDeriving
[1 of 2] Compiling Bar ( Bar.hs, interpreted )
[2 of 2] Compiling Main ( Baz.hs, interpreted )
Ok, modules loaded: Bar, Main.
*Main> t == t
True
}}}
There is no way that I could implement that instance Eq T manually in
Bar.hs because Foo exports T abstractly.
I see no reason that standalone deriving should have any magic ability
that manual instance declarations do not have. Indeed it breaks module
abstraction.
--
Ticket URL: <http://hackage.haskell.org/trac/ghc/ticket/1913>
GHC <http://www.haskell.org/ghc/>
The Glasgow Haskell Compiler_______________________________________________
Glasgow-haskell-bugs mailing list
[email protected]
http://www.haskell.org/mailman/listinfo/glasgow-haskell-bugs