Take the 2-minute tour ×  I have a function that looks as
follows:  let isInSet setElems normalize p =          normalize
p |> (Set.ofList setElems).Contains  This function can be used
to quickly check whether an element is semantically part of some
set; for example, to check if a file path belongs to an html
file:  let getLowerExtension p = (Path.GetExtension
p).ToLowerInvariant() let isHtmlPath = isInSet [".htm"; ".html";
".xhtml"] getLowerExtension  However, when I use a function such
as the above, performance is poor since evaluation of the
function body as written in "isInSet" seems to be delayed until
all parameters are known - in particular, invariant bits such as
(Set.ofList setElems).Contains are reevaluated each execution of
isHtmlPath.  How can best I maintain F#'s succint, readable
nature while still getting the more efficient behavior in which
the set construction is preevaluated.  The above is just an
example; I'm looking for a general approach that avoids bogging
me down in implementation detai