Skip to content
This repository

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse code

Instance for Maybe as per #4

  • Loading branch information...
commit 358d7d94db88e159c220da773b021fe3d6dfe90d 1 parent fe9316e
Stephen Paul Weber singpolyma authored

Showing 1 changed file with 6 additions and 0 deletions. Show diff stats Hide diff stats

  1. +6 0 Data/Text/Buildable.hs
6 Data/Text/Buildable.hs
@@ -16,6 +16,7 @@ module Data.Text.Buildable
16 16 Buildable(..)
17 17 ) where
18 18
  19 +import Data.Monoid (mempty)
19 20 import Data.Int (Int8, Int16, Int32, Int64)
20 21 import Data.Ratio (Ratio, denominator, numerator)
21 22 import Data.Text.Format.Functions ((<>))
@@ -139,6 +140,11 @@ instance (Show a) => Buildable (Shown a) where
139 140 build = fromString . show . shown
140 141 {-# INLINE build #-}
141 142
  143 +instance (Buildable a) => Buildable (Maybe a) where
  144 + build Nothing = mempty
  145 + build (Just v) = build v
  146 + {-# INLINE build #-}
  147 +
142 148 instance Buildable TimeOfDay where
143 149 build = build . Shown
144 150 {-# INLINE build #-}

0 comments on commit 358d7d9

Please sign in to comment.
Something went wrong with that request. Please try again.