functional-swift
functional-swift copied to clipboard
Page 27: Sample code has `subtract` function, but text talks about `difference` function
This seems to be on page 22 of Functional Swift 2020-03-26.pdf
excerpt below: Instead of the free functions operating on our original Region type, we could then define similar methods as extensions to this struct. And instead of assembling complex regions by passing them to functions, we could then repeatedly transform a region by calling these methods: rangeRegion.shift(ownPosition).difference(friendlyRegion)
in the last line .difference should be .subtract
great book btw. 🙏🏼