[GHC] #10139: Coercible causes ghc to hang

#10139: Coercible causes ghc to hang -------------------------------------+------------------------------------- Reporter: | Owner: nitromaster101 | Status: new Type: bug | Milestone: Priority: normal | Version: 7.10.1-rc2 Component: Compiler | Operating System: Unknown/Multiple Keywords: | Type of failure: None/Unknown Architecture: | Blocked By: Unknown/Multiple | Related Tickets: Test Case: | Blocking: | Differential Revisions: | -------------------------------------+------------------------------------- Consider my two instance declarations. The second one will hang ghc. If I change (coerce) to (coerce :: Normal a -> Sized a) it compiles fine. The first declaration also works fine. {{{ {-# LANGUAGE TypeFamilies, FlexibleInstances #-} import qualified Data.FingerTree as FT import GHC.Exts class DOps a where plus :: a -> D a -> a type family D a :: * type instance D (FT.FingerTree (Size Int, v) (Sized a)) = [Diff (Normal a)] type family Normal a :: * data Diff a = Add Int a newtype Sized a = Sized a newtype Size a = Size a -- This works: instance (FT.Measured (Size Int, v) (Sized a), Coercible (Normal a) (Sized a)) => DOps (FT.FingerTree (Size Int, v) (Sized a)) where plus = foldr (\(Add index val) seq -> FT.singleton ((coerce) val)) -- This hangs: instance (FT.Measured (Size Int, v) (Sized a), Coercible (Normal a) (Sized a)) => DOps (FT.FingerTree (Size Int, v) (Sized a)) where plus = foldr (flip f) where f seq x = case x of Add index val -> FT.singleton ((coerce) val) }}} {{{ $ ~/downloads/ghc-7.10.0.20150123/out/bin/ghci --version The Glorious Glasgow Haskell Compilation System, version 7.10.0.20150123 }}} -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/10139 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler

#10139: Coercible causes ghc to hang -------------------------------------+------------------------------------- Reporter: nitromaster101 | Owner: Type: bug | Status: new Priority: normal | Milestone: Component: Compiler | Version: 7.10.1-rc2 Resolution: | Keywords: Operating System: Unknown/Multiple | Architecture: Type of failure: None/Unknown | Unknown/Multiple Blocked By: | Test Case: Related Tickets: | Blocking: | Differential Revisions: -------------------------------------+------------------------------------- Comment (by goldfire): This is presumably related to #10079 and #7788. Fix is forthcoming in the next few days. Thanks for reporting! -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/10139#comment:1 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler

#10139: Coercible causes ghc to hang
-------------------------------------+-------------------------------------
Reporter: nitromaster101 | Owner:
Type: bug | Status: new
Priority: normal | Milestone:
Component: Compiler | Version: 7.10.1-rc2
Resolution: | Keywords:
Operating System: Unknown/Multiple | Architecture:
Type of failure: None/Unknown | Unknown/Multiple
Blocked By: | Test Case:
Related Tickets: | Blocking:
| Differential Revisions:
-------------------------------------+-------------------------------------
Comment (by Richard Eisenberg

#10139: Coercible causes ghc to hang -------------------------------------+------------------------------------- Reporter: nitromaster101 | Owner: Type: bug | Status: closed Priority: normal | Milestone: Component: Compiler | Version: 7.10.1-rc2 Resolution: fixed | Keywords: Operating System: Unknown/Multiple | Architecture: Type of failure: None/Unknown | Unknown/Multiple Blocked By: | Test Case: indexed- Related Tickets: | types/should_compile/T10139 | Blocking: | Differential Revisions: -------------------------------------+------------------------------------- Changes (by goldfire): * status: new => closed * testcase: => indexed-types/should_compile/T10139 * resolution: => fixed -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/10139#comment:3 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler
participants (1)
-
GHC