type Pkg = (Pkgtype,Address,Payload)
type Table = [(Address,Port)]
update_table1::Table - Pkg - Table
update_table1 [] (t,d,y) = [(t,d,y)]
The problem is that your function's type signature says it's returning
a Table, which is a [(Address,Port)], but it's actually returning a
On 11/2/07, karle [EMAIL PROTECTED] wrote:
type Address = Int
data Port = C | D deriving(Eq,Show)
data Payload = UP[Char] | RTDP(Address,Port) deriving(Eq,Show)
data Pkgtype = RTD | U deriving(Eq,Show)
type Pkg = (Pkgtype,Address,Payload)
type Table = [(Address,Port)]
Karle,
The expression (t,d,y) must have type Pkg, by your type annotation for
update_table1, so [ (t,d,y) ] has type [Pkg]. Also by your type
annotation, the result of update_table1 should by of type Table. Is
the type [Pkg] compatible with type Table? In other words, is the type
[