Re: [Haskell-cafe] ANNOUNCE: Utrecht Haskell Compiler (UHC) -- first release

2009-04-19 Thread Martijn van Steenbergen
Thomas Davie wrote: I've found user installs don't work at all on OS X, various people in #haskell were rather surprised to discover this, so apparently it's not the default behavior on other platforms. It really rather makes cabal install rather odd – because it doesn't actually install

Re: [Haskell-cafe] ANNOUNCE: Utrecht Haskell Compiler (UHC) -- first release

2009-04-19 Thread Duncan Coutts
On Sun, 2009-04-19 at 00:41 +0200, Thomas Davie wrote: Apparently a user install of uuagc and fgl isn't good enough. Fun to know. I've found user installs don't work at all on OS X, various people in #haskell were rather surprised to discover this, so apparently it's not the

Re: [Haskell-cafe] ANNOUNCE: Utrecht Haskell Compiler (UHC) -- first release

2009-04-19 Thread Thomas Davie
On 19 Apr 2009, at 09:52, Duncan Coutts wrote: On Sun, 2009-04-19 at 00:41 +0200, Thomas Davie wrote: Apparently a user install of uuagc and fgl isn't good enough. Fun to know. I've found user installs don't work at all on OS X, various people in #haskell were rather surprised to discover

Re: [Haskell-cafe] ANNOUNCE: Utrecht Haskell Compiler (UHC) -- first release

2009-04-19 Thread Duncan Coutts
On Sun, 2009-04-19 at 10:02 +0200, Thomas Davie wrote: It really rather makes cabal install rather odd – because it doesn't actually install anything you can use without providing extra options! It should work fine, you'll need to give more details. This has been the result, at

[Haskell-cafe] Re: ANNOUNCE: Utrecht Haskell Compiler (UHC) -- first release

2009-04-19 Thread Jon Fairbairn
a...@cs.uu.nl writes: Utrecht Haskell Compiler -- first release, version 1.0.0 The UHC team is happy to announce the first public release of the Utrecht Haskell Compiler (UHC). UHC supports almost all Haskell98

[Haskell-cafe] Matrices

2009-04-19 Thread Cetin Sert
http://ccnmtl.columbia.edu/projects/qmss/the_chisquare_test/about_the_chisquare_test.html given two matrices, Prelude Data.Matrix.Dense Data.Vector.Dense m listMatrix (2,2) [46.0,37.0,71.0,83.0] Prelude Data.Matrix.Dense Data.Vector.Dense es listMatrix (2,2)

Re: [Haskell-cafe] ANNOUNCE: Utrecht Haskell Compiler (UHC) -- first release

2009-04-19 Thread Thomas Davie
On 19 Apr 2009, at 11:10, Duncan Coutts wrote: On Sun, 2009-04-19 at 10:02 +0200, Thomas Davie wrote: It really rather makes cabal install rather odd – because it doesn't actually install anything you can use without providing extra options! It should work fine, you'll need to give more

Re: [Haskell-cafe] ANNOUNCE: Utrecht Haskell Compiler (UHC) -- first release

2009-04-19 Thread Don Stewart
tom.davie: On 19 Apr 2009, at 11:10, Duncan Coutts wrote: On Sun, 2009-04-19 at 10:02 +0200, Thomas Davie wrote: It really rather makes cabal install rather odd – because it doesn't actually install anything you can use without providing extra options! It should work fine, you'll need

Re: [Haskell-cafe] Matrices

2009-04-19 Thread Alberto Ruiz
Using hmatrix-static: import Numeric.LinearAlgebra.Static m = [$mat| 46.0,37.0; 71.0,83.0 |] es = [$mat| 40.9746835443038,42.0253164556962; 76.0253164556962,77.9746835443038 |] chisquare = sum . toList . flatten $ (m - es)^2 / es ::Double -- 1.8732940252518542 Cetin

Re: [Haskell-cafe] ANNOUNCE: Utrecht Haskell Compiler (UHC) -- first release

2009-04-19 Thread Thomas Davie
I don't understand what makes user installs more convenient. Certainly, my preference would be for global all the time – I expect something that says it's going to install something to install it onto my computer, like any other installation program does. What is it that makes user

[Haskell-cafe] Re: ANNOUNCE: Utrecht Haskell Compiler (UHC) -- first release

2009-04-19 Thread Benedikt Huber
Thomas Davie schrieb: On 19 Apr 2009, at 00:31, Antoine Latter wrote: ... Apparently a user install of uuagc and fgl isn't good enough. Fun to know. I've found user installs don't work at all on OS X, various people in #haskell were rather surprised to discover this, so apparently it's

[Haskell-cafe] Re: ANNOUNCE: Utrecht Haskell Compiler (UHC) -- first release

2009-04-19 Thread Benedikt Huber
a...@cs.uu.nl schrieb: Utrecht Haskell Compiler -- first release, version 1.0.0 The UHC team is happy to announce the first public release of the Utrecht Haskell Compiler (UHC). Great to see another haskell

Re: [Haskell-cafe] ANNOUNCE: Utrecht Haskell Compiler (UHC) -- first release

2009-04-19 Thread Daniel Fischer
Am Sonntag 19 April 2009 13:09:17 schrieb Thomas Davie: I don't understand what makes user installs more convenient. Certainly, my preference would be for global all the time – I expect something that says it's going to install something to install it onto my computer, like any other

[Haskell-cafe] Re: ANNOUNCE: Utrecht Haskell Compiler (UHC) -- first release

2009-04-19 Thread Achim Schneider
Don Stewart d...@galois.com wrote: This means that 'cabal install' works out of the box on every system, without needing admin/root privs (esp. important for students). ...and people who were bitten by sanity and thus never, ever touch /usr manually, only through their distribution's package

[Haskell-cafe] Re: ANNOUNCE: Utrecht Haskell Compiler (UHC) -- first release

2009-04-19 Thread Achim Schneider
Jon Fairbairn jon.fairba...@cl.cam.ac.uk wrote: a...@cs.uu.nl writes: Utrecht Haskell Compiler -- first release, version 1.0.0 The UHC team is happy to announce the first public release of the Utrecht Haskell

Re: [Haskell-cafe] Matrices

2009-04-19 Thread Don Stewart
Very cool! We need an hmatrix-static tutorial! aruiz: Using hmatrix-static: import Numeric.LinearAlgebra.Static m = [$mat| 46.0,37.0; 71.0,83.0 |] es = [$mat| 40.9746835443038,42.0253164556962; 76.0253164556962,77.9746835443038 |] chisquare = sum . toList .

[Haskell-cafe] Using GHC as an arrows preprocessor?

2009-04-19 Thread Peter Verswyvelen
I'm making some custom arrows and I'm getting bugs when using the GHC preprocessor, but not when using the old standalone preprocessor. In order to debug this, it would be nice to use GHC as an arrows preprocessor (so converting the arrow notation into plain Haskell and outputting the converted

Re: [Haskell-cafe] Using GHC as an arrows preprocessor?

2009-04-19 Thread Ross Paterson
On Sun, Apr 19, 2009 at 04:32:35PM +0200, Peter Verswyvelen wrote: I'm making some custom arrows and I'm getting bugs when using the GHC preprocessor, but not when using the old standalone preprocessor. In order to debug this, it would be nice to use GHC as an arrows preprocessor (so

Re: [Haskell-cafe] Converting IO [XmlTree] to [XmlTree]

2009-04-19 Thread Manlio Perillo
Henning Thielemann ha scritto: On Tue, 14 Apr 2009, rodrigo.bonifacio wrote: I guess this is a very simple question. How can I convert IO [XmlTree] to just a list of XmlTree? The old Wiki had: http://www.haskell.org/wikisnapshot/ThatAnnoyingIoType.html Should be ported to the new

[Haskell-cafe] Re: ANNOUNCE: Utrecht Haskell Compiler (UHC) -- first release

2009-04-19 Thread Simon Michael
Yes, it is bad that the runhaskell Setup interface has a different default. But, as Duncan said, too late to change it now. Why, especially as it seems something you would now rarely use directly ? (When would you want it ?) ___ Haskell-Cafe mailing

Re: [Haskell-cafe] Re: ANNOUNCE: Utrecht Haskell Compiler (UHC) -- first release

2009-04-19 Thread Daniel Fischer
Am Sonntag 19 April 2009 18:28:18 schrieb Simon Michael: Yes, it is bad that the runhaskell Setup interface has a different default. But, as Duncan said, too late to change it now. Why, especially as it seems something you would now rarely use directly ? (When would you want it ?) Because

[Haskell-cafe] Re: ANNOUNCE: Utrecht Haskell Compiler (UHC) -- first release

2009-04-19 Thread Simon Michael
I meant, why is it too late to change the Setup interface to match cabal's --user by default behaviour ? ___ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http://www.haskell.org/mailman/listinfo/haskell-cafe

[Haskell-cafe] ANNOUNCE: Runge-Kutta library -- solve ODEs

2009-04-19 Thread Uwe Hollerbach
Hello, all, I'm pleased to announce a small Runge-Kutta library for numerically solving ordinary differential equations, which I'm hereby unleashing upon an unsuspecting world. The README is as follows: This is a small module collecting about a dozen Runge-Kutta methods of different

Re: [Haskell-cafe] Converting IO [XmlTree] to [XmlTree]

2009-04-19 Thread Luke Palmer
On Sun, Apr 19, 2009 at 9:48 AM, Manlio Perillo manlio_peri...@libero.itwrote: Henning Thielemann ha scritto: On Tue, 14 Apr 2009, rodrigo.bonifacio wrote: I guess this is a very simple question. How can I convert IO [XmlTree] to just a list of XmlTree? The old Wiki had:

Re: [Haskell-cafe] ANNOUNCE: Utrecht Haskell Compiler (UHC) -- first release

2009-04-19 Thread Niemeijer, R.A.
* Experimental language extensions, some of which have not been implemented before. Does anybody know if there are any plans to incorporate some of these extensions into GHC - specifically the existential typing ? I would love to be able to use existential typing without having to give up

Re[2]: [Haskell-cafe] ANNOUNCE: Utrecht Haskell Compiler (UHC) -- first release

2009-04-19 Thread Bulat Ziganshin
Hello R.A., Sunday, April 19, 2009, 11:46:53 PM, you wrote: Does anybody know if there are any plans to incorporate some of these extensions into GHC - specifically the existential typing ? it is already here, but you should use forall keyword instead odf exists -- Best regards, Bulat

Re: [Haskell-cafe] Using GHC as an arrows preprocessor?

2009-04-19 Thread Peter Verswyvelen
On Sun, Apr 19, 2009 at 4:59 PM, Ross Paterson r...@soi.city.ac.uk wrote: On Sun, Apr 19, 2009 at 04:32:35PM +0200, Peter Verswyvelen wrote: I'm making some custom arrows and I'm getting bugs when using the GHC preprocessor, but not when using the old standalone preprocessor. In order to

Re: [Haskell-cafe] Announce: A pragmatic Haskell .NET interop layer, 0.4.0

2009-04-19 Thread Peter Verswyvelen
Cool. Slightly annoying is that your interop is weak typed, and performance might suffer because it will be using .NET reflection all the time I guess. Do you know the Salsa binding for .NET? This aims to do strong typing. Maybe both efforts could be combined. On Sat, Apr 18, 2009 at 10:44 PM,

Re: [Haskell-cafe] General function to count list elements?

2009-04-19 Thread Peter Verswyvelen
Sometimes I do miss the pragmatic C solution:- two function pointers that are equal surely represent the same functions (although in C nothing is really sure ;) - two function pointers that are different, might or might not represent that same functions. But this weak equality can sometimes be

Re: [Haskell-cafe] ANNOUNCE: Utrecht Haskell Compiler (UHC) -- first release

2009-04-19 Thread wren ng thornton
Bulat Ziganshin wrote: Hello R.A., Sunday, April 19, 2009, 11:46:53 PM, you wrote: Does anybody know if there are any plans to incorporate some of these extensions into GHC - specifically the existential typing ? it is already here, but you should use forall keyword instead odf exists

Re: [Haskell-cafe] ANNOUNCE: Runge-Kutta library -- solve ODEs

2009-04-19 Thread Martijn van Steenbergen
Hi Uwe, Uwe Hollerbach wrote: I have so far only tested it with ghc 6.8.3 on MacOS 10.3.9 (powerPC), but I know of no reason why it wouldn't work with other versions and OSs. It works fine on 6.10.1 on Leopard Intel as well. I'm afraid I haven't messed with cabal much yet, so it's not

[Haskell-cafe] Re: General function to count list elements?

2009-04-19 Thread Achim Schneider
Peter Verswyvelen bugf...@gmail.com wrote: Sometimes I do miss the pragmatic C solution:- two function pointers that are equal surely represent the same functions (although in C nothing is really sure ;) In haskell, they would, but C doesn't give you the same guarantee: int evil = 0; int

[Haskell-cafe] Re: [Haskell] Helpful libraries to implement a board game?

2009-04-19 Thread Conrad Meyer
On Sunday 19 April 2009 01:39:40 pm Frank Rosemeier wrote: Dear Haskellers, I would like to implement a board game for a single player in Haskell. The pieces may be moved one step in any direction if there is no piece next to it, and the goal is to rearrange the pieces to their home

Re: [Haskell-cafe] ANNOUNCE: Utrecht Haskell Compiler (UHC) -- first release

2009-04-19 Thread Dan Doel
On Sunday 19 April 2009 4:56:29 pm wren ng thornton wrote: Bulat Ziganshin wrote: Hello R.A., Sunday, April 19, 2009, 11:46:53 PM, you wrote: Does anybody know if there are any plans to incorporate some of these extensions into GHC - specifically the existential typing ? it is

Re: [Haskell-cafe] Re: ANNOUNCE: Utrecht Haskell Compiler (UHC) -- first release

2009-04-19 Thread Duncan Coutts
On Sun, 2009-04-19 at 11:47 -0700, Simon Michael wrote: I meant, why is it too late to change the Setup interface to match cabal's --user by default behaviour ? All the distro packages etc use the Setup.hs interface without explicitly specifying --global. Duncan

RE: [Haskell-cafe] ANNOUNCE: Utrecht Haskell Compiler (UHC) -- first release

2009-04-19 Thread Niemeijer, R.A.
If only it were that easy. Sadly, it's not. Let's look at the following example: data Test = Test { foo :: Int, bar :: Char, baz :: Bool } smallPrint t = concatMap (\f - show $ f t) [foo, bar, baz] In this code the list [foo, bar, baz] should have the type [exists a. Show a = Test - a]. If we

Re: [Haskell-cafe] ANNOUNCE: Runge-Kutta library -- solve ODEs

2009-04-19 Thread Uwe Hollerbach
Thanks, Martijn, glad to hear it's working for you too. I'll see what I can do about cabal+hackage... Uwe On 4/19/09, Martijn van Steenbergen mart...@van.steenbergen.nl wrote: Hi Uwe, Uwe Hollerbach wrote: I have so far only tested it with ghc 6.8.3 on MacOS 10.3.9 (powerPC), but I know of

Re: [Haskell-cafe] ANNOUNCE: Runge-Kutta library -- solve ODEs

2009-04-19 Thread Alexey Khudyakov
I have so far only tested it with ghc 6.8.3 on MacOS 10.3.9 (powerPC), but I know of no reason why it wouldn't work with other versions and OSs. It breaks on Linux (and all unices) because name of file in tarball is 'rungekutta.hs' not 'RungeKutta.hs' as required. In other words: god blame

Re: [Haskell-cafe] ANNOUNCE: Utrecht Haskell Compiler (UHC) --first release

2009-04-19 Thread Claus Reinke
|data Test = Test { foo :: Int, bar :: Char, baz :: Bool } |smallPrint t = concatMap (\f - show $ f t) [foo, bar, baz] |In this code the list [foo, bar, baz] should have the type [exists a. Show a = Test - a]. {-# LANGUAGE RankNTypes #-} {-# LANGUAGE ExistentialQuantification #-} data EShow =

[Haskell-cafe] Re: [Haskell] ANN: persistent-map-0.0.0

2009-04-19 Thread Alberto G. Corona
Interesting. It seems similar to TCache. However the design is different. persistent-map store different finite maps whenever any of them are modified transactionally, while TCache handles a single hashTable of object of type a and from time to time store all the transactionally modified objects

Re: [Haskell-cafe] General function to count list elements?

2009-04-19 Thread Lennart Augustsson
And when the need gets big enough you pull out StablePtr and use that. :) On Sun, Apr 19, 2009 at 10:43 PM, Peter Verswyvelen bugf...@gmail.com wrote: Sometimes I do miss the pragmatic C solution: - two function pointers that are equal surely represent the same functions (although in C nothing

Re: [Haskell-cafe] General function to count list elements?

2009-04-19 Thread Peter Verswyvelen
Or a StableName? I guess StablePtr prevents the GC to move the Haskell object, so for just doing ugly comparing StableName would be better? On Mon, Apr 20, 2009 at 12:45 AM, Lennart Augustsson lenn...@augustsson.net wrote: And when the need gets big enough you pull out StablePtr and use that.

Re: [Haskell-cafe] ANNOUNCE: Runge-Kutta library -- solve ODEs

2009-04-19 Thread Uwe Hollerbach
Damn, I never thought of that. Sorry! Guess I've only been haskell-hacking on my little old iMac... A new version is attached, with the version number bumped up by 0.0.1 and rungekutta.hs renamed to RungeKutta.hs. Hopefully it should work out-of-the-box now. Off to patch my repository... Uwe On

Fwd: [Haskell-cafe] General function to count list elements?

2009-04-19 Thread Alberto G. Corona
here goes a test of  pointer equality (valid for functions too): samepointer :: a - a - IO Bool samepointer f1 f2 = do       p1- varHash f1       p2- varHash f2       return $  p1 == p2   where    varHash x=  do       sn - makeStableName x       return  $ hashStableName sn 2009/4/18  

Re: [Haskell-cafe] ANNOUNCE: Utrecht Haskell Compiler (UHC) -- first release

2009-04-19 Thread wren ng thornton
Dan Doel wrote: On Sunday 19 April 2009 4:56:29 pm wren ng thornton wrote: Bulat Ziganshin wrote: Hello R.A., Sunday, April 19, 2009, 11:46:53 PM, you wrote: Does anybody know if there are any plans to incorporate some of these extensions into GHC - specifically the existential

Re: [Haskell-cafe] General function to count list elements?

2009-04-19 Thread Lennart Augustsson
Sorry, I meant StableName. On Mon, Apr 20, 2009 at 1:00 AM, Peter Verswyvelen bugf...@gmail.com wrote: Or a StableName? I guess StablePtr prevents the GC to move the Haskell object, so for just doing ugly comparing StableName would be better? On Mon, Apr 20, 2009 at 12:45 AM, Lennart

Re: [Haskell-cafe] Looking for the fastest Haskell primes algorithm

2009-04-19 Thread ajb
G'day all. Quoting Dan Weston weston...@imageworks.com: Unless primesUpTo n goes from highest to lowest prime (ending in 2), I don't see how sharing is possible (in either space or time) between primesUpTo for different n. Given that it's a mistake for a library to leak memory, there are

Re: [Haskell-cafe] ANNOUNCE: Utrecht Haskell Compiler (UHC) -- first release

2009-04-19 Thread Dan Doel
On Sunday 19 April 2009 7:11:51 pm wren ng thornton wrote: Yes, however, because consumers (e.g. @f@) demand that their arguments remain polymorphic, anything which reduces the polymorphism of @a@ in @x@ will make it ineligible for being passed to consumers. Maybe not precise, but it works.

[Haskell-cafe] Re: Matrices

2009-04-19 Thread Patrick Perry
Hi Cetin, This is probably the easiest way: (m - es)^2/es listMatrix (2,2) [0.6163270413689804,0.600918865334756,0.33217626255600896,0.3238718559921087 ] This will create 2 temporary arrays. Alternatively, let res = listMatrix (shape m) [ (o-e)^2 / e | o - colElems m | e - colElems

Re: [Haskell-cafe] ANNOUNCE: Utrecht Haskell Compiler (UHC) -- first release

2009-04-19 Thread Derek Elkins
On Sun, 2009-04-19 at 20:46 -0400, Dan Doel wrote: On Sunday 19 April 2009 7:11:51 pm wren ng thornton wrote: Yes, however, because consumers (e.g. @f@) demand that their arguments remain polymorphic, anything which reduces the polymorphism of @a@ in @x@ will make it ineligible for being

Re: [Haskell-cafe] ANNOUNCE: Utrecht Haskell Compiler (UHC) -- first release

2009-04-19 Thread Dan Doel
On Sunday 19 April 2009 9:31:27 pm Derek Elkins wrote: simply because this is essentially a function with type (forall a. F a) - (exists a. F a) and you can do that by instantiating the argument to any type, and then hiding it in an existential), You can do this by using undefined,

Re: [Haskell-cafe] Re: ANNOUNCE: Utrecht Haskell Compiler (UHC) -- first release

2009-04-19 Thread Richard O'Keefe
On 20 Apr 2009, at 12:52 am, Achim Schneider wrote: Why? Is there something about Haskell 98 that's hard to implement? Insanity. I doubt anyone is going to miss n+k patterns: They are one of my favourite features. They express briefly and neatly what would otherwise take several separate

Re: [Haskell-cafe] General function to count list elements?

2009-04-19 Thread Richard O'Keefe
On 19 Apr 2009, at 4:27 am, michael rice wrote: I know functions can be compared in Scheme Welcome to DrScheme, version 4.1 [3m]. Language: Swindle; memory limit: 128 megabytes. (equal? equal? equal?) #t but apparently not in Haskell I have a copy of R6RS somewhere, but I'll refer to