Learning F# — Part 4 — Functions

> let f x = 2*x + 1;; val f : x:int -> int
> f 4;; val it : int = 9
f 200;; val it : int = 401
val f : x:int -> int
let f x = 2*x + 1;;
let squared n = n*n;;
val squared : n:int -> int
squared 5;;
> let sumOfSqaures x y = squared x + squared y;; val sumOfSqaures : x:int -> y:int -> int
> sumOfSqaures 3 4;;

--

--

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store