[GHC] #10770: Typeable solver has strange effects

#10770: Typeable solver has strange effects -------------------------------------+------------------------------------- Reporter: | Owner: NeilMitchell | Type: bug | Status: new Priority: normal | Milestone: Component: Compiler | Version: 7.10.1 Keywords: | Operating System: Unknown/Multiple Architecture: | Type of failure: None/Unknown Unknown/Multiple | Test Case: | Blocked By: Blocking: | Related Tickets: Differential Revisions: | -------------------------------------+------------------------------------- Given: {{{#!hs import Data.Typeable main = print $ foo $ Just () foo :: Typeable (t a) => t a -> String foo x = let k = show $ typeOf x in k }}} I get: {{{ TypeableInfer.hs:7:24: Could not deduce (Typeable t) arising from a use of `typeOf' from the context (Typeable (t a)) bound by the type signature for foo :: Typeable (t a) => t a -> String at TypeableInfer.hs:6:8-38 In the second argument of `($)', namely `typeOf x' In the expression: show $ typeOf x In an equation for `k': k = show $ typeOf x }}} However, the error goes away with the minor modification of: {{{#!hs foo x = show $ typeOf x }}} -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/10770 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler

#10770: Typeable solver has strange effects -------------------------------------+------------------------------------- Reporter: NeilMitchell | Owner: Type: bug | Status: new Priority: normal | Milestone: Component: Compiler | Version: 7.10.1 Resolution: | Keywords: Operating System: Unknown/Multiple | Architecture: | Unknown/Multiple Type of failure: None/Unknown | Test Case: Blocked By: | Blocking: Related Tickets: | Differential Revisions: -------------------------------------+------------------------------------- Changes (by ekmett): * cc: ekmett (added) -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/10770#comment:1 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler

#10770: Typeable solver has strange effects -------------------------------------+------------------------------------- Reporter: NeilMitchell | Owner: Type: bug | Status: new Priority: normal | Milestone: Component: Compiler (Type | Version: 7.10.1 checker) | Resolution: | Keywords: Operating System: Unknown/Multiple | Architecture: | Unknown/Multiple Type of failure: None/Unknown | Test Case: Blocked By: | Blocking: Related Tickets: | Differential Revisions: -------------------------------------+------------------------------------- Changes (by thomie): * component: Compiler => Compiler (Type checker) Comment: I get the same error with HEAD (ghc-7.11.20150809), and also notice the following: {{{#!haskell {-# LANGUAGE FlexibleContexts #-} module Test where import Data.Typeable f :: (Typeable a, Typeable (Maybe a)) => Maybe a -> TypeRep f x = let k = typeOf x in k }}} shows the warning: {{{ Redundant constraint: Typeable (Maybe a) }}} Whereas the same program, with the last line changed to: {{{#!haskell f x = typeOf x }}} shows {{{ Redundant constraint: Typeable a }}} -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/10770#comment:2 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler

#10770: Typeable solver has strange effects -------------------------------------+------------------------------------- Reporter: NeilMitchell | Owner: Type: bug | Status: new Priority: normal | Milestone: 8.0.1 Component: Compiler (Type | Version: 7.10.1 checker) | Resolution: | Keywords: Operating System: Unknown/Multiple | Architecture: | Unknown/Multiple Type of failure: None/Unknown | Test Case: Blocked By: | Blocking: Related Tickets: | Differential Revisions: -------------------------------------+------------------------------------- Changes (by goldfire): * milestone: => 8.0.1 Comment: I have reason to believe that this will go away with visible type application (#5296). I'll add test cases to be sure. -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/10770#comment:3 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler

#10770: Typeable solver has strange effects
-------------------------------------+-------------------------------------
Reporter: NeilMitchell | Owner:
Type: bug | Status: new
Priority: normal | Milestone: 8.0.1
Component: Compiler (Type | Version: 7.10.1
checker) |
Resolution: | Keywords:
Operating System: Unknown/Multiple | Architecture:
| Unknown/Multiple
Type of failure: None/Unknown | Test Case:
Blocked By: | Blocking:
Related Tickets: | Differential Revisions:
-------------------------------------+-------------------------------------
Comment (by Richard Eisenberg

#10770: Typeable solver has strange effects -------------------------------------+------------------------------------- Reporter: NeilMitchell | Owner: goldfire Type: bug | Status: new Priority: normal | Milestone: 8.0.1 Component: Compiler (Type | Version: 7.10.1 checker) | Resolution: | Keywords: Operating System: Unknown/Multiple | Architecture: | Unknown/Multiple Type of failure: None/Unknown | Test Case: | typecheck/should_compile/T10770{a,b} Blocked By: 5296 | Blocking: Related Tickets: | Differential Revisions: -------------------------------------+------------------------------------- Changes (by goldfire): * owner: => goldfire * testcase: => typecheck/should_compile/T10770{a,b} * blockedby: => 5296 -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/10770#comment:5 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler

#10770: Typeable solver has strange effects -------------------------------------+------------------------------------- Reporter: NeilMitchell | Owner: goldfire Type: bug | Status: new Priority: normal | Milestone: 8.0.1 Component: Compiler (Type | Version: 7.10.1 checker) | Resolution: | Keywords: Operating System: Unknown/Multiple | Architecture: | Unknown/Multiple Type of failure: GHC rejects | Test Case: valid program | typecheck/should_compile/T10770{a,b} Blocked By: 5296 | Blocking: Related Tickets: | Differential Rev(s): Wiki Page: | -------------------------------------+------------------------------------- Changes (by bgamari): * failure: None/Unknown => GHC rejects valid program Comment: Hmm, it seems that type application didn't resolve this. What is the status of this? -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/10770#comment:6 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler

#10770: Typeable solver has strange effects -------------------------------------+------------------------------------- Reporter: NeilMitchell | Owner: bgamari Type: bug | Status: new Priority: normal | Milestone: 8.2.1 Component: Compiler (Type | Version: 7.10.1 checker) | Resolution: | Keywords: Operating System: Unknown/Multiple | Architecture: | Unknown/Multiple Type of failure: GHC rejects | Test Case: valid program | typecheck/should_compile/T10770{a,b} Blocked By: 5296 | Blocking: Related Tickets: | Differential Rev(s): Wiki Page: | -------------------------------------+------------------------------------- Changes (by bgamari): * owner: goldfire => bgamari Comment: Given that I'm working on `Typeable` for 8.2 I'll take ownership of this. -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/10770#comment:8 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler

#10770: Typeable solver has strange effects -------------------------------------+------------------------------------- Reporter: NeilMitchell | Owner: (none) Type: bug | Status: new Priority: normal | Milestone: 8.2.1 Component: Compiler (Type | Version: 7.10.1 checker) | Resolution: | Keywords: Operating System: Unknown/Multiple | Architecture: | Unknown/Multiple Type of failure: GHC rejects | Test Case: valid program | typecheck/should_compile/T10770{a,b} Blocked By: 5296 | Blocking: Related Tickets: | Differential Rev(s): Wiki Page: | -------------------------------------+------------------------------------- Changes (by bgamari): * owner: bgamari => (none) Comment: Well, Typeable is merged and this is still an issue. I don't have time to look at this in the near future so I'll drop it. -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/10770#comment:9 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler

#10770: Typeable solver has strange effects -------------------------------------+------------------------------------- Reporter: NeilMitchell | Owner: (none) Type: bug | Status: new Priority: normal | Milestone: 8.6.1 Component: Compiler (Type | Version: 7.10.1 checker) | Resolution: | Keywords: Typeable Operating System: Unknown/Multiple | Architecture: | Unknown/Multiple Type of failure: GHC rejects | Test Case: valid program | typecheck/should_compile/T10770{a,b} Blocked By: 5296 | Blocking: Related Tickets: | Differential Rev(s): Wiki Page: | -------------------------------------+------------------------------------- Changes (by RyanGlScott): * keywords: => Typeable -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/10770#comment:12 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler
participants (1)
-
GHC