[GHC] #10592: Allow cycles in class declarations

GHC ghc-devs at haskell.org
Fri Jul 10 12:20:37 UTC 2015


#10592: Allow cycles in class declarations
-------------------------------------+-------------------------------------
        Reporter:  MikeIzbicki       |                   Owner:
            Type:  feature request   |                  Status:  new
        Priority:  normal            |               Milestone:
       Component:  Compiler (Type    |                 Version:  7.10.1
  checker)                           |                Keywords:
      Resolution:                    |            Architecture:
Operating System:  Unknown/Multiple  |  Unknown/Multiple
 Type of failure:  None/Unknown      |               Test Case:
      Blocked By:                    |                Blocking:
 Related Tickets:                    |  Differential Revisions:
-------------------------------------+-------------------------------------

Comment (by simonpj):

 Hmm.  I think it'd be easy to send GHC into an infinite loop using this;
 i.e. the current implementation is over-liberal.
 {{{
 type instance FieldScalar x = Field x
 }}}
 Is it true that you expect `Scalar (Scalar a) ~ Scalar a)` (cf #10318).
 If so, you could make it better behaved by saying
 {{{
 class (Scalar (Scalar a) ~ Scalar a, Field (Scalar a)) => Vector a
 class Vector x => Field x
 }}}
 This still isn't accepted but could be under comment:6 of #10318

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


More information about the ghc-tickets mailing list