Ok, now my brain is leaking. the first instance compiles and you can do this:

> Util.range<string>.make 4.5 10.0 ;;
val it : float Util.range = {start = 4.5;
stop = 10.0;}

from the interpreter.

By on 11/28/2008 10:01 AM ()

Your static method 'make' method on range<'a> has type ('b -> 'b -> range<'b>). You can add explicit type annotations (e.g. (x : 'a)) if you want to do what I think you want to do.

There isn't any way to do the 'private constructor' or otherwise force the check when constructing records, if you want to do that, switch to a class.

By on 11/28/2008 10:16 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