add documentation for struct-lens
This commit is contained in:
parent
71b070749e
commit
c239ba6de9
|
@ -1,7 +1,7 @@
|
|||
#lang racket
|
||||
|
||||
(require scribble/manual
|
||||
"main.rkt")
|
||||
(for-label lenses))
|
||||
|
||||
(provide deflens
|
||||
deflenses)
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
#lang info
|
||||
|
||||
(define name "lenses")
|
||||
(define scribblings '(("main.scrbl" () () "lenses")))
|
||||
(define scribblings '(("main.scrbl" () (library) "lenses")))
|
||||
|
|
|
@ -15,5 +15,6 @@ source code: @url["https://github.com/jackfirth/lenses"]
|
|||
|
||||
@include-section["core/main.scrbl"]
|
||||
@include-section["list/main.scrbl"]
|
||||
@include-section["struct-lens.scrbl"]
|
||||
@include-section["syntax.scrbl"]
|
||||
@include-section["applicable.scrbl"]
|
||||
|
|
24
lenses/struct-lens.scrbl
Normal file
24
lenses/struct-lens.scrbl
Normal file
|
@ -0,0 +1,24 @@
|
|||
#lang scribble/manual
|
||||
|
||||
@(require scribble/eval
|
||||
"lenses-examples.rkt"
|
||||
(for-label lenses
|
||||
lenses/struct-lens
|
||||
racket/base
|
||||
racket/contract))
|
||||
|
||||
|
||||
@title{Struct lenses}
|
||||
|
||||
@defmodule[lenses/struct-lens]
|
||||
|
||||
@defform[(struct-lens struct-id field-id)]{
|
||||
Returns a lens for viewing the @racket[field-id] field of
|
||||
a @racket[struct-id] instance.
|
||||
@lenses-examples[
|
||||
(require lenses/struct-lens)
|
||||
(struct foo (a b c) #:transparent)
|
||||
(lens-view (struct-lens foo a) (foo 1 2 3))
|
||||
(lens-set (struct-lens foo a) (foo 1 2 3) 100)
|
||||
]}
|
||||
|
Loading…
Reference in New Issue
Block a user