Added semigroup instance for ghc8 compatibility

Bumped version number
This commit is contained in:
Owen Lynch 2018-05-29 13:55:15 -07:00
parent f9a8a7d992
commit 84ce755f19
2 changed files with 7 additions and 3 deletions

View File

@ -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

View File

@ -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