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

Provide a last function for lists #138

Open
heueristik opened this issue Nov 6, 2024 · 1 comment · May be fixed by #139
Open

Provide a last function for lists #138

heueristik opened this issue Nov 6, 2024 · 1 comment · May be fixed by #139

Comments

@heueristik
Copy link

There is a head function

head {A} (defaultValue : A) (list : List A) : A :=
  case list of
    | x :: _ := x
    | nil := defaultValue;

but no

last {A} (defaultValue : A) (list : List A) : A :=
  head@{
    defaultValue;
    list := reverse list;
  };
@mariari
Copy link
Member

mariari commented Nov 7, 2024

#139 fixes this issue

@mariari mariari linked a pull request Nov 7, 2024 that will close this issue
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants