Re: [Haskell-cafe] OT: Haskell desktop wallpaper?

2008-10-09 Thread Jim Snow
Ray tracing about a million spheres in a regular grid with reflections: lattice = let n = 50 :: Flt in bih [sphere (vec x y z) 0.2 | x - [(-n)..n], y - [(-n)..n], z - [(-n)..n]]

Re: [Haskell-cafe] OT: Haskell desktop wallpaper?

2008-10-09 Thread Cale Gibbard
Hello! I worked on this for a few minutes in the GIMP. Thought it might look nice spraypainted on asphalt. http://cale.yi.org/LambdaAsphalt.jpg (this one's at 1280x1024) - Cale 2008/10/8 R. Emre Başar [EMAIL PROTECTED]: Hi, I created a wallpaper from The.Monad.Reader logo. You can find two

Re: [Haskell-cafe] Simple Table Update

2008-10-09 Thread Ryan Ingram
On Wed, Oct 8, 2008 at 9:12 PM, Paul Keir [EMAIL PROTECTED] wrote: It brings tears to my eyes to see such a beautiful function ;) You've hit the nail on the head Ryan. The new version of my second previous code snippet now no longer requires fixpu*, and is: typeCheckAST (Program pus) =

Re: [Haskell-cafe] synchronous channels in STM

2008-10-09 Thread Ryan Ingram
I don't think what you want is possible if both sides are in STM. Other authors have posted solutions where one side or the other of the transaction is in I/O, but wholly inside STM it's not possible. The problem is that in order for synchronization to happen, you need both sides to be able to

Re: [Haskell-cafe] Hoogle? [Stacking monads]

2008-10-09 Thread Ryan Ingram
2008/10/9 Reiner Pope [EMAIL PROTECTED]: The syntax is for the implicit parameter extension[1]. I think you would write your example as foo (undefined :: Bar x) ?z :: Bar y Then querying the type of that whole expression with :t will list ?z's type in the expression's constraints. (Of

[Haskell-cafe] Web application from the ground up

2008-10-09 Thread Arnaud Bailly
Hello, I am trying to implement a complete web application from the ground up, with the objective to convince myself and others that 1) it is possible, 2) it is powerful and 3) it is more expressive to do such a thing in Haskell. I managed to get to the point where I can handle users lifecycle

Re: [Haskell-cafe] synchronous channels in STM

2008-10-09 Thread Arnar Birgisson
On Thu, Oct 9, 2008 at 12:29, roger peppe [EMAIL PROTECTED] wrote: It's useful, thanks, but not really what I was originally looking for. Synchronous channels are generally easier to reason about (less states to deal with). Right, that's very true. Interaction between transactions is naturally

[Haskell-cafe] Constraints at construction

2008-10-09 Thread Iain Barnett
If I were to create an object in C#, for instance, I could add code to the constructor that might limit the type further e.g. public class Car { string model; int wheels; public Car ( string model, int no_of_wheels ) { if ( no_of_wheels = 2 )

RE: [Haskell-cafe] Constraints at construction

2008-10-09 Thread Mitchell, Neil
Hi Iain, The wiki page has quite a nice article: http://www.haskell.org/haskellwiki/Smart_constructors Thanks Neil -Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of Iain Barnett Sent: 09 October 2008 2:03 pm To: haskell-cafe@haskell.org Subject:

[Haskell-cafe] Libraries in home dir

2008-10-09 Thread Mauricio
Hi, I want to use a few libraries from hackage and have already download and built them. Can I install those libraries somewhere in my home dir (I want to avoid installing as root) so that ghc can find them? If so, which options should I give to Setup.hs (with main=defaultMain) so that the

Re: [Haskell-cafe] Web application from the ground up

2008-10-09 Thread Marc Weber
Hi Arnaud Bailly, Share the world? *g* is a bit vague.. Fast CGI differs from CGI in one point: your application keeps running. Thus as long as the application is running you can use IORefs (bad for multithreading) MVars (thread safe) STM etc to keep track of your world state and of course you

Re: [Haskell-cafe] OT: Haskell desktop wallpaper?

2008-10-09 Thread Magnus Therning
On Thu, Oct 9, 2008 at 7:32 AM, Jim Snow [EMAIL PROTECTED] wrote: Ray tracing about a million spheres in a regular grid with reflections: lattice = let n = 50 :: Flt in bih [sphere (vec x y z) 0.2 | x - [(-n)..n], y - [(-n)..n],

Re: [Haskell-cafe] Constraints at construction

2008-10-09 Thread Iain Barnett
Thankyou, this is exactly what I was looking for. Iain On 9 Oct 2008, at 2:05 pm, Mitchell, Neil wrote: Hi Iain, The wiki page has quite a nice article: http://www.haskell.org/haskellwiki/Smart_constructors Thanks Neil -Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL

Re: [Haskell-cafe] Libraries in home dir

2008-10-09 Thread Dougal Stanton
On Thu, Oct 9, 2008 at 2:08 PM, Mauricio [EMAIL PROTECTED] wrote: Hi, I want to use a few libraries from hackage and have already download and built them. Can I install those libraries somewhere in my home dir (I want to avoid installing as root) so that ghc can find them? If so, which

Re: [Haskell-cafe] synchronous channels in STM

2008-10-09 Thread roger peppe
On Thu, Oct 9, 2008 at 9:15 AM, Ryan Ingram [EMAIL PROTECTED] wrote: I don't think what you want is possible if both sides are in STM. Other authors have posted solutions where one side or the other of the transaction is in I/O, but wholly inside STM it's not possible. Thanks, that's what I

Re: [Haskell-cafe] Libraries in home dir

2008-10-09 Thread allan
Hi, In addition if you want to do this all or most of the time, that is there are few/no cabalised libraries you DO wish to install globally, then you can tell 'cabal' to do this all the time by editing your ~/.cabal/config file. Here is mine: repos:

Re: [Haskell-cafe] Libraries in home dir

2008-10-09 Thread Daniel Fischer
Am Donnerstag, 9. Oktober 2008 15:08 schrieb Mauricio: Hi, I want to use a few libraries from hackage and have already download and built them. Can I install those libraries somewhere in my home dir (I want to avoid installing as root) so that ghc can find them? runghc ./Setup.hs configure

Re: [Haskell-cafe] Libraries in home dir

2008-10-09 Thread Alfonso Acosta
On Thu, Oct 9, 2008 at 3:08 PM, Mauricio [EMAIL PROTECTED] wrote: I want to use a few libraries from hackage and have already download and built them. Can I install those libraries somewhere in my home dir (I want to avoid installing as root) so that ghc can find them? Sure, just write:

Re: [Haskell-cafe] Web application from the ground up

2008-10-09 Thread Thomas Hartman
There's also newer material at http://happstutorial.com:5002 that's in darcs but hasn't been packaged for hackage. 2008/10/9 Thomas Hartman [EMAIL PROTECTED]: Have you seen happstutorial.com? thomas. 2008/10/9 Arnaud Bailly [EMAIL PROTECTED]: Hello, I am trying to implement a complete

Re: [Haskell-cafe] Web application from the ground up

2008-10-09 Thread Anton Tayanovskyy
Hi Arnaud, Here's a simple counter program. I mount this to /ws/ with mod_scgi, and can then do requests http://localhost/ws/ or http://localhost/ws/?amount=19 (increment by 19 not 1). http://hpaste.org/11033 I'm no expert but I'm also working on web applications in Haskell now. If you are

Re: [Haskell-cafe] Linker Errors For OpenGL / GLUT 'Hello World' Program.

2008-10-09 Thread Sven Panne
On Saturday 20 September 2008 19:13:43 Donnie Jones wrote: [...] checking GL/gl.h usability... yes checking GL/gl.h presence... yes checking for GL/gl.h... yes checking OpenGL/gl.h usability... no checking OpenGL/gl.h presence... no checking for OpenGL/gl.h... no checking GL/glu.h

Re: [Haskell-cafe] synchronous channels in STM

2008-10-09 Thread Andrea Vezzosi
I'd rather say that STM is intended to be used just for building up transactions, not to model your whole process/thread, simply because in the latter case your process couldn't have any observable intermediate state, or put in another way, between any two transactions the information can only go

Re: [Haskell-cafe] OT: Haskell desktop wallpaper?

2008-10-09 Thread Magnus Therning
On Thu, Oct 9, 2008 at 8:24 AM, Cale Gibbard [EMAIL PROTECTED] wrote: Hello! I worked on this for a few minutes in the GIMP. Thought it might look nice spraypainted on asphalt. http://cale.yi.org/LambdaAsphalt.jpg (this one's at 1280x1024) This one is nice. Any chance of getting it in

Re: [Haskell-cafe] Web application from the ground up

2008-10-09 Thread Thomas Hartman
Have you seen happstutorial.com? thomas. 2008/10/9 Arnaud Bailly [EMAIL PROTECTED]: Hello, I am trying to implement a complete web application from the ground up, with the objective to convince myself and others that 1) it is possible, 2) it is powerful and 3) it is more expressive to do

Re: [Haskell-cafe] synchronous channels in STM

2008-10-09 Thread Arnar Birgisson
On Thu, Oct 9, 2008 at 10:50, roger peppe [EMAIL PROTECTED] wrote: On Thu, Oct 9, 2008 at 9:15 AM, Ryan Ingram [EMAIL PROTECTED] wrote: I don't think what you want is possible if both sides are in STM. Other authors have posted solutions where one side or the other of the transaction is in

Re: [Haskell-cafe] synchronous channels in STM

2008-10-09 Thread roger peppe
On Thu, Oct 9, 2008 at 10:12 AM, Arnar Birgisson [EMAIL PROTECTED] wrote: Sorry, I come into this discussion late. One-place buffers, or MVars, are indeed implemented over STM in the orignal paper [1]. Yes, I should have remembered that. It's ok just as long as there's a buffer there because

Re: [Haskell-cafe] synchronous channels in STM

2008-10-09 Thread David Leimbach
On Wed, Oct 8, 2008 at 3:10 PM, roger peppe [EMAIL PROTECTED] wrote: I was wondering if it was possible to implement synchronous channels within STM. In particular, I'd like to have CSP-like send and recv primitives on a channel that each block until the other side arrives to complete the

Re: [Haskell-cafe] synchronous channels in STM

2008-10-09 Thread David Leimbach
On Thu, Oct 9, 2008 at 1:50 AM, roger peppe [EMAIL PROTECTED] wrote: On Thu, Oct 9, 2008 at 9:15 AM, Ryan Ingram [EMAIL PROTECTED] wrote: I don't think what you want is possible if both sides are in STM. Other authors have posted solutions where one side or the other of the transaction is

[Haskell-cafe] ANNOUNCE: darcs 2.1.0

2008-10-09 Thread Eric Kow
Hi all, I am delighted to announce the release of darcs 2.1.0, available at http://darcs.net/darcs-2.1.0.tar.gz What has changed? - This version provides over 40 bug fixes and 20 new features since darcs 2.0.2. The most notable changes are: * Defaulting to darcs-2. The

Re: [Haskell-cafe] synchronous channels in STM

2008-10-09 Thread Arnar Birgisson
Hi there, 2008/10/9 David Leimbach [EMAIL PROTECTED]: see writeTChan and readTChan. I assume readTChan is synchronous :-). writeTChan may be asynchronous for all I can tell (haven't looked deeply). writeTChan is asynchronous, i.e. channels in this case are unbounded buffers. But I did

[Haskell-cafe] ANNOUNCE: darcs 2.1.0 (corrected!)

2008-10-09 Thread Eric Kow
This is a correction to my previous announcement. I had misgrepped the ChangeLog. There are only 20 bug fixes and 7 new features since 2.0.2. Sorry! == Hi all, I am delighted to announce the release of darcs 2.1.0, available at http://darcs.net/darcs-2.1.0.tar.gz What has changed?

Re: [Haskell-cafe] synchronous channels in STM

2008-10-09 Thread Arnar Birgisson
On Thu, Oct 9, 2008 at 18:10, Arnar Birgisson [EMAIL PROTECTED] wrote: But I did write a concurrent prime sieve with it: I did the same, with the one-place-buffers (the MVars implemented over STM). Be warned that there is no stop condition, this just keeps printing primes forever. Please

Re: [Haskell-cafe] synchronous channels in STM

2008-10-09 Thread Ryan Ingram
This seemed like an interesting problem, so I whipped together a quick-and-dirty implementation of transactional CML semantics in Haskell using STM. Example: main = do forkIO chsThread -- administrative thread that manages communication forkIO (synchronize test1 = print) synchronize

[Haskell-cafe] is the a way to reinstall a package with cabal install?

2008-10-09 Thread Anatoly Yakovenko
is the a way to reinstall a package with cabal install? I want to add profiling support to a libarary. Thanks, Anatoly ___ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http://www.haskell.org/mailman/listinfo/haskell-cafe

Re: [Haskell-cafe] Libraries in home dir

2008-10-09 Thread Duncan Coutts
On Thu, 2008-10-09 at 10:08 -0300, Mauricio wrote: Hi, I want to use a few libraries from hackage and have already download and built them. Can I install those libraries somewhere in my home dir (I want to avoid installing as root) so that ghc can find them? If so, which options should

Re: [Haskell-cafe] is the a way to reinstall a package with cabal install?

2008-10-09 Thread Duncan Coutts
On Thu, 2008-10-09 at 09:42 -0700, Anatoly Yakovenko wrote: is the a way to reinstall a package with cabal install? I want to add profiling support to a libarary. Yes. With cabal-install-0.5.2 and later: $ cabal install foobar --reinstall --enable-library-profiling If you always want

Re: [Haskell-cafe] is the a way to reinstall a package with cabal install?

2008-10-09 Thread Alfonso Acosta
cabal install --reinstall On Thu, Oct 9, 2008 at 6:42 PM, Anatoly Yakovenko [EMAIL PROTECTED] wrote: is the a way to reinstall a package with cabal install? I want to add profiling support to a libarary. Thanks, Anatoly ___ Haskell-Cafe mailing

[Haskell-cafe] how do you deal with mplus?

2008-10-09 Thread Daryoush Mehrtash
Assuming A, B, C are monadic operation. How do you read the following function: do A 'mplus' B C I expect this to translate to: (A 'mplus' B) = C Can I then say it is equivalent to: (A =C) mplus (B =C) Thanks, Daryoush

[Haskell-cafe] Re: Libraries in home dir

2008-10-09 Thread Mauricio
Hi, I want to use a few libraries from hackage and have already download and built them. Can I install those libraries somewhere in my home dir (...) $ cabal instsll xmonad Does exactly that by default. No other flags are required. (...) Nice. Thanks for all tips. Reading them I understood

Re: [Haskell-cafe] Hoogle? [Stacking monads]

2008-10-09 Thread Andrew Coppin
Reiner Pope wrote: The syntax is for the implicit parameter extension[1]. I think you would write your example as foo (undefined :: Bar x) ?z :: Bar y Then querying the type of that whole expression with :t will list ?z's type in the expression's constraints. (Of course, you should turn off

Re: [Haskell-cafe] OT: Haskell desktop wallpaper?

2008-10-09 Thread Jim Snow
Magnus Therning wrote: Very nice indeed. You don't have any images in aspect 8x5 that don't include the window decorations? ;-) (Yes, I'm lazy!) I replaced the sphereflake image with one without window decorations: http://syn.cs.pdx.edu/~jsnow/glome/sphereflake5-720p.png I don't have

Re: [Haskell-cafe] Interesting new user perspective

2008-10-09 Thread Andrew Coppin
Don Stewart wrote: http://sandersn.com/blog/index.php?title=two_weeks_of_haskell Has some good thoughts on what tripped him up in his first two weeks of Haskell programming. Anything people want to work on there? :-) Worth a read if you're thinking about how to make Haskell yet more

Re: [Haskell-cafe] ANNOUNCE: darcs 2.1.0 (corrected!)

2008-10-09 Thread Matthias Kilian
On Thu, Oct 09, 2008 at 05:11:17PM +0100, Eric Kow wrote: This is a correction to my previous announcement. I had misgrepped the ChangeLog. There are only 20 bug fixes and 7 new features since 2.0.2. Nevermind. It's way better than 2.0.2, anyway ;-) Ciao, Kili -- the story in

Re: [Haskell-cafe] OT: Haskell desktop wallpaper?

2008-10-09 Thread George Pollard
Needs text in Haskell's official font ;) http://research.microsoft.com/~simonpj/papers/haskell-tutorial/TasteOfHaskell.pdf http://research.microsoft.com/~simonpj/papers/ndp/NdpSlides.pdf http://research.microsoft.com/~simonpj/papers/marktoberdorf/Marktoberdorf.ppt signature.asc Description:

[Haskell-cafe] [] vs [()]

2008-10-09 Thread Daryoush Mehrtash
What is the difference between empty list [] and list with one unit element [()]? daryoush ___ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http://www.haskell.org/mailman/listinfo/haskell-cafe

Re: [Haskell-cafe] [] vs [()]

2008-10-09 Thread Don Stewart
dmehrtash: What is the difference between empty list [] and list with one unit element [()]? Prelude length [] 0 Prelude length [()] 1 :-) -- Don ___ Haskell-Cafe mailing list Haskell-Cafe@haskell.org

Re: [Haskell-cafe] [] vs [()]

2008-10-09 Thread John Dorsey
dmehrtash: What is the difference between empty list [] and list with one unit element [()]? Prelude length [] 0 Prelude length [()] 1 Also, they differ in type. [()] is a list of unit elements, and happens to contain exactly one of them. [] is a (polymorphic)

Re: [Haskell-cafe] [] vs [()]

2008-10-09 Thread Sam Danielson
What is the difference between empty list [] and list with one unit element [()]? The [] constructor takes no arguments and is like Nothing in the Maybe type. The list : (cons) infix constructor takes two arguments, an element of type a and a list of type a, to construct a new list. Compare

[Haskell-cafe] Re: [] vs [()]

2008-10-09 Thread Benjamin L . Russell
On Fri, 10 Oct 2008 00:24:08 -0400, John Dorsey [EMAIL PROTECTED] wrote: dmehrtash: What is the difference between empty list [] and list with one unit element [()]? Prelude length [] 0 Prelude length [()] 1 Also, they differ in type. [()] is a list of unit

[Haskell-cafe] any estimate on when Liskell will be based on GHC 6.8.3, instead of GHC 6.6?

2008-10-09 Thread Benjamin L . Russell
Recently, I had recommended Liskell to somebody in the thread entitled Closest statically typed FP cousin to Scheme? (on comp.lang.scheme) (see http://groups.google.se/group/comp.lang.scheme/browse_thread/thread/1fa8fb06885cfd8f/a65f73105ef671a1?#a65f73105ef671a1), but then another user replied