Unit 3. Types and functions

So far, in terms of F# the language, you’ve looked at type inference, structuring code with expressions, and working with immutable data. But you’ve only dealt with simple data values—int, string, and so on. What about classes? Do we still have them in F#? If not, what else do we use? And what about functions? F# is supposed to be a functional programming language, and yet we’ve barely covered them!

Don’t worry: this unit covers all these topics. You’ll see how F#’s approach to separating data and behavior works, and why it generally means that classes are undesirable within a functional-first system. In fact, this unit doesn’t focus on classes at all. Instead, it presents alternative ways of modeling problems without ...

Get Get Programming with F# now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.