Merge pull request #11 from phadej/bounds

Bounds
This commit is contained in:
Brent Yorgey 2019-11-03 14:22:35 -06:00 committed by GitHub
commit d0b1828f54
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 11 additions and 8 deletions

View File

@ -7,7 +7,9 @@ env:
- GHCVER=7.10.3 CABALVER=1.22
- GHCVER=8.0.2 CABALVER=1.24
- GHCVER=8.2.2 CABALVER=2.0
- GHCVER=8.4.1 CABALVER=2.2
- GHCVER=8.4.4 CABALVER=2.2
- GHCVER=8.6.5 CABALVER=2.4
- GHCVER=8.8.1 CABALVER=3.0
- GHCVER=head CABALVER=head
matrix:

View File

@ -40,9 +40,7 @@ import Data.ByteString.Lazy (ByteString)
import Data.Hashable (Hashable(..))
import Data.HashMap.Strict (HashMap)
import qualified Data.HashMap.Strict as M
#if !MIN_VERSION_base(4,8,0)
import Data.Monoid (Monoid(..))
#endif
import Data.Semigroup (Semigroup(..))
import Data.String
import Data.Text (Text)
@ -65,10 +63,13 @@ newtype Element = Element (HashMap Text Text -> Builder)
instance Show Element where
show e = LT.unpack . renderText $ e
instance Semigroup Element where
-- using qualified name we make the import not redundant,
-- even when Semigroup or Monoid are in Prelude
instance Data.Semigroup.Semigroup Element where
Element e1 <> Element e2 = Element (e1 <> e2)
instance Monoid Element where
instance Data.Monoid.Monoid Element where
mempty = Element mempty
#if !(MIN_VERSION_base(4,11,0))
mappend = (<>)

View File

@ -24,13 +24,13 @@ library
Graphics.Svg.Path,
Graphics.Svg.Elements,
Graphics.Svg.Attributes
build-depends: base >= 4.5 && < 4.13,
build-depends: base >= 4.5 && < 4.14,
blaze-builder >= 0.4 && < 0.5,
bytestring >= 0.10 && < 0.11,
hashable >= 1.1 && < 1.3,
hashable >= 1.1 && < 1.4,
text >= 0.11 && < 1.3,
unordered-containers >= 0.2 && < 0.3
if !impl(ghc >= 8.0)
build-depends: semigroups >= 0.16.1 && < 0.19
build-depends: semigroups >= 0.16.1 && < 0.20
hs-source-dirs: src
default-language: Haskell2010