svenkeidel/gnome-citadel — pull request #17 by markus1189 (2014-09-05 07:20:31+00:00)
Title: Pathfinder flood fill

Implement flooding functionality using PathFinder monad.

The predicate for `floodUntil` is applied between each "expand" step, which explores all unseen neighbors of a cell. In this example, where the numbers denote the order in which cells are visited:

```
0 1 2 3 4 5
+---+---+---+---+---+---+
0 | | 3 | 3 | 3 | | |
+---+---+---+---+---+---+
1 | 2 | 1 | 1 | 1 | 4 | |
+---+---+---+---+---+---+
2 | 2 | 1 | S | 1 | 4 | |
+---+---+---+---+---+---+
3 | 2 | 1 | 1 | 1 | 4 | |
+---+---+---+---+---+---+
4 | | 5 | 5 | 5 | | |
+---+---+---+---+---+---+
5 | | | | | | |
+---+---+---+---+---+---+
```

we would check between each phase (e.g 1 and 2) the given predicate. That should be sufficient for our purposes and checking during each visited cell might be too costly anyway.

Best,
Markus