redtt icon indicating copy to clipboard operation
redtt copied to clipboard

Decompose elim into rec and case

Open jonsterling opened this issue 7 years ago • 2 comments

@ecavallo I'd like to consider decomposing the eliminators into two different combinators: case and rec, as described in here: https://cs.ru.nl/~freek/courses/tt-2010/tvftl/epigram-notes.pdf

The idea is that case doesn't do any recursion, but just lets you see what constructor you have. And rec does the recursion (basically, for each type, it takes a motive P and provides all the recursive calls that can be made).

We'd have to make sure that this idea works for HITs, but a priori I have no reason to expect that it wouldn't extend directly.

Anyway, the benefit of this is that it separates the generation of the i.h. from the branching, and enables more flexible style of program, which will become important when we elaborate pattern matching.

jonsterling avatar Oct 28 '18 16:10 jonsterling

I too see no reason why it wouldn't work. 👍

ecavallo avatar Oct 29 '18 13:10 ecavallo

@ecavallo OK! We can investigate it later. I don't want to get distracted from finishing new-domain.

jonsterling avatar Oct 29 '18 14:10 jonsterling