equal
deleted
inserted
replaced
127 |
127 |
128 fun fold_ast _ [] = raise Match |
128 fun fold_ast _ [] = raise Match |
129 | fold_ast _ [y] = y |
129 | fold_ast _ [y] = y |
130 | fold_ast c (x :: xs) = Appl [Constant c, x, fold_ast c xs]; |
130 | fold_ast c (x :: xs) = Appl [Constant c, x, fold_ast c xs]; |
131 |
131 |
132 fun fold_ast_p c = Library.foldr (fn (x, xs) => Appl [Constant c, x, xs]); |
132 fun fold_ast_p c = uncurry (fold_rev (fn x => fn xs => Appl [Constant c, x, xs])); |
133 |
133 |
134 |
134 |
135 (* unfold asts *) |
135 (* unfold asts *) |
136 |
136 |
137 fun unfold_ast c (y as Appl [Constant c', x, xs]) = |
137 fun unfold_ast c (y as Appl [Constant c', x, xs]) = |