Functional Programming Design Patterns

So for those who are going through the documentation you have probably noticed that Motoko is based off of a more functional design. This language design can be a little more difficult for people switching from an Object Oriented programming language.

For those trying to make the transition I suggest you watch this youtube video: I think the guy in the presentation breaks down what functional programming is all about along with some solid design patterns for you to move forward with.

Please feel free to leave some design patterns you are favoring for Motoko on this thread as well so we can start building a good library of solid principles.


thanks for sharing! i’ll try to watch this over the weekend


If you’re not familiar with folding in functional programming, this article is a good primer:

(Those who know group theory will find it relates).

Motoko’s Array and List fold functions can be found here: