[GHC] #9624: "Unlikely constraint" recognition

GHC ghc-devs at haskell.org
Mon Sep 22 02:31:58 UTC 2014


#9624: "Unlikely constraint" recognition
-------------------------------------+-------------------------------------
       Reporter:  dfeuer             |                   Owner:
           Type:  feature request    |                  Status:  new
       Priority:  normal             |               Milestone:
      Component:  Compiler (Type     |                 Version:  7.8.3
  checker)                           |        Operating System:
       Keywords:                     |  Unknown/Multiple
   Architecture:  Unknown/Multiple   |         Type of failure:
     Difficulty:  Unknown            |  None/Unknown
     Blocked By:                     |               Test Case:
Related Tickets:                     |                Blocking:
                                     |  Differential Revisions:
-------------------------------------+-------------------------------------
 Some constraints or combinations are relatively unlikely to appear in
 correct code, or at least correct code written by beginners. A few tiny
 examples:

 {{{#!hs
 (Integral a, Fractional a) =>  -- Possible, but rare, in correct code.
 (Integral a, RealFloat a) =>   -- Rather less possible in correct code.
 (Num a, Foldable a) =>  -- Possible, but unlikely for a beginner.
 (Fractional [a]) =>
 (Show (A -> B)) =>
 }}}

 The current error messages when constraints like these are not satisfied
 does nothing to suggest that they are unlikely to be correct or to explain
 to a beginner what kinds of mistakes can lead to errors like this. I
 imagine some people who teach classes using Haskell will have an idea of
 which specific things are worth singling out for a special explanation.

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


More information about the ghc-tickets mailing list