Skip to content

Commit

Permalink
clean up
Browse files Browse the repository at this point in the history
  • Loading branch information
BebeSparkelSparkel committed Jan 12, 2024
1 parent 9457784 commit 6fa0510
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 25 deletions.
2 changes: 0 additions & 2 deletions Data/ByteString/Builder/RealFloat.hs
Original file line number Diff line number Diff line change
Expand Up @@ -227,8 +227,6 @@ formatFloating :: forall a mw ew ei.
-- a
--( ToS a
( ToD a
, Num a
, Ord a
, RealFloat a
, R.ExponentBits a
, R.MantissaBits a
Expand Down
34 changes: 11 additions & 23 deletions Data/ByteString/Builder/RealFloat/Internal.hs
Original file line number Diff line number Diff line change
Expand Up @@ -269,26 +269,20 @@ boundString s = boundedPrim maxEncodedLength $ const (pokeAll s)
{-# SPECIALIZE toCharsNonNumbersAndZero :: SpecialStrings -> Float -> Maybe Builder #-}
{-# SPECIALIZE toCharsNonNumbersAndZero :: SpecialStrings -> Double -> Maybe Builder #-}
toCharsNonNumbersAndZero :: forall a mw ew.
( ExponentBits a
, mw ~ MantissaWord a
, Ord mw
, Num mw
, ew ~ ExponentWord a
, Ord ew
, Num ew
, Bits ew
, Integral ew

, ExponentBits a
, MantissaBits a
, CastToWord a
, mw ~ MantissaWord a
( Bits ew
, Bits mw
, CastToWord a
, Eq mw
, ExponentBits a
, Integral ew
, Integral mw
, ew ~ ExponentWord a
, MantissaBits a
, Num ew

, Num mw
, Ord ew
, Ord mw
, ew ~ ExponentWord a
, mw ~ MantissaWord a
) => SpecialStrings -> a -> Maybe Builder
toCharsNonNumbersAndZero SpecialStrings{..} f = flip BP.primBounded () . boundString <$>
if w .&. expoMantissaBits == 0
Expand Down Expand Up @@ -876,9 +870,7 @@ writeMantissa ptr olength = go (ptr `plusAddr#` olength)

-- | Write the exponent into the given address.
writeExponent :: forall ei.
( Ord ei
, Num ei
, Integral ei
( Integral ei
, ToInt ei
) => Addr# -> ei -> State# RealWorld -> (# Addr#, State# RealWorld #)
writeExponent ptr !expo s1
Expand Down Expand Up @@ -910,9 +902,6 @@ writeSign ptr False s = (# ptr, s #)
toCharsScientific :: forall a mw ei.
( Mantissa mw
, DecimalLength mw
, ei ~ ExponentInt a
, Ord ei
, Num ei
, Integral ei
, ToInt ei
, FromInt ei
Expand Down Expand Up @@ -956,7 +945,6 @@ breakdown :: forall a mw ew.
, mw ~ MantissaWord a
, Bits mw
, Integral mw
, ew ~ ExponentWord a
, Num ew
) => a -> (Bool, mw, ew)
breakdown f = (sign, mantissa, expo)
Expand Down

0 comments on commit 6fa0510

Please sign in to comment.