Curiosity

John Meacham john@repetae.net
Wed, 9 Apr 2003 04:00:43 -0700


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
---------------------------------------------------------------------------