package accessor

  1. Overview
  2. Docs
A library that makes it nicer to work with nested functional data structures

Install

Dune Dependency

Authors

Maintainers

Sources

v0.14.1.tar.gz
sha256=666d2a1c69f4e3689e54017247b677ce458bca5d59243a247de3c4495182a85b
md5=feb57a6772e2d6fd9e7c51f246b5557e

doc/accessor/Accessor/Simple/index.html

Module Accessor.Simple

Accessors are commonly not indexed and don't need to support polymorphic updates. In such cases, it may be easier to read and write types in terms of Simple.t. Here is an example where the improvement by using Simple.t is significant:

  val date_ofday
    :  Time.Zone.t
    -> ( 'i -> Date.t * Time.Ofday.t -> Date.t * Time.Ofday.t
       , 'i -> Time.t -> Time.t
       , [< isomorphism] )
         Accessor.t

It is more cleanly written like this:

  val date_ofday
    :  Time.Zone.t
    -> (_, Date.t * Time.Ofday.t, Time.t, [< isomorphism]) Accessor.Simple.t
type nonrec ('index, 'inner, 'outer, 'kind) t = ('index -> 'inner -> 'inner, 'index -> 'outer -> 'outer, 'kind) t
OCaml

Innovation. Community. Security.