Skip to content
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions AGENTS.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,3 +9,4 @@
- MUST not use magic methods to cast types. If a type cast is unavoidable, explain the reason in a code comment.
- MUST not disable compiler warnings

- Avoid O(n²) `List` patterns such as `List.concat` and repeated `List.append` on large sequences; when the project already depends on the `rrbvec` package, use `Rrbvec` vectors instead.

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 Badge Remove List.concat from the quadratic examples

For a one-time flattening of a list of lists, OCaml's List.concat traverses each input element once, so its complexity is linear in the total input size, not O(n²). This rule would therefore steer future changes away from simple standard-library code and toward an unnecessary vector representation; reserve the warning for patterns that repeatedly append to a growing list, or separately document List.concat's non-tail-recursive stack behavior.

Useful? React with 👍 / 👎.

Loading