[GHC] #12700: Don't warn about redundant constraints for type equalities

GHC ghc-devs at haskell.org
Fri Oct 14 18:39:31 UTC 2016


#12700: Don't warn about redundant constraints for type equalities
-------------------------------------+-------------------------------------
        Reporter:  crockeea          |                Owner:
            Type:  bug               |               Status:  new
        Priority:  normal            |            Milestone:
       Component:  Compiler          |              Version:  8.0.1
      Resolution:                    |             Keywords:
Operating System:  Unknown/Multiple  |         Architecture:
 Type of failure:  Incorrect         |  Unknown/Multiple
  warning at compile-time            |            Test Case:
      Blocked By:                    |             Blocking:
 Related Tickets:                    |  Differential Rev(s):
       Wiki Page:                    |
-------------------------------------+-------------------------------------

Comment (by hsyl20):

 Could we allow local type alias declarations into contexts? E.g.,
 {{{
 foo :: (RealFrac a, Integral b, let b ~ Foo a) => a -> b
 }}}
 This would be equivalent to:
 {{{
 foo :: forall a. (RealFrac a, Integral b, let b ~ Foo a) => a -> b
 }}}
 i.e., b doesn't leak and isn't reported as redundant. Still ideally "b"
 should be accessible in the function code (with ScopedTypeVariable,
 TypeApplications, etc.).

 It would be useful to me to avoid redundancy into contexts such as the
 following where "zs" is the type alias:
 {{{
 xxx :: forall x xs ys zs m.
     ( Monad m
     , zs ~ Union (Filter x xs) ys
     , Catchable x xs
     , Liftable (Filter x xs) zs
     , Liftable ys zs
     ) => Variant xs -> (x -> Flow m ys) -> Flow m zs
 }}}

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


More information about the ghc-tickets mailing list