Hi,
There appears to be a semicolon missing from hstags in fptools-3.01, patch below:
*** /usr/local/fptools/bin/hstags.orig Thu Feb 26 21:34:58 1998
--- /usr/local/fptools/bin/hstags Thu Feb 26 21:35:11 1998
***************
*** 67,73 ****
push(@Files, $_);
}
! $ghc_version_info = ${ProjectVersionInt}
$DoHsCpp = ( ! $DoCpp ) ? 'cat'
: "$HsCpp -D__HASKELL1__=2
-D__GLASGOW_HASKELL__=$ghc_version_info $Cpp_opts";
--- 67,73 ----
push(@Files, $_);
}
! $ghc_version_info = ${ProjectVersionInt};
$DoHsCpp = ( ! $DoCpp ) ? 'cat'
: "$HsCpp -D__HASKELL1__=2
-D__GLASGOW_HASKELL__=$ghc_version_info $Cpp_opts";
Also, the module below (my attempt to clean up Hash.hs) produces this
warning when compiled with ghc-3.01:
Hash.hs:1: Warning: `Hashable' mentioned 3 times in export list
I thought this one had been fixed, but now it seems to be growing.
Tim
--
module Hash (
Hashable, hash, prehash, addHash, maxPrime64k
) where
import Ix--1.3
import Array--1.3
import Ratio --1.3
import Complex --1.3
import ExtraMath
chr = toEnum :: Int -> Char --1.3
ord = fromEnum :: Char -> Int --1.3
--
-- Hash a value. Improved by trb
--
maxPrime64k :: (Integral a) => a
maxPrime64k = 65521
addHash :: Integer -> Integer -> Integer -> Integer
addHash m acc x = (integralise powerCeiling 2 m * acc + x) `mod` m
class Hashable a where
hash :: Integer -> a -> Integer
prehash :: Integer -> a -> Integer
hash m = flip mod m . prehash m
prehash = hash
instance Hashable Char where
prehash m x = (toInteger . fromEnum) x
instance Hashable Int where
prehash _ = toInteger
instance Hashable Integer where
prehash _ = id
instance Hashable Float where
hash m = hash m . decodeFloat
instance Hashable Double where
hash m = hash m . decodeFloat
instance Hashable () where
prehash _ = const 0
instance Hashable a => Hashable (Maybe a) where
hash m Nothing = hash m ()
hash m (Just x) = hash m x
--instance Hashable (a -> b) where
-- prehash _ f = 0
instance Hashable a => Hashable [a] where
hash m xs = foldl (addHash m) 0 (map (prehash m) xs)
{-# SPECIALISE instance Hashable [Char] #-}
instance (Hashable a, Hashable b) => Hashable (a,b) where
hash m (a,b) = let (+) = addHash m in prehash m a + prehash m b
instance (Hashable a, Hashable b, Hashable c) => Hashable (a,b,c) where
hash m (a,b,c) = let (+) = addHash m in prehash m a + prehash m b + prehash m c
instance (Hashable a, Hashable b, Hashable c, Hashable d) => Hashable (a,b,c,d) where
hash m (a,b,c,d) = let (+) = addHash m in prehash m a + prehash m b + prehash m c
+ prehash m d
instance (Hashable a, Hashable b, Hashable c, Hashable d, Hashable e) => Hashable
(a,b,c,d,e) where
hash m (a,b,c,d,e) = let (+) = addHash m in prehash m a + prehash m b + prehash m
c + prehash m d + prehash m e
instance Hashable Bool where
prehash _ = toInteger . fromEnum
instance (Integral a, Hashable a) => Hashable (Ratio a) where
hash m x = let (+) = addHash m in prehash m (denominator x) + prehash m (numerator
x)
instance (RealFloat a, Hashable a) => Hashable (Complex a) where
hash m (x :+ y) = let (+) = addHash m in prehash m x + prehash m y
#if __HASKELL1__ < 3
instance (Hashable a, Hashable b) => Hashable (Assoc a b) where
hash m (x := y) = let (+) = addHash m in prehash m x + prehash m y
#endif
instance (Ix a, Hashable b) => Hashable (Array a b) where
hash m = hash m . elems