provide and document mapper-lens

This commit is contained in:
AlexKnauth 2015-08-16 17:21:09 -05:00
parent 19c6723e28
commit 441d790844
3 changed files with 18 additions and 0 deletions

View File

@ -5,6 +5,7 @@
"sublist.rkt"
"arrow.rkt"
"isomorphism.rkt"
"mapper.rkt"
)
(provide (all-from-out "syntax.rkt"
@ -12,4 +13,5 @@
"sublist.rkt"
"arrow.rkt"
"isomorphism.rkt"
"mapper.rkt"
))

View File

@ -14,3 +14,4 @@ this library being backwards-compatible.
@include-section["sublist.scrbl"]
@include-section["arrow.scrbl"]
@include-section["isomorphism.scrbl"]
@include-section["mapper.scrbl"]

View File

@ -0,0 +1,15 @@
#lang scribble/manual
@(require lens/doc-util/main)
@title{Lenses that map over lists}
@defmodule[unstable/lens/mapper]
@defproc[(mapper-lens [lens lens?]) lens?]{
Creates a lens that maps @racket[lens] over a target list.
@lenses-unstable-examples[
(lens-view (mapper-lens first-lens) '((a b) (c d) (e f)))
(lens-set (mapper-lens first-lens) '((a b) (c d) (e f)) '(1 2 3))
(lens-transform (mapper-lens first-lens) '((a b) (c d) (e f)) (λ (xs) (map symbol->string xs)))
]}