Cargando…

Modular Inference of Linear Types for Multiplicity-Annotated Arrows

Bernardy et al. [2018] proposed a linear type system [Formula: see text] as a core type system of Linear Haskell. In the system, linearity is represented by annotated arrow types [Formula: see text] , where m denotes the multiplicity of the argument. Thanks to this representation, existing non-linea...

Descripción completa

Detalles Bibliográficos
Autor principal: Matsuda, Kazutaka
Formato: Online Artículo Texto
Lenguaje:English
Publicado: 2020
Materias:
Acceso en línea:https://www.ncbi.nlm.nih.gov/pmc/articles/PMC7702242/
http://dx.doi.org/10.1007/978-3-030-44914-8_17
Descripción
Sumario:Bernardy et al. [2018] proposed a linear type system [Formula: see text] as a core type system of Linear Haskell. In the system, linearity is represented by annotated arrow types [Formula: see text] , where m denotes the multiplicity of the argument. Thanks to this representation, existing non-linear code typechecks as it is, and newly written linear code can be used with existing non-linear code in many cases. However, little is known about the type inference of [Formula: see text] . Although the Linear Haskell implementation is equipped with type inference, its algorithm has not been formalized, and the implementation often fails to infer principal types, especially for higher-order functions. In this paper, based on OutsideIn(X) [Vytiniotis et al., 2011], we propose an inference system for a rank 1 qualified-typed variant of [Formula: see text] , which infers principal types. A technical challenge in this new setting is to deal with ambiguous types inferred by naive qualified typing. We address this ambiguity issue through quantifier elimination and demonstrate the effectiveness of the approach with examples.