(no subject)

l14881@alunos.uevora.pt l14881@alunos.uevora.pt
Mon, 19 May 2003 21:44:32 +0100 (WEST)


data Wam = Wam {
		falha::String,
		h::Int, 
		s::Int, 
		p::Int, 
		heap::Array Int Pares,
		registos::Array Int Pares,
		e::Int,
		b::Int,
		mode::Char,
		cp::Int,
		code::Array Int Int,
		trail::Array Int Int,
		tr::Int,
		hb::Int
	       } 
	   deriving Show




deref a c = let (tag,value) = ((heap c)!(a)) in
		if ((tag=="REF") && (value /= a)) then
		return deref value c
		else
		return a c

I would like to do something like that but it gives me an error.

error:

ERROR "trab2.hs":373 - Type error in function binding
*** Term           : deref
*** Type           : Int -> Wam -> Int
*** Does not match : Wam -> Int


Can anyone help, please?? thanks