Toy implementation of A* in Haskell