Skip to main content
QUICK REVIEW

[논문 리뷰] Functor is to Lens as Applicative is to Biplate: Introducing Multiplate

Russell O’Connor|arXiv (Cornell University)|2011. 03. 15.
Logic, programming, and type systems인용 수 14
한 줄 요약

이 논문은 랭크-3 다형성과 함께 상호 재귀적 자료형을 지원하는 헌터플러스의 새로운 일반 프로그래밍 추상화인 Multiplate를 소개한다. 이는 Biplate와 Compos를 일반화하여, Uniplate와 Compos의 핵심 유형 간에 카테고리적 동형을 설정함으로써, 복잡한 자료 구조를 위한 더 단순하고 강력한 일반적 순회 시스템을 가능하게 한다.

ABSTRACT

This paper gives two new categorical characterisations of lenses: one as a coalgebra of the store comonad, and the other as a monoidal natural transformation on a category of a certain class of coalgebras. The store comonad of the first characterisation can be generalized to a Cartesian store comonad, and the coalgebras of this Cartesian store comonad turn out to be exactly the Biplates of the Uniplate generic programming library. On the other hand, the monoidal natural transformations on functors can be generalized to work on a category of more specific coalgebras. This generalization turns out to be the type of compos from the Compos generic programming library. A theorem, originally conjectured by van Laarhoven, proves that these two generalizations are isomorphic, thus the core data types of the Uniplate and Compos libraries supporting generic program on single recursive types are the same. Both the Uniplate and Compos libraries generalize this core functionality to support mutually recursive types in different ways. This paper proposes a third extension to support mutually recursive data types that is as powerful as Compos and as easy to use as Uniplate. This proposal, called Multiplate, only requires rank 3 polymorphism in addition to the normal type class mechanism of Haskell.

연구 동기 및 목표

  • 기존의 일반 프로그래밍 라이브러리인 Uniplate와 Compos의 카테고리적 기초를 통합하기 위해.
  • Biplate와 Compos를 상호 재귀적 자료형을 안전하고 조합 가능한 방식으로 지원하도록 일반화하기 위해.
  • Uniplate의 사용성과 Compos의 표현력을 결합한 새로운 추상화인 Multiplate를 소개하기 위해.
  • Uniplate와 Compos의 핵심 유형이 렌즈와 응용형의 카테고리적 특성화를 통해 동형임을 증명하기 위해.
  • Multiplate가 랭크-3 다형성만을 요구하므로 표준 헌터플러스 타입 클래스 메커니즘 내에서 실용적임을 보여주기 위해.

제안 방법

  • 스토어 코모나드의 코알지브라로 렌즈를 카테고리적으로 특성화하고, 이를 카르테시안 스토어 코모나드로 일반화한다.
  • 카르테시안 스토어 코모나드의 코알지브라가 Uniplate의 Biplate 유형의 수학적 기초임을 규명한다.
  • Compos의 컴포즈를 특정 코알지브라의 카테고리 위에서의 모나이드럴 자연 변환으로 특성화한다.
  • 두 일반화—카르테시안 스토어 코모나드의 코알지브라와 모나이드럴 자연 변환—간의 동형을 증명함으로써 Uniplate와 Compos를 통합한다.
  • 랭크-3 다형성을 사용하여 상호 재귀적 유형을 순회할 수 있도록 하는, 양자를 일반화하는 새로운 추상화인 Multiplate를 제안한다.
  • Functor과 렌즈 사이, Applicative과 Biplate 사이의 카테고리적 이중성을 활용하여 Multiplate의 설계와 형식화를 이끌어낸다.

실험 결과

연구 질문

  • RQ1Uniplate와 Compos의 핵심 유형이 카테고리적으로 동형임을 입증할 수 있는가?
  • RQ2Biplate와 Compos는 상호 재귀적 자료형을 원칙적으로 지원하도록 어떻게 일반화할 수 있는가?
  • RQ3Functor과 렌즈 사이, Applicative과 Biplate 사이의 이중성을 뒷받침하는 카테고리적 구조는 무엇인가?
  • RQ4Uniplate의 단순성과 Compos의 표현력을 결합한 새로운 일반 프로그래밍 추상화를 구성할 수 있는가?
  • RQ5이러한 일반화를 표현하기 위해 필요한 타입 체계 기능은 무엇이며, 랭크-3 다형성만으로도 이를 달성할 수 있는가?

주요 결과

  • 카르테시안 스토어 코모나드의 코알지브라가 Biplate 유형과 동형이므로, Uniplate의 순회 메커니즘에 대한 카테고리적 기초를 제공한다.
  • 특정 카테고리의 코알지브라 위에서의 모나이드럴 자연 변환은 Compos 유형과 동형이므로, 그 이론적 기초를 통합한다.
  • 두 일반화 간의 동형은 Uniplate와 Compos의 핵심 추상화가 카테고리적으로 동치임을 확인한다.
  • Multiplate는 Compos의 표현력과 Uniplate의 사용성 모두를 갖춘 상호 재귀적 유형을 지원하는 새로운 일반 프로그래밍 추상화로 제안된다.
  • Multiplate의 구축에는 랭크-3 다형성만 필요하므로, 표준 헌터플러스 타입 클래스 시스템 내에서 실용적이다.
  • 논문은 형식적인 이중성을 확립한다: Functor는 Lens와 같고, Applicative은 Biplate와 같으며, Multiplate는 그 다음 일반화로 확장된다.

더 나은 연구,지금 바로 시작하세요

논문 읽기부터 검토까지, 연구 시간을 획기적으로 줄여보세요.

카드 등록 없음 · 무료 플랜 제공

이 리뷰는 AI가 만들고, 인간 에디터가 검토했습니다.