Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

F# Syntax Question

Tags:

f#

A bit of a sytax question...

I have the following code in F#

let GetSumOfSequenceAttempt1 : bigint = 
    seq{bigint(1)..bigint(10000000)}
    |> Seq.sum 

I dont what to keep having to place the numbers within the bigint() - is there some shorthand that will make this look neater?

like image 258
Mark Pearl Avatar asked Aug 06 '10 13:08

Mark Pearl


1 Answers

Yes:

let GetSumOfSequenceAttempt1 = 
  seq { 1I .. 10000000I }
  |> Seq.sum 
like image 74
kvb Avatar answered Oct 21 '22 08:10

kvb