[GHC] #8883: FlexibleContexts checking should happen also on inferred signature

GHC ghc-devs at haskell.org
Mon Mar 17 10:52:25 UTC 2014


#8883: FlexibleContexts checking should happen also on inferred signature
-------------------------------------+------------------------------------
        Reporter:  Blaisorblade      |            Owner:  jstolarek
            Type:  bug               |           Status:  new
        Priority:  normal            |        Milestone:
       Component:  Compiler          |          Version:  7.6.3
      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 jstolarek):

 Replying to [comment:1 simonpj]:
 > if someone would like to have a go it would not be hard and I could
 offer guidance.
 I'd like to tackle this one. Guidance will be really appreciated.

 I reduced the test case to this snippet of code:

 {{{
 {-# LANGUAGE TypeFamilies, DeriveFunctor, NoMonomorphismRestriction #-}
 -- , FlexibleContexts
 module T8883 where

 type family PF a :: * -> *

 class Regular a where
   from :: a -> PF a a

 -- But in fact, the construction is just an instance of fold.
 --fold :: (Functor (PF a), Regular a) => (PF a b -> b) -> a -> b
 fold f = f . fmap (fold f) . from
 }}}

 So how should GHC behave for this code? Reject it because
 !FlexibleContexts extension is not enabled?

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


More information about the ghc-tickets mailing list