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

  1. Newsgroups: comp.lang.functional
  2. Path: sparky!uunet!mcsun!sun4nl!rulway.LeidenUniv.nl!slc5!zweije
  3. From: zweije@slc5 (Vincent Zweije)
  4. Subject: Re: pairs vs. triples
  5. Message-ID: <1992Aug27.062837.19275@rulway.LeidenUniv.nl>
  6. Sender: root@rulway.LeidenUniv.nl (System PRIVILEGED Account)
  7. Nntp-Posting-Host: rulwislc5.leidenuniv.nl
  8. Organization: Department Of Mathematics and Computer Science
  9. References: <1992Aug26.141437.8465@swift.cs.tcd.ie> <9224002.2503@mulga.cs.mu.OZ.AU>
  10. Date: Thu, 27 Aug 92 06:28:37 GMT
  11. Lines: 23
  12.  
  13. Andrew Butterfield writes:
  14.  
  15. >Can anyone explain the following aspect of the Miranda and Haskell type
  16. >systems that I find annoying ? Is there a theoretical reason for it ?
  17.  
  18. >pairs, triples, quintuples, etc.. are _distinct_ types. In particular,
  19. >(a,(b,c)) != ((a,b),c) != (a,b,c).
  20.  
  21. Fergus James HENDERSON replies:
  22.  
  23. >Theoretically I see no reason why (a,b,c) should be required to be
  24. >equal to say (a,(b,c)). That seems like implementation details to me.
  25. >It's also very assymetric - you have to require either left-pairing
  26. >or right-pairing, and there is no obvious reason to prefer one over the
  27. >other. It makes perfect sense to me that (a,b,c) is quite simply not a
  28. >pair!
  29.  
  30. Of course, it is also impossible to let ((a,b),c) = (a,(b,c)), unless
  31. you want to end up having a nondeterministic language. For if a
  32. function expecting a pair were applied to such a thing, you would never
  33. know whether to match its argument with ((a,b),c) or (a,(b,c)).
  34.  
  35.                                                                Vincent.
  36.