Alex compilation fails on ambiguous type [was: Re: Alex requirement for Setup.lhs]

Philip K.F. Hölzenspies p.k.f.holzenspies at
Thu Dec 4 08:24:32 EST 2008

On Thursday 04 December 2008 00:11:13 Ian Lynagh wrote:
> If you have downloaded the source tarball then the preprocessed files
> are included. Cabal may be getting confused by the .x files also being
> present, so
>     rm src/Scan.x
> should fix it. You may also need to
>     rm src/Parser.y
> if you don't have happy.

Dear Ian, all,

Thank you for your tip, Ian. Deleting src/Scan.x did do the trick. However, I 
get a very strange type error when I try to compile alex 2.2. Maybe someone 
knows what's going on here:

[16 of 16] Compiling Main             ( src/Main.hs, 
dist/build/alex/alex-tmp/Main.o )

    Ambiguous type variable `e' in the constraint:
      `GHC.Exception.Exception e'
        arising from a use of `throw' at src/Main.hs:316:25-31
    Probable fix: add a type signature that fixes these type variable(s)

Lines 314 through 316 in src/Main.hs are:

    r <- Exception.catch 
	   (unblock (thing a))
	   (\e -> do { after a; throw e })

I guess the error in itself makes some sense, because throw can not be 
resolved without knowing a concrete instance of e. I just don't get why I get 
this error in a release version of alex; I would imagine other people do not 
get this error. What am I missing?


More information about the Glasgow-haskell-users mailing list