basic pathfinding algorithms in haskell