Parallel pattern-matching offers the maximum laziness for programs written in lazy functional languages. Function arguments are evaluated concurrently and all arguments are given equal precedence, so functions can return results whenever possible in the presence of errors or infinite computations. We describe the motivation for and the semantics of parallel pattern-matching. We also describe the first available implementation of Haskell with parallel pattern-matching. The implementation works via a source-to-source translation into Concurrent Haskell, using the existing facilities of GHC to provide the required concurrency. Various transformation techniques are outlined which can help to reduce the degree and cost of the concurrency required to satisfy the semantics.
['Lyndon While', 'Gregory Mildenhall']
An implementation of parallel pattern-matching via concurrent haskell