Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP

Loading…

Fixes for GHC 7.4.1 #1

Merged
merged 1 commit into from

2 participants

DanielSchuessler Stefan Wehr
DanielSchuessler

No description provided.

Stefan Wehr skogsbaer merged commit 46f47e4 into from
Stefan Wehr
Owner

Daniel, thanks for the patch!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
This page is out of date. Refresh to see the latest.
Showing with 21 additions and 3 deletions.
  1. +20 −2 src/Text/XML/Generator.hs
  2. +1 −1  xmlgen.cabal
22 src/Text/XML/Generator.hs
View
@@ -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)
2  xmlgen.cabal
View
@@ -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
Something went wrong with that request. Please try again.