@MISC{Erkok00arecursive, author = {Levent Erkok}, title = {A Recursive do for Haskell: Design and Implementation}, year = {2000} }
Bookmark
OpenURL
Abstract
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. To remedy this problem, we propose an extension to Haskell's do-notation and describe its translation into the core language. Computing Review Subject Categories: Formal denitions and theory (D.3.1), Language constructs and features (D.3.3). Keywords: Haskell, monads, recursion, mx, do-notation. 1 Introduction Suppose you are designing an interpreter for a language that has ### expressions for introducing local bindings. Operationally, the expression #########denotes the same value as # where # is substituted for all free occurrences of the variable #. The abstract syntax of your language might include: data Exp = ... | Let Var Exp Exp Assuming the language is applicative, the natural choice for implementation would be the envir...