Implementing data structures in terms of Church encodings (i.e. catamorphisms or the eliminators). Here is an example using the Option type:
https://gist.github.com/debasishg/1059864
Here is an example of the List type:
https://gist.github.com/debasishg/1059896
The point is that data structures become just their catamorphism function. Data structures are functions! How awesome is that?
Very awesome! Thanks for sharing.
This really helped me grasp what is so cool about React, recommended.
Implementing data structures in terms of Church encodings (i.e. catamorphisms or the eliminators). Here is an example using the Option type:
https://gist.github.com/debasishg/1059864
Here is an example of the List type:
https://gist.github.com/debasishg/1059896
The point is that data structures become just their catamorphism function. Data structures are functions! How awesome is that?
Very awesome! Thanks for sharing.