[GHC] #13053: Inferred type for hole is not general enough

GHC ghc-devs at haskell.org
Mon Jan 2 05:47:22 UTC 2017


#13053: Inferred type for hole is not general enough
-------------------------------------+-------------------------------------
           Reporter:  osa1           |             Owner:
               Type:  bug            |            Status:  new
           Priority:  normal         |         Milestone:
          Component:  Compiler       |           Version:  8.1
           Keywords:                 |  Operating System:  Unknown/Multiple
       Architecture:                 |   Type of failure:  None/Unknown
  Unknown/Multiple                   |
          Test Case:                 |        Blocked By:
           Blocking:                 |   Related Tickets:
Differential Rev(s):                 |         Wiki Page:
-------------------------------------+-------------------------------------
 As noted by @deech in #13050, inferred types for holes are sometimes not
 general enough. Example:

 {{{
 Prelude> :set -XNoMonomorphismRestriction -- added this just to make sure
 Prelude> :t _ 1 2

 <interactive>:1:1: error:
     • Found hole: _ :: Integer -> Integer -> t
       Where: ‘t’ is a rigid type variable bound by
                the inferred type of it :: t at <interactive>:1:1
     • In the expression: _
       In the expression: _ 1 2
 }}}

 A more general type would be `(Num a, Num b) => a -> b -> t`.

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


More information about the ghc-tickets mailing list