Hi Jon:
>
> whoops! I meant to say
> sqrt :: (Numeric n, Numeric f) => n -> f
>
> or something - the important bit was that the result type shouldn't be
> constrained to be the same as the argument, because while sqrt int is
> meaningful it doesn't usually give an int result. What you get back
> should depend on what you use it for.
OK, I agree here. Mine was just some quick example, and
I do not promote squishing everything into one type.
As long as my other example with eigenvalues works for me,
that is: as long as I can hope for a vector of reals
OR complex, I am satisfied. But I definitely do not want
an error, because I know up front that some solution exists
- be it real or complex. Sometimes I can predict which one,
but often I cannot.
Jan
- Rambling on numbers in Haskell Jan Skibinski
- Re: Rambling on numbers in Haskell Fergus Henderson
- RE: Rambling on numbers in Haskell Mark P Jones
- Re: Rambling on numbers in Haskell Hans Aberg
- Re: Rambling on numbers in Haskell Alastair Reid
- Re: Rambling on numbers in Haskell Jan Skibinski
- RE: Rambling on numbers in Haskell Jan Skibinski
- Re: Rambling on numbers in Haskell Jon . Fairbairn
- Re: Rambling on numbers in Haskell Jon . Fairbairn
- Re: Rambling on numbers in Haskell Jan Skibinski
- Re: Rambling on numbers in Haskell Felix Schroeter
- Re: Rambling on numbers in Haskell Fergus Henderson
- Re: Rambling on numbers in Haskell Simon L Peyton Jones
- Re: Rambling on numbers in Haskell Hans Aberg
- Re: Rambling on numbers in Haskell David Lester
