Status of GHC runtime dependency on GNU multi precision arithmetic library

Stefan O'Rear stefanor at
Wed Aug 22 11:24:56 EDT 2007

On Wed, Aug 22, 2007 at 10:32:36AM +0100, Simon Peyton-Jones wrote:
> | There is an interest in removing GMP, motivated partly by licensing but
> | also due to portabiltity concerns and the fact that the use of GHC's
> | memory manager in GMP prevents FFI code from using GMP safely.
> |
> |
> Just to summarise our position at GHC HQ on this question:

> * We don't much like bundling GMP either.  But it works and it's fast.
> * We'd be very happy to have others work on a replacement
>         (a) using a another C library
>         (b) using a Haskell library
> * To replace GMP altogether we'd need to be convinced that
>   we would not lose much performance.
> * There are one or two arbitrary precision libraries in Haskell
>   eg

Another possibility that occured to me recently, is to switch Integer
to a simpler (perhaps even pure-Haskell) representation, and provide
(core?  extra?  Hackage?) a hsgmp package.  If you have big numbers,
switching is easy:

import Prelude hiding(Integer)
import Data.Integer.GMP
type Integer = MPZ

-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 189 bytes
Desc: Digital signature
Url :

More information about the Glasgow-haskell-users mailing list