Skip to content

Commit

Permalink
Instance for Maybe as per haskell#4
Browse files Browse the repository at this point in the history
  • Loading branch information
singpolyma committed Oct 13, 2012
1 parent fe9316e commit 358d7d9
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions Data/Text/Buildable.hs
Expand Up @@ -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 ((<>))
Expand Down Expand Up @@ -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 #-}
Expand Down

0 comments on commit 358d7d9

Please sign in to comment.