[Haskell-beginners] Question about Real World Haskell
David Frey
dpfrey at shaw.ca
Thu Jan 29 18:27:37 EST 2009
On Thu, 29 Jan 2009 15:21:24 +0000, Alan Cameron <alan.cameron at iname.com>
wrote:
> In Chapter 3 of Real World Haskell it is not clear to me how to get the
> myInfo into the ghci system there appears to be two definitions for
> ch03/BookStore.hs can anyone help?
>
> Alan Cameron
>
I assume you are referring to this:
-- file: ch03/BookStore.hs
data BookInfo = Book Int String [String]
deriving show
... Book text here ...
-- file: ch03/BookStore.hs
data MagazineInfo = Magazine Int String [String]
deriving show
... More book text here ...
-- file: ch03/BookStore.hs
myInfo = Book 9870135072455 "Algebra of Programming"
["Richard Bird", "Oege de Moor"]
When the book mentions a filename, that means that what follows is from
that file, but may only be a piece of that file. Save all of these pieces
into a file named BookStore.hs and then run "ghci BookStore.hs" in the
same directory as the file.
More information about the Beginners
mailing list