A recursive do for Haskell

Certain programs making use of monads need to perform recursion over the values of monadic actions. Although the do-notation of Haskell provides a convenient framework for monadic programming, it lacks the generality to support such recursive bindings. In this paper, we describe an enhanced translation schema for the donotation and its integration into Haskell. The new translation allows variables to be bound recursively, provided the underlying monad comes equipped with an appropriate fixed-point operator.

[1]  Andrew Moran,et al.  Semantics of value recursion for Monadic Input/Output , 2002, RAIRO Theor. Informatics Appl..

[2]  John Launchbury,et al.  Microprocessor specification in Hawk , 1998, Proceedings of the 1998 International Conference on Computer Languages (Cat. No.98CB36225).

[3]  Mark P. Jones,et al.  Typing Haskell in Haskell , 1999 .

[4]  Johan Nordlander,et al.  Reactive Objects and Functional Programming , 1999 .

[5]  H.J.M. Meijer,et al.  Proceedings of the 1999 Haskell Workshop , 1999 .

[6]  Ross Paterson,et al.  A new notation for arrows , 2001, ICFP '01.

[7]  Oege de Moor An Exercise in Polytypic Program Derivation: repmin , 1996 .

[8]  Levent Erkok,et al.  A Recursive do for Haskell: Design And Implementation , 2000 .

[9]  Richard S. Bird Using circular programs to eliminate multiple traversals of data , 2004, Acta Informatica.

[10]  John Launchbury,et al.  Recursive monadic bindings , 2000, ICFP '00.

[11]  Andrew Moran,et al.  Semantics of fixIO , 2001 .

[12]  Andrew K. Wright Simple imperative polymorphism , 1995, LISP Symb. Comput..

[13]  Levent Erkok,et al.  Value recursion in monadic computations , 2002 .

[14]  John Hughes,et al.  Report on the Programming Language Haskell 98 , 1999 .

[15]  Nick Benton,et al.  Traced Premonoidal Categories , 2003, RAIRO Theor. Informatics Appl..

[16]  Koen Claessen Embedded Languages for Describing and Verifying Hardware , 2001 .

[17]  John Launchbury,et al.  On embedding a microarchitectural design language within Haskell , 1999, ICFP '99.

[18]  Mark P. Jones,et al.  First-class polymorphism with type inference , 1997, POPL '97.

[19]  Simon L. Peyton Jones,et al.  Report on the programming language Haskell: a non-strict, purely functional language version 1.2 , 1992, SIGP.