A recursive do for Haskell : design and implementation
Levent Erkök
Abstract
Levent Erkök
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...
OpenAlex reports 5 citations for this work. Citation counts describe recorded attention and do not establish research quality.
A contribution statement is not available in the OpenAlex record.
Method details are not available in the OpenAlex metadata.
Findings are not separately available in the OpenAlex metadata.
Limitations are not available in the OpenAlex metadata.
Application details are not available in the OpenAlex metadata.
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...
Key concepts: Haskell, Programming language, Computer science, Recursion (computer science), Notation, Generality, Extension (predicate logic), Functional programming