Re: [Haskell-cafe] Wumpus World

2008-03-27 Thread Robert Wills
This might also be relevant: http://web.engr.oregonstate.edu/~erwig/zurg/ ___ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http://www.haskell.org/mailman/listinfo/haskell-cafe

[Haskell-cafe] FW: containers-0.1.0.1

2008-03-27 Thread john lask
who is maintainer of containers package ... From: [EMAIL PROTECTED] To: [EMAIL PROTECTED] Subject: containers-0.1.0.1 Date: Wed, 12 Mar 2008 23:48:33 + containers-0.1.0.1 will not build with ghc-6.6, the lines #include Typeable.h

Re: [Haskell-cafe] announce: Glome.hs raytracer

2008-03-27 Thread Andrew Coppin
Bulat Ziganshin wrote: plus a b = unsafePerformIO (modifyIORef counter (+1)) `seq` a+b Erm... might it be better to use an MVar? (To avoid lost updates if there are multiple render threads.) ___ Haskell-Cafe mailing list

Re[2]: [Haskell-cafe] announce: Glome.hs raytracer

2008-03-27 Thread Bulat Ziganshin
Hello Andrew, Thursday, March 27, 2008, 12:27:47 PM, you wrote: plus a b = unsafePerformIO (modifyIORef counter (+1)) `seq` a+b Erm... might it be better to use an MVar? (To avoid lost updates if there are multiple render threads.) you are right, IORef is appropriate only for single-threaded

RE: [Haskell-cafe] No newlines in the whitespace for Parsec lexeme parsers

2008-03-27 Thread Paul Keir
Thankyou all. Once I get more familiar with Parsec I might do my own lexeme parser. For now I've changed its definition of simpleSpace to simpleSpace = skipMany1 (satisfy (\c - (c /= '\n') (isSpace c))) so that it skips whitespace, but not newlines. My parser then explicitly matches

Re: [Haskell-cafe] announce: Glome.hs raytracer

2008-03-27 Thread pepe
On 27/03/2008, at 3:49, Ian Lynagh wrote: On Wed, Mar 26, 2008 at 02:33:20PM -0700, Jim Snow wrote: -Memory consumption is atrocious: 146 megs to render a scene that's a 33k ascii file. Where does it all go? A heap profile reports the max heap size at a rather more reasonable 500k or so.

[Haskell-cafe] Recursion problem in infinite list model

2008-03-27 Thread Hans Aberg
When experimenting with list index sets (i.e. lists more general than provided by Haskell), I arrived at the problem that in the example code below for example h(list 6) does not (in Hugs) write out the beginning of the list lazily. It does work for list 6 first (list 6) rest (list

Re: [Haskell-cafe] Recursion problem in infinite list model

2008-03-27 Thread Claude Heiland-Allen
Hans Aberg wrote: When experimenting with list index sets (i.e. lists more general than provided by Haskell), I arrived at the problem that in the example code below for example h(list 6) does not (in Hugs) write out the beginning of the list lazily. It does work for list 6 first (list

[Haskell-cafe] Re: Libraries need a new owner

2008-03-27 Thread Adrian Hey
Don Stewart wrote: That said, I know that type families are provisionally available, so maybe doing something with generalised tries might be possible. I don't mind mentoring anyone who wants to do something with any of this. Great! Would you like to revise the Soc ticket, with this

Re: [Haskell-cafe] Recursion problem in infinite list model

2008-03-27 Thread Luke Palmer
On Thu, Mar 27, 2008 at 2:18 PM, Claude Heiland-Allen The combination of (-+) and h is too strict, this modification works: (-+) :: a - List a - List a x -+ ~(List y) = List(f) where -- lazy pattern match f 0 = x f k = y(k-1) More to the point, if List is declared as:

Re: [Haskell-cafe] Recursion problem in infinite list model

2008-03-27 Thread Hans Aberg
On 27 Mar 2008, at 15:18, Claude Heiland-Allen wrote: The combination of (-+) and h is too strict, this modification works: (-+) :: a - List a - List a x -+ ~(List y) = List(f) where -- lazy pattern match f 0 = x f k = y(k-1) Thank you for the fast response. Yes, that might be what I

Re: [Haskell-cafe] Recursion problem in infinite list model

2008-03-27 Thread Hans Aberg
On 27 Mar 2008, at 15:32, Luke Palmer wrote: More to the point, if List is declared as: newtype List a = List (Integer - a) Instead of with data, it also works. The problem, as was stated, was that -+ is too strict. That is, without the ~ there, -+ evaluates its right argument to make

Re: [Haskell-cafe] Recursion problem in infinite list model

2008-03-27 Thread Miguel Mitrofanov
Hmmm, seems like your (-+) is not lazy enough. Since pattern matching is strict by default, you have anything -+ (_|_) = (_|_) Therefore, the function, which is constantly (_|_), is a fixed point for the equation defining h. In other words, if you define h' x = undefined then you have h'

Re: [Haskell-cafe] Recursion problem in infinite list model

2008-03-27 Thread Hans Aberg
On 27 Mar 2008, at 15:58, Miguel Mitrofanov wrote: Hmmm, seems like your (-+) is not lazy enough. ... You can fix it by defining (-+) as x -+ ~(List y) = ... Yes, this has been pointed out... Since pattern matching is strict by default, you have anything -+ (_|_) = (_|_) Therefore,

Re: [Haskell-cafe] Equality constraints in type families

2008-03-27 Thread Hugo Pacheco
The current implementation is wrong, as it permits type S a b = a type family F a :: * - * type instance F a = S a Why do we need to forbid this type instance? Because it breaks the confluence of equality constraint normalisation. Here are two diverging normalisations: (1)

Re: [Haskell-cafe] Equality constraints in type families

2008-03-27 Thread Hugo Pacheco
Sorry, I meant type FList a x = Either One (a,x) type instance F [a] = FList a On Thu, Mar 27, 2008 at 4:45 PM, Hugo Pacheco [EMAIL PROTECTED] wrote: The current implementation is wrong, as it permits type S a b = a type family F a :: * - * type instance F a = S a Why do

Re: [Haskell-cafe] Re: SoC project: Python-Haskell bridge - request for feedback

2008-03-27 Thread Dan Weston
I notice that you omit from the advantages of calling Haskell from Python what I consider the most important reason of all (at least from the Haskell community side). The choice of programming language (at least at the top level) is primarily a political or managerial choice, not a technical

[Haskell-cafe] GSoC Project Proposal: Parallel Profiling Tools for GHC.

2008-03-27 Thread Donnie Jones
Hello Everyone,GSoC Project: Parallel Profiling Tools for GHC. Student: Donnie Jones Mentor: Simon Marlow Project based upon suggestion by Simon Marlow: http://hackage.haskell.org/trac/summer-of-code/ticket/1559 Overview: For Haskell there are currently no tools to investigate the performance of

Re: [Haskell-cafe] Recursion problem in infinite list model

2008-03-27 Thread Hans Aberg
On 27 Mar 2008, at 17:51, Luke Palmer wrote: By your naming, am I correct in assuming that you're implementing transfinite lists? If so, cool! Yes, it is an old idea I brought up now. If list length is written also for infinite lists, then concatenated lists get indexed by the sum of

Re: [Haskell-cafe] Re: SoC project: Python-Haskell bridge - request for feedback

2008-03-27 Thread Don Stewart
Remember that there are two proposals here, one potentially to the Python team, one to the Haskell team . Of course the Haskell guys are strongly interested in the use case Dan describes -- mitigating risk by using Haskell for small components first, as part of larger legacy systems. The Python

Re: [Haskell-cafe] Recursion problem in infinite list model

2008-03-27 Thread Hans Aberg
On 27 Mar 2008, at 17:51, Luke Palmer wrote: A more standard way to do this would be: data List a = List (Ordinal - a) Ordinal I used data List a = Empty | (Ordinal-a) :+ Ordinal which might then be simplified by dropping Empty. Hans Aberg

Re: [Haskell-cafe] Terminating GLUT/GLFW programs

2008-03-27 Thread Paul L
On 3/25/08, Luke Palmer [EMAIL PROTECTED] wrote: Er, not Ctrl, of course... Mod-Shift-C. /me goes to punish his hand for compusive send presses. I believe that is to kill a window rather than a normal window close. -- Regards, Paul Liu Yale Haskell Group http://www.haskell.org/yale

Re: [Haskell-cafe] announce: Glome.hs raytracer (memory leak with parMap)

2008-03-27 Thread Jim Snow
pepe wrote: On 27/03/2008, at 3:49, Ian Lynagh wrote: On Wed, Mar 26, 2008 at 02:33:20PM -0700, Jim Snow wrote: -Memory consumption is atrocious: 146 megs to render a scene that's a 33k ascii file. Where does it all go? A heap profile reports the max heap size at a rather more reasonable

[Haskell-cafe] Re: SoC project: Python-Haskell bridge - request for feedback

2008-03-27 Thread John Goerzen
FWIW, my MissingPy project accomplishes part of this (calling Python from Haskell) already. -- John On 2008-03-27, Dan Weston [EMAIL PROTECTED] wrote: I notice that you omit from the advantages of calling Haskell from Python what I consider the most important reason of all (at least from

[Haskell-cafe] Web server libraries

2008-03-27 Thread John Goerzen
Hi again, I'm currently working on a project that has a Web interface to data stored in a SQL database. I wrote this thing in WASH a few years back. Overall, this has been acceptable, but the non-Haskell-adepts around here run away screaming from the code. Not only that, but we don't get

[Haskell-cafe] HTTP client libraries

2008-03-27 Thread John Goerzen
Hi folks, I was recently looking for HTTP client libraries for Haskell. I investigated several, and it seems that there aren't any really ready for primetime. Am I missing anything? Here's what I found: * Bjorn's String-based HTTP It eats RAM. Does not appear to read data lazily, returns

[Haskell-cafe] Re: GSoC Project Proposal: Parallel Profiling Tools for GHC.

2008-03-27 Thread Donnie Jones
Hello, I added some additional goals below. On Thu, Mar 27, 2008 at 2:23 PM, Donnie Jones [EMAIL PROTECTED] wrote: Hello Everyone,GSoC Project: Parallel Profiling Tools for GHC. Student: Donnie Jones Mentor: Simon Marlow Project based upon suggestion by Simon Marlow:

Re: [Haskell-cafe] HTTP client libraries

2008-03-27 Thread Neil Mitchell
Hi * tagsoup Broken in many ways. Does not support chunked encoding that is mandated by HTTP RFC. Will be incompatible with numerous HTTP servers, and the manual states as much. Port 80 hardcoded. I'd just like to stress that the one in tagsoup shouldn't be used for anything! It

Re: [Haskell-cafe] HTTP client libraries

2008-03-27 Thread Thomas Schilling
On 27 mar 2008, at 20.08, John Goerzen wrote: Hi folks, I was recently looking for HTTP client libraries for Haskell. I investigated several, and it seems that there aren't any really ready for primetime. Am I missing anything? Here's what I found: * Bjorn's String-based HTTP It eats

Re: [Haskell-cafe] Re: SoC project: Python-Haskell bridge - request for feedback

2008-03-27 Thread Dan Weston
I did not see MissingPy on Hackage (presumably it would be next to MissingH?) I found it (listed on http://www.complete.org/jgoerzen/softindex.html) at http://darcs.complete.org/missingpy Is this the right place to get it? Dan John Goerzen wrote: FWIW, my MissingPy project accomplishes

Re: [Haskell-cafe] Web server libraries

2008-03-27 Thread Niklas Broberg
HSP: big on dynamic pages. I don't want to make my webserver able to compile Haskell code. Develop code, compile, test, make sure it's right, then push to production every 6 months around here. Being one of the main developers of HSP, I guess I should reply to this. :-) HSP is indeed big

Re: [Haskell-cafe] Re: SoC project: Python-Haskell bridge - request for feedback

2008-03-27 Thread Don Stewart
Oh, I thought I added that as related work to the ticket page. If its not, couldyou add it? jgoerzen: FWIW, my MissingPy project accomplishes part of this (calling Python from Haskell) already. -- John On 2008-03-27, Dan Weston [EMAIL PROTECTED] wrote: I notice that you omit from the

Re: [Haskell-cafe] Web server libraries

2008-03-27 Thread Paul Brown
On Thu, Mar 27, 2008 at 12:26 PM, John Goerzen [EMAIL PROTECTED] wrote: What I really want is some sort of simple tool that supports FastCGI or some such, has basic support for form data input validation and marshalling to/from Haskell types, and basic control flow. So I've looked around a

Re: [Haskell-cafe] HTTP client libraries

2008-03-27 Thread Paul Brown
On Thu, Mar 27, 2008 at 12:08 PM, John Goerzen [EMAIL PROTECTED] wrote: * Bjorn's String-based HTTP It eats RAM. Does not appear to read data lazily, returns a String, and may have a memory leak as well. Does not appear to be suited for anything except very small file downloads. Do

Re: [Haskell-cafe] Equality constraints in type families

2008-03-27 Thread Wolfgang Jeltsch
Am Mittwoch, 26. März 2008 03:07 schrieb Hugo Pacheco: The extra syntax has its advantages (more local information) and disadvantages (more clutter). We weren't convinced that we need the extra syntax, so left it out for the moment. However, this is something that can always be changed if

Re: [Haskell-cafe] Equality constraints in type families

2008-03-27 Thread Wolfgang Jeltsch
Am Donnerstag, 27. März 2008 22:43 schrieb Wolfgang Jeltsch: Am Mittwoch, 26. März 2008 03:07 schrieb Hugo Pacheco: The extra syntax has its advantages (more local information) and disadvantages (more clutter). We weren't convinced that we need the extra syntax, so left it out for the

[Haskell-cafe] MonadMemory class

2008-03-27 Thread Ariel J. Birnbaum
Two questions came to mind while thinking of memory references in Haskell: 1. Is there a standard equivalent of the following: class (Monad m) = MonadMemory m r | m - r where new :: a - m (r a) read :: r a - m a write :: r a - a - m () What kind of axioms should an instance of this

Re: [Haskell-cafe] Equality constraints in type families

2008-03-27 Thread Hugo Pacheco
The reason for the braces in type families is because type indices are treated differently than normal parameters. I don't think this should be adopted for type synonyms either. Cheers, hugo On Thu, Mar 27, 2008 at 9:48 PM, Wolfgang Jeltsch [EMAIL PROTECTED] wrote: Am Donnerstag, 27. März

Re: [Haskell-cafe] MonadMemory class

2008-03-27 Thread Bulat Ziganshin
Hello Ariel, Friday, March 28, 2008, 1:02:39 AM, you wrote: class (Monad m) = MonadMemory m r | m - r where there are more than one way to define such class. look at http://haskell.org/haskellwiki/Library/ArrayRef for examples -- Best regards, Bulatmailto:[EMAIL

Re: [Haskell-cafe] MonadMemory class

2008-03-27 Thread Derek Elkins
On Fri, 2008-03-28 at 00:02 +0200, Ariel J. Birnbaum wrote: Two questions came to mind while thinking of memory references in Haskell: 1. Is there a standard equivalent of the following: class (Monad m) = MonadMemory m r | m - r where new :: a - m (r a) read :: r a - m a

Re: [Haskell-cafe] MonadMemory class

2008-03-27 Thread Ryan Ingram
On 3/27/08, Ariel J. Birnbaum [EMAIL PROTECTED] wrote: class (Monad m) = MonadMemory m r | m - r where new :: a - m (r a) read :: r a - m a write :: r a - a - m () What kind of axioms should an instance of this class satisfy? Here's some thoughts: (~=) means equivalent excluding

Re: [Haskell-cafe] HTTP client libraries

2008-03-27 Thread Adam Langley
On Thu, Mar 27, 2008 at 12:08 PM, John Goerzen [EMAIL PROTECTED] wrote: * network-minihttp Doesn't appear to actually be very useful as a client. Also, as far as I have been able to deduce, none of these have built-in support for https (SSL) URLs. The client doesn't do a lot, but I

Re: [Haskell-cafe] MonadMemory class

2008-03-27 Thread Ariel J. Birnbaum
look at http://haskell.org/haskellwiki/Library/ArrayRef for examples Thanks, Data.Ref.Universal looks just like it! One question though. In:  class (Monad m) = Ref m r | m-r, r-m where Why is the second fundep necessary? -- Ariel J. Birnbaum ___

Re: [Haskell-cafe] MonadMemory class

2008-03-27 Thread Ariel J. Birnbaum
This has come up a few times and been written by many Haskellers I was quite certain of that, hence my puzzlement at being unable to find it =) What kind of axioms should an instance of this class satisfy? There are quite a few obvious ones, but I'm not sure it's particularly necessary. I'm

[Haskell-cafe] Parsec Expected Type

2008-03-27 Thread Paul Keir
Hi, Does anyone know why this reduced Parsec production stops compilation, and how I can fix it? tester = reserved parameter | do { reserved dimension; symbol : } Thanks, Paul ___ Haskell-Cafe mailing list Haskell-Cafe@haskell.org

Re: [Haskell-cafe] MonadMemory class

2008-03-27 Thread Ariel J. Birnbaum
(write r x = read) == (write r x return x) You probably mean (write r x read r) == (write r x return x)? 3) References are independent: If m does not refer to r, then: (read r = (\x - m return x)) == m read r (write r x m) == m = (\v - write r x return v) What if m writes to r' which

Re: [Haskell-cafe] Equality constraints in type families

2008-03-27 Thread Manuel M T Chakravarty
Hugo Pacheco: Sorry, I meant type FList a x = Either One (a,x) type instance F [a] = FList a We should not allow such programs. Manuel On Thu, Mar 27, 2008 at 4:45 PM, Hugo Pacheco [EMAIL PROTECTED] wrote: The current implementation is wrong, as it permits type S a b = a type

Re: [Haskell-cafe] Monad instance for Data.Set, again

2008-03-27 Thread Wolfgang Jeltsch
Am Montag, 24. März 2008 20:47 schrieb Henning Thielemann: […] Here is another approach that looks tempting, but unfortunately does not work, and I wonder whether this can be made working. module RestrictedMonad where import Data.Set(Set) import qualified Data.Set as Set class

Re: [Haskell-cafe] Equality constraints in type families

2008-03-27 Thread Hugo Pacheco
Yes, but doesn't the confluence problem only occur for type synonyms that ignore one or more of the parameters? If so, this could be checked... On Fri, Mar 28, 2008 at 12:04 AM, Manuel M T Chakravarty [EMAIL PROTECTED] wrote: Hugo Pacheco: Sorry, I meant type FList a x = Either One (a,x)

Re: [Haskell-cafe] Parsec Expected Type

2008-03-27 Thread Luke Palmer
Hi Paul, 2008/3/27 Paul Keir [EMAIL PROTECTED]: Hi, Does anyone know why this reduced Parsec production stops compilation, and how I can fix it? tester = reserved parameter | do { reserved dimension; symbol : } Look at the types of reserved and symbol (from

Re: [Haskell-cafe] HTTP client libraries

2008-03-27 Thread Don Stewart
paulrbrown+haskell-cafe: On Thu, Mar 27, 2008 at 12:08 PM, John Goerzen [EMAIL PROTECTED] wrote: * Bjorn's String-based HTTP It eats RAM. Does not appear to read data lazily, returns a String, and may have a memory leak as well. Does not appear to be suited for anything except

Re: [Haskell-cafe] HTTP client libraries

2008-03-27 Thread John Goerzen
On Thursday 27 March 2008 04:38:21 pm Paul Brown wrote: On Thu, Mar 27, 2008 at 12:08 PM, John Goerzen [EMAIL PROTECTED] wrote: * Bjorn's String-based HTTP It eats RAM. Does not appear to read data lazily, returns a String, and may have a memory leak as well. Does not appear to be

Re: [Haskell-cafe] Re: SoC project: Python-Haskell bridge - request for feedback

2008-03-27 Thread John Goerzen
On Thursday 27 March 2008 04:07:23 pm Dan Weston wrote: I did not see MissingPy on Hackage (presumably it would be next to MissingH?) I found it (listed on http://www.complete.org/jgoerzen/softindex.html) at http://darcs.complete.org/missingpy Is this the right place to get it? Yes, it is.

Re: [Haskell-cafe] Equality constraints in type families

2008-03-27 Thread Wolfgang Jeltsch
Am Donnerstag, 27. März 2008 23:12 schrieben Sie: The reason for the braces in type families is because type indices are treated differently than normal parameters. I don't think this should be adopted for type synonyms either. Cheers, hugo In a way, there is also different treatment in the

Re: [Haskell-cafe] Wumpus World

2008-03-27 Thread Richard A. O'Keefe
On 27 Mar 2008, at 8:25 pm, Robert Wills wrote: This might also be relevant: http://web.engr.oregonstate.edu/~erwig/zurg/ But note that the Prolog code that they compared against was, um, let's put this kindly, seriously naive. For example, (a) it has 36 SLOC.You can do it naturally

[Haskell-cafe] Functional dependencies with Type Classes

2008-03-27 Thread Henning Günther
Hi, suppose there are two (identical) classes: class Res a b | a - b where getRes :: a - b and class Res2 t where type Member t getRes2 :: t - Member t It is easy to automatically make every instance of Res2 an instance of res: instance Res2 a = Res a (Member a)

[Haskell-cafe] Unescaping with HaXmL (or anything else!)

2008-03-27 Thread Anton van Straaten
I want to unescape an encoded XML or HTML string, e.g. converting quot; to the quote character, etc. Since I'm using HaXml anyway, I tried using xmlUnEscapeContent with no luck, e.g. with HaXml 1.19.1: let (CString _ s _) = head $ xmlUnEscapeContent stdXmlEscaper $ [CString False This

Re: [Haskell-cafe] MonadMemory class

2008-03-27 Thread Ryan Ingram
On 3/27/08, Ariel J. Birnbaum [EMAIL PROTECTED] wrote: (write r x = read) == (write r x return x) You probably mean (write r x read r) == (write r x return x)? Yes. Oops! 3) References are independent: If m does not refer to r, then: (read r = (\x - m return x)) == m read r

Re: [Haskell-cafe] Recursion problem in infinite list model

2008-03-27 Thread Ryan Ingram
Another way to defer the evaluation of the second argument of (-+) is like this: (-+) :: a - List a - List a x -+ y = List(f) where f 0 = x f k = case y of List g - g (k-1) This is exactly what the lazy pattern will do at compile-time. Does this give you a better understanding of how lazy

Re: [Haskell-cafe] Web server libraries

2008-03-27 Thread Sterling Clover
While hvac, which I announced here recently, is not yet ready for primetime, so to speak, you may want to take a look at it -- with a few tweaks it should match your specs. (darcs get http:// community.haskell.org/~sclv/hvac/) It does include some templating, though you don't have to use it

[Haskell-cafe] Sound typeable via type families?

2008-03-27 Thread Dan Doel
Hello, Recently, someone (I forgot who, exactly) mentioned in #haskell this article: http://okmij.org/ftp/Haskell/types.html#unsound-typeable where Oleg demonstrates that Typeable makes the type system unsound, and one can get back unsafeCoerce (which is used in the implementation, I