Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Instance for Maybe as per #4

  • Loading branch information...
commit 358d7d94db88e159c220da773b021fe3d6dfe90d 1 parent fe9316e
Stephen Paul Weber singpolyma authored
Showing with 6 additions and 0 deletions.
  1. +6 −0 Data/Text/Buildable.hs
6 Data/Text/Buildable.hs
View
@@ -16,6 +16,7 @@ module Data.Text.Buildable
Buildable(..)
) where
+import Data.Monoid (mempty)
import Data.Int (Int8, Int16, Int32, Int64)
import Data.Ratio (Ratio, denominator, numerator)
import Data.Text.Format.Functions ((<>))
@@ -139,6 +140,11 @@ instance (Show a) => Buildable (Shown a) where
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 #-}
Please sign in to comment.
Something went wrong with that request. Please try again.