Skip to content

Commit 75b0fe0

Browse files
committed
Merge pull request #10 from singpolyma/fixed
Instance for Data.Fixed.Fixed
2 parents ef5cd2d + e6730b3 commit 75b0fe0

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

Data/Text/Buildable.hs

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,7 @@ import Data.Void (Void, absurd)
2222

2323
import Data.Monoid (mempty)
2424
import Data.Int (Int8, Int16, Int32, Int64)
25+
import Data.Fixed (Fixed, HasResolution, showFixed)
2526
import Data.Ratio (Ratio, denominator, numerator)
2627
import Data.Text.Format.Functions ((<>))
2728
import Data.Text.Format.Int (decimal, hexadecimal)
@@ -93,6 +94,10 @@ instance Buildable Integer where
9394
build = decimal
9495
{-# INLINE build #-}
9596

97+
instance (HasResolution a) => Buildable (Fixed a) where
98+
build = build . showFixed False
99+
{-# INLINE build #-}
100+
96101
instance Buildable Word8 where
97102
build = decimal
98103
{-# INLINE build #-}

0 commit comments

Comments
 (0)