-
Notifications
You must be signed in to change notification settings - Fork 16
/
Copy pathweb-graph.scrbl
36 lines (28 loc) · 1.17 KB
/
web-graph.scrbl
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
#lang scribble/manual
@(require (for-label racket/base
racket/contract/base
rebellion/web-graph
rebellion/web-link)
(submod rebellion/private/scribble-evaluator-factory doc)
scribble/example)
@(define make-evaluator
(make-module-sharing-evaluator-factory
#:public (list 'rebellion/web-graph 'rebellion/web-link)
#:private (list 'racket/base)))
@title{Web Graphs}
@defmodule[rebellion/web-graph]
A @deftech{web graph} is an immutable, directed multigraph where nodes are URIs
and edges are link relations.
@defproc[(web-graph? [v any/c]) boolean?]{
A predicate for @tech{web graphs}.}
@defproc[(web-graph [link web-link?] ...) web-graph?]{
Constructs a @tech{web graph} containing the given @racket[link]s.
@(examples
#:eval (make-evaluator) #:once
(web-graph
(web-link "http://example.org" 'stylesheet "/styles.css")
(web-link "http://example.org" 'stylesheet "/fonts.css")
(web-link "http://example.org" 'search "/opensearch.xml")
(web-link "http://example.org" 'privacy-policy "/privacy-policy")))}
@defthing[empty-web-graph web-graph?]{
The empty @tech{web graph}.}