A church-style intermediate language for MLF

MLF is a type system that seamlessly merges ML-style implicit but second-class polymorphism with System-F explicit first-class polymorphism. We present xMLF, a Church-style version of MLF with full type information that can easily be maintained during reduction. All parameters of functions are explicitly typed and both type abstraction and type instantiation are explicit. However, type instantiation in xMLF is more general than type application in System F. We equip xMLF with a small-step reduction semantics that allows reduction in any context, and show that this relation is confluent and type preserving. We also show that both subject reduction and progress hold for weak-reduction strategies, including call-by-value with the value-restriction. We exhibit a type preserving encoding of MLF into xMLF, which shows that xMLF can be used as the internal language for MLF after type inference, and also ensures type soundness for the most expressive variant of MLF.

[1]  Simon L. Peyton Jones,et al.  System F with type equality coercions , 2007, TLDI '07.

[2]  Paolo Herms Partial Type Inference with Higher-Order Types , 2009 .

[3]  Daan Leijen A type directed translation of MLF to system F , 2007, ICFP '07.

[4]  John C. Mitchell,et al.  Polymorphic Type Inference and Containment , 1988, Inf. Comput..

[5]  Daan Leijen,et al.  Flexible types: robust type inference for first-class polymorphism , 2009, POPL '09.

[6]  Benjamin C. Pierce,et al.  Advanced Topics In Types And Programming Languages , 2004 .

[7]  Didier Rémy,et al.  Recasting MLF , 2009, Inf. Comput..

[8]  Didier Rémy,et al.  MLF: raising ML to the power of system F , 2014, SIGP.

[9]  Didier Rémy,et al.  MLF: raising ML to the power of system F , 2003, ACM SIGPLAN Notices.

[10]  Henk Barendregt,et al.  The Lambda Calculus: Its Syntax and Semantics , 1985 .

[11]  Peyton Jones,et al.  Haskell 98 language and libraries : the revised report , 2003 .

[12]  Boris Yakobowski Graphical types and constraints - second-order polymorphism and inference. (Types et contraintes graphiques - polymorphisme de second ordre et inférence) , 2008 .

[13]  Didier Rémy,et al.  A graphical presentation of MLF types with a linear-time unification algorithm , 2007, TLDI '07.

[14]  Karl Crary Typed compilation of inclusive subtyping , 2000, ICFP '00.

[15]  Didier Rémy,et al.  From ML to MLF: graphic type constraints with efficient type inference , 2008, ICFP.

[16]  Simon L. Peyton Jones,et al.  Generative type abstraction and type-level computation , 2011, POPL '11.

[17]  Matthias Felleisen,et al.  A Syntactic Approach to Type Soundness , 1994, Inf. Comput..

[18]  Didier Rémy,et al.  On the power of coercion abstraction , 2012, POPL '12.

[19]  Didier Le Botlan,et al.  MLF: An extension of ML with first-class polymorphism and implicit instantiation. (MLF : Une extension de ML avec polymorphisme de second ordre et instanciation implicite) , 2004 .

[20]  Daan Leijen,et al.  Qualified types for MLF , 2005, ICFP '05.

[21]  Mark P. Jones A Theory of Qualified Types , 1994, Sci. Comput. Program..

[22]  Boris Yakobowski,et al.  From ML to ML F : graphic type constraints with efficient type inference , 2008, ICFP 2008.

[23]  Arthur Charguéraud,et al.  Engineering formal metatheory , 2008, POPL '08.

[24]  Giulio Manzonetto,et al.  Harnessing MLF with the Power of System F , 2010, MFCS.