[GHC] #11125: Typechecker can't infer StM m Bool ~ Bool from StM m a ~ a

GHC ghc-devs at haskell.org
Mon Nov 23 10:23:54 UTC 2015


#11125: Typechecker can't infer StM m Bool ~ Bool from StM m a ~ a
-------------------------------------+-------------------------------------
        Reporter:  nikomi            |                Owner:
            Type:  bug               |               Status:  new
        Priority:  normal            |            Milestone:
       Component:  Compiler (Type    |              Version:  7.10.2
  checker)                           |
      Resolution:                    |             Keywords:
Operating System:  Unknown/Multiple  |         Architecture:
                                     |  Unknown/Multiple
 Type of failure:  None/Unknown      |            Test Case:
      Blocked By:                    |             Blocking:
 Related Tickets:                    |  Differential Rev(s):
       Wiki Page:                    |
-------------------------------------+-------------------------------------

Comment (by nikomi):

 The definitions of the original STM functions could also be useful:
 {{{#!hs
 always :: STM Bool -> STM ()
 alwaysSucceeds :: STM a -> STM ()
 }}}
 In my sample code I can see no relevant difference between {{{always}}}
 and {{{alwaysSucceeds}}} other than the argument type: m Bool vs. m a -
 conforming the argument types of the functions I want to lift: STM Bool
 vs. STM a.

 Yet the function with the generic type {{{a}}} compiles and the one with
 the specific type {{{Bool}}} does not - I have another sample where a
 usage of {{{m ()}}} fails to compile with exactly the same error right
 next to {{{m a}}}s that compile file (in those cases the base monad is IO,
 not STM)

 So from my limited point of view (with no insight into the TC) the
 difference is generic vs. specific.

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


More information about the ghc-tickets mailing list