(* Changes to walk a maze as a lazy list method *) datatype 'a stream = cell of 'a * (unit -> 'a stream) | empty; fun MazeStr ([], _, _) = empty | MazeStr ((first,path)::queue, maze, goal) = if first = goal then cell(first::path, fn () => MazeStr(queue, maze, goal)) else if member(first,path) then MazeStr(queue, maze, goal) else MazeStr(queue @ enqueue(stepone(first,maze),first::path), maze, goal); fun next (cell(_,f)) = f(); (* Call with:- MazeStr([(0,[])], hamptoncourt, 10); *)