Commits

singpolyma  committed cef2a9c

Instance for Maybe as per #4

  • Participants
  • Parent commits 8061b0d

Comments (0)

Files changed (1)

File Data/Text/Buildable.hs

       Buildable(..)
     ) where
 
+import Data.Monoid (mempty)
 import Data.Int (Int8, Int16, Int32, Int64)
 import Data.Ratio (Ratio, denominator, numerator)
 import Data.Text.Format.Functions ((<>))
     build = fromString . show . shown
     {-# INLINE build #-}
 
+instance (Buildable a) => Buildable (Maybe a) where
+    build Nothing = mempty
+    build (Just v) = build v
+    {-# INLINE build #-}
+
 instance Buildable TimeOfDay where
     build = build . Shown
     {-# INLINE build #-}