标签: scala
是否有一个库定义了这样一个有用的组合器?
def f[A](g: A => A, pred: A => Boolean) : A => A = { a => val newA = g(a) if (pred(newA)) newA else a }