ParaForming: Forming Parallel Haskell Programs Using Novel Refactoring Techniques

  • Christopher Brown
  • Hans-Wolfgang Loidl
  • Kevin Hammond
Part of the Lecture Notes in Computer Science book series (LNCS, volume 7193)


Enabling programmers to “think parallel” is critical if we are to be able to effectively exploit future multicore/manycore architectures. This paper introduces paraforming: a new approach to constructing parallel functional programs using formally-defined refactoring transformations. We introduce a number of new refactorings for Parallel Haskell that capture common parallel abstractions, such as divide-and-conquer and data parallelism, and show how these can be used by HaRe, the Haskell Refactorer. Using a paraforming approach, we are able to easily obtain significant and scalable speedups (up to 7.8 on an 8-core machine).


Parallel Performance Parallel Program Data Parallelism Abstract Syntax Tree Task Parallelism 
These keywords were added by machine and not by the authors. This process is experimental and the keywords may be updated as the learning algorithm improves.


Unable to display preview. Download preview PDF.

Unable to display preview. Download preview PDF.


  1. 1.
    Moore, G.E.: Readings in Computer Architecture, pp. 56–59. Morgan Kaufmann Publishers Inc., San Francisco (2000)Google Scholar
  2. 2.
    Peyton Jones, S., Hammond, K.: Haskell 98 Language and Libraries, the Revised Report. Cambridge University Press (2003)Google Scholar
  3. 3.
    Opdyke, W.F.: Refactoring Object-Oriented Frameworks. PhD thesis, Department of Computer Science, University of Illinois at Urbana-Champaign, Champaign, IL, USA (1992)Google Scholar
  4. 4.
    Li, H., Thompson, S., Reinke, C.: The Haskell Refactorer: HaRe, and its API. In: Proc. of the 5th Workshop on Language Descriptions, Tools and Applications (LDTA 2005). Electronic Notes in Theoretical Computer Science, vol. 141(4) (April 2005)Google Scholar
  5. 5.
    Hallgren, T.: Haskell Tools from the Programatica Project. In: ACM SIGPLAN Workshop on Haskell, pp. 103–106. ACM Press, Uppsala (2003)CrossRefGoogle Scholar
  6. 6.
    Lämmel, R., Visser, J.: A Strafunski Application Letter. In: Dahl, V. (ed.) PADL 2003. LNCS, vol. 2562, pp. 357–375. Springer, Heidelberg (2002)CrossRefGoogle Scholar
  7. 7.
    Trinder, P.W., Hammond, K., Loidl, H.W., Peyton Jones, S.L.: Algorithm + Strategy = Parallelism. J. of Functional Programming 8(1), 23–60 (1998)MathSciNetzbMATHCrossRefGoogle Scholar
  8. 8.
    Marlow, S., Maier, P., Loidl, H.W., Aswad, M.K., Trinder, P.: Seq no more: Better Strategies for Parallel Haskell. In: 3rd ACM SIGPLAN Symposium on Haskell, pp. 91–102. ACM Press, Baltimore (2010)CrossRefGoogle Scholar
  9. 9.
    Loogen, R., Ortega-Mallén, Y., Peña-Marí, R.: Parallel Functional Programming in Eden. J. of Functional Programming 15(3), 431–475 (2005)zbMATHCrossRefGoogle Scholar
  10. 10.
    Brown, C.: Tool Support for Refactoring Haskell Programs. PhD thesis, Computing Laboratory, University of Kent, Canterbury, Kent, UK (September 2008)Google Scholar
  11. 11.
    Li, H.: Refactoring Haskell Programs. PhD thesis, School of Computing, University of Kent, Canterbury, Kent, UK (September 2006)Google Scholar
  12. 12.
    Loidl, H.W., Trinder, P., Hammond, K., Junaidu, S., Morgan, R., Peyton Jones, S.: Engineering Parallel Symbolic Programs in GpH. Concurrency — Practice and Experience 11(12), 701–752 (1999)CrossRefGoogle Scholar
  13. 13.
    Kennedy, K., McKinley, K.S., Tseng, C.W.: Interactive Parallel Programming using the ParaScope Editor. IEEE Trans. Parallel Distrib. Syst. 2, 329–341 (1991)CrossRefGoogle Scholar
  14. 14.
    Wloka, J., Sridharan, M., Tip, F.: Refactoring for Reentrancy. In: ESEC/FSE 2009, pp. 173–182. ACM, Amsterdam (2009)CrossRefGoogle Scholar
  15. 15.
    Dig, D.: A Refactoring Approach to Parallelism. IEEE Softw. 28, 17–22 (2011)CrossRefGoogle Scholar
  16. 16.
    Hammond, K., Berthold, J., Loogen, R.: Automatic Skeletons in Template Haskell. Parallel Processing Letters 13(3), 413–424 (2003)MathSciNetCrossRefGoogle Scholar
  17. 17.
    Scaife, N., Horiguchi, S., Michaelson, G., Bristow, P.: A Parallel SML Compiler Based on Algorithmic Skeletons. J. Funct. Program. 15, 615–650 (2005)zbMATHCrossRefGoogle Scholar
  18. 18.
    Marlow, S., Newton, R., Peyton Jones, S.: A Monad for Deterministic Parallelism. In: Intl. Conference on Functional Programming (ICFP 2011) (2011) (submitted)Google Scholar
  19. 19.
    Epstein, J., Black, A., Peyton Jones, S.: Towards Haskell in the Cloud. In: 4th ACM SIGPLAN Symposium on Haskell. ACM Press, Tokyo (2011)Google Scholar

Copyright information

© Springer-Verlag Berlin Heidelberg 2012

Authors and Affiliations

  • Christopher Brown
    • 1
  • Hans-Wolfgang Loidl
    • 2
  • Kevin Hammond
    • 1
  1. 1.School of Computer ScienceUniversity of St. AndrewsUK
  2. 2.School of Mathematical and Computer SciencesHeriot-Watt UniversityUK

Personalised recommendations