The Motoko language sometimes takes a functional approach, as can be seen when making ’changes’ to immutable arrays
and when appending to lists
As a useful guide, Joachim Breitner’s Haskell series may be worth a review to get you thinking about functional programming when approaching your Motoko projects.
Joachim Breitner’s Haskell for Readers, includes a good primer on functional programming:
And his blog entry on this:
Joachim’s CIS 194 Haskell course at the University of Pennsylvania also contains a good overview of these concepts: