Re: [Haskell-cafe] ReadP question

2006-08-31 Thread Udo Stenzel
Chris Kuklewicz wrote: I just tried to mimic regular expression matching with ReadP and got what seems like a non-terminating program. Is there another way to use ReadP to do this? -- Simulate (a?|b+|c*)*d regular expression test = star (choice [quest (c 'a') ,plus

Re: [Haskell-cafe] Re: data structures question

2006-08-31 Thread Bulat Ziganshin
Hello Benjamin, Wednesday, August 30, 2006, 11:40:09 PM, you wrote: Matthias Fischmann wrote: The trick is that Int is not the only index data type, but tuples of index data types are, too. Do this: | type Point = (State, State, Int) | type TypeV = Array State Double | | matrix ::

Re: [Haskell-cafe] state and exception or types again...

2006-08-31 Thread Andrea Rossato
Il Wed, Aug 30, 2006 at 11:24:45AM +0100, Brian Hulley ebbe a scrivere: Thanks, glad to be of help. I met Haskell a couple of months ago, when I switched my window manager to Ion. Tuomo Valkonen, its developer, uses darcs. Moreover he develops a small PIM, riot, written in Haskell. I wanted to

Re: [Haskell-cafe] source code for haskell web server?

2006-08-31 Thread Henning Thielemann
On Wed, 30 Aug 2006, Tim Newsham wrote: Does anyone know where I could find the source code for the Haskell web server described in the papers Tackling the Awkward Squad by SPJ and Writing High-Performance Server Applications in Haskell, Case Study: A Haskell Web Server by Simon Marlow?

Re: [Haskell-cafe] Re: data structures question

2006-08-31 Thread Benjamin Franksen
On Thursday 31 August 2006 09:09, Bulat Ziganshin wrote: Hello Benjamin, Wednesday, August 30, 2006, 11:40:09 PM, you wrote: Matthias Fischmann wrote: The trick is that Int is not the only index data type, but tuples of index data types are, too. Do this: | type Point = (State,

[Haskell-cafe] Haskell for hp-ux (ia64)

2006-08-31 Thread Green Bryan - bgreen
Does anyone know of a binary for hp-ux (ia64)? I have permission from my company to try and go forward with using Haskell for development with my team. But, we are running hp-ux on a 16 processor(ia64) box and I cant find a build for it. B Green

Re: [Haskell-cafe] monads once again: a newbie perspective

2006-08-31 Thread Andrea Rossato
Il Thu, Aug 31, 2006 at 02:39:59PM +0100, Simon Peyton-Jones ebbe a scrivere: Andrea Don't forget to link to it from here! http://haskell.org/haskellwiki/Books_and_tutorials#Using_monads Simon, I'll do. But now the text is far from being complete: there's only the code... (the most

Re: [Haskell-cafe] ReadP question

2006-08-31 Thread Chris Kuklewicz
Tom Phoenix wrote: On 8/30/06, Chris Kuklewicz [EMAIL PROTECTED] wrote: -- Simulate (a?|b+|c*)*d regular expression But 'go' seems to not terminate with the leading 'star' Unless I'm missing something... The part of the pattern inside the parentheses should successfully match at least

[Haskell-cafe] A free monad theorem?

2006-08-31 Thread Benjamin Franksen
I'd like to know if the following reasoning can be made more precise: As we all know, the monadic bind operation has type: bind :: Monad m = m a - (a - m b) - m b My intuition says that in order to apply the second argument to some non-trivial (i.e. non-bottom) value of type a, the bind

Re: [Haskell-cafe] A free monad theorem?

2006-08-31 Thread Chris Kuklewicz
Benjamin Franksen wrote: I'd like to know if the following reasoning can be made more precise: As we all know, the monadic bind operation has type: bind :: Monad m = m a - (a - m b) - m b My intuition says that in order to apply the second argument to some non-trivial (i.e.

[Haskell-cafe] Re: A free monad theorem?

2006-08-31 Thread Benjamin Franksen
Chris Kuklewicz wrote: Benjamin Franksen wrote: I'd like to know if the following reasoning can be made more precise: As we all know, the monadic bind operation has type: bind :: Monad m = m a - (a - m b) - m b My intuition says that in order to apply the second argument to some

[Haskell-cafe] Re: Re: data structures question

2006-08-31 Thread Benjamin Franksen
Chris Kuklewicz wrote: Benjamin Franksen wrote: Matthias Fischmann wrote: The trick is that Int is not the only index data type, but tuples of index data types are, too. Do this: | type Point = (State, State, Int) | type TypeV = Array State Double | | matrix :: TypeV | matrix = array

Re: [Haskell-cafe] Re: Re: data structures question

2006-08-31 Thread Jared Updike
And stop calling me Shirley. Could you please be a bit more explicit? Have I offended anyone? This is a reference to a joke from the movie Airplane: Surely, you can't be serious. I am serious, and stop calling me Shirley. I imagine it meant nothing personal. Jared. --

Re: [Haskell-cafe] Re: Re: data structures question

2006-08-31 Thread Chris Kuklewicz
Benjamin Franksen wrote: Chris Kuklewicz wrote: Benjamin Franksen wrote: Matthias Fischmann wrote: The trick is that Int is not the only index data type, but tuples of index data types are, too. Do this: | type Point = (State, State, Int) | type TypeV = Array State Double | | matrix ::

Re: [Haskell-cafe] A free monad theorem?

2006-08-31 Thread Tomasz Zielonka
On Thu, Aug 31, 2006 at 07:23:55PM +0200, Benjamin Franksen wrote: I'd like to know if the following reasoning can be made more precise: As we all know, the monadic bind operation has type: bind :: Monad m = m a - (a - m b) - m b My intuition says that in order to apply the

Re: [Haskell-cafe] A free monad theorem?

2006-08-31 Thread Tomasz Zielonka
On Thu, Aug 31, 2006 at 10:16:38PM +0200, Tomasz Zielonka wrote: Cont (const ()) :: Cont () a-- from Control.Monad.Cont whatever you do, you won't be able to extract an 'a' typed value, non-bottom from this computation. Unless you substitute () for 'a', of course

[Haskell-cafe] Re: Re: Re: data structures question

2006-08-31 Thread Benjamin Franksen
Chris Kuklewicz wrote: Benjamin Franksen wrote: Chris Kuklewicz wrote: I did not even run the code I wrote through ghci, I was just showing what it could look like. And stop calling me Shirley. [...] Could you please be a bit more explicit? Have I offended anyone? Or else, how do I have to

Re: [Haskell-cafe] A free monad theorem?

2006-08-31 Thread Andrea Rossato
Il Thu, Aug 31, 2006 at 07:23:55PM +0200, Benjamin Franksen ebbe a scrivere: I argued that monadic values get 'chained' in a very specific way and that in order to get an intuition about what this monadic chaining really means on the most general level, the standard model of 'computation that

[Haskell-cafe] Re: A free monad theorem?

2006-08-31 Thread Benjamin Franksen
Tomasz Zielonka wrote: On Thu, Aug 31, 2006 at 07:23:55PM +0200, Benjamin Franksen wrote: I'd like to know if the following reasoning can be made more precise: As we all know, the monadic bind operation has type: bind :: Monad m = m a - (a - m b) - m b My intuition says that in

Re: [Haskell-cafe] Re: A free monad theorem?

2006-08-31 Thread Robert Dockins
So getting the value out of the monad is not a pure function (extract :: Monad m = m a - a). I think I stated that, already, in my previous post. I'd even say that the monadic values alone can be completely meaningless. They often have a meaning only relative to some environment, thus are

Re: [Haskell-cafe] HaXml question

2006-08-31 Thread Albert Lai
Tim Newsham [EMAIL PROTECTED] writes: I thought this one would be easy but I'm starting to think its not. I am playing with HaXml and I want to transform an XML tree into another tree. The transforms are simple enough, but the kicker is that I want them to be stateful. In this example, the

Re: [Haskell-cafe] Re: A free monad theorem?

2006-08-31 Thread Tomasz Zielonka
On Fri, Sep 01, 2006 at 01:13:14AM +0200, Benjamin Franksen wrote: So getting the value out of the monad is not a pure function (extract :: Monad m = m a - a). I think I stated that, already, in my previous post. The only generic way of extracting values from a monadic value is the bind