[Haskell-cafe] Please help from a newby

karle ph_kittichai at yahoo.com
Fri Nov 2 16:25:03 EDT 2007


The same declaration.-


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)] 

update_table1::Table -> Pkg -> Table
update_table1 [] (t,d,y)  = [(t,d,y)]

Error is

Type error in explicitly typed binding
*** Term           : update_table1
*** Type           : Table -> Pkg -> [(Pkgtype,Int,Payload)]
*** Does not match : Table -> Pkg -> Table

Please kindly suggest, thanks in advance.





-- 
View this message in context: http://www.nabble.com/Please-help-from-a-newby-tf4740192.html#a13555338
Sent from the Haskell - Haskell-Cafe mailing list archive at Nabble.com.



More information about the Haskell-Cafe mailing list