강혁준
가입: 2023년 3월 8일 올린 글: 1
|
올려짐: 2023년6월10일 15:01 주제: [HW8] poly checker 관해 질문 드립니다. |
|
|
스켈레톤에 제공된 test case15, 16를 보면
let val print = fn x =>
(write x; true)
in
(print 1, (print "hello world", print true))
end
위와 같은 프로그램에 대해 (bool, (bool, bool))을 유추해야 합니다.
여기서 print에는 write가 있어서
for all a (a = int, bool, string), a => bool 이라는 타입을 갖게 되는데
이게 수업시간에 배운 poly type과 일치하는지 잘 모르겠습니다.
(수업시간에 배운 poly type은 for all simple type a, a => a 형태였던 것 같습니다.)
저희가 hw8에서 구현하는 것이 이런 Ad hoc polymorphism인가요? |
|