[GHC] #7156: "Pattern match on GADT" error for non-GADT
GHC
cvs-ghc at haskell.org
Fri Aug 17 12:55:50 CEST 2012
#7156: "Pattern match on GADT" error for non-GADT
---------------------------------------------------------------+------------
Reporter: ryani | Owner:
Type: bug | Status: new
Priority: normal | Milestone:
Component: Compiler (Type checker) | Version: 7.0.4
Keywords: GADTs, TypeFamilies, ExistentialQuantification | Os: Unknown/Multiple
Architecture: Unknown/Multiple | Failure: None/Unknown
Difficulty: Unknown | Testcase:
Blockedby: | Blocking:
Related: |
---------------------------------------------------------------+------------
Comment(by ryani):
Interesting workaround I just found...
{{{
{-# LANGUAGE TypeFamilies, ExistentialQuantification #-}
module NonGADT where
class (a ~ ()) => C a
instance C ()
data T a = (C a) => T
f :: T a -> a
f T = ()
}}}
typechecks successfully under GHC7.4.1. It seems to work identically to
GADTs, including inferring the type of {{{ T }}} as {{{ T () }}}.
--
Ticket URL: <http://hackage.haskell.org/trac/ghc/ticket/7156#comment:4>
GHC <http://www.haskell.org/ghc/>
The Glasgow Haskell Compiler
More information about the Glasgow-haskell-bugs
mailing list