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
_version_ 1783616574629871616
author Matsuda, Kazutaka
author_facet Matsuda, Kazutaka
author_sort Matsuda, Kazutaka
collection PubMed
description 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.
format Online
Article
Text
id pubmed-7702242
institution National Center for Biotechnology Information
language English
publishDate 2020
record_format MEDLINE/PubMed
spelling pubmed-77022422020-12-01 Modular Inference of Linear Types for Multiplicity-Annotated Arrows Matsuda, Kazutaka Programming Languages and Systems Article 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. 2020-04-18 /pmc/articles/PMC7702242/ http://dx.doi.org/10.1007/978-3-030-44914-8_17 Text en © The Author(s) 2020 Open Access This chapter is licensed under the terms of the Creative Commons Attribution 4.0 International License (http://creativecommons.org/licenses/by/4.0/), which permits use, sharing, adaptation, distribution and reproduction in any medium or format, as long as you give appropriate credit to the original author(s) and the source, provide a link to the Creative Commons license and indicate if changes were made. The images or other third party material in this chapter are included in the chapter's Creative Commons license, unless indicated otherwise in a credit line to the material. If material is not included in the chapter's Creative Commons license and your intended use is not permitted by statutory regulation or exceeds the permitted use, you will need to obtain permission directly from the copyright holder.
spellingShingle Article
Matsuda, Kazutaka
Modular Inference of Linear Types for Multiplicity-Annotated Arrows
title Modular Inference of Linear Types for Multiplicity-Annotated Arrows
title_full Modular Inference of Linear Types for Multiplicity-Annotated Arrows
title_fullStr Modular Inference of Linear Types for Multiplicity-Annotated Arrows
title_full_unstemmed Modular Inference of Linear Types for Multiplicity-Annotated Arrows
title_short Modular Inference of Linear Types for Multiplicity-Annotated Arrows
title_sort modular inference of linear types for multiplicity-annotated arrows
topic Article
url https://www.ncbi.nlm.nih.gov/pmc/articles/PMC7702242/
http://dx.doi.org/10.1007/978-3-030-44914-8_17
work_keys_str_mv AT matsudakazutaka modularinferenceoflineartypesformultiplicityannotatedarrows