[GHC] #15355: Functional dependencies can get GHC to print "UnkSkol"

GHC ghc-devs at haskell.org
Sun Jul 8 22:48:45 UTC 2018


#15355: Functional dependencies can get GHC to print "UnkSkol"
-------------------------------------+-------------------------------------
           Reporter:  goldfire       |             Owner:  (none)
               Type:  bug            |            Status:  new
           Priority:  normal         |         Milestone:  8.6.1
          Component:  Compiler       |           Version:  8.4.3
           Keywords:                 |  Operating System:  Unknown/Multiple
  FunctionalDependencies             |
       Architecture:                 |   Type of failure:  None/Unknown
  Unknown/Multiple                   |
          Test Case:                 |        Blocked By:
           Blocking:                 |   Related Tickets:
Differential Rev(s):                 |         Wiki Page:
-------------------------------------+-------------------------------------
 When I say

 {{{#!hs
 class C a b | a -> b where
   foo :: a -> b

 instance C Int Bool where
   foo = (>0)

 blah :: C Int Double => Int -> _a
 blah = foo
 }}}

 I get

 {{{
     • Couldn't match type ‘Double’ with ‘Bool’
         arising from a functional dependency between constraints:
           ‘C Int Bool’ arising from a use of ‘foo’ at Scratch.hs:51:8-10
           ‘C Int Double’ arising from UnkSkol at Scratch.hs:51:1-10
     • In the expression: foo
       In an equation for ‘blah’: blah = foo
 }}}

 There are actually two problems:

 1. If we replace `_a` with `Double`, GHC accepts the program. I'm not sure
 it should. But that's a larger problem than...

 2. ... when it prints the error, it says `UnkSkol`. It probably shouldn't.

 This ticket is about the second problem, because the first one require
 more fundep love than is usually on offer around here.

 Erroring here is reasonable enoug

-- 
Ticket URL: <http://ghc.haskell.org/trac/ghc/ticket/15355>
GHC <http://www.haskell.org/ghc/>
The Glasgow Haskell Compiler


More information about the ghc-tickets mailing list