\( \newcommand\D{\mathrm{d}} \newcommand\E{\mathrm{e}} \newcommand\I{\mathrm{i}} \newcommand\bigOh{\mathcal{O}} \newcommand{\cat}[1]{\mathbf{#1}} \newcommand\curl{\vec{\nabla}\times} \newcommand{\CC}{\mathbb{C}} \newcommand{\NN}{\mathbb{N}} \newcommand{\QQ}{\mathbb{Q}} \newcommand{\RR}{\mathbb{R}} \newcommand{\ZZ}{\mathbb{Z}} \)
UP | HOME

Functional Programming in Standard ML

Table of Contents

1. Introduction

Standard ML is not a "pure" functional programming language, but we can work with the fragment of Standard ML which is a "pure" functional language. The only side effects come from:

  • References
  • Exceptions
  • Input/output
  • Threading (forking, etc.)

I suppose a "purist" would argue that definitions also cause a side-effect, altering the environment to add a new binding. We will ignore such people.

The advantage to writing functional code is that we can take advantage of equational reasoning to prove the code works as expected.

2. References

  • Åke Wikström,
    Functional Programming Using Standard ML.
    Prentice Hall, 1987.

Last Updated 2023-02-27 Mon 08:18.