mirror of
https://github.com/idris-lang/Idris2.git
synced 2024-12-24 04:09:10 +03:00
3a6614b227
This has involved quite a bit of reorganisation and some improvements in resugaring so that the results look nice. In summary: * Expression search now gives back a RawImp rather than a checked term, which allows it to include case expressions * Case with one pattern is resugared to a destructuring let * Some name generation issues address in function generation We look at intermediate results for local variables which are functions that return a concrete type, or recursive calls that return a single constructor type. In these cases, we: * let bind the local variable/recursive call * generate a new definition for the scope, as a 'case' function When we recursively generate the definition, it's a bit more restricted so as not to explode the search space. We only take the first result, we only look one constructor deep, and we go right to left on variable splitting so only deconstruct the name we've just added.
8 lines
260 B
Plaintext
8 lines
260 B
Plaintext
1/1: Building IEdit (IEdit.idr)
|
|
Main> natElim p y f 0 = y
|
|
natElim p y f (S k) = f k (natElim p y f k)
|
|
Main> f k (natElim2 p x f k)
|
|
Main> listElim p mnil mcons [] = mnil
|
|
listElim p mnil mcons (x :: xs) = mcons x xs (listElim p mnil mcons xs)
|
|
Main> Bye for now!
|