[Haskell-beginners] Double vs. Num

Tim Perry tim.v2.0 at gmail.com
Wed May 4 23:08:41 UTC 2016


I imagine that in this program when Double isn't specified the compiler
doesn't assign a "hardware optimized" number type. Consequently it isn't
using the specialized functions that are used for 64-bit floating point
numbers. When the program specifies it is receiving the "Double" values,
then it does use the "hardware optimized" data types.

On Wed, May 4, 2016 at 3:12 PM, Ben Rogalski <bwrogalski at gmail.com> wrote:

> I have found that using the type Double in a type signature causes my
> program to run much faster than if I use a type variable with a Num
> constraint.
>
> Is this common, and if so, why is explicitly using Double faster?
>
> _______________________________________________
> Beginners mailing list
> Beginners at haskell.org
> http://mail.haskell.org/cgi-bin/mailman/listinfo/beginners
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.haskell.org/pipermail/beginners/attachments/20160504/59684698/attachment.html>


More information about the Beginners mailing list