[GHC] #9636: Function with type error accepted

GHC ghc-devs at haskell.org
Fri Sep 26 20:17:26 UTC 2014


#9636: Function with type error accepted
-------------------------------------+-------------------------------------
              Reporter:  augustss    |            Owner:
                  Type:  bug         |           Status:  new
              Priority:  normal      |        Milestone:
             Component:  Compiler    |          Version:  7.8.3
            Resolution:              |         Keywords:
      Operating System:              |     Architecture:  Unknown/Multiple
  Unknown/Multiple                   |       Difficulty:  Unknown
       Type of failure:              |       Blocked By:
  None/Unknown                       |  Related Tickets:
             Test Case:              |
              Blocking:              |
Differential Revisions:              |
-------------------------------------+-------------------------------------

Comment (by augustss):

 I don't think a warning is right, I think it's an error.  I view closed
 type families as functions on types, and when you use a function you
 expect it to reduce to a normal form.  With a warning you're saying that T
 x is sometimes equal to some other type and sometimes it's a new type.
 That makes no sense to me.  It has nothing to do with being inhabited,
 uninhabited types are perfectly fine.

 It like saying that if I define a function 'f False = ()' and then do
 'print (f True)' it would print "f True", i.e., elevating the function
 symbol f from a function to a constructor just because it's partial.

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


More information about the ghc-tickets mailing list