Skip to Content
Learning Functional Programming in Go
book

Learning Functional Programming in Go

by Lex Sheehan
November 2017
Intermediate to advanced
670 pages
17h 35m
English
Packt Publishing
Content preview from Learning Functional Programming in Go

A closer look at f(x)

Let's examine a basic function definition, where f is the function name and x is the input value. Another name for x is the input parameter.

The entire expression f(x) represents the output value:

If f(x) = x + 1, then we know that every time we input the value 2, the output value will always be 3.

This pure and simple characteristic is what makes functional programming so powerful.

If, on the other hand, we had an object with an AddOne method that would sometimes return 3 when given the value of 2, then how could we reliably scale our object.AddOne method? We can't, and that is the main reason why, in the context of ...

Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Start your free trial

You might also like

Learning Functional Programming

Learning Functional Programming

Jack Widman

Publisher Resources

ISBN: 9781787281394Supplemental Content