#1245: Turn tuples into syntactic sugar for heterogeneous lists
--------------------------------------------+-------------------------------
    Reporter:  benja.fallenstein@…          |        Owner:              
        Type:  feature request              |       Status:  new         
    Priority:  normal                       |    Milestone:  _|_         
   Component:  Compiler                     |      Version:  6.6         
    Keywords:                               |     Testcase:              
   Blockedby:                               |   Difficulty:  Unknown     
          Os:  Unknown/Multiple             |     Blocking:              
Architecture:  Unknown/Multiple             |      Failure:  None/Unknown
--------------------------------------------+-------------------------------

Comment(by agocorona):

 I also want some kind of syntactic sugar for H. Lists.

 The absence of syntactic sugar makes heterogeneous list to look scary.
 People in haskell is accostumed to syntactic sugaring, so people think of
 not sugared expressions as second class.

 I´ don't know the details, but it seems that tuples are in the language to
 cover the heterogeneous flexibility thing that homogeneous lists may not
 provide, but they introduce its own inflexibilities; These repeating
 instances for two, three, four and so on tuples makes them artificial and
 repetitive. In its comparison, a complex but unique H. List instance look
 elegant. specially if it is sugarized.

 An alternative to sugarize H.Lists preserving tuples could be to use {} to
 sugarize H. lists as

    {x,y,z}

 and desugarize it into:

 x :*: y :*: z :*: {}

 Just like [] means empty list, {} would mean HNil, the empty heterogeneous
 list.


 But this alternative , if implemented, would soon render tuples  obsolete.
 These (,,) (,,,) constrctors may create marginally faster and compact
 structures, but they are much less manageable.

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