UArray for newtypes (LogFloat)

Felipe Lessa felipe.lessa at
Sat Mar 7 20:06:58 EST 2009

On Sat, Mar 7, 2009 at 9:10 PM, wren ng thornton <wren at> wrote:
> You can replace many of the coercions by using logToLogFloat and
> logFromLogFloat. Those give an isomorphism without doing log/exp, which is
> specialized for Double to be id (except logToLogFloat also checks isNaN).

I used unsafeCoerce for saving the check cost as we know it is valid.

> Though, as a general matter it seems that adding "deriving (IArray UArray)"
> to the newtype declaration is sufficient. Doesn't even require
> GeneralizedNewtypeDeriving. I'll push out a new release soon.

Whoa, that's great news for me, didn't know it was possible. And
thanks for acting so promptly. :)


More information about the Libraries mailing list