Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Merge pull request #1 from DanielSchuessler/master

Fixes for GHC 7.4.1
  • Loading branch information...
commit 46f47e44a0c2dd037fee682fc49c053d3768adb9 2 parents 7a6c808 + cabec79
@skogsbaer authored
Showing with 21 additions and 3 deletions.
  1. +20 −2 src/Text/XML/Generator.hs
  2. +1 −1  xmlgen.cabal
View
22 src/Text/XML/Generator.hs
@@ -1,5 +1,5 @@
{-# LANGUAGE FlexibleContexts, TypeSynonymInstances, FlexibleInstances, TypeFamilies, MultiParamTypeClasses, BangPatterns,
- UndecidableInstances, OverlappingInstances #-}
+ UndecidableInstances, OverlappingInstances, CPP #-}
-- | This module provides combinators for generating XML documents.
--
-- As an example, suppose you want to generate the following XML document:
@@ -69,6 +69,21 @@ import qualified Data.String as S
import qualified Data.Text as T
import qualified Data.Text.Lazy as TL
+#ifdef MIN_VERSION_base
+
+#if MIN_VERSION_base(4,5,0)
+#define BASE_AT_LEAST_4_5_0_0
+#endif
+
+#else
+
+-- Fallback for ghci
+#if __GLASGOW_HASKELL__ >= 704
+#define BASE_AT_LEAST_4_5_0_0
+#endif
+
+#endif
+
--
-- Basic definitions
--
@@ -456,14 +471,17 @@ instance Misc Doc
-- Operators
--
+-- Note: (<>) is defined in Data.Monoid starting with base 4.5.0.0
+#ifndef BASE_AT_LEAST_4_5_0_0
infixl 6 <>
-- | Shortcut for the 'mappend' functions of monoids. Used to concatenate elements, attributes
-- and text nodes.
(<>) :: Monoid t => t -> t -> t
(<>) = mappend
+#endif
infixl 5 <#>
--- | Shortcut for coonstructing pairs. Used in combination with 'xelem' for separating child-attributes
+-- | Shortcut for constructing pairs. Used in combination with 'xelem' for separating child-attributes
-- from child-elements.
(<#>) :: a -> b -> (a, b)
(<#>) x y = (x, y)
View
2  xmlgen.cabal
@@ -17,7 +17,7 @@ Source-Repository head
Library
Exposed-modules: Text.XML.Generator
Hs-Source-Dirs: src
- Build-Depends: base >= 4.2 && < 4.4, blaze-builder == 0.3.*,
+ Build-Depends: base >= 4.2 && < 4.6, blaze-builder == 0.3.*,
bytestring == 0.9.*, containers >= 0.3 && < 0.5,
monads-tf == 0.1.*, text >= 0.10 && < 0.12
Ghc-Prof-Options: -auto-all -caf-all
Please sign in to comment.
Something went wrong with that request. Please try again.