[GHC] #10134: Pattern Matching Causes Infinite Type Error

GHC ghc-devs at haskell.org
Tue Mar 3 15:26:18 UTC 2015


#10134: Pattern Matching Causes Infinite Type Error
-------------------------------------+-------------------------------------
              Reporter:  dongen      |             Owner:
                  Type:  bug         |            Status:  new
              Priority:  normal      |         Milestone:
             Component:  Compiler    |           Version:  7.8.4
              Keywords:              |  Operating System:  Unknown/Multiple
          Architecture:              |   Type of failure:  None/Unknown
  Unknown/Multiple                   |        Blocked By:
             Test Case:              |   Related Tickets:
              Blocking:              |
Differential Revisions:              |
-------------------------------------+-------------------------------------
 Howsagoin,

 This is a report about ghci (7.8.4) with CLaSH 0.4.1

 I have a collection of modules that show an odd error. I don't want to
 send them to the list but I can send them to the developers if they think
 the described behaviour is definitely an  error, which I suspect it is.

 When I write:

 >  (a,b) = expression

 I get a type error about an occurs check: cannot construct infinite type:
 t0 ~ (t0 + 1) -1. The error message doesn't mention t0.

 However, when I leave out the pattern matching on the tuple and write

 > var = expression
 > a = fst var
 > b = snd var

 where var is a fresh variable, everything is fine. This is odd, because
 all I did was stripping off the pattern matching.

 To make sure, I also tried

 > var = expression
 > (a,b) = var

 This also gave the same type checking error.

 If there's anybody willing to have a look at this, please feel free to
 contact me by email. If you think I should produce a small example, also
 please let me know, but please note that it already took me several hours
 before I found that leaving out the pattern matching solved the problem:-(

 TIA for your time.

 Marc van Dongen
 dongen at cs.ucc.ie

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


More information about the ghc-tickets mailing list