#3714: Improve error message if an associated family declaration has excess
parameters
---------------------------+------------------------------------------------
  Reporter:  simonpj       |          Owner:  chak            
      Type:  bug           |         Status:  new             
  Priority:  normal        |      Milestone:                  
 Component:  Compiler      |        Version:  6.10.4          
Resolution:                |       Keywords:                  
Difficulty:                |             Os:  Unknown/Multiple
  Testcase:                |   Architecture:  Unknown/Multiple
   Failure:  None/Unknown  |  
---------------------------+------------------------------------------------
Comment (by MartijnVanSteenbergen):

 Moving the type index {{{e}}} to the right of the {{{::}}}—turning it into
 a type parameter, like Manuel suggests—complicates writing certain
 instances. Before I could write:

 {{{
 type instance T2 () e = e -> Bool
 }}}

 But now I have to write:

 {{{
 instance C2 () where
   type T2 () = T2Unit

 newtype T2Unit e = T2Unit (e -> Bool)
 }}}

 introducing a newtype whenever the type is not directly eta-reducible. In
 my case this defeats the purpose of writing these instances, as the goal
 is to derive a ''simpler'' type from a generic representation of a
 datatype (instances for generic building blocks), not a more complicated
 one (with newtypes that weren't necessary before).

 Just to be clear, there isn't really a problem, because I can just leave
 the type family outside the class. So the actual question here is: why are
 [type family inside type class] and [multiple family indices for writing
 type lambdas] sometimes mutually exclusive?

 Thanks,

 Martijn.

-- 
Ticket URL: <http://hackage.haskell.org/trac/ghc/ticket/3714#comment:3>
GHC <http://www.haskell.org/ghc/>
The Glasgow Haskell Compiler
_______________________________________________
Glasgow-haskell-bugs mailing list
[email protected]
http://www.haskell.org/mailman/listinfo/glasgow-haskell-bugs

Reply via email to