#1145: class instance lost during re-export & packaging
-------------------------+--------------------------------------------------
    Reporter:  conal     |       Owner:         
        Type:  bug       |      Status:  new    
    Priority:  normal    |   Milestone:         
   Component:  Compiler  |     Version:  6.6    
    Severity:  normal    |    Keywords:         
  Difficulty:  Unknown   |    Testcase:         
Architecture:  Unknown   |          Os:  Unknown
-------------------------+--------------------------------------------------
The package [http://hackage.haskell.org/cgi-bin/hackage-
 scripts/package/TV-0.2 TV] defines an instance OFun (in module
 [http://darcs.haskell.org/packages/TV/doc/html/Interface-TV-OFun.html
 Interface.TV.OFun], source
 [http://darcs.haskell.org/packages/TV/doc/html/src/Interface/TV/OFun.hs.html
 here]) for a type class
 [http://darcs.haskell.org/packages/DeepArrow/doc/html/Data-
 FunArr.html#t%3AFunArr| FunArr] in the package [http://hackage.haskell.org
 /cgi-bin/hackage-scripts/package/DeepArrow-0.0.1 DeepArrow].  The module
 [http://darcs.haskell.org/packages/TV/doc/html/Interface-TV.html
 Interface.TV] (source
 [http://darcs.haskell.org/packages/TV/doc/html/src/Interface/TV.hs.html
 here]) re-exports Interface.TV.OFun in its entirety.

 When I compile a test program that imports Interface.TV, under ghc-6.6,
 the OFun instance of !FunArr is not found.  If the test module also says
 "import Interface.TV.OFun()", the instance is found.  I get this behavior
 with ghc, ghc --make, and ghci.

 The test program:
 {{{
 module Bug where

 import Interface.TV.UI

 -- Required to pick up the FunArr instance for OFun.  GHC bug?
 import Interface.TV.OFun()

 reverseT :: TV KIO (String -> String)
 reverseT = tv (oTitle "reverse" defaultOut) reverse

 revTwice :: TV KIO (String -> String)
 revTwice = reverseT ->| reverseT
 }}}

 Test compile:
 {{{
 bash-3.2$ ghc -c Bug.hs
 bash-3.2$
 }}}
 If I comment out the second import line, the problem surfaces:
 {{{
 ghc -c Bug.hs

 Bug.hs:12:11:
     No instance for (FunArr ar (Output KIO))
       arising from use of `->|' at Bug.hs:12:11-31
     Possible fix:
       add an instance declaration for (FunArr ar (Output KIO))
     In the expression: reverseT ->| reverseT
     In the definition of `revTwice': revTwice = reverseT ->| reverseT
 bash-3.2$
 }}}

 More details:
 {{{
 bash-3.2$ uname -a
 CYGWIN_NT-5.1 Compy 1.5.24(0.156/4/2) 2007-01-31 10:57 i686 Cygwin

 bash-3.2$ ghc --version
 The Glorious Glasgow Haskell Compilation System, version 6.6

 bash-3.2$ ghc -v -c Bug.hs
 Glasgow Haskell Compiler, Version 6.6, for Haskell 98, compiled by GHC
 version 6.6
 Using package config file: c:\ghc\ghc-6.6\package.conf
 wired-in package base mapped to base-2.0
 wired-in package rts mapped to rts-1.0
 wired-in package haskell98 mapped to haskell98-1.0
 wired-in package template-haskell mapped to template-haskell-2.0
 Hsc static flags: -static
 Created temporary directory: c:/tmp/ghc3880_0
 *** Checking old interface for main:Bug:
 *** Parser:
 *** Renamer/typechecker:

 Bug.hs:12:11:
     No instance for (FunArr ar (Output KIO))
       arising from use of `->|' at Bug.hs:12:11-31
     Possible fix:
       add an instance declaration for (FunArr ar (Output KIO))
     In the expression: reverseT ->| reverseT
     In the definition of `revTwice': revTwice = reverseT ->| reverseT
 *** Deleting temp files:
 Deleting: c:/tmp/ghc3880_0/ghc3880_0.s
 Warning: deleting non-existent c:/tmp/ghc3880_0/ghc3880_0.s
 *** Deleting temp dirs:
 Deleting: c:/tmp/ghc3880_0
 bash-3.2$
 }}}

-- 
Ticket URL: <http://hackage.haskell.org/trac/ghc/ticket/1145>
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

Reply via email to