[commit: ghc] master: Ship transformers with GHC (71feb10)

2013-01-02 Thread Ian Lynagh
Repository : ssh://darcs.haskell.org//srv/darcs/ghc

On branch  : master

http://hackage.haskell.org/trac/ghc/changeset/71feb1025eed0c3cc849c85e2b00e16bc1a21790

---

commit 71feb1025eed0c3cc849c85e2b00e16bc1a21790
Author: Ian Lynagh i...@well-typed.com
Date:   Wed Jan 2 20:49:07 2013 +

Ship transformers with GHC

This means that we can use the standard MonadIO class, rather than
needing our own copy.

---

 compiler/ghc.cabal.in|3 ++-
 compiler/utils/MonadUtils.hs |   23 +--
 ghc.mk   |   22 +++---
 ghc/GhciMonad.hs |   22 ++
 mk/validate-settings.mk  |1 +
 validate |9 +++--
 6 files changed, 24 insertions(+), 56 deletions(-)

diff --git a/compiler/ghc.cabal.in b/compiler/ghc.cabal.in
index 44d0952..803989e 100644
--- a/compiler/ghc.cabal.in
+++ b/compiler/ghc.cabal.in
@@ -52,7 +52,8 @@ Library
array  = 0.1   0.5,
filepath   = 1 1.4,
Cabal,
-   hpc
+   hpc,
+   transformers
 
 if flag(stage1)  impl(ghc  7.5)
 Build-Depends: old-time   = 1 1.2
diff --git a/compiler/utils/MonadUtils.hs b/compiler/utils/MonadUtils.hs
index c697790..60748ea 100644
--- a/compiler/utils/MonadUtils.hs
+++ b/compiler/utils/MonadUtils.hs
@@ -24,36 +24,15 @@ module MonadUtils
 ) where
 
 ---
--- Detection of available libraries

-
--- we don't depend on MTL for now
-#define HAVE_MTL 0
-

 -- Imports
 ---
 
 import Maybes
 
 import Control.Applicative
-#if HAVE_MTL
-import Control.Monad.Trans
-#endif
 import Control.Monad
 import Control.Monad.Fix
-

--- MTL

-
-#if !HAVE_MTL
-
-class Monad m = MonadIO m where
-liftIO :: IO a - m a
-
-instance MonadIO IO where liftIO = id
-#endif
+import Control.Monad.IO.Class
 
 ---
 -- Lift combinators
diff --git a/ghc.mk b/ghc.mk
index f73c801..f4a7a61 100644
--- a/ghc.mk
+++ b/ghc.mk
@@ -330,7 +330,7 @@ endif
 # They do not say this package will be built; see $(PACKAGES_xx) for that
 
 # Packages that are built but not installed
-PKGS_THAT_ARE_INTREE_ONLY := haskeline transformers terminfo xhtml
+PKGS_THAT_ARE_INTREE_ONLY := haskeline terminfo xhtml
 
 PKGS_THAT_ARE_DPH := \
 dph/dph-base \
@@ -355,7 +355,7 @@ PKGS_THAT_USE_TH := $(PKGS_THAT_ARE_DPH)
 #
 # We assume that the stage0 compiler has a suitable bytestring package,
 # so we don't have to include it below.
-PKGS_THAT_BUILD_WITH_STAGE0 = Cabal/Cabal hpc binary bin-package-db hoopl
+PKGS_THAT_BUILD_WITH_STAGE0 = Cabal/Cabal hpc binary bin-package-db hoopl 
transformers
 
 # $(EXTRA_PACKAGES)  is another classification, of packages built but
 #not installed
@@ -1337,17 +1337,17 @@ BINDIST_LIBRARY_FLAGS = --enable-library-vanilla 
--disable-shared
 endif
 BINDIST_LIBRARY_FLAGS += --disable-library-prof
 
-.PHONY: validate_build_transformers
-validate_build_transformers:
-   cd libraries/transformers  $(BINDIST_PREFIX)/bin/ghc --make Setup
-   cd libraries/transformers  ./Setup configure 
--with-ghc=$(BINDIST_PREFIX)/bin/ghc $(BINDIST_HADDOCK_FLAG) 
$(BINDIST_LIBRARY_FLAGS) --global --builddir=dist-bindist 
--prefix=$(BINDIST_PREFIX)
-   cd libraries/transformers  ./Setup build   --builddir=dist-bindist
+.PHONY: validate_build_xhtml
+validate_build_xhtml:
+   cd libraries/xhtml  $(BINDIST_PREFIX)/bin/ghc --make Setup
+   cd libraries/xhtml  ./Setup configure 
--with-ghc=$(BINDIST_PREFIX)/bin/ghc $(BINDIST_HADDOCK_FLAG) 
$(BINDIST_LIBRARY_FLAGS) --global --builddir=dist-bindist 
--prefix=$(BINDIST_PREFIX)
+   cd libraries/xhtml  ./Setup build   --builddir=dist-bindist
 ifeq $(HADDOCK_DOCS) YES
-   cd libraries/transformers  ./Setup haddock --builddir=dist-bindist
+   cd libraries/xhtml  ./Setup haddock --builddir=dist-bindist
 endif
-   cd libraries/transformers  ./Setup install --builddir=dist-bindist
-   cd libraries/transformers  ./Setup clean   --builddir=dist-bindist
-   cd libraries/transformers  rm -f Setup Setup.exe Setup.hi Setup.o
+   cd libraries/xhtml  ./Setup install --builddir=dist-bindist
+   cd libraries/xhtml  ./Setup clean   --builddir=dist-bindist
+   cd libraries/xhtml  rm -f Setup Setup.exe

transformers and GHC

2012-12-07 Thread Ian Lynagh

Hi Ross and other GHC folk,

Currently, we build transformers in a GHC tree, but we don't ship and
install it. However, the ghc library redefines

class Monad m = MonadIO m where
liftIO :: IO a - m a

which seems a little silly, and means that a client of both the GHC API
and other libraries may need to use 2 different MonadIO/liftIO's.

So I propose we start shipping transformers with GHC, and get rid of
GHC's MonadIO class. The main argument against shipping libraries with
GHC in general is that it effectively means end users don't get new
releases of the library until there is a new GHC release out, but
transformers is so stable (notwithstanding the current libraries@
proposal) that I don't think that's much of an issue in this case.

What do you think?


Thanks
Ian


___
Cvs-ghc mailing list
Cvs-ghc@haskell.org
http://www.haskell.org/mailman/listinfo/cvs-ghc