Skip to content
Word wrap kata

Details

After the great talk on Elixir last month it's time to practice our functional skills.

Write a function named wrap that takes two arguments, a string, and a column number. The function returns the string, but with line breaks inserted at just the right places to make sure that no line is longer than the column number. You try to break lines at word boundaries.

This is a deceptively simple exercise but a quick search will show that it has spawned some interesting discussions around the functional programming community.

As usual there will be pizza.

Photo of Cork Functional Programmers group
Cork Functional Programmers
See more events
Bank of Ireland Workbench
70 Patrick Street · Cork