roc-lang / roc-lang/examples

example suggestion: tree with a variable number of children

Open
#102 2 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

example suggestion good first issue
Dominant language
Shell
Stars
46
Forks
19
Avg merge
13h 38m
Merged PRs (30d)
19

Description

Starting point:

NodeID : U64

Node : { value: Str, children :  List NodeID}

tree : Dict NodeID Node
tree = Dict.empty {}
       |> Dict.insert 0 { value: "hey", children: [1]}
       |> Dict.insert 1 { value: "hey!", children: []}

Brendan also suggested a type like this, which could look nicer/simpler:

Node: [Element { branch: List Node, ...}]

We may want to make a simple example and one optimized for performance but we can worry about that later.

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 with the NodeID, Node, and tree examples in the issue, then compare the proposed variable-child representations. Clarify whether the goal is a simple example, a performance-oriented example, or both; done requires an agreed example scope and representation.

Written by the indexing model from the issue text.

Assessment

Domain
documentation
Issue type
Feature
Difficulty
5/5
Estimated time
Over a week
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
25/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.