[GHC] #8411: TypeSynonymInstances with partial type

#8411: TypeSynonymInstances with partial type ----------------------------+---------------------------------------------- Reporter: wvv | Owner: Type: bug | Status: new Priority: normal | Milestone: Component: Compiler | Version: 7.6.3 Keywords: | Operating System: Unknown/Multiple Architecture: | Type of failure: GHC rejects valid program Unknown/Multiple | Test Case: Difficulty: Unknown | Blocking: Blocked By: | Related Tickets: | ----------------------------+---------------------------------------------- TypeSynonymInstances allow only full synonyms. With {{{ {-# LANGUAGE TypeSynonymInstances #-} type RTuple b a = (a, b) instance Monad (RTuple b) where ... -- or instance Monad (RTuple b :: * -> *) where ... }}} I got next error: {{{ test.hs:17:22: Type synonym `RevTuple' should have 2 arguments, but has been given 1 In the instance declaration for `Monad (RTuple b :: * -> *)' }}} -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/8411 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler

#8411: TypeSynonymInstances with partial type ----------------------------------------------+---------------------------- Reporter: wvv | Owner: Type: bug | Status: closed Priority: normal | Milestone: Component: Compiler | Version: 7.6.3 Resolution: invalid | Keywords: Operating System: Unknown/Multiple | Architecture: Type of failure: GHC rejects valid program | Unknown/Multiple Test Case: | Difficulty: Unknown Blocking: | Blocked By: | Related Tickets: ----------------------------------------------+---------------------------- Changes (by monoidal): * status: new => closed * resolution: => invalid Comment: Unfortunately, this is by design. Partial application of type synonyms is highly nontrivial; if done, it would require a large upheaval of type inference, and add a lot of complexity. For example, how GHC could know whether given `return :: a -> (a,a)`, is `Monad ((,) a)` or `Monad (RTuple a)` required? The situation gets much more complicated with larger synonyms, and things get ugly. I suggest to ask this question on haskell- cafe or IRC and leave two links found by a google search: #785, http://stackoverflow.com/questions/4922560/. -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/8411#comment:1 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler
participants (1)
-
GHC