0
comment
comment
on 1/6/2019 1:32 AM
When you start out on F# your first thought might be:
let square x = x * x
let sumOfSquares n =
[1..n]
|> List.map square
|> List.sum
hey, that sort of looks like:
public static class Utils
{
public static int SumOfSquares(int n)
{
return Enumerable.Range(1, n)
.Select(i => i * i)
.Sum();
}
}
Examples from F# for fun and profit: Sum of squares.
At a first glance, F# looks sort like slightly different style of C#, where instead of using extension methods you[...]