check this simple example:
using ApproxFun
d = PiecewiseSegment([-1,0,1.])
i = Fun(d) # identity
abs(i), sign(i) # work
Fun(sign, d) # crashes Julia with Bus error: 10
(i should not also that there is almost no documentation of PiecewiseSegment. is this not supposed to be used? i would in fact need it in my actual problem, in order to implement fast interpolation and integration of piecewise defined functions with known locations of discontinuities)