Let\'s say I am solving a particular problem and come up with a function
let function parameter1 ... =
a lot of adding, multiplying & so on with a
Here's an article on generic, numeric calculations in F#. In general, you have two options:
...or you can combine these techniques.
In your case, it sounds like static constraints will work.
A simple example from that article:
let inline halfSquare num =
let res = LanguagePrimitives.DivideByInt num 2
res * res