Saturday, March 1, 2014

H/Direct patch

Below is a diff to get Don Stewart's package of H/Direct on Hackage to compile with the latest Platform (2013.2.0.0):
diff --recursive hdirect//hdirect.cabal /cygdrive/e/ghc/libraries/ghc_7_6_3/hdirect-0.21.0/hdirect.cabal
59,62c59,60
<     build-depends:      base >= 2 && < 5,
<                         old-locale >= 1  && <= 1.1,
<                         old-time >= 1.1 && <= 1.2,
<                         process >= 1.0 && <= 1.2,
---
>     build-depends:      haskell98,
>                         base >= 2 && < 5,
69,72c67,68
<     build-depends:      base >= 2 && < 5,
<                         old-locale >= 1  && <= 1.1,
<                         old-time >= 1.0 && <= 1.2,
<                         process >= 1.0 && <= 1.2,
---
>     build-depends:      haskell98,
>                         base >= 2 && < 5,
Only in hdirect/: hdirect.cabal~
diff --recursive hdirect//src/AbsHUtils.lhs /cygdrive/e/ghc/libraries/ghc_7_6_3/hdirect-0.21.0/src/AbsHUtils.lhs
199,201c199,201
< import Data.Maybe   ( fromMaybe, isJust )
< import Data.Char    ( isLower )
< import Data.List    ( mapAccumL, intersperse )
---
> import Maybe   ( fromMaybe, isJust )
> import Char    ( isLower )
> import List    ( mapAccumL, intersperse )
diff --recursive hdirect//src/Attribute.lhs /cygdrive/e/ghc/libraries/ghc_7_6_3/hdirect-0.21.0/src/Attribute.lhs
17c17
< import Data.List  ( find )
---
> import List  ( find )
19c19
< import Data.Maybe ( mapMaybe )
---
> import Maybe ( mapMaybe )
diff --recursive hdirect//src/Bag.lhs /cygdrive/e/ghc/libraries/ghc_7_6_3/hdirect-0.21.0/src/Bag.lhs
19c19
< import Data.List(partition)
---
> import List(partition)
diff --recursive hdirect//src/BasicTypes.lhs /cygdrive/e/ghc/libraries/ghc_7_6_3/hdirect-0.21.0/src/BasicTypes.lhs
54c54
< import Data.Maybe ( fromMaybe )
---
> import Maybe ( fromMaybe )
57c57
< import Data.Int
---
> import Int
diff --recursive hdirect//src/CStubGen.lhs /cygdrive/e/ghc/libraries/ghc_7_6_3/hdirect-0.21.0/src/CStubGen.lhs
18,19c18,19
< import Data.List  ( nub )
< import Data.Maybe ( isJust )
---
> import List  ( nub )
> import Maybe ( isJust )
diff --recursive hdirect//src/CgMonad.lhs /cygdrive/e/ghc/libraries/ghc_7_6_3/hdirect-0.21.0/src/CgMonad.lhs
86c86
< import Data.Maybe   ( fromMaybe )
---
> import Maybe   ( fromMaybe )
diff --recursive hdirect//src/CodeGen.lhs /cygdrive/e/ghc/libraries/ghc_7_6_3/hdirect-0.21.0/src/CodeGen.lhs
57c57
< import Data.List  ( partition, intersperse, isPrefixOf )
---
> import List  ( partition, intersperse, isPrefixOf )
61,62c61,62
< import Data.Maybe ( mapMaybe, isJust )
< import Control.Monad ( when )
---
> import Maybe ( mapMaybe, isJust )
> import Monad ( when )
diff --recursive hdirect//src/CoreIDL.lhs /cygdrive/e/ghc/libraries/ghc_7_6_3/hdirect-0.21.0/src/CoreIDL.lhs
16c16
< import Data.Int ( Int32 )
---
> import Int ( Int32 )
diff --recursive hdirect//src/CoreUtils.lhs /cygdrive/e/ghc/libraries/ghc_7_6_3/hdirect-0.21.0/src/CoreUtils.lhs
211,213c211,213
< import Data.Maybe  ( mapMaybe, fromMaybe, mapMaybe, isJust )
< import Data.List   ( partition, find, nub, mapAccumL )
< import Data.Char   ( toLower, toUpper, isLower, isUpper, isAlpha, isDigit )
---
> import Maybe  ( mapMaybe, fromMaybe, mapMaybe, isJust )
> import List   ( partition )
> import Char   ( toLower, toUpper, isLower, isUpper, isAlpha, isDigit )
217,219c217,219
< import Data.Int
< -- import List
< import Data.Bits
---
> import Int
> import List
> import Bits
diff --recursive hdirect//src/DefGen.lhs /cygdrive/e/ghc/libraries/ghc_7_6_3/hdirect-0.21.0/src/DefGen.lhs
10c10
< import Data.List
---
> import List
diff --recursive hdirect//src/Desugar.lhs /cygdrive/e/ghc/libraries/ghc_7_6_3/hdirect-0.21.0/src/Desugar.lhs
56,60c56,60
< import Data.Int
< import Control.Monad
< import Data.Maybe    ( isJust, fromJust, fromMaybe )
< import Data.Char ( toLower, isSpace )
< import Data.List ( partition, sort, sortBy, isPrefixOf )
---
> import Int
> import Monad
> import Maybe    ( isJust, fromJust, fromMaybe )
> import Char ( toLower, isSpace )
> import List ( partition, sort, sortBy, isPrefixOf )
diff --recursive hdirect//src/Digraph.lhs /cygdrive/e/ghc/libraries/ghc_7_6_3/hdirect-0.21.0/src/Digraph.lhs
38,40c38,40
< import Data.Maybe
< import Data.Array
< import Data.List ( sortBy, (\\) )
---
> import Maybe
> import Array
> import List ( sortBy, (\\) )
diff --recursive hdirect//src/DsMonad.lhs /cygdrive/e/ghc/libraries/ghc_7_6_3/hdirect-0.21.0/src/DsMonad.lhs
83,85c83,85
< import System.IO  ( hPutStrLn, stderr )
< import Data.Int ( Int32 )
< import Control.Monad ( when )
---
> import IO  ( hPutStrLn, stderr )
> import Int ( Int32 )
> import Monad ( when )
87c87
< import Data.Maybe ( catMaybes )
---
> import Maybe ( catMaybes )
diff --recursive hdirect//src/FiniteMap.lhs /cygdrive/e/ghc/libraries/ghc_7_6_3/hdirect-0.21.0/src/FiniteMap.lhs
51c51
< import Data.Maybe( isJust )
---
> import Maybe( isJust )
diff --recursive hdirect//src/GetOpt.lhs /cygdrive/e/ghc/libraries/ghc_7_6_3/hdirect-0.21.0/src/GetOpt.lhs
74c74
< import Control.Monad
---
> import Monad
diff --recursive hdirect//src/HugsCodeGen.lhs /cygdrive/e/ghc/libraries/ghc_7_6_3/hdirect-0.21.0/src/HugsCodeGen.lhs
18c18
< import Data.List  ( nub, intersperse )
---
> import List  ( nub, intersperse )
diff --recursive hdirect//src/IDLUtils.lhs /cygdrive/e/ghc/libraries/ghc_7_6_3/hdirect-0.21.0/src/IDLUtils.lhs
112,114c112,114
< import Data.Int
< import Data.Word    ( Word16 )
< import Data.Bits
---
> import Int
> import Word    ( Word16 )
> import Bits
116,117c116,117
< import Data.List   ( isPrefixOf, find )
< import Data.Char   ( isDigit, isAlpha, isSpace )
---
> import List   ( isPrefixOf, find )
> import Char   ( isDigit, isAlpha, isSpace )
120,121c120,121
< import Data.Maybe
< import Control.Monad
---
> import Maybe
> import Monad
diff --recursive hdirect//src/JavaProxy.lhs /cygdrive/e/ghc/libraries/ghc_7_6_3/hdirect-0.21.0/src/JavaProxy.lhs
24c24
< import Data.Maybe  ( mapMaybe )
---
> import Maybe  ( mapMaybe )
diff --recursive hdirect//src/Lex.lhs /cygdrive/e/ghc/libraries/ghc_7_6_3/hdirect-0.21.0/src/Lex.lhs
16c16
< import Data.Char
---
> import Char
19c19
< import Data.List ( isPrefixOf )
---
> import List ( isPrefixOf )
diff --recursive hdirect//src/LexM.lhs /cygdrive/e/ghc/libraries/ghc_7_6_3/hdirect-0.21.0/src/LexM.lhs
57,59c57,59
< import System.IO      ( hPutStrLn, stderr )
< import Control.Monad   ( when )
< import Data.Char    ( toLower )
---
> import IO      ( hPutStrLn, stderr )
> import Monad   ( when )
> import Char    ( toLower )
diff --recursive hdirect//src/Literal.lhs /cygdrive/e/ghc/libraries/ghc_7_6_3/hdirect-0.21.0/src/Literal.lhs
25c25
< import Data.List ( intersperse )
---
> import List ( intersperse )
diff --recursive hdirect//src/Main.lhs /cygdrive/e/ghc/libraries/ghc_7_6_3/hdirect-0.21.0/src/Main.lhs
31,33c31
< import Control.Exception ( catch )
< import System.Time ( getClockTime, toCalendarTime, formatCalendarTime )
< import System.IO  ( hPutStr, hPutStrLn, stderr, stdout, hPutChar,
---
> import IO  ( hPutStr, hPutStrLn, stderr, stdout, hPutChar,
36,38c34,35
< import Control.Monad  ( when )
< import System.Environment ( getProgName )
< import System.Exit ( exitWith, ExitCode(..) )
---
> import Monad  ( when )
> import System (getProgName, exitWith, ExitCode(..) )
41,42c38,39
< -- import Data.Time
< import Data.List  ( partition )
---
> import Time
> import List  ( partition )
44c41
< import System.Locale
---
> import Locale
diff --recursive hdirect//src/MarshallAuto.lhs /cygdrive/e/ghc/libraries/ghc_7_6_3/hdirect-0.21.0/src/MarshallAuto.lhs
34c34
< import Data.Maybe ( isJust )
---
> import Maybe ( isJust )
diff --recursive hdirect//src/MarshallCore.lhs /cygdrive/e/ghc/libraries/ghc_7_6_3/hdirect-0.21.0/src/MarshallCore.lhs
56,57c56,57
< import Data.Maybe
< import Data.List     ( nub )
---
> import Maybe
> import List     ( nub )
diff --recursive hdirect//src/MarshallDep.lhs /cygdrive/e/ghc/libraries/ghc_7_6_3/hdirect-0.21.0/src/MarshallDep.lhs
31,33c31,33
< import Data.List  ( nubBy )
< import Data.Maybe ( mapMaybe, fromMaybe, fromJust, isJust )
< import Control.Monad ( when )
---
> import List  ( nubBy )
> import Maybe ( mapMaybe, fromMaybe, fromJust, isJust )
> import Monad ( when )
diff --recursive hdirect//src/MarshallFun.lhs /cygdrive/e/ghc/libraries/ghc_7_6_3/hdirect-0.21.0/src/MarshallFun.lhs
31c31
< import Data.Maybe
---
> import Maybe
diff --recursive hdirect//src/MarshallJNI.lhs /cygdrive/e/ghc/libraries/ghc_7_6_3/hdirect-0.21.0/src/MarshallJNI.lhs
34,35c34,35
< import Control.Monad ( when )
< import Data.Maybe ( mapMaybe )
---
> import Monad ( when )
> import Maybe ( mapMaybe )
diff --recursive hdirect//src/MarshallMethod.lhs /cygdrive/e/ghc/libraries/ghc_7_6_3/hdirect-0.21.0/src/MarshallMethod.lhs
96,97c96,97
< import Data.Maybe  ( fromMaybe, isJust, fromJust )
< import Control.Monad       ( when, mplus )
---
> import Maybe  ( fromMaybe, isJust, fromJust )
> import Monad       ( when, mplus )
diff --recursive hdirect//src/MarshallServ.lhs /cygdrive/e/ghc/libraries/ghc_7_6_3/hdirect-0.21.0/src/MarshallServ.lhs
47,48c47,48
< import Control.Monad ( when )
< import Data.Maybe
---
> import Monad ( when )
> import Maybe
diff --recursive hdirect//src/MarshallStruct.lhs /cygdrive/e/ghc/libraries/ghc_7_6_3/hdirect-0.21.0/src/MarshallStruct.lhs
40,41c40,41
< import Data.List    ( findIndex, partition )
< import Data.Maybe    ( mapMaybe  )
---
> import List    ( findIndex, partition )
> import Maybe    ( mapMaybe  )
diff --recursive hdirect//src/MarshallType.lhs /cygdrive/e/ghc/libraries/ghc_7_6_3/hdirect-0.21.0/src/MarshallType.lhs
50c50
< import Data.Maybe ( fromMaybe, isJust, fromJust )
---
> import Maybe ( fromMaybe, isJust, fromJust )
diff --recursive hdirect//src/MarshallUnion.lhs /cygdrive/e/ghc/libraries/ghc_7_6_3/hdirect-0.21.0/src/MarshallUnion.lhs
26c26
< import Data.Char       ( ord )
---
> import Char       ( ord )
diff --recursive hdirect//src/MarshallUtils.lhs /cygdrive/e/ghc/libraries/ghc_7_6_3/hdirect-0.21.0/src/MarshallUtils.lhs
45c45
< import Data.List  ( intersperse )
---
> import List  ( intersperse )
diff --recursive hdirect//src/MkImport.lhs /cygdrive/e/ghc/libraries/ghc_7_6_3/hdirect-0.21.0/src/MkImport.lhs
24c24
< import Data.List   ( nub )
---
> import List   ( nub )
diff --recursive hdirect//src/Opts.lhs /cygdrive/e/ghc/libraries/ghc_7_6_3/hdirect-0.21.0/src/Opts.lhs
13,14c13
< import System.Environment ( getArgs )
< -- import System
---
> import System
16,17c15,16
< import System.IO     ( hPutStrLn, stderr )
< import Control.Monad  ( when )
---
> import IO     ( hPutStrLn, stderr )
> import Monad  ( when )
diff --recursive hdirect//src/Parser.hs /cygdrive/e/ghc/libraries/ghc_7_6_3/hdirect-0.21.0/src/Parser.hs
34c34
< import System.IO ( hPutStrLn, stderr )
---
> import IO ( hPutStrLn, stderr )
diff --recursive hdirect//src/Parser.y /cygdrive/e/ghc/libraries/ghc_7_6_3/hdirect-0.21.0/src/Parser.y
32c32
< import System.IO ( hPutStrLn, stderr )
---
> import IO ( hPutStrLn, stderr )
diff --recursive hdirect//src/PpAbstractH.lhs /cygdrive/e/ghc/libraries/ghc_7_6_3/hdirect-0.21.0/src/PpAbstractH.lhs
43c43
< import Data.Char  ( isAlpha )
---
> import Char  ( isAlpha )
diff --recursive hdirect//src/PpCore.lhs /cygdrive/e/ghc/libraries/ghc_7_6_3/hdirect-0.21.0/src/PpCore.lhs
20c20
< import Data.List  ( partition )
---
> import List  ( partition )
24,25c24,25
< import Data.Maybe ( fromMaybe )
< import Data.Char  ( isAlphaNum, toUpper )
---
> import Maybe ( fromMaybe )
> import Char  ( isAlphaNum, toUpper )
diff --recursive hdirect//src/PpIDLSyn.lhs /cygdrive/e/ghc/libraries/ghc_7_6_3/hdirect-0.21.0/src/PpIDLSyn.lhs
16c16
< import Data.Maybe
---
> import Maybe
diff --recursive hdirect//src/PreProc.lhs /cygdrive/e/ghc/libraries/ghc_7_6_3/hdirect-0.21.0/src/PreProc.lhs
1,2d0
< > {-# LANGUAGE ScopedTypeVariables      #-}
< 
20d17
< import Control.Exception ( catch )
22,24c19,20
< import System.CPUTime
< import System.Environment  ( getEnv )
< import System.Process ( system )
---
> import CPUTime
> import System  ( getEnv, system )
26c22
< import Data.List    ( intersperse )
---
> import List    ( intersperse )
28c24
< -- import IO
---
> import IO
30c26
< import Control.Monad
---
> import Monad
48c44
<                (\ (_ :: IOError) -> return "/tmp/")
---
>                (\ _ -> return "/tmp/")
73c69
<                (\(_ :: IOError)-> return ("gcc -E -x c"))
---
>                (\ _ -> return ("gcc -E -x c"))
86c82
<                ( \ (_ :: IOError)-> return "/tmp/")
---
>                ( \ _ -> return "/tmp/")
89c85
<                    ( \ (_ :: IOError)-> return "rm -f")
---
>                    ( \ _ -> return "rm -f")
diff --recursive hdirect//src/Rename.lhs /cygdrive/e/ghc/libraries/ghc_7_6_3/hdirect-0.21.0/src/Rename.lhs
55,58c55,58
< import Data.Maybe  ( isJust, fromMaybe )
< import Data.List      ( isPrefixOf )
< import Control.Monad     ( when, mplus )
< import Data.Char  ( isUpper, toUpper )
---
> import Maybe  ( isJust, fromMaybe )
> import List      ( isPrefixOf )
> import Monad     ( when, mplus )
> import Char  ( isUpper, toUpper )
diff --recursive hdirect//src/RnMonad.lhs /cygdrive/e/ghc/libraries/ghc_7_6_3/hdirect-0.21.0/src/RnMonad.lhs
63c63
< import Data.Maybe ( isJust )
---
> import Maybe ( isJust )
diff --recursive hdirect//src/Skeleton.lhs /cygdrive/e/ghc/libraries/ghc_7_6_3/hdirect-0.21.0/src/Skeleton.lhs
21c21
< import Data.List ( partition )
---
> import List ( partition )
diff --recursive hdirect//src/TypeInfo.lhs /cygdrive/e/ghc/libraries/ghc_7_6_3/hdirect-0.21.0/src/TypeInfo.lhs
27c27
< import Data.Maybe
---
> import Maybe
diff --recursive hdirect//src/Utils.lhs /cygdrive/e/ghc/libraries/ghc_7_6_3/hdirect-0.21.0/src/Utils.lhs
1,2d0
< > {-# LANGUAGE ScopedTypeVariables        #-}
< 
55,56c53
< import Data.Char (chr, ord, readLitChar)
< import Control.Exception ( catch )
---
> import Char (chr, ord, readLitChar)
58c55,56
< import Data.Int
---
> import IO
> import Int
60c58
< import System.Directory
---
> import Directory
62,63c60,61
< import Control.Monad ( when )
< import Data.List  ( mapAccumL, isPrefixOf )
---
> import Monad ( when )
> import List  ( mapAccumL, isPrefixOf )
283c281
<             `catch` (\ (_::IOError) -> return False)
---
>             `catch` (\ _ -> return False)

Blog Archive

About Me

My photo
Disambiguating biog as there are a few Stephen Tetley's in the world. I'm neither a cage fighter or yachtsman. I studied Fine Art in the nineties (foundation Bradford 1992, degree Cheltenham 1992 - 95) then Computing part-time at Leeds Met graduating in 2003. I'm the Stephen Tetley on Haskell Cafe and Stackoverflow.