Functional Core, Imperative Shell in Nushell

Gary Bernhardt gave a famous talk called Boundaries . In this talk he introduces a pattern he calls the Functional Core, Imperative Shell. The Imperative Shell is a sequence of steps that sits at the edges of your code. The Functional Core contains the business logic in the form of pure, total functions. I will demonstrate what this means in the form of a recent shell script I wrote in Nushell.…