Skip to content

Conversation

@cartermp
Copy link
Contributor

I've attempted to add two sections: a short one on Immutability, and a longer one that progressively moves a function towards pipelines and function composition. I try to leave out gory details as much as possible, as I think it's best to defer to the documentation there (links are provided).

cc @forki @dsyme

/// use Partial Application and the input and output types of each data processing operation match
/// the signatures of the functions we're using.
let squareOddValuesAndAddOneComposition =
List.filter isOdd >> List.map(fun x -> x |> square |> addOne)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

May be worth demonstrating:

List.filter isOdd >> List.map (square >> addOne)

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good feedback!

@saul
Copy link
Contributor

saul commented Dec 30, 2016

Looks great 👍

@KevinRansom KevinRansom merged commit 9b1cee6 into dotnet:master Dec 30, 2016
printfn "The table of squares from 0 to 99 is:\n%A" sampleTableOfSquares


/// Values in F# are immutable by default (save for Arrays). They cannot be changed
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

"save for" sounds slightly archaic and might confuse people who only know a little English. Perhaps just remove the "(save for Arrays)", it seems a bit out of place to have the exclusion in the intro senetence any case

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good feedback.


/// The F# pipe operators ('|>', '<|', etc.) and F# composition operators ('>>', '<<')
/// are used extensively when processing data. These operators are themselves functions
/// which make use of Partial Application.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think Partial Application need to be capitalized - if anything put it in quotes? Either is OK as long as style in the document is consistent.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I've capitalized it throughout the document, and also have a link to the section in our docs which explains it.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Typo in my comment - I meant "need not be capitalized". Sorry. It looks somehow wrong, as if Making It Mysterious

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Okay. I'll send a quick fix.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants