I'd like to convert the following typed program into an untyped one that
uses a contract instead of a type signature to protect the member function.

#lang typed/racket
(struct: (A) Node ([val : A]

                   [left-tree  : (MyTree A)]

                   [right-tree : (MyTree A)]))
(define-type (MyTree A) (U 'Nil (Node A)))

(: member (All (A) (-> A (MyTree A) Boolean)))
(define (member x xs)
  #t)


More specifically, can someone help me fill in the blank marked "TODO"
below:

#lang racket
(struct Node (val left-tree right-tree))

(define/contract (member x xs)
  (parametric->/c [A] TODO)
  #t)
____________________
  Racket Users list:
  http://lists.racket-lang.org/users

Reply via email to