Question about Real World Haskell

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
3 messages Options
Reply | Threaded
Open this post in threaded view
|

Question about Real World Haskell

Alan Cameron
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


Reply | Threaded
Open this post in threaded view
|

Question about Real World Haskell

David Frey
On Thu, 29 Jan 2009 15:21:24 +0000, Alan Cameron <[hidden email]>
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.
Reply | Threaded
Open this post in threaded view
|

Question about Real World Haskell

Patrick LeBoutillier-2
> 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.

You can find the entire source code from the book here:

http://examples.oreilly.com/9780596514983/rwh-examples2.zip

Patrick
--
=====================
Patrick LeBoutillier
Rosem?re, Qu?bec, Canada