Reid Barton | 2 Oct 2008 04:28
Picon
Favicon

building yhc

Hello,

I tried building Yhc recently (I'd like to use the javascript backend
in a project) but I ran into the following error:

src/compiler/Core/Convert.hs:133:50:
    Couldn't match expected type `String -> Warning'
           against inferred type `Map.Map Id Info'
    In the first argument of `toForeign', namely `syms'
    In the expression: toForeign syms memo cc Imported cname arity i
    In the definition of `forn':
        forn = toForeign syms memo cc Imported cname arity i
scons: *** [src/compiler/Core/Convert.o] Error 1

I got things working by applying the following small patch:

{
hunk ./Core/Convert.hs 133
-        forn                          = toForeign syms memo cc Imported cname arity i
+        forn                          = toForeign FFIWarn syms memo cc Imported cname arity i
}

although I don't know whether that matches the intent of adding the
(String -> Warning) argument.

I had to make an even smaller patch to get the javascript translator
to build:

{
hunk ./src/translator/js/Makefile 200
(Continue reading)

Malcolm Wallace | 8 Oct 2008 12:12
Picon

Re: building yhc

Reid Barton <rwbarton <at> math.harvard.edu> wrote:

> src/compiler/Core/Convert.hs:133:50:
>     Couldn't match expected type `String -> Warning'
>            against inferred type `Map.Map Id Info'
>     In the first argument of `toForeign', namely `syms'
>     In the expression: toForeign syms memo cc Imported cname arity i
>     In the definition of `forn':
>         forn = toForeign syms memo cc Imported cname arity i

Thanks for the patch.  Now applied.  (It was my fault - after
introducing optionality to warning-generation for FFI code in nhc98, I
neglected to check whether there was anywhere in yhc that would be
affected.)

Regards,
    Malcolm

Gmane