Concepts
Currying
Definition
Partial application
// Template function with 2 parameters
let insideTag (tagName: string) (content: string) =
$"<{tagName}>{content}</{tagName}>"
// Helpers with a single parameter `content`
// `tagName` is fixed by partial application
let emphasize = insideTag "em" // `tagName` fixed to "em"
let strong = insideTag "strong" // `tagName` fixed to "strong"
// Equivalent less elegant but more explicit
let em content = insideTag "em" contentSyntax of F♯ functions
IntelliSense with Ionide
.NET compilation of a curried function
Unified function design
Parameter order
Last updated