diff --git a/blaze-colonnade/blaze-colonnade.cabal b/blaze-colonnade/blaze-colonnade.cabal index e6d96cb..3c4d90c 100644 --- a/blaze-colonnade/blaze-colonnade.cabal +++ b/blaze-colonnade/blaze-colonnade.cabal @@ -1,5 +1,5 @@ name: blaze-colonnade -version: 1.2.0 +version: 1.2.1 synopsis: Helper functions for using blaze-html with colonnade description: Blaze HTML and colonnade homepage: https://github.com/andrewthad/colonnade#readme diff --git a/blaze-colonnade/src/Text/Blaze/Colonnade.hs b/blaze-colonnade/src/Text/Blaze/Colonnade.hs index fa70e3b..c59fb58 100644 --- a/blaze-colonnade/src/Text/Blaze/Colonnade.hs +++ b/blaze-colonnade/src/Text/Blaze/Colonnade.hs @@ -53,7 +53,8 @@ import Text.Blaze.Html (Html, toHtml) import Colonnade (Colonnade,Headed,Headless,Fascia,Cornice) import Data.Text (Text) import Control.Monad -import Data.Monoid +import Data.Semigroup +import Data.Monoid hiding ((<>)) import Data.Foldable import Data.String (IsString(..)) import Data.Maybe (listToMaybe) @@ -266,9 +267,12 @@ data Cell = Cell instance IsString Cell where fromString = stringCell +instance Semigroup Cell where + (Cell a1 c1) <> (Cell a2 c2) = Cell (a1 <> a2) (c1 <> c2) + instance Monoid Cell where mempty = Cell mempty mempty - mappend (Cell a1 c1) (Cell a2 c2) = Cell (mappend a1 a2) (mappend c1 c2) + mappend = (<>) -- | Create a 'Cell' from a 'Widget' htmlCell :: Html -> Cell