No safety in numbers
Jon Cast
jcast@cate0-46.reshall.ou.edu
Thu, 21 Aug 2003 16:23:27 -0500
Konrad Hinsen <hinsen@cnrs-orleans.fr> wrote:
> On Thursday 21 August 2003 22:42, Jon Cast wrote:
>
> > > (or any other type I declare it to be).
> >
> > Right. But: you can declare it to have type Fractional alpha =>
> > alpha, which is the same type the constant has in the middle of an
> > expression.
>
> I can make such a declaration, but it still gets converted to Double.
How are you doing this? I'm not seeing the behavior you describe.
> What I can do is turn my constant table into a function:
>
> constant :: Fractional a =3D> String -> a
> constant "k_B" = 0.0083144708636327096
>
> and have the return values be of type Fractional a =3D> a. But I
> suppose there is some runtime cost associated with such a function
> call, so I would rather avoid it.
Jon Cast