Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Support building on GHC with integer-simple #8

Open
singpolyma opened this issue Oct 2, 2014 · 2 comments
Open

Support building on GHC with integer-simple #8

singpolyma opened this issue Oct 2, 2014 · 2 comments

Comments

@singpolyma
Copy link

Related to #1

@singpolyma
Copy link
Author

The following patch is obviously not a solution, but it builds for me:

diff --git a/Blaze/Text/Int.hs b/Blaze/Text/Int.hs
index 33d0ee6..5f26625 100644
--- a/Blaze/Text/Int.hs
+++ b/Blaze/Text/Int.hs
@@ -27,14 +27,10 @@ import GHC.Num (quotRemInteger)
 import GHC.Types (Int(..))

 #ifdef  __GLASGOW_HASKELL__
-# if __GLASGOW_HASKELL__ < 611
-import GHC.Integer.Internals
-# else
-import GHC.Integer.GMP.Internals
-# endif
+import GHC.Integer.Simple.Internals
 #endif

-#ifdef INTEGER_GMP
+#ifdef __GLASGOW_HASKELL__
 # define PAIR(a,b) (# a,b #)
 #else
 # define PAIR(a,b) (a,b)
@@ -106,7 +102,6 @@ int = integral
 {-# INLINE int #-}

 integer :: Integer -> Builder
-integer (S# i#) = int (I# i#)
 integer i
     | i < 0     = minus `mappend` go (-i)
     | otherwise = go i
diff --git a/blaze-textual.cabal b/blaze-textual.cabal
index 99cf086..7898e20 100644
--- a/blaze-textual.cabal
+++ b/blaze-textual.cabal
@@ -45,6 +45,7 @@ library
     other-modules: Blaze.Text.Double.Native

   build-depends:
+    integer-simple,
     base == 4.*,
     blaze-builder >= 0.2.1.4,
     bytestring,
@@ -67,14 +68,6 @@ library

   ghc-options:      -Wall

-  if impl(ghc >= 6.11)
-    cpp-options: -DINTEGER_GMP
-    build-depends: integer-gmp >= 0.2
-
-  if impl(ghc >= 6.9) && impl(ghc < 6.11)
-    cpp-options: -DINTEGER_GMP
-    build-depends: integer >= 0.1 && < 0.2
-
 test-suite tests
   type:           exitcode-stdio-1.0
   hs-source-dirs: tests

@andrewthad
Copy link

This is also a problem for me.

kantp pushed a commit to kantp/blaze-textual that referenced this issue Jun 28, 2015
This allows the library to build with GHC versions using the
integer-simple library instead of integer-gmp.

I think this should resolve issues swamp-agr#1 and swamp-agr#8.
kantp pushed a commit to kantp/blaze-textual that referenced this issue Jun 28, 2015
This allows the library to build with GHC versions using the
integer-simple library instead of integer-gmp.

I think this should resolve issues swamp-agr#1 and swamp-agr#8.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants