Add monoid instance for Cell

This commit is contained in:
Andrew Martin 2016-11-15 07:25:54 -05:00
parent 809572a05b
commit 8d2e834cf5

View File

@ -15,6 +15,7 @@ import Yesod.Core
import Colonnade.Types
import Data.Text (Text)
import Control.Monad
import Data.Monoid
import Data.String (IsString(..))
import qualified Colonnade.Encoding as Encoding
import qualified Data.Text.Lazy as LText
@ -28,6 +29,10 @@ data Cell site = Cell
instance IsString (Cell site) where
fromString = stringCell
instance Monoid (Cell site) where
mempty = Cell [] mempty
mappend (Cell a1 c1) (Cell a2 c2) = Cell (mappend a1 a2) (mappend c1 c2)
cell :: WidgetT site IO () -> Cell site
cell = Cell []