From 9382b739fe2fa166dcd0e5e1e5d921ea5cf65bb6 Mon Sep 17 00:00:00 2001 From: AlexKnauth Date: Fri, 10 Jul 2015 23:32:14 -0400 Subject: [PATCH] document sublist-lens and add it to unstable/lens --- unstable/lens/main.rkt | 8 ++++++-- unstable/lens/main.scrbl | 1 + unstable/lens/sublist.scrbl | 13 +++++++++++++ 3 files changed, 20 insertions(+), 2 deletions(-) create mode 100644 unstable/lens/sublist.scrbl diff --git a/unstable/lens/main.rkt b/unstable/lens/main.rkt index b657015..3ffba54 100644 --- a/unstable/lens/main.rkt +++ b/unstable/lens/main.rkt @@ -4,10 +4,14 @@ "compound.rkt" "list.rkt" "hash.rkt" - "view-set.rkt") + "view-set.rkt" + "sublist.rkt" + ) (provide (all-from-out "syntax.rkt" "compound.rkt" "list.rkt" "hash.rkt" - "view-set.rkt")) + "view-set.rkt" + "sublist.rkt" + )) diff --git a/unstable/lens/main.scrbl b/unstable/lens/main.scrbl index 90299a2..3b525f3 100644 --- a/unstable/lens/main.scrbl +++ b/unstable/lens/main.scrbl @@ -14,3 +14,4 @@ this library being backwards-compatible. @include-section["list.scrbl"] @include-section["hash.scrbl"] @include-section["syntax.scrbl"] +@include-section["sublist.scrbl"] diff --git a/unstable/lens/sublist.scrbl b/unstable/lens/sublist.scrbl new file mode 100644 index 0000000..c78be0b --- /dev/null +++ b/unstable/lens/sublist.scrbl @@ -0,0 +1,13 @@ +#lang scribble/manual + +@(require lens/doc-util/main) + +@title{Sublist lenses} + +@defmodule[unstable/lens/sublist] + +@defproc[(sublist-lens [i exact-nonnegative-integer?] [j exact-nonnegative-integer?]) lens?]{ +@lenses-unstable-examples[ + (lens-view (sublist-lens 1 4) '(0 1 2 3 4 5)) + (lens-set (sublist-lens 1 4) '(0 1 2 3 4 5) '(a b c)) +]}