Account Options

  1. Sign in
The old Google Groups will be going away soon, but your browser is incompatible with the new version.
Google Groups Home
« Groups Home
Message from discussion Clearly, Haskell is ill-founded
The group you are posting to is a Usenet group. Messages posted to this group will make your email address visible to anyone on the Internet.
Your reply message has not been sent.
Your post was successful
 
From:
To:
Cc:
Followup To:
Add Cc | Add Followup-to | Edit Subject
Subject:
Validation:
For verification purposes please type the characters you see in the picture below or the numbers you hear by clicking the accessibility icon. Listen and type the numbers you hear
 
Derek Elkins  
View profile  
 More options Jul 15 2007, 9:48 pm
Newsgroups: fa.haskell
From: Derek Elkins <derek.a.elk...@gmail.com>
Date: Mon, 16 Jul 2007 01:48:45 UTC
Local: Sun, Jul 15 2007 9:48 pm
Subject: Re: [Haskell-cafe] Clearly, Haskell is ill-founded

On Mon, 2007-07-16 at 02:29 +0100, Conor McBride wrote:
> Hi

> Whoops! Only just spotted this. Many apologies.

> On 10 Jul 2007, at 20:35, Creighton Hogg wrote:

> > Me:

> > > No, an
> > > operating system is supposed to remain responsive. And that's what
> > > total coprograms do.

> > I'm sorry, but can you expand a little further on this?  I guess I  
> > don't understand how a corecursion => responsive to input but not  
> > terminating.  Where does the idea of waiting for input fit into  
> > corecursion?

> You'll be needing a bit of higher-order corecursion for that.
> Here's a coprogram for haskell-cafe:

>  > data{-codata-} Punter = Speak String (String -> Punter)

> A Punter is guaranteed to ask a question, and whatever answer you give
> them, they've always got another question, forever! Meanwhile, a
> String -> Punter is a good-natured soul, always up for answering  
> questions.
> Hence haskell-cafe is a productive coprogram(*) producing a stream of  
> questions
> and answers!

>  > data{-codata-} Stream x = x :> (Stream x)

>  > cafe :: Punter -> (String -> Punter) -> Stream (String, String)
>  > cafe (Speak question learn) guru =
>  >   let  Speak answer guru' = guru question
>  >   in   (question, answer) :> (cafe (learn answer) guru')

If the Punter asks the appropriate question, perhaps the guru will spend
the rest of time thinking about an answer.

_______________________________________________
Haskell-Cafe mailing list
Haskell-C...@haskell.org
http://www.haskell.org/mailman/listinfo/haskell-cafe


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.