On 7/17/07, John Meacham
On Tue, Jul 17, 2007 at 10:20:01PM +0000, Samuel J. J. Bronson wrote:
I just tried to compile this program (based on figure one in "The GRIN Project: A Highly Optimising Back End for Lazy Functional Languages"):
{-# OPTIONS_JHC -N -fffi #-}
import Jhc.Basics import Jhc.Int import Jhc.Num import Jhc.Order
default (Integer, Double)
main = sum (upto 1 10)
upto m n | m > n = [] | otherwise = m : upto (m+1) n
sum [] = 0 sum (x:xs) = x + sum xs
And I got a stupid error about a missing "put" method for IORef. It seems that the typechecker isn't getting rid of all the MetaVars in this program...
hmm.. main not being an actual IO action doesn't behave too well with overloading. (I really should make it just fail without an explicit option saying you want to evaluate an expression)
I don't really want the code to work... I just want it to get a proper error. Also it's taking forever to compile the Prelude -- it's been compiling all night and it's still on the same line of output as when I went to bed... (I suspect that it would be on a different character if I hadn't piped it through tee and less, though). I'd be happy with an error from the typechecker, an error from E.FromHs, an error from an E pass... pretty much anything before it's trying to write an .ho file ;-).