Catamorphisms follow structure, so you can rebuild a new (or the same) structure via your fold. Example: List.foldRight to rebuild a new list. You can implement fmap this way in terms of foldRight.
-
-
-
aList.foldRight(Nil)( (x,xs) => f(x) :: xs ) is equivalent to http://aList.map (f)
- 4 more replies
New conversation -
-
-
Not sure exactly what your looking for but here’s my favorite recursion scheme intro https://free.cofree.io/2017/11/13/recursion/ … but fwiw the magic is that you can form a data structure with an initial algebra and a functor
-
well I did read through that particular blog and indeed I liked very much how it was written. Nonetheless I wish I could learn this material much more easily.
End of conversation
New conversation -
Loading seems to be taking a while.
Twitter may be over capacity or experiencing a momentary hiccup. Try again or visit Twitter Status for more information.