textflint.common.utils.fp_utils¶
-
textflint.common.utils.fp_utils.
concat
(xss)[source]¶ Concat list of list to be a list. Usage:
concat([[1, 2], [2, 3]]) == [1, 2, 2, 3]
- Parameters
xss (list) – the list to be concat
-
textflint.common.utils.fp_utils.
recur_ap
(f, ls)[source]¶ Apply f to every elem in ls (a nested list) recursively. Usages:
recur_ap(lambda x: x+2, 1) = 3 recur_ap(lambda x: x+2, [2, [3, 4]]) = [4, [5, 6]]
- Parameters
f (FunctionType) – the function to be applied to ls
ls – the value or the nested list to be processed
- Returns
process result