[GHC] #9636: Function with type error accepted
GHC
ghc-devs at haskell.org
Wed Oct 1 16:29:15 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):
To me saying that `T Bool` is OK because it's inaccessible is akin to
saying that type incorrect expressions are OK as long as they are
inaccessible. After all, if you don't use them, they can't cause any
harm. But for expressions we have decided that this isn't acceptable.
I guess making `T a` behave would require something like kind classes. We
don't say that the expression `show x` is unconditionally type correct.
It depends on the type of `x` belonging to the `Show` class. In the same
way, `T a` is not unconditionally type correct, it's only type correct if
`a` is one of the types where `T` is well defined. Until we have
something like that I think you'll have to accept that the substitution
lemma doesn't work. You can pretend it works by saying `T Bool` is a
type, if that makes you happier. I just wonder which type it is. :)
But I'm not asking for the moon. :) I'd just like the compiler to tell
me when it finds something that is clearly not going to work, like `T
Bool`. Exactly under what conditions and how it tells me, I don't care.
--
Ticket URL: <http://ghc.haskell.org/trac/ghc/ticket/9636#comment:12>
GHC <http://www.haskell.org/ghc/>
The Glasgow Haskell Compiler
More information about the ghc-tickets
mailing list