home *** CD-ROM | disk | FTP | other *** search
/ NetNews Usenet Archive 1992 #19 / NN_1992_19.iso / spool / comp / lang / function / 1041 < prev    next >
Encoding:
Text File  |  1992-08-26  |  1.5 KB  |  37 lines

  1. Newsgroups: comp.lang.functional
  2. Path: sparky!uunet!munnari.oz.au!cs.mu.OZ.AU!mundil.cs.mu.OZ.AU!fjh
  3. From: fjh@mundil.cs.mu.OZ.AU (Fergus James HENDERSON)
  4. Subject: Re: pairs vs. triples
  5. Message-ID: <9224002.2503@mulga.cs.mu.OZ.AU>
  6. Sender: news@cs.mu.OZ.AU
  7. Organization: Computer Science, University of Melbourne, Australia
  8. References: <1992Aug26.141437.8465@swift.cs.tcd.ie>
  9. Date: Wed, 26 Aug 1992 16:45:26 GMT
  10. Lines: 25
  11.  
  12. butrfeld@swift.cs.tcd.ie writes:
  13.  
  14. >Can anyone explain the following aspect of the Miranda and Haskell type
  15. >systems that I find annoying ? Is there a theoretical reason for it ?
  16. >
  17. >pairs, triples, quintuples, etc.. are _distinct_ types. In particular,
  18. >(a,(b,c)) != ((a,b),c) != (a,b,c).
  19.  
  20. A practical reason is to give the implementation freedom to implement
  21. triples etc. as efficiently as possible. Requiring (a,b,c) to be stored
  22. in the same manner as (a,(b,c)) might require an extra level of indirection
  23. (and type equivalence usually implies storage equivalence).
  24.  
  25. Theoretically I see no reason why (a,b,c) should be required to be
  26. equal to say (a,(b,c)). That seems like implementation details to me.
  27. It's also very assymetric - you have to require either left-pairing
  28. or right-pairing, and there is no obvious reason to prefer one over the
  29. other. It makes perfect sense to me that (a,b,c) is quite simply not a
  30. pair!
  31.  
  32. -- 
  33. Fergus Henderson             fjh@munta.cs.mu.OZ.AU      
  34. This .signature virus is a self-referential statement that is true - but 
  35. you will only be able to consistently believe it if you copy it to your own
  36. .signature file!
  37.