Conversation
Implements all 8 list operations: append, concat, filter, length, map, foldl, foldr, reverse. Includes test generator, reference solution, and 22 test cases from canonical data. Closes #158
|
Hello. Thanks for opening a PR on Exercism 🙂 We ask that all changes to Exercism are discussed on our Community Forum before being opened on GitHub. To enforce this, we automatically close all PRs that are submitted. That doesn't mean your PR is rejected but that we want the initial discussion about it to happen on our forum where a wide range of key contributors across the Exercism ecosystem can weigh in. You can use this link to copy this into a new topic on the forum. If we decide the PR is appropriate, we'll reopen it and continue with it, so please don't delete your local branch. If you're interested in learning more about this auto-responder, please read this blog post. Note: If this PR has been pre-approved, please link back to this PR on the forum thread and a maintainer or staff member will reopen it. |
|
Next time, please follow How to contribute |
| @@ -0,0 +1,18 @@ | |||
| { | |||
| "authors": [ | |||
| "oxe-i" | |||
There was a problem hiding this comment.
This should be your github username
There was a problem hiding this comment.
Yes I maj with claude because I am in another project with and I am tired, sorry.
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
config.json
Outdated
| "difficulty": 3 | ||
| }, | ||
| { | ||
| "slug": "list-ops", |
There was a problem hiding this comment.
Exercises of the same difficulty are organized in alphabetical order. You should use bin/reorder-exercises
There was a problem hiding this comment.
Done, ran bin/reorder-exercises to fix the ordering. Thanks for the review!
| | "foldr", "\"(acc, el) -> el + acc\"" => "(fun el acc => el + acc)" | ||
| | "foldr", "\"(x, y) -> x / y\"" => "(· / ·)" | ||
| | _, _ => funStr | ||
|
|
There was a problem hiding this comment.
We could define another function ^ for integer power.
| "foldl", "\"(acc, el) -> el ^ acc\"" => "(fun acc el => el ^ acc)"
| "foldr", "\"(acc, el) -> el ^ acc\"" => "(fun el acc => el ^ acc)"
We could have a .meta/extra.json like the meetup or atbash-cipher or grep exercises, to compute 3 ^ (2 ^ 5) or 2 ^ (3 ^ 5) using foldl or foldr.
"input": {
"list": [2, 3],
"initial": 5,
"function": "(acc, el) -> el ^ acc"
},
There was a problem hiding this comment.
Done. Added power (^) mappings to the generator and created .meta/extra.json with two extra test cases for foldl/foldr using el ^ acc on [3, 2] with initial 2 (foldl → 512, foldr → 81).
All 24 tests pass.
|
I don't think you ran the generator. If we look at some The generator can have and You can run the generator using |
|
@jojo8356 It seems you are not running the generator script, as you should, and so the test file does not necessarily match the generator file for the exercise. Since this PR does not follow our contribution guidelines, it will be closed. Thank you for your contribution. |
Closes #158
Summary
list-opspractice exercise (difficulty 3)Files
exercises/practice/list-ops/— full exercise (stub, tests, example, docs, lakefile)generators/Generator/Generator/ListOpsGenerator.lean— test generatorgenerators/Generator/Generator.lean— updated dispatch tableconfig.json— added exercise entry