From the course: Programming Foundations: Discrete Mathematics

Unlock the full course today

Join today to access over 22,600 courses taught by industry experts or purchase this course individually.

Challenge: Learn SML

Challenge: Learn SML

From the course: Programming Foundations: Discrete Mathematics

Start my 1-month free trial

Challenge: Learn SML

- [Voiceover] For this challenge, we're going to do some programming. We're going to use SML, Standard Machine Language, or a similar functional programming language of your choice. The idea is to use SML to create some new dataypes, as we saw in this chapter. Start with a new datatype called "candy," which can have the values "chocolate," "caramel," "taffy," "gum," and "toffee." Next, get creative and add some other datatypes of your choice. Maybe you want to add a datatype called "fruit." Or a datatype called "vegetables." Once you're comfortable with the new datatypes, I want you to try one of the special functions available within SML. SML provides a special function to work with sequences of characters or strings. You'll start with a function called "explode," which takes a string as a parameter, and creates a sequence of characters in a list. In SML, you type in the word "explode," parenthesis, double quotes, and your first name. Double quotes, close parenthesis. And when you…

Contents