diff --git a/src/doc/trpl/functions.md b/src/doc/trpl/functions.md index d0ecb6067955..c8b79232aa90 100644 --- a/src/doc/trpl/functions.md +++ b/src/doc/trpl/functions.md @@ -75,7 +75,8 @@ This is a deliberate design decision. While full-program inference is possible, languages which have it, like Haskell, often suggest that documenting your types explicitly is a best-practice. We agree that forcing functions to declare types while allowing for inference inside of function bodies is a wonderful -sweet spot between full inference and no inference. +sweet spot between full inference and no inference. (For closures, i.e. unnamed +functions, types do not have to be declared.) What about returning a value? Here's a function that adds one to an integer: