On Wed, 18 Jun 2008, Rohan Drape wrote: > i was actually thinking though of the 'update' sytax being only > syntax, ie. > > data A = A {a :: Int, b :: Int} deriving (Show) > > -- cannot write f as: > --f g x n = x { g = n } > > -- instead either > f_a x n = x { a = n } > f_b x n = x { b = n } > > -- or > data AA = Aa | Ab > f Aa x n = x { a = n } > f Ab x n = x { b = n }
If you are interested in more stuff for record access, see http://darcs.haskell.org/record-access/ I like to upload this to hackage once the interface becomes a bit stable. > ps. actually, seeing it written down in that context record seems not > the best name for that sub-tree, since it suggests recording to disk > etc. (and the two meanings record & record are pronounced differently > which is actually what i noticed). unfortunately i don't have a > better suggestion. 'attribute set', 'struct', ... ? _______________________________________________ haskell-art mailing list haskell-art@lists.lurk.org http://lists.lurk.org/mailman/listinfo/haskell-art