Json
If T is not specified, defaults to the traditional definition of JSON as a recursive type.
T
If T is provided, Json<T> resolves to the non-recursive definition of JSON.
Json<T>
The non-recursive definition allows you to be more precise when you're applying a transformation to some JSON value one level at a time.
This comes up when you're working with a traversal like the Visitor pattern, where you've separated your concerns:
This comes up a lot in the context of this library, which heavily exploits recursion schemes to "factor out" recursion.
Recursion schemes are well-founded and well-known in the Haskell community, but the technique has not found its way into the industry yet.
It is this library's explicit goal is to showcase how useful recursion schemes are, and how you can use them to write recursive programs that:
Json
If
T
is not specified, defaults to the traditional definition of JSON as a recursive type.If
T
is provided,Json<T>
resolves to the non-recursive definition of JSON.The non-recursive definition allows you to be more precise when you're applying a transformation to some JSON value one level at a time.
This comes up when you're working with a traversal like the Visitor pattern, where you've separated your concerns:
This comes up a lot in the context of this library, which heavily exploits recursion schemes to "factor out" recursion.
Recursion schemes are well-founded and well-known in the Haskell community, but the technique has not found its way into the industry yet.
It is this library's explicit goal is to showcase how useful recursion schemes are, and how you can use them to write recursive programs that: