Skip to content

Commit c3a072c

Browse files
authored
Speculative normalisation (#1902)
* Split Normalise into three files Evaluation, Quoting, and Conversion checking are distinct steps, and I'm about to add some variations to quoting so better to reorganise a bit. * Add a Quote mode that limits size of result Sometimes normalising an expression is a good idea because it makes things smaler, and sometimes it isnt, because it doesn't. We can't tell in advance which situation we're in, but we can try speculatively normalising something. This is good for case types and hole types - we generally want the normal form, but if that's expensive, we should stop. So, quote is now able to give up if it passes a certain size threshold for stuck applications. By experimentation, it seems that up to 10 doesn't hurt too much, but beyond that it's better not to normalise at all. * Add the new normalise files
1 parent 5126600 commit c3a072c

File tree

7 files changed

+1326
-1195
lines changed

7 files changed

+1326
-1195
lines changed

idris2api.ipkg

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -61,6 +61,9 @@ modules =
6161
Core.Name,
6262
Core.Name.Namespace,
6363
Core.Normalise,
64+
Core.Normalise.Convert,
65+
Core.Normalise.Eval,
66+
Core.Normalise.Quote,
6467
Core.Options,
6568
Core.Options.Log,
6669
Core.Ord,

src/Core/Normalise.idr

Lines changed: 25 additions & 1194 deletions
Large diffs are not rendered by default.

0 commit comments

Comments
 (0)