
On Wed, Mar 14, 2012 at 11:28 PM, Olwe Melwasul
I'm working my way through Real World Haskell and am in Chapter 3. On page 56 there is a discussion called "Record Syntax" and it gives this data constructor:
data Customer = Customer { customerID :: CustomerID , customerName :: String , customerAddress :: Address } deriving (Show)
where CustomerID and Address were defined (and loaded) before. But when I try to put in data, I get these errors
*Main> :load BookStore.hs [1 of 1] Compiling Main ( BookStore.hs, interpreted ) Ok, modules loaded: Main. *Main> customer1 = Customer 271828 "J.R. Hacker" ["255 Syntax Ct", "Milpitas, CA 95134", "USA"]
In GHCi definitions are introduced with 'let', as in:
let x = ...
Antoine