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