diff --git a/api.rkt b/api.rkt index 4eb972a..616a29f 100644 --- a/api.rkt +++ b/api.rkt @@ -37,6 +37,7 @@ (require "mapping.rkt") (require racket/set) (require racket/match) +(require racket-typed-matrix/struct-map) ;; (These utilities need to be defined ahead of the domain struct ;; definition.) @@ -52,13 +53,10 @@ ;; www.google.com is represented as '(#"www" #"google" #"com"). (struct domain (labels downcased-labels) #:transparent - #:property prop:equal+hash (list domain=? domain-hash-1/2 domain-hash-1/2)) - -(require racket-typed-matrix/struct-map) -(install-struct-mapper! struct:domain - (lambda (f seed x) - (let-values (((labels seed) (f (domain-labels x) seed))) - (values (make-domain labels) seed)))) + #:property prop:equal+hash (list domain=? domain-hash-1/2 domain-hash-1/2) + #:property prop:struct-map (lambda (f seed x) + (let-values (((labels seed) (f (domain-labels x) seed))) + (values (make-domain labels) seed)))) ;; A ShortString is a String with length 255 or shorter.