leanprover-community / leanprover-community/lean

`expr.fold` uneccesarily(?) is not defined for `pexpr`s

Open
#199 3 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
C++
Stars
433
Forks
79
PR merge metrics
No merged PRs in 30d

Description

The statement of expr.fold is

meta constant expr.fold {α : Type} : expr → α → (expr → nat → α → α) → α

which prohibits folding over pexprs. Is there any good reason for this (the only thing I can think of is a possible VM representation difference?).

If not, let's change it.

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start at the expr.fold declaration quoted in the issue and compare its expr parameter with pexpr, including the VM representation concern raised there. Determine whether folding pexprs is supported; done means the requested definition change is made if it is compatible, with relevant behavior checked.

Written by the indexing model from the issue text.

Assessment

Tech stack
cpp
Domain
compilers
Issue type
Feature
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
42/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.