Re: [Haskell-cafe] Re: Hit a wall with the type system

2007-11-29 Thread Dan Piponi
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

[Haskell-cafe] Re: Hit a wall with the type system

2007-11-28 Thread Chris Smith
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

[Haskell-cafe] Re: Hit a wall with the type system

2007-11-28 Thread Chris Smith
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

[Haskell-cafe] Re: Hit a wall with the type system

2007-11-28 Thread Chris Smith
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,