Paragraph flowing as a fold.
Wolfgang Corcoran-Mathe (2024)🔗 https://www.sigwinch.xyz/cs/2024/flow-fold.html
âš“ #functional-programming #bcs2220 #bcs
An elegant example of FP for the FP portion of my PL course:
A simple, useful, plain-text variant of Donald Knuth’s paragraph-filling algorithm can be expressed as a fold. This algorithm runs in time linear to the length of its input and usually produces better results than the classic greedy text-flow algorithm.
