From: Matt McCutchen Date: Wed, 30 Jul 2008 04:37:11 +0000 (-0400) Subject: Add compatibility gorp for GHC 6.6.1. X-Git-Url: https://mattmccutchen.net/match/match.git/commitdiff_plain/7b8c0e4e53d51ee1d3207493738ee9a36e7181d8 Add compatibility gorp for GHC 6.6.1. --- diff --git a/program/CS2MinCostFlow.hs b/program/CS2MinCostFlow.hs index 47a73f5..5ce8086 100644 --- a/program/CS2MinCostFlow.hs +++ b/program/CS2MinCostFlow.hs @@ -5,7 +5,12 @@ import System.IO.Unsafe import Data.Graph.Inductive.Graph import Data.Array.IArray import Data.List + +#if __GLASGOW_HASKELL__ <= 606 +(*) `on` f = \x y -> f x * f y +#else import Data.Function +#endif -- Configure the path to cs2.exe relative to the program/ directory here. cs2cmd = "./cs2.exe" diff --git a/program/Formatter.hs b/program/Formatter.hs index 5ee5a00..ed851b3 100644 --- a/program/Formatter.hs +++ b/program/Formatter.hs @@ -1,6 +1,10 @@ module Formatter where import Data.List +#if __GLASGOW_HASKELL__ <= 606 +intercalate xs xss = concat (intersperse xs xss) +#endif + padWith :: a -> Int -> [a] -> [a] padWith _ 0 l = l padWith e n [] = replicate n e diff --git a/program/Makefile b/program/Makefile index df9942e..78eb667 100644 --- a/program/Makefile +++ b/program/Makefile @@ -1,7 +1,9 @@ # Let's keep it simple for now. +# -cpp: Handle GHC 6.6.1 compatibility checks. +# -fglasgow-exts: Handle rank-2 type of RandomizedMonad, among other things. all: - ghc -fglasgow-exts --make -c *.hs + ghc -cpp -fglasgow-exts --make -c *.hs all-optimized: - ghc -fglasgow-exts --make -O -hisuf O.hi -osuf O.o -c *.hs + ghc -cpp -fglasgow-exts --make -O -hisuf O.hi -osuf O.o -c *.hs clean: rm -f *.hi *.o diff --git a/program/debug b/program/debug index 32e8157..f25ff9d 100755 --- a/program/debug +++ b/program/debug @@ -1,3 +1,3 @@ #!/bin/bash # Let ghci see only the source so it loads the modules debuggably. -exec ghci -fglasgow-exts -hisuf D.hi -osuf D.o Test "$@" +exec ghci -cpp -fglasgow-exts -hisuf D.hi -osuf D.o Test "$@"