[Haskell] Pattern Matching with rank-2 types

Simon Peyton-Jones simonpj at microsoft.com
Mon Jan 23 06:43:20 EST 2006


Well spotted!

Yes, I changed this some time ago.  Handling polymorphic subsumption
when matching patterns just turned to be a lot of hassle, with little
obvious payoff.  Types in patterns must now match exactly.

I could conceivably back-pedal on this, but you are the first person to
even notice the change (or at least to comment on it).

Simon

| -----Original Message-----
| From: haskell-bounces at haskell.org [mailto:haskell-bounces at haskell.org]
On Behalf Of Bruno Oliveira
| Sent: 21 January 2006 18:44
| To: Haskell Mailing List
| Subject: [Haskell] Pattern Matching with rank-2 types
| 
| Hello,
| 
| The following function is a valid function in ghc6.2.2:
| 
| > func :: (forall a . [a]) -> [b]
| > func [] = []
| 
| However, in ghc6.4.1 it does not work anymore:
| 
| Iterators4.lhs:56:6:
|     Couldn't match `forall a. [a]' against `[a]'
|     When checking the pattern: []
|     In the definition of `func': func [] = []
| 
| Is this supposed to happen?
| 
| Cheers,
| 
| Bruno
| 
| 
| _______________________________________________
| Haskell mailing list
| Haskell at haskell.org
| http://www.haskell.org/mailman/listinfo/haskell


More information about the Haskell mailing list