↓ Skip to main content

Type Algebra

Datatypes and Folds: Part II

·5 mins

Non-mutually re­curs­ive and Mu­tu­ally re­curs­ive data­types Wel­come back. In this post we will look at cre­at­ing type algebra's and folds for more com­plic­ated data types. In es­sence, this ex­er­cise will not be any more dif­fi­cult than the pre­vi­ous ones, provided that you stick with the steps. Up in this part, are the non-mutually re­curs­ive data­types and mu­tu­ally re­curs­ive data­types. First up, data struc­tures that are re­curs­ive into other data struc­tures. The folds for these data struc­tures are no more com­plex than their `simpler’ forms. In fact, you could treat them the same, but for clar­ity we will treat them as dis­tinct. If you want to know more about the pre­vi­ous part, it might help your search if you look for the keyword cata­morph­ism.