problem compiling an older Haskell program with GHC 6.6.1

Peter Tanski p.tanski at gmail.com
Fri Jul 6 11:42:16 EDT 2007


On Fri, 6 Jul 2007 09:59:41 -0400 Scott Stoller wrote:
> I am trying to compile paradox 1.0, an older (GHC 5) Haskell program,
> with GHC 6.6.1 (the Solaris 10 / x86 binary distribution).
>
<snip>
>
> Set.hs:26:7:
>     Could not find module `Data.FiniteMap':
>       locations searched:
>         Data/FiniteMap.hs
>         Data/FiniteMap.lhs
> *** Deleting temp files:
> Deleting: /tmp/ghc13306_0/ghc13306_0.dep
> *** Deleting temp dirs:
> Deleting: /tmp/ghc13306_0
> make: *** [depend.mak] Error 1
>
> is this a backwards-compatibility issue between GHC 6.6.1 and older
> versions of GHC?  is there a simple workaround?

The problem is that the Data.FiniteMap library has been deprecated  
and renamed to Data.Map.  See http://www.haskell.org/ghc/dist/current/ 
docs/libraries/base/Data-Map.html .  The solution is to go through  
paradox and change references to Data.FiniteMap to Data.Map and,  
especially, to check that functions from Data.FiniteMap now have the  
form of Data.Map.  Changing the functions should not be too hard:  
mostly swapping variables around.  You may also run into namespace  
collision problems with Data.List (GHC will alert you), in which case:

import Data.Map as Map
import Data.List as List

and for each function that collided, such as map or fold, specify  
which one you are using:

Data.map ... List.map ...

Otherwise you should be fine.  The change from Data.FiniteMap to  
Data.Map has been around for a little while now but there are still  
quite a few old libraries kicking around that use FiniteMap and need  
to be updated.

Cheers,
Pete




More information about the Glasgow-haskell-users mailing list