Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Recursive lambdas #1638

Open
jonaprieto opened this issue Nov 22, 2022 · 1 comment
Open

Recursive lambdas #1638

jonaprieto opened this issue Nov 22, 2022 · 1 comment

Comments

@jonaprieto
Copy link
Collaborator

jonaprieto commented Nov 22, 2022

f : {A : Type} -> List A -> Pair (List A) Nat;
f := go(acc1 := []; acc2 := 0)@\{
     []        := (acc1, acc2)
   | (x :: xs) := go (x :: acc1) (acc2 + 1) xs
  };
@jonaprieto jonaprieto added this to the 0.3 milestone Nov 22, 2022
@janmasrovira janmasrovira self-assigned this Nov 23, 2022
jonaprieto added a commit that referenced this issue Jan 19, 2023
* Closes #1597 
* Closes #1624 
* Closes #1633 

The tutorial uses syntax which has not been implemented yet: it depends
on
- #1637, 
- #1716, 
- #1639,
- #1638.

The tutorial also assumes the following issues are done: 
- #1720, and
- #1701.

Co-authored-by: Jonathan Cubides <jonathan.cubides@uib.no>
@lukaszcz lukaszcz modified the milestones: 0.3, 0.4 Jan 24, 2023
@lukaszcz
Copy link
Collaborator

lukaszcz commented Apr 7, 2023

As Jeremy pointed out, it would be more consistent to denote the multiple accumulator arguments as follows:

f : (A : Type) -> List A -> Pair (List A) Nat;
f := go(acc1 := [])(acc2 := 0)@\{
     []        := (acc1, acc2)
   | (x :: xs) := go (x :: acc1) (acc2 + 1) xs
  };

The ; does suggest a pair, which may be confusing.

We could also consider adding optional arguments in general. I opened an issue about them: #1991.

@lukaszcz lukaszcz modified the milestones: 0.5.0, 0.5.2 Sep 15, 2023
@jonaprieto jonaprieto modified the milestones: 0.5.2, 0.5.3 Oct 2, 2023
@jonaprieto jonaprieto modified the milestones: 0.5.3, 0.5.4 Oct 31, 2023
@jonaprieto jonaprieto modified the milestones: 0.5.4, 0.5.5 Nov 17, 2023
@jonaprieto jonaprieto modified the milestones: 0.5.5, 0.5.6 Dec 1, 2023
@jonaprieto jonaprieto modified the milestones: 0.5.6, 0.6.1 Mar 9, 2024
@paulcadman paulcadman modified the milestones: 0.6.1, 0.6.2 Mar 25, 2024
@paulcadman paulcadman modified the milestones: 0.6.2, 0.6.3, 0.8 - Sanalejo Jun 12, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

4 participants