├── .gitattributes ├── .travis.yml ├── CONTRIBUTING.md └── README.md /.gitattributes: -------------------------------------------------------------------------------- 1 | * text=auto 2 | README.md merge=union 3 | -------------------------------------------------------------------------------- /.travis.yml: -------------------------------------------------------------------------------- 1 | language: ruby 2 | rvm: 3 | - 2.2 4 | before_script: 5 | - gem install awesome_bot 6 | script: 7 | - awesome_bot README.md --allow-redirect -w vimeo.com 8 | -------------------------------------------------------------------------------- /CONTRIBUTING.md: -------------------------------------------------------------------------------- 1 | # Contribution Guidelines 2 | 3 | Ensure your pull request adheres to the following guidelines: 4 | 5 | - **The pull request should have a useful title and include a link to the resource you're submitting and why it should be included.** 6 | - Search previous suggestions before making a new one, as yours may be a duplicate. 7 | - Make an individual pull request for each suggestion. 8 | - Use the following format: `[Title](link) - Description.` 9 | - Additions should be added to the bottom of the relevant section. 10 | - Keep descriptions short and simple, but descriptive. 11 | - Start the description with a capital and end with a full stop/period. 12 | - Check your spelling and grammar. 13 | - New categories or improvements to the existing categorization are welcome, but should be done in a separate pull request. 14 | 15 | Thank you for your suggestion! 16 | 17 | ### Updating your PR 18 | 19 | A lot of times, making a PR adhere to the standards above can be difficult. If the maintainers notice anything that we'd like changed, we'll ask you to edit your PR before we merge it. If you're not sure how to do that, [here is a guide](https://github.com/RichardLitt/docs/blob/master/amending-a-commit-guide.md) on the different ways you can update your PR so that we can merge it. 20 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # Awesome Recursion Schemes [![Awesome](https://cdn.rawgit.com/sindresorhus/awesome/d7305f38d29fed78fa85652e3a63e154dd8e8829/media/badge.svg)](https://github.com/sindresorhus/awesome) 2 | 3 | > A curation of useful resources for learning about and using recursion schemes. 4 | 5 | Recursion schemes are simple, composable combinators, that automate the process of traversing and recursing through nested data structures. 6 | 7 | 8 | ## Contents 9 | 10 | - [Introductions](#introductions) 11 | - [Articles](#articles) 12 | - [Papers](#papers) 13 | - [Presentations](#presentations) 14 | - [Cheat Sheets](#cheat-sheets) 15 | - [Podcasts](#podcasts) 16 | - [Implementations](#implementations) 17 | 18 | 19 | ## Introductions 20 | 21 | - [Awesome Recursion Schemes](https://github.com/passy/awesome-recursion-schemes) - A curation of useful resources for learning about and using recursion schemes. 22 | - [Practical Recursion Schemes](https://jtobin.io/practical-recursion-schemes) - 23 | Introduction to pattern functors, fix points, anamorphisms, catamorphisms, 24 | paramorphisms and hylomorphisms, requiring very little prior knowledge. 25 | - [An Introduction to Recursion Schemes](http://blog.sumtypeofway.com/an-introduction-to-recursion-schemes/) - 26 | Three-part series in which you discover recursion schemes from scratch and 27 | implement a small subset of Edward Kmett's library. 28 | - [Understanding Algebras](https://www.schoolofhaskell.com/user/bartosz/understanding-algebras) - 29 | Bartosz Milewski explains F-algebras and shows how to use them in the context of 30 | catamorphisms. 31 | - [Recursion Schemes in JavaScript and Flow](https://medium.com/@JosephJnk/recursion-schemes-in-javascript-and-flow-with-static-land-recursision-schemes-97cf10599fb7) - 32 | Series introducing recursion schemes and related concepts in JavaScript, 33 | aimed at developers with a minimal functional programming background. 34 | 35 | ## Articles 36 | 37 | - [Recursion Schemes: A Field Guide (Redux)](http://comonad.com/reader/2009/recursion-schemes/) - 38 | List of various recursion schemes with code samples. 39 | - [Catamorphisms](https://wiki.haskell.org/Catamorphisms) - Definition on the Haskell Wiki. 40 | - [Catamorphisms](https://www.schoolofhaskell.com/user/edwardk/recursion-schemes/catamorphisms) - 41 | Short definition with code on School of Haskell by Edward Kmett. 42 | - [Rotating Squares](https://jtobin.io/rotating-squares) - Using a hylomorphism to rotate a quadtree by Jared Tobin. 43 | - [Recursion Schemes, Part V: Hello, Hylomorphisms](http://blog.sumtypeofway.com/recursion-schemes-part-v/) 44 | - [Promorphisms, Pre and Post](https://jtobin.io/promorphisms-pre-post) - Practical examples of pre- and postpromorphisms by Jared Tobin. 45 | - [Time Traveling Recursion Schemes](https://jtobin.io/time-traveling-recursion) - Exploring histo and futu by example by Jared Tobin. 46 | - [Recursion Schemes, Part IV: Time is of the Essence](http://blog.sumtypeofway.com/recursion-schemes-part-iv-time-is-of-the-essence/) - Practical article about histomorphism and the futumorphism. 47 | - [Cheat Sheet](https://github.com/sellout/recursion-scheme-talk/blob/master/cheat%20sheet.pdf) - Map of various recursion schemes and their duals. 48 | - [Correcting the Visitor pattern](http://logji.blogspot.co.uk/2012/02/correcting-visitor-pattern.html) - Showing that the Visitor pattern implements an f-algebra for use with a catamorphism (in Java). 49 | - [Recursion Schemes in Scala](https://free.cofree.io/2017/11/13/recursion/) - Introduces the fixpoint combinator, anamorphism, catamorphism, hylomorphism, paramorphism, apomorphism, histomorphism, dynamorphism and futumorphism. 50 | - [What's in a Fold: The Basic Catamorphism in recursion-schemes](https://duplode.github.io/posts/whats-in-a-fold.html) - Introduces catamorphism as a generalization of fold. 51 | 52 | ### Hylomorphisms in the Wild 53 | 54 | Articles by Bartosz Milewski about solving small, practical problems by applying a hylomorphism. 55 | 56 | - [Stalking a Hylomorphism in the Wild](https://bartoszmilewski.com/2017/12/29/stalking-a-hylomorphism-in-the-wild/) - Advent of Code 2017, Domino challenge 57 | - [Open Seasons on Hylomorphisms](https://bartoszmilewski.com/2018/12/20/open-season-on-hylomorphisms/) - Advent of Code 2018, String comparison challenge 58 | 59 | ## Papers 60 | 61 | - [Functional Programming with Bananas, Lenses, Envelopes and Barbed Wire, 1991, Meijer et al.](http://maartenfokkinga.github.io/utwente/mmf91m.pdf) - 62 | The original paper most of this is based on. 63 | - [A Duality of Sorts, 2013, Hinze et al.](http://www.cs.ox.ac.uk/ralf.hinze/publications/Sorting.pdf) - 64 | Shows that many basic sorting algorithms exist as a pair, and that these pairs 65 | arise naturally out of the duality between folds and unfolds. 66 | - [Sorting with Bialgebras and Distributive Laws, 2012, Hinze et al.](http://www.cs.ox.ac.uk/people/daniel.james/sorting/sorting.pdf) - 67 | Shows how paramorphisms and apomorphisms can be used for more efficient 68 | implementations of sorting algorithms. 69 | - [Scrap your boilerplate: a practical design pattern for generic programming, 2003, SPJ et al.](http://research.microsoft.com/en-us/um/people/simonpj/Papers/hmap/hmap.ps) - 70 | Design pattern for writing programs that traverse data structures built from rich mutually-recursive data types. 71 | 72 | ## Presentations 73 | 74 | - [Slidedecks by Tim Philip Williams](http://www.timphilipwilliams.com/slides.html) - 75 | "Recursion Schemes by Example" and "Exotic Tools for Exotic Trades" provide 76 | concise definitions as well as practical examples of many recursion schemes. 77 | - [Unifying Structured Recursion Schemes](https://www.youtube.com/watch?v=9EGYSb9vov8) - 78 | 12 min presentation by Ralf Hinze, Nicolas Wu, and Jeremy Gibbons. 79 | - [Recursion Schemes](https://www.youtube.com/watch?v=Zw9KeP3OzpU) - 80 | Presented by Tim Williams at the London Haskell meetup. 81 | - [F-algebras or: How I Learned to Stop Worrying and Love the Type System](https://www.youtube.com/watch?v=PK4SOaAGVfg) - 82 | Presented by Anthony Burzillo at the NYC Haskell User's Group. 83 | - [A Gentle Introduction to Recursion Schemes](https://www.youtube.com/watch?v=i5A2Amfcir8) - 84 | Presented by Jean Remi Desjardins at Lambdaconf 2016. 85 | - [recursion-scheme-talk](https://github.com/sellout/recursion-scheme-talk) - Collection of slide decks about recursion schemes. 86 | - [Bracer: Transforming Real-World Languages with Coproducts and Recursion Schemes](https://www.youtube.com/watch?v=5Kr7IykGMzU) - High-level talk about structuring programs with coproducts and recursion schemes by Patrick Thomson. 87 | - [Recursion: Where Functional Programming Hits Bottom](https://www.youtube.com/watch?v=24UoRaoKLjM) - Introduction to recursive fix point data structures and recursion schemes in Haskell and Scala by Greg Pfeil. 88 | - [Programming with algebras](https://www.youtube.com/watch?v=-98fR9VmLbQ) - Bartosz Milewski's article in talk form, presented at LambdaCon. 89 | - [Peeling the Banana: Recursion Schemes from First Principles](https://www.youtube.com/watch?v=XZ9nPZbaYfE&t=3s) - Zainab Ali's Introductory talk presented at LambdaWorld. 90 | 91 | ## Cheat Sheets 92 | 93 | - [The Hitchhiker's Guide to Morphisms](https://ipfs.io/ipfs/QmTppu1VDAQWsdiyVSZX6qb8PErdpwzNP2oKfEhcgaBvWR/guide-to-morphisms.pdf) - Overview of different morphisms including a printable PDF. 94 | 95 | ## Podcasts 96 | 97 | - [Magic Read Along](http://www.magicreadalong.com/) - Casual discussions about 98 | category theory that often bring up recursion schemes, including [episode 99 | 33](http://www.magicreadalong.com/episode/33) which talks about Histomorphisms 100 | and Futumorphisms. 101 | - [Scala Love](https://scala.love/) - Podcast about Scala that brings up 102 | recursion schemes in [the second episode](https://scala.love/happy-valentin/). 103 | - [The Haskell Cast](https://www.haskellcast.com/) - Recursion schemes come up in 104 | [Episode 13 with John Wiegley](https://www.haskellcast.com/episode/013-john-wiegley-on-categories-and-compilers). 105 | 106 | ## Implementations 107 | 108 | - [recursion-schemes](https://github.com/ekmett/recursion-schemes/) for 109 | Haskell - The canonical implementation by Edward Kmett. 110 | - [Matryoshka](https://github.com/slamdata/matryoshka) for Scala using Scalaz - 111 | Generalized folds, unfolds, and traversals for fixed point data structures. 112 | - [andyscott/droste](https://github.com/andyscott/droste) for Scala using Cats - 113 | Generalized folds, unfolds, and traversals for fixed point data structures. 114 | - [recursion\_schemes](https://github.com/vmchale/recursion_schemes/) for 115 | Idris, based off Edward Kmett's Haskell library. 116 | - [purescript-matryoshka](https://github.com/slamdata/purescript-matryoshka) for PureScript - 117 | Work-in-process port of matryoshka. 118 | - [recursion](https://github.com/vmchale/recursion) for ATS - Demonstration of 119 | recursion schemes in ATS. 120 | - [dada](https://github.com/sellout/dada) for Dhall - a library for recursion 121 | schemes in Dhall. 122 | - [static-land-recursion-schemes](https://github.com/JosephJNK/static-land-recursion-schemes) for JavaScript/Flow - 123 | Schemes for data structures written in the style of [flow-static-land](https://github.com/gcanti/flow-static-land). 124 | - [Katalyst](https://github.com/aedans/Katalyst) for Kotlin - a re-envisioning based off Matryoshka using lightweight higher kinded polymorphism. 125 | 126 | ## License 127 | 128 | This content is licensed 129 | under [CC0](https://creativecommons.org/publicdomain/zero/1.0/). 130 | --------------------------------------------------------------------------------