[GHC] #9085: Inaccessible equations in a closed type family should be a warning, not an error
GHC
ghc-devs at haskell.org
Wed May 7 15:46:31 UTC 2014
#9085: Inaccessible equations in a closed type family should be a warning, not an
error
------------------------------------+-------------------------------------
Reporter: goldfire | Owner: goldfire
Type: bug | Status: new
Priority: normal | Milestone:
Component: Compiler | Version: 7.8.2
Keywords: | Operating System: Unknown/Multiple
Architecture: Unknown/Multiple | Type of failure: None/Unknown
Difficulty: Unknown | Test Case:
Blocked By: | Blocking:
Related Tickets: |
------------------------------------+-------------------------------------
If I say
{{{
foo _ = ()
foo False = ()
}}}
I get
{{{
/Users/rae/temp/Bug.hs:2:1: Warning:
Pattern match(es) are overlapped
In an equation for ‘foo’: foo False = ...
}}}
But, if I say
{{{
{-# LANGUAGE TypeFamilies #-}
type family Foo a where
Foo x = ()
Foo Bool = ()
}}}
I get
{{{
/Users/rae/temp/Bug.hs:5:3:
Inaccessible family instance equation:
Foo Bool = ()
In the equations for closed type family ‘Foo’
In the type family declaration for ‘Foo’
}}}
If this issues a warning at the term level, it probably should do the same
at the type level.
This was my design decision that I'm changing, and I will fix. The warning
will be controlled by the same flag that controls the term-level version.
--
Ticket URL: <http://ghc.haskell.org/trac/ghc/ticket/9085>
GHC <http://www.haskell.org/ghc/>
The Glasgow Haskell Compiler
More information about the ghc-tickets
mailing list