[Haskell-cafe] Showable mutually recursive (fixed-point) datatypes

2005-02-16 Thread Remi Turk
[WARNING: braindamag(ed|ing) experience following] Hi all, a few days ago I decided I desperately needed a set which could contain (among others) itself. My first idea was > module Main where > import List > import Monad > data Elem s a = V a | R (s (Elem s a)) Now, a self-containing list can

RE: [Haskell-cafe] Point-free style (Was: Things to avoid)

2005-02-16 Thread Bernard Pope
On Mon, 2005-02-14 at 15:56 +, Simon Marlow wrote: > > I don't think a general "things to avoid" section should be advocating > not naming things... in fact I would advocate the reverse. Name as many > things as possible, at least until you have a good feel for how much > point-freeness is go

[Haskell-cafe] Installation with yum.

2005-02-16 Thread Manoj Kummini
Hi. I am trying to install haskell on FC3 following the instructions from http://www.haskell.org/fedora/ I copied the lines: [EMAIL PROTECTED] ~# cat /etc/yum.repos.d/haskell.repo [haskell-stable] name=Haskell Packages (stable) baseurl=http://haskell.org/fedora/haskell/$releasever/$basearch/RPMS

Re: [Haskell-cafe] IO and Wash

2005-02-16 Thread John Goerzen
On Wed, Feb 16, 2005 at 02:56:11PM -, Simon Marlow wrote: > > the unsafe_io prevent that? > > You can avoid lots of unnecessary state-saving by judicious use of > WASH's 'once' function. eg. Hmm. I have tried this, but I'm not seeing any change in the amount of saved state as a result of u

Re: [Haskell-cafe] IO and Wash

2005-02-16 Thread Tomasz Zielonka
On Wed, Feb 16, 2005 at 08:30:29AM -0600, John Goerzen wrote: > Ahh, I think I understand what you're saying... table_io is not > supposed to be unsafe; that is, it should work without saving data in > the log even if the input would be different on a different session. > But yes, if the validatio

Re: [Haskell-cafe] Unsafe IO and Wash

2005-02-16 Thread Tomasz Zielonka
On Wed, Feb 16, 2005 at 08:27:31AM -0600, John Goerzen wrote: > > You do know that the current version of WASH rebuilds the continuation > > by repeating all the previous steps, don't you? Until WASH can keep the > > Yes. What I don't understand is why. If I have a submit button, and it > is pas

RE: [Haskell-cafe] Unsafe IO and Wash

2005-02-16 Thread Simon Marlow
On 16 February 2005 14:28, John Goerzen wrote: > On Wed, Feb 16, 2005 at 07:16:50AM +0100, Tomasz Zielonka wrote: >> On Wed, Feb 16, 2005 at 04:33:29AM +, John Goerzen wrote: >>> On a related note, Wash seems to be preserving all sorts of >>> unnecessary "state" from previous screens a user vi

RE: [Haskell-cafe] IO and Wash

2005-02-16 Thread Simon Marlow
On 16 February 2005 14:30, John Goerzen wrote: > On Wed, Feb 16, 2005 at 07:31:07AM +0100, Tomasz Zielonka wrote: >>> verbatim. Any ideas? >> >> I have never used table_io. maybe there's a bug in it. Hmmm, it seems >> to be conceptually wrong. The single purpose of table_io seems to be >> to avo

[Haskell-cafe] Re: Unsafe IO and Wash

2005-02-16 Thread John Goerzen
On 2005-02-16, John Goerzen <[EMAIL PROTECTED]> wrote: > On Wed, Feb 16, 2005 at 07:16:50AM +0100, Tomasz Zielonka wrote: >> On Wed, Feb 16, 2005 at 04:33:29AM +, John Goerzen wrote: >> > On a related note, Wash seems to be preserving all sorts of unnecessary >> > "state" from previous screens

Re: [Haskell-cafe] IO and Wash

2005-02-16 Thread John Goerzen
On Wed, Feb 16, 2005 at 07:31:07AM +0100, Tomasz Zielonka wrote: > > verbatim. Any ideas? > > I have never used table_io. maybe there's a bug in it. Hmmm, it seems > to be conceptually wrong. The single purpose of table_io seems to be > to avoid keeping the result of an IO action in the log. But

Re: [Haskell-cafe] Unsafe IO and Wash

2005-02-16 Thread John Goerzen
On Wed, Feb 16, 2005 at 07:16:50AM +0100, Tomasz Zielonka wrote: > On Wed, Feb 16, 2005 at 04:33:29AM +, John Goerzen wrote: > > On a related note, Wash seems to be preserving all sorts of unnecessary > > "state" from previous screens a user visited. > > You do know that the current version of

[Haskell-cafe] Point-free style

2005-02-16 Thread Stephan Hohe
Benjamin Franksen wrote: This one is a little bit shorter and somewhat more 'elementary': s = (.) (flip (.) (head . uncurry zip . splitAt 1 . replicate 2) . uncurry) . (flip (.) (flip (.)) . flip (.)) And with less flips: s = (((. head . uncurry zip . splitAt 1 . repeat) . uncurry) .) . (.) . flip

[Haskell-cafe] transformation of point-free expressions

2005-02-16 Thread Daniel Fischer
G'day ye all, is there an *elegant* way to transform ( (.) (flip (.) (flip ($ . flip (.) . flip (.) to the more compact form flip (.) . flip ? And more general, is there an algorithm to simplify such expressions (other than take a piece of paper, apply it to the appropriate number of argu

Re: [Haskell-cafe] Unsafe IO and Wash

2005-02-16 Thread Tomasz Zielonka
Seems like 7 am is not my time of day. Even I have problems to understand this message. Let me correct the biggest typos. On Wed, Feb 16, 2005 at 07:16:50AM +0100, Tomasz Zielonka wrote: > Are you sure your IO actions will always yield the same result? If so, > the you can safely use unsafe_io. Ot