1
Haskell 유형 클래스를 사용하여 commutativity 적용
함께 교차 할 수있는 기하학적 객체의 유형 클래스를 정의하고 싶습니다. class Intersect a b c | a b -> c where intersect :: a -> b -> c -- Language extensions: -XMultiParamTypeClasses, -XFunctionalDependencies 아이디어는 다른 유형의 객체를 처리 할 수있는 범용 교차 함수를 갖는 것입니다. 예를 들어 instance Intersect Line …