Skip to content

Stdlib: list updating functions

E. Rivas requested to merge er433/stdlib/list_update into dev

Motivation and Context

It can be useful to have new functions updating lists.

Description

This MR adds new functions for updating lists.

We also add find_opt reference in documentation that was missing.

Component

  • compiler
  • website
  • webide
  • vscode-plugin
  • debugger

Types of changes

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to not work as expected)
  • Performance improvement (non-breaking change that improves performance)
  • None (change with no changelog)

Changelog

New functions in stdlib's List module:

  • val filter_map : ('a -> 'b option) -> 'a list -> 'b list
  • val update : ('a -> 'a option) -> 'a list -> 'a list
  • val update_with : ('a -> 'a option) -> 'a -> 'a list -> 'a list

Checklist:

  • Changes follow the existing coding style (use dune @fmt to check).
  • Tests for the changes have been added (for bug fixes / feature).
  • Documentation has been updated.
  • Changelog description has been added (if appropriate).
  • Start titles under ## Changelog section with #### (if appropriate).
  • There is no image or uploaded file in changelog
  • Examples in changed behaviour have been added to the changelog (for breaking change / feature).
Edited by E. Rivas

Merge request reports