Stricness of floor etc
Ian Lynagh
igloo@earth.li
Wed, 12 Mar 2003 14:40:18 +0000
Hi all,
Looking at
ghc --show-iface .../ghc/lib/ghc-5.05/imports/base/GHC/Float.hi
I see
floor1 :: forall b. (GHC.Real.Integral b) =>
Double -> b
__S L
properFraction2 :: forall b. (GHC.Real.Integral b) =>
Double -> (b, Double)
__S L
decodeFloat2 :: Double
__S U(L)m
My understanding of this is that floor and properFraction of Doubles
have a lazy argument while decodeFloat has a strict constructor of lazy
values. It's not clear to me why the U(L) strictness isn't inherited by
properFraction and then float, nor do I understand why decodeFloat is
not strict in its argument when it seems to be working exclusively with
unboxed values. Unfortunately decodeDouble# in PrimopWrappers.hi doesn't
seem to have a strictness description so I can't see what's going on
there.
So I guess what I'm asking is are these strictnesses the best that can
be inferred or could GHC do better?
Of course a strict floor (Double to Int and Integer) is what I'm really
hoping for (without having to specify it explicitly with $! in my code).
Incidentally, what are 'm's in the strictness descriptions?
Thanks
Ian