Writable: use foldLeft so the updated value is carried

Open Beginner friendly
#203 0 comments 0 reactions 0 assignees View on GitHub

Maintainers usually reply within 1 day

Nobody has claimed this yet.

Assessment

Difficulty
2/5
Estimated time
1-3 hours
Newbie friendliness
68/100
Issue type
Refactor
Clarity
Mostly clear
Activity status
Active
Tech stack
scala
Domain
data

Research direction

Start at core/src/main/scala/com/phasmidsoftware/tableparser/core/write/Writable.scala:70, the fold the review comment flags, and read the surrounding method to see how the accumulator o is threaded through each step. Compare against the foldLeft usages elsewhere in the core module to match house style. Done means the updated value is carried into each iteration and the core write tests (core module test suite) still pass.

Written by the indexing model from the issue text.

Description

core/src/main/scala/com/phasmidsoftware/tableparser/core/write/Writable.scala:70:

CONSIDER using foldLeft so that we can use the updated value of o at each step.

As written, the updated value is discarded at each step, which may be a defect rather than a style point.

Dominant language
Scala
Stars
11
Forks
4
Avg merge
6h 54m
Merged PRs (30d)
52

Getting set up

This project ships no dev container, Dockerfile or contributing guide, so setting up is up to you: start from its README, and see our first-contribution guide for the general steps.

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.

More from rchillyard/TableParser

All issues in rchillyard/TableParser

Similar issues

More Scala issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.