Re: [Haskell] pattern matching on record fields and position

2005-11-02 Thread John Meacham
You might want to look at the 'get', 'set' and 'update' rules that DrIFT can derive. i made them to addres a lot of the same issues you mentioned. I personally think it is a travesty that data Foo = Foo { a :: Int, b :: Char } | Bar { a :: Int } let x = Bar { a = 4 } y = x { b = 'x'} resu

Re: [Haskell] pattern matching on record fields and position

2005-11-02 Thread Malcolm Wallace
David Roundy <[EMAIL PROTECTED]> writes: > I have a couple of related (almost conjugate) proposals/questions. > Basically, I've been thinking about how to make code more robust with > respect to changes in the data types. This sounds a bit like "views", proposals for which have been around for ye

[Haskell] pattern matching on record fields and position

2005-11-02 Thread David Roundy
Hello fellow haskellers, I have a couple of related (almost conjugate) proposals/questions. Basically, I've been thinking about how to make code more robust with respect to changes in the data types. Pattern matching based on positions is very fragile (I don't think this is a surprise to anyone).