A typed monadic embedding of aspects

We describe a novel approach to embed pointcut/advice aspects in a typed functional programming language like Haskell. Aspects are first-class, can be deployed dynamically, and the pointcut language is extensible. Type soundness is guaranteed by exploiting the underlying type system, in particular phantom types and a new anti-unification type class. The use of monads brings type-based reasoning about effects for the first time in the pointcut/advice setting, thereby practically combining Open Modules and EffectiveAdvice, and enables modular extensions of the aspect language.

[1]  Philip Wadler,et al.  How to make ad-hoc polymorphism less ad hoc , 1989, POPL '89.

[2]  Eugenio Moggi,et al.  Notions of Computation and Monads , 1991, Inf. Comput..

[3]  Paul Hudak,et al.  Monad transformers and modular interpreters , 1995, POPL '95.

[4]  Gregor Kiczales,et al.  Aspect-oriented programming , 1996, CSUR.

[5]  Cristina V. Lopes,et al.  Aspect-oriented programming , 1999, ECOOP Workshops.

[6]  Daan Leijen,et al.  Domain specific embedded compilers , 1999, DSL '99.

[7]  Mark P. Jones,et al.  Type Classes with Functional Dependencies , 2000, ESOP.

[8]  Wolfgang De Meuter Monads as a theoretical foundation for AOP , 2000 .

[9]  William G. Griswold,et al.  An Overview of AspectJ , 2001, ECOOP.

[10]  Simon Peyton Jones,et al.  Template meta-programming for Haskell , 2002, ACM SIGPLAN Notices.

[11]  Benjamin C. Pierce,et al.  Types and programming languages: the next generation , 2003, 18th Annual IEEE Symposium of Logic in Computer Science, 2003. Proceedings..

[12]  Hidehiko Masuhara,et al.  A Compilation and Optimization Model for Aspect-Oriented Programs , 2003, CC.

[13]  Hidehiko Masuhara,et al.  Dataflow Pointcut in Aspect-Oriented Programming , 2003, APLAS.

[14]  Gregor Kiczales,et al.  A semantics for advice and dynamic join points in aspect-oriented programming , 2001, TOPL.

[15]  Martin C. Rinard,et al.  A classification system and analysis for aspect-oriented programs , 2004, SIGSOFT '04/FSE-12.

[16]  Rémi Douence,et al.  Trace-Based Aspects , 2004 .

[17]  Jonathan Aldrich,et al.  Open Modules: Modular Reasoning About Advice , 2005, ECOOP.

[18]  Akinori Yonezawa,et al.  Aspectual Caml: an aspect-oriented functional language , 2005, ICFP '05.

[19]  David Walker,et al.  Harmless advice , 2006, POPL '06.

[20]  Shriram Krishnamurthi,et al.  Semantics and scoping of aspects in higher-order languages , 2006, Sci. Comput. Program..

[21]  Christian Hofer,et al.  On the relation of aspects and monads , 2007, FOAL.

[22]  Meng Wang,et al.  Aspect-oriented programming with type classes , 2007, FOAL.

[23]  David Walker,et al.  AspectML: A polymorphic aspect-oriented functional programming language , 2008, TOPL.

[24]  Gordon Plotkin,et al.  A Note on Inductive Generalization , 2008 .

[25]  Éric Tanter Expressive scoping of dynamically-deployed aspects , 2008, AOSD.

[26]  Bruno De Fraine,et al.  StrongAspectJ: flexible and safe pointcut/advice bindings , 2008, AOSD.

[27]  Éric Tanter Execution levels for aspect-oriented programming , 2010, AOSD.

[28]  Bruno C. d. S. Oliveira,et al.  EffectiveAdvice: disciplined advice with explicit effects , 2010, AOSD.

[29]  Éric Tanter,et al.  AspectScript: expressive aspects for the web , 2010, AOSD.

[30]  Gary T. Leavens,et al.  Translucid contracts: expressive specification and modular verification for aspect-oriented interfaces , 2011, AOSD '11.

[31]  Éric Tanter,et al.  A semantics for execution levels with exceptions , 2011, FOAL.

[32]  Nicolas Tabareau,et al.  A monadic interpretation of execution levels and exceptions for AOP , 2012, AOSD.

[33]  Nicolas Tabareau,et al.  A practical monadic aspect weaver , 2012, FOAL '12.