[GHC] #9211: Untouchable type variable (regression from 7.6)

GHC ghc-devs at haskell.org
Tue Jun 17 14:38:59 UTC 2014


#9211: Untouchable type variable (regression from 7.6)
-------------------------------------+------------------------------------
        Reporter:  simonpj           |            Owner:
            Type:  bug               |           Status:  new
        Priority:  normal            |        Milestone:
       Component:  Compiler          |          Version:  7.8.2
      Resolution:                    |         Keywords:
Operating System:  Unknown/Multiple  |     Architecture:  Unknown/Multiple
 Type of failure:  None/Unknown      |       Difficulty:  Unknown
       Test Case:                    |       Blocked By:
        Blocking:                    |  Related Tickets:
-------------------------------------+------------------------------------

Comment (by oleg):

 My real examples are not that different from the one I posted. Here is one
 of the recent ones:

 {{{
 unsafeLam :: (Applicative m, AppPermutable i, SSym repr, LamPure repr) =>
        (forall j. (j ~ (->) (repr a))) =>
         (i :. j) (repr a) -> (m :. (i :. j)) (repr b))
        -> (m :. i) (repr (a->b))

 }}}

 As you can see, I use the type equality constraint to give an abbreviation
 to a complex type that appears several times in a complex expression. In
 the
 above example, 'j' is used as an abbreviation for '(->) (repr a)' that
 occurs twice in a large type. OCaml has the convenient notation
 'type as x -> x -> x' to give an abbreviation to a type. I was happy that
 I found something similar in Haskell. Alas, as this ticket shows,
 sometimes
 it doesn't work. I have fixed my problem by getting rid of the
 abbreviation.
 (Giving the local type annotation in the real case proved to be too messy.
 The compiler kept complaining and needing more and more annotations.)

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


More information about the ghc-tickets mailing list