i thank for the two suggestions (newtype as a wrapper and type families) and i 
have explored them. haskell-cafe was very helpful!

i use often a piece of code to update a part of a record with field names which 
codes as follows:

data X a b c = X {afield :: a, bfield :: b, cfield :: c}

dotoBfield :: (b -> b) -> X a b c -> X a b c
dotoBfield  op x = x { bfield = op (bfield x)}

and similar for A and C.

is there a better idiom to achieve the same effect?
can this be automated (for example, using generics)?
_______________________________________________
Haskell-Cafe mailing list
[email protected]
http://www.haskell.org/mailman/listinfo/haskell-cafe

Reply via email to