#3699: Wildcards in type functions
------------------------------------+---------------------------------------
  Reporter:  MartijnVanSteenbergen  |          Owner:                  
      Type:  feature request        |         Status:  new             
  Priority:  normal                 |      Milestone:  6.14 branch     
 Component:  Compiler               |        Version:  6.10.4          
Resolution:                         |       Keywords:                  
Difficulty:                         |             Os:  Unknown/Multiple
  Testcase:                         |   Architecture:  Unknown/Multiple
   Failure:  None/Unknown           |  
------------------------------------+---------------------------------------
Comment (by MartijnVanSteenbergen):

 Continuing this line of thought, instances for this family go hand in hand
 with instances for this type class:

 {{{
 class MkErrorAlgebra f where
   mkErrorAlgebra :: ErrorAlg f e a -> ErrorAlgPF f e a
 }}}

 Would it then also make sense to write:

 {{{
 instance MkErrorAlgebra f => MkErrorAlgebra (f :>: _) where
   mkErrorAlgebra alg         (Tag f)           = mkErrorAlgebra alg f
 }}}

 ?

 Just a wild idea which I'm not sure yet I like or dislike. It does fit in
 with the idea of not making up names if you don't have to. For that reason
 I also prefer writing {{{data D :: <kind> where}}} for GADTs rather than
 making up arbitrary names for the type arguments. Going even further, this
 idea can be extended to e.g. {{{data Const a _ = Const a}}} for normal
 ADTs.

 Okay, enough wild ideas for now. :-)

-- 
Ticket URL: <http://hackage.haskell.org/trac/ghc/ticket/3699#comment:2>
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