Is there any reason why the list type is defined in the Report as data [a] = [] | a : [a] deriving (Eq, Ord) rather than data [a] = [] | (:) {head:: a, tail:: [a]} deriving (Eq, Ord) (which would shorten Prelude.List somewhat)? -- Jón Fairbairn Jon.Fairbairn@cl.cam.ac.uk 31 Chalmers Road jf@cl.cam.ac.uk Cambridge CB1 3SZ +44 1223 570179 (after 14:00 only, please!)
because that would imply you could use the record update syntax which you cannot do in haskell. as in: xs = [1,2,3] ys = xs {head = 4} -- bad code John On Wed, Apr 09, 2003 at 11:10:14AM +0100, Jon Fairbairn wrote:
Is there any reason why the list type is defined in the Report as
data [a] = [] | a : [a] deriving (Eq, Ord)
rather than
data [a] = [] | (:) {head:: a, tail:: [a]} deriving (Eq, Ord)
(which would shorten Prelude.List somewhat)?
-- Jón Fairbairn Jon.Fairbairn@cl.cam.ac.uk 31 Chalmers Road jf@cl.cam.ac.uk Cambridge CB1 3SZ +44 1223 570179 (after 14:00 only, please!)
_______________________________________________ Haskell mailing list Haskell@haskell.org http://www.haskell.org/mailman/listinfo/haskell
-- --------------------------------------------------------------------------- John Meacham - California Institute of Technology, Alum. - john@foo.net ---------------------------------------------------------------------------
On 2003-04-09 at 04:00PDT John Meacham wrote:
because that would imply you could use the record update syntax which you cannot do in haskell.
as in:
xs = [1,2,3] ys = xs {head = 4} -- bad code
But since this is the report we are talking about, were the change made, that would no longer be bad code. -- Jón Fairbairn Jon.Fairbairn@cl.cam.ac.uk 31 Chalmers Road jf@cl.cam.ac.uk Cambridge CB1 3SZ +44 1223 570179 (after 14:00 only, please!)
G'day all. On Wed, Apr 09, 2003 at 03:24:19PM +0100, Jon Fairbairn wrote:
But since this is the report we are talking about, were the change made, that would no longer be bad code.
This actually looks like quite a good change for the post-98 era. Are we taking submissions on the next version yet? Cheers, Andrew Bromage
participants (3)
-
Andrew J Bromage -
John Meacham -
Jon Fairbairn