Send Beginners mailing list submissions to
        [email protected]

To subscribe or unsubscribe via the World Wide Web, visit
        http://www.haskell.org/mailman/listinfo/beginners
or, via email, send a message with subject or body 'help' to
        [email protected]

You can reach the person managing the list at
        [email protected]

When replying, please edit your Subject line so it is more specific
than "Re: Contents of Beginners digest..."


Today's Topics:

   1. Re:  Tutorial/Book with Exercises (Peter Verswyvelen)
   2. Re:  Tutorial/Book with Exercises (S.J.Thompson)
   3. Re:  Tutorial/Book with Exercises (Zachary Turner)
   4. Re:  Tutorial/Book with Exercises (Michael Mossey)
   5.  module path? qtHaskell examples? (Michael Mossey)
   6. Re:  Tutorial/Book with Exercises (Zachary Turner)
   7.  question about show -- RWH chapter 5 (7stud)


----------------------------------------------------------------------

Message: 1
Date: Wed, 25 Mar 2009 10:37:38 +0100
From: Peter Verswyvelen <[email protected]>
Subject: Re: [Haskell-beginners] Tutorial/Book with Exercises
To: Zachary Turner <[email protected]>
Cc: [email protected]
Message-ID:
        <[email protected]>
Content-Type: text/plain; charset="iso-8859-1"

Did you checkout The Haskell School of Expression?
http://www.haskell.org/soe/

2009/3/25 Zachary Turner <[email protected]>

> Which book or tutorial has the best exercises?  Whenever I learn a language
> I like to do tons of exercises, and in fact I keep a list of books with
> great exercises.  I currently have Real World Haskell and Programming in
> Haskell (Hutton), but I feel the exercises in these books are lacking.
> Examples of books with great exercises are ANSI Common Lisp (Graham),
> Developing Applications with Ocaml (O'Reilly), The Algorithm Design Manual
> (Skiena), and and Enumerative Combinatorics by Stanley (this book is the
> king of all books when it comes to exercises).  They shouldn't be
> impossible, but at the same time exercises like "what are the types of the
> following expressions" are pretty silly.  I think a good book should be
> broken into chapters where it takes at least 10 to 20 times as long to
> complete the exercises at the end of each chapter than it did to read the
> chapter and understand the material in it.
>
> _______________________________________________
> Beginners mailing list
> [email protected]
> http://www.haskell.org/mailman/listinfo/beginners
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: 
http://www.haskell.org/pipermail/beginners/attachments/20090325/4fa56ada/attachment-0001.htm

------------------------------

Message: 2
Date: Wed, 25 Mar 2009 10:10:10 +0000 (GMT)
From: "S.J.Thompson" <[email protected]>
Subject: Re: [Haskell-beginners] Tutorial/Book with Exercises
To: Peter Verswyvelen <[email protected]>
Cc: [email protected]
Message-ID: <[email protected]>
Content-Type: TEXT/PLAIN; charset=US-ASCII



You could look at my "Haskell: the craft of functional programming"
as well ...

 http://www.cs.kent.ac.uk/people/staff/sjt/craft2e/

Regards

Simon



On Wed, 25 Mar 2009, Peter Verswyvelen wrote:

> Did you checkout The Haskell School of Expression?
> http://www.haskell.org/soe/
>
> 2009/3/25 Zachary Turner <[email protected]>
>
> > Which book or tutorial has the best exercises?  Whenever I learn a language
> > I like to do tons of exercises, and in fact I keep a list of books with
> > great exercises.  I currently have Real World Haskell and Programming in
> > Haskell (Hutton), but I feel the exercises in these books are lacking.
> > Examples of books with great exercises are ANSI Common Lisp (Graham),
> > Developing Applications with Ocaml (O'Reilly), The Algorithm Design Manual
> > (Skiena), and and Enumerative Combinatorics by Stanley (this book is the
> > king of all books when it comes to exercises).  They shouldn't be
> > impossible, but at the same time exercises like "what are the types of the
> > following expressions" are pretty silly.  I think a good book should be
> > broken into chapters where it takes at least 10 to 20 times as long to
> > complete the exercises at the end of each chapter than it did to read the
> > chapter and understand the material in it.
> >
> > _______________________________________________
> > Beginners mailing list
> > [email protected]
> > http://www.haskell.org/mailman/listinfo/beginners
> >
> >
>


------------------------------

Message: 3
Date: Wed, 25 Mar 2009 08:26:57 -0500
From: Zachary Turner <[email protected]>
Subject: Re: [Haskell-beginners] Tutorial/Book with Exercises
To: "S.J.Thompson" <[email protected]>
Cc: [email protected]
Message-ID:
        <[email protected]>
Content-Type: text/plain; charset="iso-8859-1"

On Wed, Mar 25, 2009 at 5:10 AM, S.J.Thompson <[email protected]>wrote:

>
>
> You could look at my "Haskell: the craft of functional programming"
> as well ...
>
>  http://www.cs.kent.ac.uk/people/staff/sjt/craft2e/
>
> Regards
>
> Simon
>

Thanks!  Both books were available to search inside on amazon, so I was able
to take a look.  I especially like the amount that are included in yours,
and the fact that some of them are harder.  I only wish more authors
appreciated the value of good exercises, which IMO are at least as important
as the standard content of the book.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: 
http://www.haskell.org/pipermail/beginners/attachments/20090325/cb0e8f70/attachment-0001.htm

------------------------------

Message: 4
Date: Wed, 25 Mar 2009 07:40:22 -0700
From: Michael Mossey <[email protected]>
Subject: Re: [Haskell-beginners] Tutorial/Book with Exercises
To: Zachary Turner <[email protected]>, [email protected]
Message-ID: <[email protected]>
Content-Type: text/plain; charset=ISO-8859-1; format=flowed



Zachary Turner wrote:
> Which book or tutorial has the best exercises?  Whenever I learn a 
> language I like to do tons of exercises, and in fact I keep a list of 
> books with great exercises.  I currently have Real World Haskell and 
> Programming in Haskell (Hutton), but I feel the exercises in these books 
> are lacking.  

Hi Zachary, great question. I just recently purchased "Real World 
Haskell" and "The Haskell School of Expression" (SOE). I'm also working 
through Hal Daume III's "Yet Another Haskell Tutorial" (YAHT), free online.

YAHT has some hard exercises, early on. He introduces continuations in 
chapter 4, briefly, and then casually asks you to rewrite map and filter 
  in continuation-passing-style. I was stumped. But most of the 
exercises are approachable.

I have looked at Simon Thompson's book (The Craft of Functional 
Programming) in the bookstore and it looks elegantly written.

If I'm working alone, I also appreciate having the answers to the 
exercises available somewhere. I like to solve the problem, then go see 
how much more elegantly the answer key did it. There is a website with 
answers to SOE's exercises:

<http://www.elbeno.com/haskell_soe_blog/?page_id=24>

YAHT includes the answers in the appendix.

I don't know about Thompson's book; maybe he can tell us where to find 
the answers, or if they are in the appendix.

Thanks,
Mike


------------------------------

Message: 5
Date: Wed, 25 Mar 2009 08:27:21 -0700
From: Michael Mossey <[email protected]>
Subject: [Haskell-beginners] module path? qtHaskell examples?
To: [email protected]
Message-ID: <[email protected]>
Content-Type: text/plain; charset=ISO-8859-1; format=flowed

Does GHC or GHCi let you specify the module search path via an 
environment variable? I notice it can be specified on the command line 
with -i. I don't want to type that every time, but I could always create 
an alias (or on Windows, a "macro") for running ghc/ghci.

A second, unrelated question which I will put in the same email to 
reduce traffic volume: does anyone have working examples of qtHaskell 
programs?

Thanks,
Mike


------------------------------

Message: 6
Date: Wed, 25 Mar 2009 20:10:09 -0500
From: Zachary Turner <[email protected]>
Subject: Re: [Haskell-beginners] Tutorial/Book with Exercises
To: Michael Mossey <[email protected]>
Cc: [email protected]
Message-ID:
        <[email protected]>
Content-Type: text/plain; charset="iso-8859-1"

On Wed, Mar 25, 2009 at 9:40 AM, Michael Mossey <[email protected]>wrote:

>
>
> Zachary Turner wrote:
>
>> Which book or tutorial has the best exercises?  Whenever I learn a
>> language I like to do tons of exercises, and in fact I keep a list of books
>> with great exercises.  I currently have Real World Haskell and Programming
>> in Haskell (Hutton), but I feel the exercises in these books are lacking.
>>
>
> Hi Zachary, great question. I just recently purchased "Real World Haskell"
> and "The Haskell School of Expression" (SOE). I'm also working through Hal
> Daume III's "Yet Another Haskell Tutorial" (YAHT), free online.
>
> YAHT has some hard exercises, early on. He introduces continuations in
> chapter 4, briefly, and then casually asks you to rewrite map and filter  in
> continuation-passing-style. I was stumped. But most of the exercises are
> approachable.
>
> I have looked at Simon Thompson's book (The Craft of Functional
> Programming) in the bookstore and it looks elegantly written.
>
> If I'm working alone, I also appreciate having the answers to the exercises
> available somewhere. I like to solve the problem, then go see how much more
> elegantly the answer key did it. There is a website with answers to SOE's
> exercises:
>
> <http://www.elbeno.com/haskell_soe_blog/?page_id=24>
>
> YAHT includes the answers in the appendix.
>
> I don't know about Thompson's book; maybe he can tell us where to find the
> answers, or if they are in the appendix.
>

Thanks for the good suggestions!  I'll definitely check out YAHT, hard
exercises sound good.  I also came across Richard Bird's Haskell book, which
judging from what I found on Amazon's search inside, it looks like it has
some pretty serious ones, so I might check that out too.

If you're an exercise freak like me, you should take a look at Richard
Stanley's Enumerative Combinatorics Volume 2, page 221 (problem 19), if for
no other reason than to say you've seen the best exercise in the history of
exercises, across all books and fields.  :P  (
http://www-math.mit.edu/~rstan/ec/catalan.pdf)  Even if you don't understand
the material, it's pretty evident after you've scrolled down a few pages why
it's so amazing.

Thanks again
-------------- next part --------------
An HTML attachment was scrubbed...
URL: 
http://www.haskell.org/pipermail/beginners/attachments/20090325/313cc66e/attachment-0001.htm

------------------------------

Message: 7
Date: Thu, 26 Mar 2009 15:41:47 +0000 (UTC)
From: 7stud <[email protected]>
Subject: [Haskell-beginners] question about show -- RWH chapter 5
To: [email protected]
Message-ID: <[email protected]>
Content-Type: text/plain; charset=us-ascii

In chapter 5, RWH defines a JValue data type like this:


SimpleJSON.hs:
--------------

module SimpleJSON
    (
     JValue(..)
    ) where 

data JValue = JNumber Double
            | JString String
            | JArray [JValue]
            | JObject [(String, JValue)]
            | JBool Bool
            | JNull 
              deriving (Eq, Ord, Show)

------------


Then RWH defines some functions like this:

PutJSON.hs:
----------
module PutJSON where

import SimpleJSON

renderJValue::JValue->String
renderJValue (JNumber f)    = show f
renderJValue (JString s)    = show s
renderJValue (JBool True)   = "true"
renderJValue (JBool False)  = "false" 
renderJValue JNull          = "null"
----------

My question is about the function: 

renderJValue (JString s) = show s

A JString value contains a string, so why does the function use
show to convert s to a string?  Why isn't that function defined
like this:

renderJValue (JString s) = s

Using that modified function seems to work:


Main.hs:
---------
module Main () where

import SimpleJSON
import PutJSON 

main = let x = JString "hello" 
       in putStrLn (renderJValue x)


$ ghc -o simple Main.hs PutJSON.hs SimpleJSON.hs
/usr/libexec/gcc/i686-apple-darwin8/4.0.1/ld: warning -F: directory name 
(/Users/me/Library/Frameworks) does not exist

$ simple
hello

Also can anyone tell me why I always get that warning?

Thanks



------------------------------

_______________________________________________
Beginners mailing list
[email protected]
http://www.haskell.org/mailman/listinfo/beginners


End of Beginners Digest, Vol 9, Issue 31
****************************************

Reply via email to