Type-directed language extension for effectful computations

Evgenii Kotelnikov
2014 Proceedings of the Fifth Anuual Scala Workshop on - SCALA '14  
Computation types such as functors, applicative functors and monads have become common abstractions for modeling effectful computations in functional programming languages. They are often used together with special language extensions intended to simplify the syntax of monadic expressions. We can simplify it even more by employing types rather than just mechanical syntactic transformation. In this paper we present scala-workflow, a macro-based extension to the Scala programming language that
more » ... ers uniform syntax for structuring effectful computations expressed as abstract interfaces with a stackable set of combinators. Unlike similar syntactic extensions, such as F#'s computation expressions, Haskell's do-notation and Scala's own for-expressions, scala-workflow allows users to transparently blend pure and effectful functions in a bounded context, as they are separated during macro expansion based on the types of subexpressions.
doi:10.1145/2637647.2637648 dblp:conf/ecoop/Kotelnikov14 fatcat:kuf5j3uzhnfnhbe7ckjde2neu4