This Article 
 Bibliographic References 
 Add to: 
Exception Handlers in Functional Programming Languages
August 1993 (vol. 19 no. 8)
pp. 826-834

Constructs for expressing exception handling can greatly help to avoid clutter in code by allowing the programmer to separate the code to handle unusual situations from the code for the normal case. The author proposes a new approach to embed exception handlers in functional languages. The proposed approach discards the conventional view of treating exceptions, as a means of effecting a control transfer; instead, exceptions are used to change the state of an object. The two types of exceptions, terminate and resume, are treated differently. A terminate exception, when raised, is viewed as shielding the input object. On the other hand, a resume exception designates the input object as curable and requires the immediate application of a handler function. This approach enables the clean semantics of functions raising exceptions without associating any implementation restriction and without loss of the referential transparency and the commutativity properties of functions.

[1] J. Backus, "Can programming be liberated from the von Neumann style? A functional style and its algebra of programs,"Commun. ACM, vol. 21, no. 8, pp. 613-641, Aug. 1978.
[2] J. Backus, J.H. Williams, E.L. Wimmers, P. Lucas, and A. Aiken, "FL language manual," IBM Almaden Research Center, San Jose, CA, Tech. Rep. RJ-7100(67 163), 1989.
[3] M. Bretz and J. Ebert, "An exception handling construct for functional languages," inLecture Notes in Computer Science 300. Berlin: Springer-Verlag, 1988, pp. 160-174.
[4] F. Cristian, "Exception handling and software fault tolerance,"IEEE Trans. Comput., vol. C-31, no. 6, pp. 531-540, June 1982.
[5] J. B. Goodenough, "Exception handling: issues and a proposed notation,"Commun. ACM, vol. 18, (Tech. Rep. 12), pp. 683-696. Dec. 1975.
[6] K. Hammond, "Exception handling in a parallel functional language: PSML," Dept. Computing Sci., Univ. of Glasgow, Glasgow, Scotland, Res. Rep. CSC/89/R17, 1989.
[7] R. W. Harper, A.R.J.G. Milner, and M.Tofte, "The definition of Standard ML, version 3," Dept. Comput. Sci., Edinburgh Univ., Edinburgh, Scotland, Internal Rep. ECS-LFCS-89-91, 1989.
[8] B. Randell, "System structure for software fault tolerance,"IEEE Trans. Software Eng., vol. SE-1, no. 2, pp. 220-232, June 1975.
[9] A. C. Reeves, D.A. Harrison, A.F. Sinclair, and P. Williamson, "Gerald: An exceptional lazy functional programming language," Dept. Computing Sci., Univ. of Stirling, Stirling, Scotland, Tech. Rep. 50, Feb. 1990.
[10] P. L. Wadler, "How to replace failure by a list of successes: A method for exception handling, backtracking and pattern matching in lazy functional languages," inProc. ACM Symp. Functional Programming and Computer Architecture, Sept. 1985.
[11] S. Yemini and D. M. Berry, "An axiomatic treatment of exception handling in an expression-oriented language,"ACM Trans. Program. Lang. Syst., vol. 9, no. 3, July 1987.

Index Terms:
functional programming; exception handling; programmer; functional languages; terminate; resume; input object; implementation restriction; referential transparency; commutativity properties; exception handling; functional programming; high level languages; programming theory
R. Govindarajan, "Exception Handlers in Functional Programming Languages," IEEE Transactions on Software Engineering, vol. 19, no. 8, pp. 826-834, Aug. 1993, doi:10.1109/32.238585
Usage of this product signifies your acceptance of the Terms of Use.