An interesting code snippet.

For anyone else looking at it, this bit of formatting might help...

1
2
3
4
5
6
let row = Array.zeroCreate 5
row.[0] < -1


let row2 = Array.zeroCreate 5
row2.[0] < false

In an .fs file it's fine. Pasted line by line into fsi there is an error after the first line. if pasted in a block, it's OK, and returns...

val row : int [] = [|0; 0; 0; 0; 0|]
val row2 : bool [] = [|false; false; false; false; false|]

By on 12/4/2009 6:50 PM ()

It is, but it can float constraints to get solved later. In this case the array has type array<'a> after the first line, and then later when you assign it can pin down 'a to be bool or int.

By on 12/3/2009 9:55 AM ()
IntelliFactory Offices Copyright (c) 2011-2012 IntelliFactory. All rights reserved.
Home | Products | Consulting | Trainings | Blogs | Jobs | Contact Us | Terms of Use | Privacy Policy | Cookie Policy
Built with WebSharper