[GHC] #13509: Perplexing type error

GHC ghc-devs at haskell.org
Sun Apr 2 03:27:18 UTC 2017


#13509: Perplexing type error
-------------------------------------+-------------------------------------
           Reporter:  bgamari        |             Owner:  (none)
               Type:  bug            |            Status:  new
           Priority:  high           |         Milestone:  8.2.1
          Component:  Compiler       |           Version:  8.0.1
           Keywords:                 |  Operating System:  Unknown/Multiple
       Architecture:                 |   Type of failure:  GHC rejects
  Unknown/Multiple                   |  valid program
          Test Case:                 |        Blocked By:
           Blocking:                 |   Related Tickets:
Differential Rev(s):                 |         Wiki Page:
-------------------------------------+-------------------------------------
 The `fast-digits` package fails to build with 8.2.0-rc1,

 {{{
 [1 of 2] Compiling Data.FastDigits.Internal (
 src/Data/FastDigits/Internal.hs, dist/build/Data/FastDigits/Internal.o )

 src/Data/FastDigits/Internal.hs:42:34: error:
     • Couldn't match a lifted type with an unlifted type
       Expected type: Word# -> (# Word#, Word# #)
         Actual type: Word# -> (# Word#, Word# #)
     • In the expression: go pw2
       In a pattern binding: (# n, pw2n #) = go pw2
       In the expression:
         let (# n, pw2n #) = go pw2
         in
           case timesWord2# pw pw2n of
             (# 0##, pw2n1 #) -> (# n `timesWord#` 2## `plusWord#` 1##,
 pw2n1 #)
             _ -> (# n `timesWord#` 2##, pw2n #)
    |
 42 |           -> let (# n, pw2n #) = go pw2 in
    |                                  ^^^^^^

 src/Data/FastDigits/Internal.hs:43:33: error:
     • Couldn't match a lifted type with an unlifted type
       When matching the kind of ‘Word#’
     • In the second argument of ‘timesWord2#’, namely ‘pw2n’
       In the expression: timesWord2# pw pw2n
       In the expression:
         case timesWord2# pw pw2n of
           (# 0##, pw2n1 #) -> (# n `timesWord#` 2## `plusWord#` 1##, pw2n1
 #)
           _ -> (# n `timesWord#` 2##, pw2n #)
    |
 43 |             case timesWord2# pw pw2n of
    |                                 ^^^^

 src/Data/FastDigits/Internal.hs:44:37: error:
     • Couldn't match a lifted type with an unlifted type
       When matching the kind of ‘Word#’
     • In the first argument of ‘timesWord#’, namely ‘n’
       In the first argument of ‘plusWord#’, namely ‘n `timesWord#` 2##’
       In the expression: n `timesWord#` 2## `plusWord#` 1##
    |
 44 |               (# 0##, pw2n1 #) -> (#n `timesWord#` 2## `plusWord#`
 1##, pw2n1 #)
    |                                     ^
 }}}

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


More information about the ghc-tickets mailing list