Errata

Functional Programming with C#

Errata for Functional Programming with C#

Submit your own errata for this product.

The errata list is a list of errors and their corrections that were found after the product was released.

The following errata were submitted by our customers and have not yet been approved or disproved by the author or editor. They solely represent the opinion of the customer.

Color Key: Serious technical mistake Minor technical mistake Language or formatting error Typo Question Note Update

Version Location Description Submitted by Date submitted
Printed Page 30
Sourcecode

The line "chosenFilms.Add((f));" has extra "()" that are not needed.

Matthias Lange  Dec 13, 2023 
Printed Page 41
Sourcecode

The variable "gridCoords" is defined but on the last line of this example "coords" is referenced instead.

Matthias Lange  Dec 13, 2023 
Printed Page 42
Functional Median calculation

The variable "sortedListCount" is declared but not used in "var median = IsEvenNumber(sortedList.Count())..." instead the Count() method is invoked again.

Matthias Lange  Dec 13, 2023 
Printed Page 44
Sourcecode

Within the foreach loop we have the assignment "currentValue = startingValue + d;" but the description implies that we want to do "currentValue = currentValue +d;"

Matthias Lange  Dec 13, 2023 
Printed Page 50
Last code block

Line is "NumberOfMIssingEpisodes = x.NumMisEps," but should be "NumberOfMissingEpisodes = x.NumMisEps,"

Matthias Lange  Dec 13, 2023 
Printed Page 51
First Code segment

Line is "var finalReport = $"{reportHeader}{Environment.NewLine}{reportTextLines}";" but should be
"var finalReport = $"{reportHeader}{Environment.NewLine}{reportBody}";"

Matthias Lange  Dec 13, 2023 
Printed Page 51
Functional continuous fluent expression

Line is "acc.NumEps + int.Parse(va[4])," but should be "acc.NumEps + int.Parse(val[4]),"

Matthias Lange  Dec 13, 2023 
Printed Page 51
Last Line

Line is "var finalReport = $"{reportHeader}{Environment.NewLine}{reportHeader}";" but should be
"var finalReport = $"{reportHeader}{Environment.NewLine}{reportBody}";"

Matthias Lange  Dec 13, 2023 
Printed Page 60
First and Second Code Segment

In the MonopolyPlayersBankAccount pattern matching "PassingGoBonus" is referenced instead of "mba.PassingGoBonus"

Matthias Lange  Dec 14, 2023 
Printed Page 61
Last code segment

The Line "Func<SPS,SPS,Result) calc) =>" should be "Func<SPS,SPS,GameResult> calc) =>"
The Enum is GameResult and typo using ")" instead of ">"

Matthias Lange  Dec 14, 2023 
Printed Page 61
Last code segment

The string.join line is missing a ")"

Matthias Lange  Dec 14, 2023 
Printed Page 63
First Code segment

In the MonopolyPlayersBankAccount pattern matching "PassingGoBonus" is referenced instead of "mba.PassingGoBonus"

Matthias Lange  Dec 14, 2023 
Printed Page 63
First Code segment

The switch expression case "MonopolyPlayersBankAccount { Player.FirstName: "Simon" } mba => ..." will only be reached when the CurrSquare is "InJail" and the FirstName is Simon which is not the intended meaning.

Matthias Lange  Dec 14, 2023 
Printed Page 65,66
Code Segments

One of the Movie properties is called "Directory" instead of "Director"

Matthias Lange  Dec 14, 2023 
Printed Page 78
Second Code Segment

The Line "x => "MiddleNames = string.Join(" ", x.MiddleNames)" is a syntax error and should be 'x => "MiddleNames = " + string.Join(" ", x.MiddleNames)'

Matthias Lange  Dec 14, 2023 
Printed Page 81
Second Code Segment

The actual implementation of the extension method is missing.

asd  Dec 14, 2023 
PDF Page 82
First sentence

'but without needing up upgrade...' I believe this should be 'but without needing to upgrade...'

Matthias Lange  Dec 14, 2023 
Printed Page 91
First Code segment

cur instead of curr

Matthias Lange  Dec 15, 2023 
Printed Page 91
All extension Method

Should this extension method really return true when it has no elements?

Matthias Lange  Dec 15, 2023 
Printed Page 97
Last code segment

Shorthand version compares 'M' but longhand version compares 'm'

Matthias Lange  Dec 15, 2023 
Printed Page 102
Last code segment

String interpolation is not used.

Matthias Lange  Dec 15, 2023 
Printed Page 106
FahrenheitToCelsius expression

Missing ')'

Matthias Lange  Dec 15, 2023 
Printed Page 111
First Code segment

The first 'celsiusToFahrenheit' should be 'fahrenheitToCelsius'.

Matthias Lange  Dec 15, 2023 
Printed Page 115, 116, 118
Code Segments

Method should be 'public' and not 'pubic' (3x)

Matthias Lange  Dec 15, 2023 
Printed Page 116
Last code segment

Try Catch produces Syntax Error because 'Exception' is missing after catch.

Matthias Lange  Dec 15, 2023 
Printed Page 118
Last code segment

Line 'if(result.Value == null)' is wrong. There is no 'Value' Property on the class 'ExecutionResult<T>'

Matthias Lange  Dec 15, 2023 
Printed Page 119
OnError extension Method

Combined with the MapWithTryCatch this returns the unassigned Result in case there is an error.

Matthias Lange  Dec 15, 2023 
Printed, PDF, ePub Page 128
CustomerOffering Class

public int Id { Get; set; } instead of public int Id { get; set; }

Matthias Lange  Dec 15, 2023 
Printed, PDF, ePub Page 166
Last code segment

Use of Reader is shown but no example implementation like the other Monads in this chapter.

Matthias Lange  Dec 18, 2023 
Printed, PDF, ePub Page 167
Second and third code segment

GetCustomer(userName, x) -- x is not defined anywhere

Matthias Lange  Dec 18, 2023 
Printed, PDF, ePub Page 167
Last code segment

lambda expression uses capital X instead of x

Matthias Lange  Dec 18, 2023 
Printed, PDF, ePub Page 169
Third code segment

GetCustomreOrders instead of GetCustomerOrders

Matthias Lange  Dec 18, 2023 
Printed, PDF, ePub Page 170
First Code segment

Extra '}'

Matthias Lange  Dec 18, 2023 
Printed, PDF, ePub Page 176
First Code segment

var addresses = this.mapping.GetAddress(from).Bind(x =>(From: x,To: this.mapping.GetAddress(to)));

leads to an unhandled exception in case GetAddress throws one according to the Bind in this book

Matthias Lange  Dec 18, 2023 
Printed, PDF, ePub Page 193
Last code segment

currentPlayer is returned but not used. In case its supposed to be used to get the winner its wrong unless the winner rolled a 6 to win.

Matthias Lange  Dec 18, 2023 
Printed, PDF, ePub Page 201
First Code segment

GetCurrent returns default instead of null which results in unintended behavior for primitives.

Matthias Lange  Dec 18, 2023 
Printed, PDF, ePub Page 203
First Code segment

GetCurrent returns default instead of null which results in unintended behavior for primitives.

Matthias Lange  Dec 18, 2023 
Printed, PDF, ePub Page 215
Last code segment

Missing ')'

Matthias Lange  Dec 18, 2023 
Printed, PDF, ePub Page 215
First paragraph

Text implies the prior code is pure but calling an API is not pure.

Matthias Lange  Dec 18, 2023 
Printed, PDF, ePub Page 222
First Code segment

'else i--;' should be 'else floor--;'

Matthias Lange  Dec 18, 2023 
Printed, PDF, ePub Page 227
First Code segment

'this._currentFloorNumber = startingFloorNumber == -1 ? -1 : this.input[this._currentCharacter]'
the else part tries to assign the character to currentFloorNumber and not actual resulting floorNumber

Matthias Lange  Dec 18, 2023 
Printed, PDF, ePub Page 243
First Code segment

'formatHolidayWithMean' should be 'formatHolidayWithMeals'

Matthias Lange  Dec 18, 2023 
Printed, PDF, ePub Page 250
First Code segment

'FarenheitToCelsius' should be 'FahrenheitToCelsius'

Matthias Lange  Dec 18, 2023 
Printed, PDF, ePub Page 263
Second Code Segment

Missing ')' in Pattern Match 'TexInput ti...'

Matthias Lange  Dec 18, 2023 
Printed, PDF, ePub Page 265
Last code segment

Text implies we want to create a DU but code does not show one. No inheritance used.

Matthias Lange  Dec 18, 2023 
Printed, PDF, ePub Page 266
First Code segment

IntegerInput i when
(i.IntegerFromUser * costPerItem) > oldState.Credits =>
"You can't accord that many!",

'accord' should be 'afford'

Matthias Lange  Dec 18, 2023 
Printed, PDF, ePub Page 268
Second Code Segment

The inventory amount is replaced with the purchase amount. So previous amounts are lost.

Matthias Lange  Dec 18, 2023 
Printed, PDF, ePub Page 270
First Code segment

Credits are set to 1000 in case Player is not Happy with his Selection so player either loses credits if he had more than 1000 before or he gains credits if he had less

Matthias Lange  Dec 18, 2023 
Printed, PDF, ePub Page 282
First Code segment

If player takes more than 10 seconds to answer timeAccuracy will be negative and cause bugs later.

Matthias Lange  Dec 18, 2023