From the course: Programming Foundations: Discrete Mathematics

Functional programming

“

- [Voiceover] What are Functional Programming Languages? Functional Programming Languages use functions, not objects or procedures. Functions are the fundamental building blocks of a program. It allows the user to take on complex, real world tasks. SML, or Standard Machine Language, is an example of a Functional Programming Language. It is based on the model of evaluating expressions, as opposed to the model of executing sequences of commands, found in Imperative Languages. SML differs slightly from pure Functional Languages. SML allows the use of constructs such as, variables, assignment, and sequencing of side affecting operations. The use of a Functional Programming Language in this series, is to show the transfer of skills for writing proofs, to writing programs, and vice-versa. So that we can model mathematical concepts on the computer. SML is easy to install and use. To start, go to the website: smlnj.org. From here, we can click on "Downloads," to get the most recent version. I'm gonna go ahead and click on the 110.79 software links. As you can see, it provides us with downloads for a Unix environment, MAC OSX, and Microsoft Windows. For this series, I'm gonna download the Windows version. Notice, it's an MSI file. Once it's downloaded, you need to make sure you have the Windows Installer on your machine. If not, you can use the WinINSTALL to get it. OK. Now it's installed. I can go ahead and open it. As you can see, the setup window will install Standard ML of New Jersey. Let's click on: "Next." I'm gonna leave the default file folder. Click "Next." Then I'm gonna click: "Install." It's not a very large file, and the install doesn't take very long. You will need to have admin rights on your computer. So when you get the User Account control message, go ahead and say: "Yes." Well, it completed the install, so I'm gonna click on: "Finish." Now, I can go to my list of applications, and you'll see, it added: SML of New Jersey. I can click on that, and it'll automatically open up a command window, and put me into the SML programming language. I'm now ready to start programming in my Functional Programming Language, SML.

Contents