Skip to content

Commit

Permalink
add contracts
Browse files Browse the repository at this point in the history
  • Loading branch information
jbclements committed Mar 3, 2015
1 parent b1efd54 commit 852d6f3
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 33 deletions.
27 changes: 0 additions & 27 deletions mboxrd-read/doc.txt

This file was deleted.

8 changes: 4 additions & 4 deletions mboxrd-read/main.rkt
Original file line number Diff line number Diff line change
Expand Up @@ -15,10 +15,10 @@
(require racket/contract
racket/stream)

(provide/contract [mboxrd-parse (path? . -> . stream?)]
[mboxrd-parse/port (input-port? . -> . stream?)])
(provide/contract [mboxrd-parse (path? . -> . (stream/c (list/c bytes? bytes?)))]
[mboxrd-parse/port (input-port? . -> . (stream/c (list/c bytes? bytes?)))])

;; mboxrd-parse : path -> (lazy-listof (list/c bytes? (promise/c bytes?)))
;; mboxrd-parse :
;; given a path to an mbox file, return a lazy list of the messages in the
;; file. Each file is represented as a list containing a byte-string
;; representing the header and the promise of a byte-string representing
Expand All @@ -28,7 +28,7 @@
(define (mboxrd-parse path)
(mboxrd-parse/port (open-input-file path)))

;; mboxrd-parse/port : port -> (lazy-listof (list/c bytes? (delay/c bytes?))
;; mboxrd-parse/port :
;; NB: this procedure assumes that it's the only one reading the port. Bad
;; stuff will happen if its not; it doesn't leave the "From " of the next
;; message on the stream.
Expand Down
4 changes: 2 additions & 2 deletions mboxrd-read/mboxrd-read.scrbl
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
also known as "normal UNIX mbox files", into lazy lists of messages.}

@defproc[(mboxrd-parse [path path?])
(lazy-listof (list/c bytes? bytes?))]{
(stream/c (list/c bytes? bytes?))]{
given a path to an mbox file, return a stream of the messages in the
file. Each file is represented as a list containing a byte-string
representing the header and the promise of a byte-string representing
Expand All @@ -18,7 +18,7 @@
}

@defproc[(mboxrd-parse/port [port input-port?])
(lazy-listof (list/c bytes? bytes?))]{
(stream/c (list/c bytes? bytes?))]{
given an input port, return a lazy list of the messages in the port.

NB: this procedure assumes that it's the only one reading the port. Bad
Expand Down

0 comments on commit 852d6f3

Please sign in to comment.