main
Matthew Butterick 10 years ago
parent c0ed7b08a1
commit 4d254fe912

@ -19,6 +19,8 @@
(define-type QuadAttrValue Any)
(define-predicate QuadAttrValue? QuadAttrValue)
(define-type QuadAttrs (HashTable QuadAttrKey QuadAttrValue))
(define-type HashableList (All (A) (Rec duo (U Null (List* QuadAttrKey A duo)))))
(: quad-attrs? (Any . -> . Boolean))
(define (quad-attrs? x)

@ -16,9 +16,8 @@
;; push together multiple attr sources into one list of pairs.
;; mostly a helper function for the two attr functions below.
(: join-attrs ((Listof (U Quad QuadAttrs)) . -> . QuadAttrs))
(: join-attrs ((Listof (U Quad QuadAttrs HashableList)) . -> . QuadAttrs))
(define (join-attrs quads-or-attrs-or-lists)
; (list-of-mergeable-attrs? . -> . pairs?)
(append-map hash->list (filter-not false? (map (λ(x)
(cond
[(quad? x) (quad-attrs x)]

Loading…
Cancel
Save