Graph rewriting and functional languages