summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorandrewthad <>2018-06-13 13:12:00 (GMT)
committerhdiff <hdiff@hdiff.luite.com>2018-06-13 13:12:00 (GMT)
commit437a93d83775ddbc6cbcefa769917a641e025c83 (patch)
treee294f87e9e3f20cbdb27927dc531f60410e682cf
parent9374d4e5d2cc4485c48b63ee6c6ad05b6d029273 (diff)
version 1.0.1HEAD1.0.1master
-rw-r--r--lucid-colonnade.cabal8
-rw-r--r--src/Lucid/Colonnade.hs6
2 files changed, 9 insertions, 5 deletions
diff --git a/lucid-colonnade.cabal b/lucid-colonnade.cabal
index 39bb4e4..21ecc44 100644
--- a/lucid-colonnade.cabal
+++ b/lucid-colonnade.cabal
@@ -1,5 +1,5 @@
name: lucid-colonnade
-version: 1.0
+version: 1.0.1
synopsis: Helper functions for using lucid with colonnade
description: Lucid and colonnade
homepage: https://github.com/andrewthad/colonnade#readme
@@ -17,10 +17,10 @@ library
exposed-modules:
Lucid.Colonnade
build-depends:
- base >= 4.7 && < 5
- , colonnade >= 1.1 && < 1.3
+ base >= 4.9 && < 5
+ , colonnade >= 1.1.1 && < 1.3
, lucid >= 2.9 && < 3.0
- , text >= 1.0 && < 1.3
+ , text >= 1.2 && < 1.3
default-language: Haskell2010
source-repository head
diff --git a/src/Lucid/Colonnade.hs b/src/Lucid/Colonnade.hs
index 600b99e..e993040 100644
--- a/src/Lucid/Colonnade.hs
+++ b/src/Lucid/Colonnade.hs
@@ -30,7 +30,8 @@ module Lucid.Colonnade
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)
@@ -62,6 +63,9 @@ data Cell d = Cell
instance (d ~ ()) => IsString (Cell d) where
fromString = stringCell
+instance Semigroup d => Semigroup (Cell d) where
+ Cell a1 c1 <> Cell a2 c2 = Cell (mappend a1 a2) (liftA2 (<>) c1 c2)
+
instance Monoid d => Monoid (Cell d) where
mempty = Cell mempty (return mempty)
mappend (Cell a1 c1) (Cell a2 c2) = Cell (mappend a1 a2) (liftA2 mappend c1 c2)