Path finding implemented in a functional programming language