Make work under Hugs98 Sep2006. Falderal needs improving, though.
Cat's Eye Technologies
8 years ago
0 | 0 |
#!/bin/sh
|
1 | 1 |
|
2 | |
cd src && mkdir -p ../bin && ghc Main.hs -o ../bin/sixtypical
|
|
2 |
PROG=sixtypical
|
|
3 |
|
|
4 |
if [ x`which ghc` = x -a x`which runhugs` = x ]; then
|
|
5 |
echo "Neither ghc nor runhugs found on search path."
|
|
6 |
exit 1
|
|
7 |
fi
|
|
8 |
|
|
9 |
mkdir -p bin
|
|
10 |
|
|
11 |
if [ x`which ghc` = x -o ! x$USE_HUGS = x ]; then
|
|
12 |
# create script to run with Hugs
|
|
13 |
cat >bin/$PROG <<'EOF'
|
|
14 |
#!/bin/sh
|
|
15 |
THIS=`realpath $0`
|
|
16 |
DIR=`dirname $THIS`/../src
|
|
17 |
runhugs $DIR/Main.hs $*
|
|
18 |
EOF
|
|
19 |
chmod 755 bin/$PROG
|
|
20 |
else
|
|
21 |
cd src && ghc --make Main.hs -o ../bin/$PROG
|
|
22 |
fi
|
132 | 132 |
PoisonedWith ulocation ->
|
133 | 133 |
updateRoutCtx nm location usage routCtxAccum
|
134 | 134 |
in
|
135 | |
Map.foldrWithKey (poison) routCtx calledRoutCtx
|
|
135 |
foldrWithKey (poison) routCtx calledRoutCtx
|
|
136 |
where
|
|
137 |
-- for Hugs Sep2006, which doesn't have Map.foldrWithKey
|
|
138 |
foldrWithKey f z = foldr (uncurry f) z . Map.toAscList
|
136 | 139 |
|
137 | 140 |
--
|
138 | 141 |
-- Utility function:
|
|
166 | 169 |
in
|
167 | 170 |
updateRoutCtx nm location newUsage routCtxAccum
|
168 | 171 |
in
|
169 | |
Map.foldrWithKey (poison) routCtx1 routCtx2
|
|
172 |
foldrWithKey (poison) routCtx1 routCtx2
|
|
173 |
where
|
|
174 |
-- for Hugs Sep2006, which doesn't have Map.foldrWithKey
|
|
175 |
foldrWithKey f z = foldr (uncurry f) z . Map.toAscList
|