Article View: comp.lang.functional
Article #182Re: pairs vs. triples
From: Vincent Zweije
Date: Thu, 27 Aug 1992 06:28
Date: Thu, 27 Aug 1992 06:28
23 lines
1572 bytes
1572 bytes
Andrew Butterfield 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).
Fergus James HENDERSON replies:
>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!
Of course, it is also impossible to let ((a,b),c) = (a,(b,c)), unless
you want to end up having a nondeterministic language. For if a
function expecting a pair were applied to such a thing, you would never
know whether to match its argument with ((a,b),c) or (a,(b,c)).
Vincent.
Technical Details
Message-ID:
<1992Aug27.062837.19275@rulway.LeidenUniv.nl>Path:
arc1-ca.pugleaf.net!sparky!uunet!mcsun!sun4nl!rulway.LeidenUniv.nl!slc5!zweijeReferences:
<1992Aug26.141437.8465@swift.cs.tcd.ie> <9224002.2503@mulga.cs.mu.OZ.AU>Show Full Headers
Complete Article Headers
Newsgroups: comp.lang.functional Path: arc1-ca.pugleaf.net!sparky!uunet!mcsun!sun4nl!rulway.LeidenUniv.nl!slc5!zweije From: zweije@slc5 (Vincent Zweije) Subject: Re: pairs vs. triples Message-ID: <1992Aug27.062837.19275@rulway.LeidenUniv.nl> Sender: root@rulway.LeidenUniv.nl (System PRIVILEGED Account) Nntp-Posting-Host: rulwislc5.leidenuniv.nl Organization: Department Of Mathematics and Computer Science References: <1992Aug26.141437.8465@swift.cs.tcd.ie> <9224002.2503@mulga.cs.mu.OZ.AU> Date: Thu, 27 Aug 92 06:28:37 GMT Lines: 23