`#:methods gen:custom-write` replacement in typed/racket?

Probably silly, but I don't want to affect any existing code that relies on gen:custom-write

(struct vec3 (x y z)
  #:methods gen:custom-write
  [(define (write-proc v port mode)
     (fprintf port "~a ~a ~a" (vec3-x v) (vec3-y v) (vec3-z v)))]
  #:transparent
  #:mutable)

prop:custom-write should work

2 Likes