Adding documentation

This commit is contained in:
Jay McCarthy 2014-11-17 23:04:46 -05:00
parent 1b2c8ef2ef
commit 8a9b9c006f
2 changed files with 12 additions and 7 deletions

View File

@ -25,3 +25,4 @@ This manual documents data structure libraries available in the
@include-section["integer-set.scrbl"] @include-section["integer-set.scrbl"]
@include-section["bit-vector.scrbl"] @include-section["bit-vector.scrbl"]
@include-section["union-find.scrbl"] @include-section["union-find.scrbl"]
@include-section["enumerate.scrbl"]

View File

@ -23,6 +23,12 @@
(provide (provide
(contract-out (contract-out
[nat?
(-> any/c
boolean?)]
[extended-nat?
(-> any/c
boolean?)]
[enum [enum
(-> extended-nat? (-> nat? any/c) (-> any/c nat?) (-> extended-nat? (-> nat? any/c) (-> any/c nat?)
enum?)] enum?)]
@ -72,11 +78,8 @@
[const/e [const/e
(-> any/c (-> any/c
enum?)] enum?)]
[from-list/e
(-> list?
enum?)]
[fin/e [fin/e
(-> list? (->* () #:rest list?
enum?)] enum?)]
[nat/e enum?] [nat/e enum?]
[int/e enum?] [int/e enum?]
@ -84,7 +87,8 @@
(->* () #:rest (listof (cons/c enum? (-> any/c boolean?))) (->* () #:rest (listof (cons/c enum? (-> any/c boolean?)))
enum?)] enum?)]
[disj-append/e [disj-append/e
(->* (enum?) #:rest (listof (cons/c enum? (-> any/c boolean?))) (->* ((cons/c enum? (-> any/c boolean?)))
#:rest (listof (cons/c enum? (-> any/c boolean?)))
enum?)] enum?)]
[fin-cons/e [fin-cons/e
(-> enum? enum? (-> enum? enum?
@ -236,8 +240,8 @@
es/e)])) es/e)]))
;; filter/e : enum a, (a -> bool) -> enum a ;; filter/e : enum a, (a -> bool) -> enum a
;; size won't be accurate! ;; xxx size won't be accurate!
;; encode is not accurate right now! ;; xxx encode is not accurate right now!
(define (filter/e e p) (define (filter/e e p)
(enum (size e) (enum (size e)
(λ (n) (λ (n)