Send Beginners mailing list submissions to
        beginners@haskell.org

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
        beginners-requ...@haskell.org

You can reach the person managing the list at
        beginners-ow...@haskell.org

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


Today's Topics:

   1.  Re: threadDelay does not delay thread execution?
      (Ertugrul Soeylemez)
   2. Re:  Re: threadDelay does not delay thread        execution?
      (Benjamin Edwards)
   3. Re:  'cabal install hdirect' can't find hdirect (Stephen Tetley)


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

Message: 1
Date: Mon, 5 Jul 2010 12:34:00 +0200
From: Ertugrul Soeylemez <e...@ertes.de>
Subject: [Haskell-beginners] Re: threadDelay does not delay thread
        execution?
To: beginners@haskell.org
Message-ID: <20100705123400.08a5b...@tritium.streitmacht.eu>
Content-Type: text/plain; charset=US-ASCII

Benjamin Edwards <edwards.b...@gmail.com> wrote:

> I am looking to make a simple program that polls an interface once a
> second or so. I thought I could use threadDelay for this, so knocked
> up the following toy program to test my idea.
>
> module TD
>   where
>
> import Control.Concurrent
> import Control.Concurrent.MVar
>
> main :: IO ()
> main = do mv <- newEmptyMVar
>           forkIO $ loop mv 0 "Hai"
>           takeMVar mv
>           return ()
>   where loop mv n msg = do putStrLn msg
>                            threadDelay 10000
>                            if n < 10 then loop mv (n+1) msg
>                                      else putMVar mv ()
>
> It doesn't work, in as much as I see all the messages printed
> seemingly as fast as Std out will print them. What am I doing wrong?

Note that threadDelay takes microseconds, not milliseconds.  So
'threadDelay 1000000' should wait one second (at least).


Greets,
Ertugrul


-- 
nightmare = unsafePerformIO (getWrongWife >>= sex)
http://ertes.de/




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

Message: 2
Date: Mon, 5 Jul 2010 12:41:03 +0200
From: Benjamin Edwards <edwards.b...@gmail.com>
Subject: Re: [Haskell-beginners] Re: threadDelay does not delay thread
        execution?
To: haskellbeginners <beginners@haskell.org>
Message-ID:
        <aanlktinnu3ugi91orux8ttijmfjao5afwnboxndam...@mail.gmail.com>
Content-Type: text/plain; charset="iso-8859-1"

ahhhh.... I had read mirco secords, but for some reason in my addled brain I
converted that to miliseconds. Doh!

Thans

On 5 July 2010 12:34, Ertugrul Soeylemez <e...@ertes.de> wrote:

> Benjamin Edwards <edwards.b...@gmail.com> wrote:
>
> > I am looking to make a simple program that polls an interface once a
> > second or so. I thought I could use threadDelay for this, so knocked
> > up the following toy program to test my idea.
> >
> > module TD
> >   where
> >
> > import Control.Concurrent
> > import Control.Concurrent.MVar
> >
> > main :: IO ()
> > main = do mv <- newEmptyMVar
> >           forkIO $ loop mv 0 "Hai"
> >           takeMVar mv
> >           return ()
> >   where loop mv n msg = do putStrLn msg
> >                            threadDelay 10000
> >                            if n < 10 then loop mv (n+1) msg
> >                                      else putMVar mv ()
> >
> > It doesn't work, in as much as I see all the messages printed
> > seemingly as fast as Std out will print them. What am I doing wrong?
>
> Note that threadDelay takes microseconds, not milliseconds.  So
> 'threadDelay 1000000' should wait one second (at least).
>
>
> Greets,
> Ertugrul
>
>
> --
> nightmare = unsafePerformIO (getWrongWife >>= sex)
> http://ertes.de/
>
>
> _______________________________________________
> Beginners mailing list
> Beginners@haskell.org
> http://www.haskell.org/mailman/listinfo/beginners
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: 
http://www.haskell.org/pipermail/beginners/attachments/20100705/066d0559/attachment-0001.html

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

Message: 3
Date: Mon, 5 Jul 2010 14:12:53 +0100
From: Stephen Tetley <stephen.tet...@gmail.com>
Subject: Re: [Haskell-beginners] 'cabal install hdirect' can't find
        hdirect
To: Larry Evans <cppljev...@suddenlink.net>
Cc: beginners@haskell.org
Message-ID:
        <aanlktil7-6-i-ohnsxrtg_s3osulvk33us_haumo6...@mail.gmail.com>
Content-Type: text/plain; charset="iso-8859-1"

Hi Larry

Here is the working code.

The original paper uses quite a bit of heavy machinery - both
continuation monads (5.6) and the Extensible Union Types (section 4),
so its probably not an ideal starting point for building intuition on
monad transformers or Lambda evaluators.

Lennart Augustsson has some notes "Lambda calculus cooked four ways"
that are good for the later. Off the top of my head, I can't think of
a good source for the former.

-- Code attached for "MonadTransformers and Modular Interpreters"
-- Sheng Liang, Paul Hudak, Mark Jones
--
-- Code written by Wolfram Kahl, 2001-03-27.
-- 
-- Updated to work with GHC/GHCi, 2010-07-05, by me.
--
-------------- next part --------------
A non-text attachment was scrubbed...
Name: Interpreter.hs
Type: application/octet-stream
Size: 17175 bytes
Desc: not available
Url : 
http://www.haskell.org/pipermail/beginners/attachments/20100705/fb803e56/Interpreter.obj

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

_______________________________________________
Beginners mailing list
Beginners@haskell.org
http://www.haskell.org/mailman/listinfo/beginners


End of Beginners Digest, Vol 25, Issue 15
*****************************************

Reply via email to