How to generate stable id for AST nodes in functional programming?
问题 I want to substitute a specific AST node into another, and this substituted node is specified by interactive user input. In non-functional programming, you can use mutable data structure, and each AST node have a object reference, so when I need to reference to a specific node, I can use this reference. But in functional programming, use IORef is not recommended, so I need to generate id for each AST node, and I want this id to be stable , which means: when a node is not changed, the