[ghc 7.4 compatibility changes
John Meacham <john@repetae.net>**20120306035643
 Ignore-this: c15e182e5a05efb7a623f6386fbb9884
] hunk ./Makefile.am 45
-GHCINC=  -i -i$(srcdir)/drift_processed \
-	 -i$(srcdir)/src -i$(builddir)/src -odir $(builddir)/src -hidir $(builddir)/src
+GHCINC=  -i @GHCINC@ -i$(srcdir)/drift_processed \
+	 -i$(srcdir)/src -i$(builddir)/src -odir $(builddir)/src -hidir $(builddir)/src \
+	 -I$(srcdir)/src
hunk ./Makefile.am 49
-PACKAGES= -package fgl -package regex-compat -package random -package array -package directory \
+PACKAGES= -hide-all-packages -package base -package fgl -package regex-compat -package random -package array -package directory \
hunk ./Makefile.am 51
-	  -package unix -package haskell98 -package utf8-string -package zlib -package HsSyck \
+	  -package unix  -package utf8-string -package zlib -package HsSyck \
adddir ./compat
adddir ./compat/haskell98
addfile ./compat/haskell98/Array.hs
hunk ./compat/haskell98/Array.hs 1
+module Array (
+    module Ix,  -- export all of Ix for convenience
+    Array, array, listArray, (!), bounds, indices, elems, assocs,
+    accumArray, (//), accum, ixmap
+  ) where
+
+import Ix
+import Data.Array
addfile ./compat/haskell98/CPUTime.hs
hunk ./compat/haskell98/CPUTime.hs 1
+module CPUTime (
+    getCPUTime, cpuTimePrecision
+  ) where
+
+import System.CPUTime
addfile ./compat/haskell98/Char.hs
hunk ./compat/haskell98/Char.hs 1
+module Char (
+    isAscii, isLatin1, isControl, isPrint, isSpace, isUpper, isLower,
+    isAlpha, isDigit, isOctDigit, isHexDigit, isAlphaNum,
+    digitToInt, intToDigit,
+    toUpper, toLower,
+    ord, chr,
+    readLitChar, showLitChar, lexLitChar,
+
+-- ...and what the Prelude exports
+    Char, String
+  ) where
+
+import Data.Char
addfile ./compat/haskell98/Complex.hs
hunk ./compat/haskell98/Complex.hs 1
+module Complex (
+    Complex((:+)), realPart, imagPart, conjugate,
+    mkPolar, cis, polar, magnitude, phase
+  ) where
+
+import Data.Complex
addfile ./compat/haskell98/Directory.hs
hunk ./compat/haskell98/Directory.hs 1
+module Directory (
+    Permissions( .. ),
+    createDirectory, removeDirectory, removeFile,
+    renameDirectory, renameFile, getDirectoryContents,
+    getCurrentDirectory, setCurrentDirectory,
+    doesFileExist, doesDirectoryExist,
+    getPermissions, setPermissions,
+    getModificationTime
+  ) where
+
+import System.Directory
addfile ./compat/haskell98/IO.hs
hunk ./compat/haskell98/IO.hs 1
+module IO (
+    Handle, HandlePosn,
+    IOMode(ReadMode,WriteMode,AppendMode,ReadWriteMode),
+    BufferMode(NoBuffering,LineBuffering,BlockBuffering),
+    SeekMode(AbsoluteSeek,RelativeSeek,SeekFromEnd),
+    stdin, stdout, stderr,
+    openFile, hClose, hFileSize, hIsEOF, isEOF,
+    hSetBuffering, hGetBuffering, hFlush,
+    hGetPosn, hSetPosn, hSeek,
+    hWaitForInput, hReady, hGetChar, hGetLine, hLookAhead, hGetContents,
+    hPutChar, hPutStr, hPutStrLn, hPrint,
+    hIsOpen, hIsClosed, hIsReadable, hIsWritable, hIsSeekable,
+    isAlreadyExistsError, isDoesNotExistError, isAlreadyInUseError,
+    isFullError, isEOFError,
+    isIllegalOperation, isPermissionError, isUserError,
+    ioeGetErrorString, ioeGetHandle, ioeGetFileName,
+    try, bracket, bracket_,
+
+    -- ...and what the Prelude exports
+    IO, FilePath, IOError, ioError, userError, catch, interact,
+    putChar, putStr, putStrLn, print, getChar, getLine, getContents,
+    readFile, writeFile, appendFile, readIO, readLn
+  ) where
+
+import System.IO
+import System.IO.Error
+
+-- | The 'bracket' function captures a common allocate, compute, deallocate
+-- idiom in which the deallocation step must occur even in the case of an
+-- error during computation. This is similar to try-catch-finally in Java.
+--
+-- This version handles only IO errors, as defined by Haskell 98.
+-- The version of @bracket@ in "Control.Exception" handles all exceptions,
+-- and should be used instead.
+
+bracket        :: IO a -> (a -> IO b) -> (a -> IO c) -> IO c
+bracket before after m = do
+        x  <- before
+        rs <- try (m x)
+        _ <- after x
+        case rs of
+           Right r -> return r
+           Left  e -> ioError e
+
+-- | A variant of 'bracket' where the middle computation doesn't want @x@.
+--
+-- This version handles only IO errors, as defined by Haskell 98.
+-- The version of @bracket_@ in "Control.Exception" handles all exceptions,
+-- and should be used instead.
+
+bracket_        :: IO a -> (a -> IO b) -> IO c -> IO c
+bracket_ before after m = do
+         x  <- before
+         rs <- try m
+         _ <- after x
+         case rs of
+            Right r -> return r
+            Left  e -> ioError e
addfile ./compat/haskell98/Ix.hs
hunk ./compat/haskell98/Ix.hs 1
+module Ix (
+    Ix(range, index, inRange), rangeSize
+  ) where
+
+import Data.Ix
addfile ./compat/haskell98/LICENSE
hunk ./compat/haskell98/LICENSE 1
+Code derived from the document "Report on the Programming Language
+Haskell 98", is distributed under the following license:
+
+  Copyright (c) 2002 Simon Peyton Jones
+
+  The authors intend this Report to belong to the entire Haskell
+  community, and so we grant permission to copy and distribute it for
+  any purpose, provided that it is reproduced in its entirety,
+  including this Notice.  Modified versions of this Report may also be
+  copied and distributed for any purpose, provided that the modified
+  version is clearly presented as such, and that it does not claim to
+  be a definition of the Haskell 98 Language.
+
+-----------------------------------------------------------------------------
+
+Code derived from the document "The Haskell 98 Foreign Function
+Interface, An Addendum to the Haskell 98 Report" is distributed under
+the following license:
+
+  Copyright (c) 2002 Manuel M. T. Chakravarty
+
+  The authors intend this Report to belong to the entire Haskell
+  community, and so we grant permission to copy and distribute it for
+  any purpose, provided that it is reproduced in its entirety,
+  including this Notice.  Modified versions of this Report may also be
+  copied and distributed for any purpose, provided that the modified
+  version is clearly presented as such, and that it does not claim to
+  be a definition of the Haskell 98 Foreign Function Interface.
+
+-----------------
+
+This code has been modified by John Meacham for distribution with jhc
addfile ./compat/haskell98/List.hs
hunk ./compat/haskell98/List.hs 1
+module List (
+    elemIndex, elemIndices,
+    find, findIndex, findIndices,
+    nub, nubBy, delete, deleteBy, (\\), deleteFirstsBy,
+    union, unionBy, intersect, intersectBy,
+    intersperse, transpose, partition, group, groupBy,
+    inits, tails, isPrefixOf, isSuffixOf,
+    mapAccumL, mapAccumR,
+    sort, sortBy, insert, insertBy, maximumBy, minimumBy,
+    genericLength, genericTake, genericDrop,
+    genericSplitAt, genericIndex, genericReplicate,
+    zip4, zip5, zip6, zip7,
+    zipWith4, zipWith5, zipWith6, zipWith7,
+    unzip4, unzip5, unzip6, unzip7, unfoldr,
+
+    -- ...and what the Prelude exports
+    -- []((:), []), -- This is built-in syntax
+    map, (++), concat, filter,
+    head, last, tail, init, null, length, (!!),
+    foldl, foldl1, scanl, scanl1, foldr, foldr1, scanr, scanr1,
+    iterate, repeat, replicate, cycle,
+    take, drop, splitAt, takeWhile, dropWhile, span, break,
+    lines, words, unlines, unwords, reverse, and, or,
+    any, all, elem, notElem, lookup,
+    sum, product, maximum, minimum, concatMap,
+    zip, zip3, zipWith, zipWith3, unzip, unzip3
+  ) where
+
+import Data.List hiding (foldl')
addfile ./compat/haskell98/Locale.hs
hunk ./compat/haskell98/Locale.hs 1
+module Locale (
+    TimeLocale(..), defaultTimeLocale
+  ) where
+
+import System.Locale (
+	-- just the bits that are specified by Haskell 98
+	TimeLocale(TimeLocale,wDays,months,amPm,dateTimeFmt,
+		   dateFmt,timeFmt,time12Fmt),
+        defaultTimeLocale
+    )
addfile ./compat/haskell98/Maybe.hs
hunk ./compat/haskell98/Maybe.hs 1
+module Maybe (
+    isJust, isNothing,
+    fromJust, fromMaybe, listToMaybe, maybeToList,
+    catMaybes, mapMaybe,
+
+    -- ...and what the Prelude exports
+    Maybe(Nothing, Just),
+    maybe
+  ) where
+
+import Data.Maybe
addfile ./compat/haskell98/Monad.hs
hunk ./compat/haskell98/Monad.hs 1
+module Monad (
+    MonadPlus(mzero, mplus),
+    join, guard, when, unless, ap,
+    msum,
+    filterM, mapAndUnzipM, zipWithM, zipWithM_, foldM,
+    liftM, liftM2, liftM3, liftM4, liftM5,
+
+    -- ...and what the Prelude exports
+    Monad((>>=), (>>), return, fail),
+    Functor(fmap),
+    mapM, mapM_, sequence, sequence_, (=<<),
+  ) where
+
+import Control.Monad
addfile ./compat/haskell98/Random.hs
hunk ./compat/haskell98/Random.hs 1
+module Random (
+   RandomGen(next, split, genRange),
+   StdGen, mkStdGen,
+   Random( random,   randomR, randoms,  randomRs, randomIO, randomRIO ),
+   getStdRandom, getStdGen, setStdGen, newStdGen
+  ) where
+
+import System.Random
addfile ./compat/haskell98/Ratio.hs
hunk ./compat/haskell98/Ratio.hs 1
+module Ratio (
+    Ratio, Rational, (%), numerator, denominator, approxRational
+  ) where
+
+import Data.Ratio
addfile ./compat/haskell98/System.hs
hunk ./compat/haskell98/System.hs 1
+module System (
+    ExitCode(ExitSuccess,ExitFailure),
+    getArgs, getProgName, getEnv, system, exitWith, exitFailure
+  ) where
+
+import System.Exit
+import System.Environment
+import System.Cmd
addfile ./compat/haskell98/Time.hs
hunk ./compat/haskell98/Time.hs 1
+module Time (
+    ClockTime,
+    Month(January,February,March,April,May,June,
+          July,August,September,October,November,December),
+    Day(Sunday,Monday,Tuesday,Wednesday,Thursday,Friday,Saturday),
+    CalendarTime(CalendarTime, ctYear, ctMonth, ctDay, ctHour, ctMin,
+    		 ctSec, ctPicosec, ctWDay, ctYDay, ctTZName, ctTZ, ctIsDST),
+    TimeDiff(TimeDiff, tdYear, tdMonth, tdDay, tdHour,
+ 	     tdMin, tdSec, tdPicosec),
+    getClockTime, addToClockTime, diffClockTimes,
+    toCalendarTime, toUTCTime, toClockTime,
+    calendarTimeToString, formatCalendarTime
+  ) where
+
+import System.Time
hunk ./configure.ac 43
+GHC_CHECK_MODULE(System.Time,old-time,,,[])
hunk ./configure.ac 53
+GHC_CHECK_MODULE(System,,,[] ,[ GHCINC="$GHCINC -icompat/haskell98"])
+
hunk ./configure.ac 61
+GHCFLAGS="$GHCFLAGS -package pretty"
+TRY_COMPILE_GHC([
+import Text.PrettyPrint.HughesPJ
+import Data.Monoid
+instance Monoid Doc
+main = putStrLn "hello"
+],[HAS_MONOID_DOC=0],[HAS_MONOID_DOC=1])
+
hunk ./configure.ac 79
-
hunk ./configure.ac 89
+AC_SUBST(HAS_MONOID_DOC)
hunk ./configure.ac 94
-AC_CONFIG_FILES([Makefile jhc.spec src/Version/Config.hs docs/building.mkd src/cbits/config.h src/data/targets.ini])
+AC_SUBST(GHCINC)
+AC_CONFIG_FILES([Makefile jhc.spec src/hs_src_config.h src/Version/Config.hs docs/building.mkd src/cbits/config.h src/data/targets.ini])
hunk ./src/C/FromGrin2.hs 6
-import Control.Monad.RWS
+import Control.Monad.RWS(asks,tell,local,get,runRWST,RWST,MonadState(..),MonadWriter(..),MonadReader(..))
+import Control.Monad
hunk ./src/C/FromGrin2.hs 11
-import Data.Monoid
+import Data.Monoid(Monoid(..))
hunk ./src/C/Generate.hs 75
-import Control.Monad.RWS
-import Control.Monad.Writer
+import Control.Monad
+import Control.Monad.RWS(RWS(..),MonadState(..),MonadWriter(..),MonadReader(..),runRWS,asks,MonadFix(..))
+import Control.Monad.Writer(Writer(..),censor, runWriter)
+import Data.Monoid(Monoid(..))
hunk ./src/C/Prims.hs 5
-import Data.Monoid
+import Data.Monoid(Monoid(..))
hunk ./src/DataConstructors.hs 55
-import Doc.DocLike
+import Doc.DocLike as D
hunk ./src/DataConstructors.hs 874
-    arr = bop (R,0) (space <> text "->" <> space)
+    arr = bop (R,0) (space D.<> text "->" D.<> space)
hunk ./src/Doc/DocLike.hs 1
-{-# LANGUAGE UndecidableInstances,OverlappingInstances #-}
+{-# LANGUAGE CPP,UndecidableInstances,OverlappingInstances #-}
hunk ./src/Doc/DocLike.hs 4
+#include "hs_src_config.h"
+
hunk ./src/Doc/DocLike.hs 8
-import Data.Monoid
+import Data.Monoid(Monoid(..))
hunk ./src/Doc/DocLike.hs 16
-
hunk ./src/Doc/DocLike.hs 25
-
hunk ./src/Doc/DocLike.hs 52
-
hunk ./src/Doc/DocLike.hs 59
-
-
hunk ./src/Doc/DocLike.hs 82
-
hunk ./src/Doc/DocLike.hs 113
-
hunk ./src/Doc/DocLike.hs 126
-
hunk ./src/Doc/DocLike.hs 151
+#if !HAS_MONOID_DOC
hunk ./src/Doc/DocLike.hs 156
+#endif
hunk ./src/Doc/DocLike.hs 179
-
hunk ./src/Doc/Pretty.hs 52
-import Data.Monoid
+import Data.Monoid(Monoid(..))
hunk ./src/Doc/Pretty.hs 54
-infixr 5 </>,<//>,<$>,<$$>
+infixr 5 </>,<//>,<$$>
hunk ./src/E/CPR.hs 3
-import Control.Monad.Writer hiding(Product(..))
+import Control.Monad.Writer(Writer(..),runWriter,tell,Monoid(..))
hunk ./src/E/Rules.hs 19
-import Control.Monad.Writer
-import Maybe
+import Control.Monad.Writer(WriterT(..),execWriterT,liftM,tell)
+import Data.Maybe
+import Data.Monoid(Monoid(..))
hunk ./src/Fixer/VMap.hs 15
-import Data.Monoid
+import Data.Monoid(Monoid(..))
hunk ./src/FrontEnd/Class.hs 31
-import Control.Monad.Writer
+import Control.Monad.Writer(Monoid(..),Writer(..))
hunk ./src/FrontEnd/Exports.hs 9
-import Data.Monoid
+import Data.Monoid(Monoid(..))
hunk ./src/FrontEnd/Tc/Unify.hs 9
-import Control.Monad.Writer
+import Control.Monad
+import Control.Monad.Trans
+import Control.Monad.Writer(Monoid(..),Writer(..))
hunk ./src/GenUtil.hs 652
-showDuration :: Integral a => a -> String
+showDuration :: (Show a,Integral a) => a -> String
hunk ./src/Grin/FromE.hs 7
-import Data.Monoid
+import Data.Monoid(Monoid(..))
hunk ./src/Grin/Grin.hs 56
-import Char
hunk ./src/Grin/Grin.hs 57
-import Data.Monoid
+import Data.Char
+import Data.Monoid(Monoid(..))
hunk ./src/Grin/Grin.hs 60
-import Prelude
hunk ./src/Grin/Show.hs 11
-import Control.Monad.Writer
+import Control.Monad.Writer(Writer(..),tell,when,forM_,execWriter)
hunk ./src/Ho/Build.hs 17
-import Data.Monoid
+import Data.Monoid(Monoid(..))
hunk ./src/Util/Seq.hs 34
-import Data.Monoid
+import Data.Monoid(Monoid(..))
addfile ./src/hs_src_config.h.in
hunk ./src/hs_src_config.h.in 1
+#ifndef HS_SRC_CONFIG
+#define HS_SRC_CONFIG
+
+#define HAS_MONOID_DOC @HAS_MONOID_DOC@
+
+#endif