samer@44: % with_field - Apply operator to structure samer@44: % with_field :: samer@44: % N:string ~'field name', samer@44: % (A->B) ~'function' samer@44: % -> (struct { N : A } -> struct { N : B}). samer@44: function g=with_field(nm,f) samer@44: g=@op; samer@44: function x=op(x), x.(nm)=f(x.(nm)); end samer@44: end