[Yhc] building yhc

Reid Barton rwbarton at math.harvard.edu
Wed Oct 1 22:28:22 EDT 2008


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
-	$(GHC) --make -package base -package network -package hxt -package filepath $< -o $@
+	$(GHC) --make -package base -package network -package hxt-7.5 -package filepath $< -o $@
}

The user's guide on the wiki also needs some minor tweaks to be up to
date with the current version of Yhc.  I'll probably make them tonight
or tomorrow.  Now that I have haskell running in the browser, it's
very cool!

Regards,
Reid Barton


More information about the Yhc mailing list