Re: [GHC] #14046: “Illegal type synonym family application in instance” is too strict in the presence of functional dependencies

GHC ghc-devs at haskell.org
Sun Jul 30 02:21:38 UTC 2017


#14046: “Illegal type synonym family application in instance” is too strict in the
presence of functional dependencies
-------------------------------------+-------------------------------------
        Reporter:  lexi.lambda       |                Owner:  (none)
            Type:  feature request   |               Status:  new
        Priority:  normal            |            Milestone:
       Component:  Compiler          |              Version:  8.0.1
      Resolution:                    |             Keywords:
Operating System:  Unknown/Multiple  |         Architecture:
 Type of failure:  GHC rejects       |  Unknown/Multiple
  valid program                      |            Test Case:
      Blocked By:                    |             Blocking:
 Related Tickets:  #3485             |  Differential Rev(s):
       Wiki Page:                    |
-------------------------------------+-------------------------------------

Comment (by Iceland_jack):

 Random thoughts, we can derive `MonadReader Bool`

 {{{#!hs
 newtype A a = A (Bool -> a)
   deriving newtype
     (Functor, Applicative, Monad, MonadReader Bool)
 }}}

 but given an instance like `instance (Representable f, Rep f ~ a) =>
 MonadReader a (Co f)`.. if we ever want to (non-standalone) derive that we
 cannot specify the context.. and if we can
 [https://www.reddit.com/r/haskell/comments/6ksr76/rfc_part_1_deriving_instances_of/
 derive via newtypes] the `~(Rep f)` notation makes sense to have:

 {{{#!hs
 newtype B f a = B (f a)
   deriving newtype
     (Functor, Applicative, Monad)
   deriving via Co (B r)
     (MonadReader ~(Rep r))
 }}}

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


More information about the ghc-tickets mailing list