> > You can use the FFI for all these operations, just import the C
> > versions.  You can even use unboxed types if you really 
> want (mostly it
> > shouldn't be necessary, though).
> 
> Ah, yes, that works too :).  I only suggested it because all the other
> Float# functions seem to be exactly what is found in the 
> RealFloat class and these were "missing"...foreign works too, though.

I think it's just this way due to hysterical raisins.

There are few reasons to make something into a primitive instead of a
foreign call; the main one is that you get constant folding.  Another
reason is if it can be implemented inline by both the C code generator
and the native code generator.  Neither of these seem particularly
important for asinhDouble# and friends, but there are existing primops
you could make the same argument for.

> Out of curiousity, why would I get better performance when using:
> 
>   data Log = Log Float#
> 
> instead of
> 
>   newtype Log = Log Float
> 
> ?  GHC should be removing the newtype constructor anyway, so I don't
> understand the difference.

There shouldn't be any difference, as far as I can tell.  The two types
have the same representation.  But strange things do happen.  If you
have an example where it makes a difference, we can take a look.

Cheers,
        Simon
_______________________________________________
Glasgow-haskell-bugs mailing list
[EMAIL PROTECTED]
http://www.haskell.org/mailman/listinfo/glasgow-haskell-bugs

Reply via email to