On Nov 28, 2007 9:20 PM, Chris Smith <[EMAIL PROTECTED]> wrote:
> I intend to naively treat each function as being from the reals to the
> reals, and then take advantage of the fact (which is proven by the type
> system in the code I posted) that when the derivative is evaluated at
> integer inputs
Luke Palmer wrote:
> I don't see why this should be true. Int -> Int is an instance of this type,
> but derivatives require limits, which integers don't have. Do you intend to
> output the difference sequence of the function in this case?
>
> But then Double -> Double is also an instance of this
The question I asked is about how to type the differentiation function.
Whether the function is correct is a different question, which I'm happy
to talk about; but understand that it's just an example I was playing
with.
Luke Palmer wrote:
> Oh, I think I totally missed the point. I missed th
I'll repeat, just for the heck of it, that what I want is a type
something like:
diff :: forall A a. (A :> Floating, A a) =>
(forall b. A b => b -> b) -> b -> b
where A is quantified over all type classes, and :> denotes "is a
superclass of". The syntax is made up, of course,