improve compatibility with base-4.11, since Semigroup is now a superclass of Monoid

This commit is contained in:
Andrew Martin 2018-05-29 20:18:49 -04:00
parent 372cd4b843
commit 4c5446afea
No known key found for this signature in database
GPG Key ID: 4FEE56C538F773B4
13 changed files with 48 additions and 11 deletions

1
.gitignore vendored
View File

@ -30,3 +30,4 @@ colonnade/result
reflex-dom-colonnade/result
siphon-0.8.0-docs.tar.gz
siphon-0.8.0-docs/
.ghc.environment.*

View File

@ -17,11 +17,11 @@ library
exposed-modules:
Text.Blaze.Colonnade
build-depends:
base >= 4.7 && < 5
base >= 4.9 && < 5
, colonnade >= 1.1 && < 1.3
, blaze-markup >= 0.7 && < 0.9
, blaze-html >= 0.8 && < 0.10
, text >= 1.0 && < 1.3
, text >= 1.2 && < 1.3
default-language: Haskell2010
test-suite test

View File

@ -1,3 +1,4 @@
{-# LANGUAGE BangPatterns #-}
{-# LANGUAGE RankNTypes #-}
{-# LANGUAGE ScopedTypeVariables #-}

15
build Executable file
View File

@ -0,0 +1,15 @@
#!/bin/bash
set -e
# To use this script on Ubuntu, you will need to first run the following:
#
# sudo apt install ghc-8.0.2 ghc-8.2.2 ghc-8.4.3
declare -a ghcs=("8.0.2" "8.2.2" "8.4.3")
## now loop through the above array
for g in "${ghcs[@]}"
do
cabal new-build --project-file "projects/cabal-$g.project" --builddir "dist-$g" -w "/opt/ghc/bin/ghc-$g" ./colonnade
done

4
cabal.project Normal file
View File

@ -0,0 +1,4 @@
packages: ./colonnade
./blaze-colonnade
./lucid-colonnade
./yesod-colonnade

View File

@ -35,13 +35,12 @@ library
Colonnade
Colonnade.Encode
build-depends:
base >= 4.7 && < 5
base >= 4.9 && < 5
, contravariant >= 1.2 && < 1.5
, vector >= 0.10 && < 0.13
, text >= 1.0 && < 1.3
, bytestring >= 0.10 && < 0.11
, profunctors >= 4.0 && < 5.3
, semigroups >= 0.17 && < 0.19
default-language: Haskell2010
ghc-options: -Wall

View File

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

View File

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

View File

@ -0,0 +1,4 @@
packages: ./colonnade
./blaze-colonnade
./lucid-colonnade
./yesod-colonnade

View File

@ -0,0 +1,4 @@
packages: ./colonnade
./blaze-colonnade
./lucid-colonnade
./yesod-colonnade

View File

@ -0,0 +1,3 @@
packages: ./colonnade
./blaze-colonnade
./lucid-colonnade

View File

@ -17,7 +17,7 @@ library
exposed-modules:
Reflex.Dom.Colonnade
build-depends:
base >= 4.7 && < 5.0
base >= 4.9 && < 5.0
, colonnade >= 1.2 && < 1.3
, contravariant >= 1.2 && < 1.5
, vector >= 0.10 && < 0.13

View File

@ -1,5 +1,5 @@
name: yesod-colonnade
version: 1.2.0
version: 1.2.1
synopsis: Helper functions for using yesod with colonnade
description: Yesod and colonnade
homepage: https://github.com/andrewthad/colonnade#readme
@ -17,9 +17,11 @@ library
exposed-modules:
Yesod.Colonnade
build-depends:
base >= 4.7 && < 5
base >= 4.9 && < 4.11
, colonnade >= 1.2 && < 1.3
, yesod-core >= 1.4 && < 1.5
, conduit >= 1.2 && < 1.3
, conduit-extra >= 1.2 && < 1.3
, text >= 1.0 && < 1.3
, blaze-markup >= 0.7 && < 0.9
, blaze-html >= 0.8 && < 0.10