Newsgroups: fa.haskell
From: Conor McBride <c...@Cs.Nott.AC.UK>
Date: Mon, 16 Jul 2007 07:15:16 UTC
Local: Mon, Jul 16 2007 3:15 am
Subject: Re: [Haskell-cafe] Clearly, Haskell is ill-founded
Hi Derek
On 16 Jul 2007, at 02:48, Derek Elkins wrote: > On Mon, 2007-07-16 at 02:29 +0100, Conor McBride wrote: [..] >> Hi >>> data{-codata-} Punter = Speak String (String -> Punter) >>> data{-codata-} Stream x = x :> (Stream x) >>> cafe :: Punter -> (String -> Punter) -> Stream (String, String) > If the Punter asks the appropriate question, perhaps the guru will also a productive coprogram. In more realistic examples, mere productivity might not be enough: you might want to be sure that questions will eventually be answered, after some initial segment of "busy" responses. To that end, an exercise. Implement a codata type data{-codata-} Mux x y = ... which intersperses x's and y's in such a way that (1) an initial segment of a Mux does not determine whether the next (2) there are productive coprograms demuxL :: Mux x y -> Stream x (ie, alternation is none the less forced) You may need to introduce some (inductive) data to achieve this. If you All the best Conor _______________________________________________ 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.
| ||||||||||||||