의 모호한 선두로부터 코드입니다 : 기본 설정으로 "t 쇼"의 "쇼"를 사용하고 주어진 정의와 트리 데이터와 "쇼"를 사용하는 방법클래스 인스턴스 및 하스켈
data Tree t = NilT
| Node t (Tree t) (Tree t)
instance Show (Tree t) where
show NilT = ""
show Node t l r = (show t) ++ ", " ++ (show l) ++ ", " ++ (show r)
나 혼자서?
숙제에 문제가 있습니까? 그것은 의심스러운 최근의 질문과 유사 http://stackoverflow.com/questions/7478878/show-function-for-polymorphic-type 및 http://stackoverflow.com/questions/7479252/how-to-define-that- a-generic-type-is-printable – ivanm