re: Write a function that shows off something unique or interesting about the language you're using VIEW POST

re: In Ruby we can monkeypatch to easily add functionality to any class. For example: class String def yell! self.upcase + "!!!" end end...

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
code of conduct - report abuse