let filter_from_func f kf =
    fold_from_func (fun a ki -> if f ki then ki::a else a) [] kf