In F# it is also easy to add functionality to existing classes.
type String with
member me.yell () =
me.ToUpper() + "!!!"
You can also add functions to existing static classes (modules) too.
module Array =
let shuffle arr =
[| for i in 0 .. 23 do yield i * i |]
|> Array.filter isOdd // filter is built-in
|> Array.shuffle // i added
We’re a place where coders share, stay up-to-date and grow their careers.
We strive for transparency and don't collect excess data.