Re: UArray for newtypes (LogFloat)

7 Mar
2009
7 Mar
'09
8:06 p.m.
On Sat, Mar 7, 2009 at 9:10 PM, wren ng thornton
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. :) -- Felipe.
5919
Age (days ago)
5919
Last active (days ago)
0 comments
1 participants
participants (1)
-
Felipe Lessa