mirror of
https://github.com/byteverse/colonnade.git
synced 2024-09-11 06:45:41 +03:00
Merge pull request #13 from olynch/master
Added semigroup instance for ghc8 compatibility
This commit is contained in:
commit
372cd4b843
@ -1,5 +1,5 @@
|
|||||||
name: blaze-colonnade
|
name: blaze-colonnade
|
||||||
version: 1.2.0
|
version: 1.2.1
|
||||||
synopsis: Helper functions for using blaze-html with colonnade
|
synopsis: Helper functions for using blaze-html with colonnade
|
||||||
description: Blaze HTML and colonnade
|
description: Blaze HTML and colonnade
|
||||||
homepage: https://github.com/andrewthad/colonnade#readme
|
homepage: https://github.com/andrewthad/colonnade#readme
|
||||||
|
@ -53,7 +53,8 @@ import Text.Blaze.Html (Html, toHtml)
|
|||||||
import Colonnade (Colonnade,Headed,Headless,Fascia,Cornice)
|
import Colonnade (Colonnade,Headed,Headless,Fascia,Cornice)
|
||||||
import Data.Text (Text)
|
import Data.Text (Text)
|
||||||
import Control.Monad
|
import Control.Monad
|
||||||
import Data.Monoid
|
import Data.Semigroup
|
||||||
|
import Data.Monoid hiding ((<>))
|
||||||
import Data.Foldable
|
import Data.Foldable
|
||||||
import Data.String (IsString(..))
|
import Data.String (IsString(..))
|
||||||
import Data.Maybe (listToMaybe)
|
import Data.Maybe (listToMaybe)
|
||||||
@ -266,9 +267,12 @@ data Cell = Cell
|
|||||||
instance IsString Cell where
|
instance IsString Cell where
|
||||||
fromString = stringCell
|
fromString = stringCell
|
||||||
|
|
||||||
|
instance Semigroup Cell where
|
||||||
|
(Cell a1 c1) <> (Cell a2 c2) = Cell (a1 <> a2) (c1 <> c2)
|
||||||
|
|
||||||
instance Monoid Cell where
|
instance Monoid Cell where
|
||||||
mempty = Cell mempty mempty
|
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'
|
-- | Create a 'Cell' from a 'Widget'
|
||||||
htmlCell :: Html -> Cell
|
htmlCell :: Html -> Cell
|
||||||
|
Loading…
Reference in New Issue
Block a user