package json-data-encoding

  1. Overview
  2. Docs
Type-safe encoding to and decoding from JSON

Install

Dune Dependency

Authors

Maintainers

Sources

json-data-encoding-0.11.tar.gz
md5=80dd53c56b44d5696d8542ac7013a768
sha512=63894b9fa49b450445bbe125f81e0336dd0e59e23e6875cab4344c727ef454ee126b4344815d653332ccca7e8b9e80b0f272e5d407091d0b4f59426dc46a7994

doc/json-data-encoding/List_map/index.html

Module List_mapSource

Sourceval map_pure : ('a -> 'b) -> 'a list -> 'b list

Tail-recursive List.map alternative.

This map function is the one described in https://discuss.ocaml.org/t/a-new-list-map-that-is-both-stack-safe-and-fast/865

CAVEAT: The order of application of the function to the elements of the list is different from that of Stdlib.List.map. The function is applied in reverse order of the elements in the list. In other words:

map_pure f l is equivalent to List.rev_map f (List.rev l)

Considering this caveat, it is recommended to use this mapping function with a pure function as argument. This is why the name map_pure is chosen.

OCaml

Innovation. Community. Security.