The simplicity of JSON-FP expressions allows programmers to focus on functional blocks instead of splitting hairs on syntax of programming structure. That simplicity also makes metaprogramming feasible.
8. Example
var add_5 =
{“->”: [{multiply: 10}, {add: 5}, {divide: 10}]};
var rounding =
{“->”:
[
add_5,
{floor: null}
]
};
9. Summary
You can pipe (chain) JSON-FP expressions
to achieve the needed functionalities
(higher-order function).
For readability and reuse purposes, you
can assign chained (or any compounded)
expressions to a variable.
13. Bucket
Input elements are evaluated against the
bucket predicates (which are JSON-FP
expressions) sequentially.
If any predicate turns true, the element
belongs to that bucket and no further
checking will be done for that element.
14. Now can you visualize a JSON-FP
program as something like this:
17. Actually makes it easy to do
metaprogramming.
You don’t have to worry about syntax
or programming structure. You only
need to choose the right functional
block.