
30 Nov
2007
30 Nov
'07
11:06 a.m.
On 30 Nov 2007, cdsmith@twu.net wrote:
Sure. To be more specific, here's the contract I would really like.
1. You need to pass in a polymorphic function a -> a, where a is, at *most*, restricted to being an instance of Floating. This part I can already express via rank-N types. For example, the diffFloating function in my original post enforces this part of the contract.
It seems to me that you need the type system to ensure that the function is differentiable. For this, you have to export the type (though not the constructor as long as you don't want users to be able to extend it). Am I missing something? Jed