Higher-Order Functions and Safe Dynamic Dispatch in Move 2.2

Move 2.2 is cooking up something exciting—higher-order functions (HO functions) and safe dynamic dispatch in storage. Here’s a quick example of what you’ll be able to do: a tiny simulation of a pocket calculator.

This update significantly enhances flexibility and security for developers, allowing for more modular and reusable code that interacts directly with storage. A powerful addition for Move developers!

Source: https://x.com/wgrieskamp/status/1895247474346074365

Also check AIP-112 - Function Values in the Move VM

Move 2 adds higher-order functions to the language. Function values can be constructed using partial function applications and lambda expressions, and passed around as values, as well as stored in vectors and structs. Under certain conditions, function values can also be persisted in storage, meaning in Move that they have the store ability. This new feature requires extensions to the Move VM which are described in this AIP.

1 Like