provide and document lens-join/assoc

This commit is contained in:
AlexKnauth 2015-08-30 17:27:46 -04:00
parent 59a1b7473a
commit d13145e6ea
3 changed files with 20 additions and 0 deletions

View File

@ -0,0 +1,18 @@
#lang scribble/manual
@(require lens/private/doc-util/main)
@title{Joining lenses with an association list}
@defmodule[unstable/lens/join-assoc]
@defproc[(lens-join/assoc [key key/c] [lens (lens/c target/c value/c)] ... ...)
(lens/c target/c (listof (cons/c key/c value/c)))]{
Like @racket[lens-join/hash], except joins the keys and values into an
association list instead of a hash-table.
@lens-unstable-examples[
(define a-b-lens (lens-join/assoc 'a first-lens
'b third-lens))
(lens-view a-b-lens '(1 2 3))
(lens-set a-b-lens '(1 2 3) '((a . 100) (b . 200)))
]}

View File

@ -3,6 +3,7 @@
"dict-nested.rkt"
"if.rkt"
"isomorphism.rkt"
"join-assoc.rkt"
"mapper.rkt"
"match.rkt"
"set-filterer.rkt"

View File

@ -16,6 +16,7 @@ this library being backwards-compatible.
"dict-nested.scrbl"
"if.scrbl"
"isomorphism.scrbl"
"join-assoc.scrbl"
"mapper.scrbl"
"match.scrbl"
"set-filterer.scrbl"