Debian Codegraph @

importers/ding2tei/todo/testing.idempotence

raw
1 Assuming a Pretty instance for Syntax.Dict, it should hold that
2
3 (parse . scan . pretty)
4
5 is the identity on Syntax.Dict.
6
7
8 A slightly weaker condition is that
9
10 (pretty . parse . scan)
11
12 is idempotent on valid textual dictionaries (those that parse.scan does not
13 emit an error for).
14
15
16 For testing, one shall either use the idempotence condition or
17
18 (parse . scan . pretty . parse . scan) x = (parse . scan) x
19
20 for valid textual dictionaries x.