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:  LYAHFGG, chapter 11 question (Chris Allen)
   2. Re:  LYAHFGG, chapter 11 question (Brandon Allbery)
   3. Re:  Haskeline and forkIO (Heinrich Apfelmus)
   4. Re:  LYAHFGG, chapter 11 question (Peter Hall)


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

Message: 1
Date: Tue, 26 Aug 2014 22:39:23 -0500
From: Chris Allen <[email protected]>
To: [email protected]
Subject: Re: [Haskell-beginners] LYAHFGG, chapter 11 question
Message-ID: <[email protected]>
Content-Type: text/plain; charset="windows-1252"; Format="flowed"

I've found LYAH beginning ca. the Functors material to become difficult 
for some people based on my experiences and the people I've worked with. 
Difficult in the sense of getting a forest-eye view or essence of what 
they are and what they mean.

At this point, I generally recommend people flip over to cis194. NICTA 
course is an excellent follow-up as well and communicates what Functor, 
Applicative, and Monad are in a way that is unmistakable.

My detailed guide is here: https://github.com/bitemyapp/learnhaskell

There's also the #haskell, #haskell-beginners, and #nicta-course IRC 
channels on Freenode if you'd like interactive help.

HTH,
Chris


On 08/26/2014 09:33 PM, Frank wrote:
> About "Learn You a Haskell ...", is it My imagination or is chapter 11 
> absurdly long and/or thick? I can (and have) read a 100+ page U.S. 
> Supreme Court ruling, readily understand it, and be able to explain it 
> in plain English, with next to zero trouble. I spend every work day 
> reading, parsing, interpreting, and using, the ISO C++ standard. I 
> /taught/ My undergraduate Physics IV class while simultaneously taking 
> it. Yet, chapter 11 feels as if it goes on and on to the point I 
> easily forget what I read just a few lines before, rendering 
> comprehension of the same an almost Sisyphean task. Is it just Me? Am 
> I just tired? Is there an alternative resource for understanding the 
> concepts that particular chapter presents?
>
> Sincerely,
> Frank D. Martinez
>
> -- 
> P.S.: I prefer to be reached on BitMessage at 
> BM-2D8txNiU7b84d2tgqvJQdgBog6A69oDAx6
>
>
> _______________________________________________
> 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/20140826/d2d1f9e8/attachment-0001.html>

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

Message: 2
Date: Tue, 26 Aug 2014 23:42:15 -0400
From: Brandon Allbery <[email protected]>
To: The Haskell-Beginners Mailing List - Discussion of primarily
        beginner-level topics related to Haskell <[email protected]>
Subject: Re: [Haskell-beginners] LYAHFGG, chapter 11 question
Message-ID:
        <CAKFCL4XYjs-t6HObai8-tmZ4-ipLdWPCGAE-2T6sf=ua2ru...@mail.gmail.com>
Content-Type: text/plain; charset="utf-8"

On Tue, Aug 26, 2014 at 11:32 PM, Matthew Moppett <[email protected]>
wrote:

> And monads seem to be used much more often than applicatives in Haskell.


Much of that is historical: Monads have been around for a long time,
Applicatives are fairly recent, and a lot of things that are best done with
Applicatives were done with Monads because they were there.

-- 
brandon s allbery kf8nh                               sine nomine associates
[email protected]                                  [email protected]
unix, openafs, kerberos, infrastructure, xmonad        http://sinenomine.net
-------------- next part --------------
An HTML attachment was scrubbed...
URL: 
<http://www.haskell.org/pipermail/beginners/attachments/20140826/11021ffe/attachment-0001.html>

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

Message: 3
Date: Wed, 27 Aug 2014 11:00:53 +0200
From: Heinrich Apfelmus <[email protected]>
To: [email protected]
Subject: Re: [Haskell-beginners] Haskeline and forkIO
Message-ID: <[email protected]>
Content-Type: text/plain; charset=UTF-8; format=flowed

Jeff C. Britton wrote:
> I am trying to modify an example in RealWorldHaskell from Chapter 24.
> The example is the first code snippet labeled -- file: ch24/Compressor.hs
> 
> I am trying to replace the use of Readline with Haskeline.
> In my code the forkIO thread does not run.
> I guessed that since the result of the worker thread was thrown away that 
> perhaps laziness was the problem.
> So, I attempted to use `seq`, but that does not work either.

The forkIO is not run because your code never actually runs it. :)

The snippet

    let f = runWorker (worker path)
    in
        f `seq` do
          return f
          loop

binds a value (here an `IO` action) to the variable `f`, then makes sure 
that the variable is evaluated to weak head normal form (which is 
something quite different from executing the `IO` action), and then 
combines the IO action `return f` (which has no side effects, but 
returns the value of `f`) with `loop`.

The key point to understand here is that IO actions are first-class 
values: you can bind them to variables and combine them with `>>` and 
`>>=`. In a sense, you never execute IO actions, you only build them. 
The only time when something is executed is when the Haskell compiler 
executes the IO action assigned to the `main` variable.

What you had in mind is a program that combines the IO action `f` 
directly with the `loop`, like this:

    let f = runWorker (worker path)
    in
        do
          f
          loop


Best regards,
Heinrich Apfelmus

--
http://apfelmus.nfshost.com



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

Message: 4
Date: Wed, 27 Aug 2014 10:22:11 +0100
From: Peter Hall <[email protected]>
To: The Haskell-Beginners Mailing List - Discussion of primarily
        beginner-level topics related to Haskell <[email protected]>
Subject: Re: [Haskell-beginners] LYAHFGG, chapter 11 question
Message-ID:
        <caa6hak62kgvnok-rnbxk0mf6wnocjyvsja+ouhp2isjd1nv...@mail.gmail.com>
Content-Type: text/plain; charset="utf-8"

> I learned a new word today, ?Sisyphean.?

Me too! :)

Peter


On 27 August 2014 04:21, Jeff C. Britton <[email protected]> wrote:

>  I had originally encountered problems at this point myself.  I lost
> motivation because I had just had this feeling that programming with
> applicatives was just not going to be fun, and it was beginning to seem
> like Haskell programming might involve a lot of this.  I put the book down
> for about 1 year.  Somewhere I came across an article on Monads that
> changed my mind.  I started over and am now almost done with Chapter 13.
> This time around things are looking a lot cooler.  I think chapters 11,12,
> and 13 may lack the motivational information to keep one going.  I can say
> that the author Miran Lipovaca really does a great job of explaining this
> material.  I don?t think you are going to find a better source.  Absolutely
> every step of the way is laid out in painstaking detail.  Plus there are
> constant reminders of material that was just covered that is relevant to
> the immediate situation.  All I can say is go slow and make sure you
> understand every detail before proceeding.  Keep at it regularly so as not
> to forget important terms.  Go back and reread if necessary.  Have the
> confidence that it will be worthwhile.  The Monad chapters are little bit
> more interesting, but you will need to understand the applicatives first.
> I learned a new word today, ?Sisyphean.?
>
>
>
> *From:* Beginners [mailto:[email protected]] *On Behalf Of *
> Frank
> *Sent:* Tuesday, August 26, 2014 7:33 PM
> *To:* The Haskell-Beginners Mailing List - Discussion of primarily
> beginner-level topics related to Haskell
> *Subject:* [Haskell-beginners] LYAHFGG, chapter 11 question
>
>
>
> About "Learn You a Haskell ...", is it My imagination or is chapter 11
> absurdly long and/or thick? I can (and have) read a 100+ page U.S. Supreme
> Court ruling, readily understand it, and be able to explain it in plain
> English, with next to zero trouble. I spend every work day reading,
> parsing, interpreting, and using, the ISO C++ standard. I *taught* My
> undergraduate Physics IV class while simultaneously taking it. Yet, chapter
> 11 feels as if it goes on and on to the point I easily forget what I read
> just a few lines before, rendering comprehension of the same an almost
> Sisyphean task. Is it just Me? Am I just tired? Is there an alternative
> resource for understanding the concepts that particular chapter presents?
>
>
>
> Sincerely,
>
> Frank D. Martinez
>
>
>
> --
> P.S.: I prefer to be reached on BitMessage at
> BM-2D8txNiU7b84d2tgqvJQdgBog6A69oDAx6
>
> _______________________________________________
> 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/20140827/3c77103e/attachment-0001.html>

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

Subject: Digest Footer

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


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

End of Beginners Digest, Vol 74, Issue 26
*****************************************

Reply via email to