Hi,

actually, the type of range can be numeric, but it doesn't have to be (although the logic remains), for instance it could be a date range... or any "sortable" and "measurable" type.

For what it's worth, the error messages were cleared by changing the length signature to
val inline length : ^a t -> ^b when ^a : (static member ( - ) : ^a * ^a -> ^b)

And adding the "inline" keyword to the functions calling (-). Of course, it's not perfect, but it works for the purpose...

In any case, thanks a lot for the help, especially on a week-end!!!!! :-)

Julien

By on 7/28/2007 8:33 AM ()

I believe you want "transform" to be generic over a numeric type. To do this you should either pass in the subtraction function for the type as an explicit argument or else pass an instance of INumeric<'a> in as an argument. Alternatively you can store an instance of INumeric<'a> in your Range data structure.

Kind regards

don

By on 7/28/2007 4:28 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