In F# I can easily do
let a = [1 .. 10];;
Then why can\'t I do
let a = DateTime.Parse(\"01/01/2012\")
let b = DateTime.Parse(\"
Here's a funky way of generating a list of dates. Note I'm taking no credit for this whatsoever as I got it from someone else.
open System
let a = new DateTime(2013,12,1)
let b = new DateTime(2013,12,5)
Seq.unfold (fun d -> if d < b then Some(d, d.AddDays(1.0)) else None) a
|> Seq.toList;;
It returns:
val it : DateTime list = [01/12/2013 00:00:00; 02/12/2013 00:00:00; 03/12/2013 00:00:00; 04/12/2013 00:00:00]