4 Designing function signatures and types
This chapter covers
- Designing good function signatures
- Fine-grained control over the inputs to a function
- Using
Unit
as a more flexible alternative tovoid
The principles we’ve covered so far define FP in general, regardless of whether you’re programming in a statically typed language like C# or a dynamically typed language like JavaScript. In this chapter, you’ll learn some functional techniques that are specific to statically typed languages. Having functions and their arguments typed opens up a whole set of interesting considerations..
Functions are the building blocks of a functional program, so getting the function signature right is paramount. And because a function signature is defined in terms ...
Get Functional Programming in C#, Second Edition 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.