Re: [Haskell-cafe] About code style ?

2010-02-02 Thread zaxis
thanks for all suggestions. zaxis wrote: For me i like C style instead of layout. For example, func1 a = do -- ... a * 2 -- ... I always write it as: func1 a = do { -- ...; a * 2; -- ...; } However, i donot know how to write pure function using C style.

Re: [Haskell-cafe] Very imperfect hash function

2010-02-02 Thread Hans Aberg
On 2 Feb 2010, at 03:05, Richard O'Keefe wrote: A simple hash-function for strings is to simply exclusive-or the bytes and then reduce modulo a prime number, Simply exclusive-oring the bytes will give you at most 256 distinct results. (For an ASCII source, 128 distinct results.) After

[Haskell-cafe] want to post haskell question

2010-02-02 Thread 조광래
hi I have a question about haskell coding. Matrices One of many ways to define matrices in Haskell is the list of matrix rows, where a row is a list of double precision oating point numbers: type Matrix=[[Double]] Using this type you should define the following functions (definition of dim is

Re: [Haskell-cafe] want to post haskell question

2010-02-02 Thread Ozgur Akgun
Hi, Try to understand this: type Matrix = [[Double]] multSM :: Double - Matrix - Matrix multSM d m = map (\ i - map (\ j - d*j ) i) m Now try this for multSM (instead of the above definition) multSM = map . map . (*) Hope it helps, On 2 February 2010 09:35, 조광래 kwangrae...@gmail.com wrote:

Re: [Haskell-cafe] want to post haskell question

2010-02-02 Thread Miguel Mitrofanov
|multSM d m = [[(b*a)| b-[d], a-(head m)]] Well, let's see what do we have here. We have []'s around something. Something is [(b*a)| b-[d], a-(head m)], which is just a legal Haskell value, so our mutlSM d m has to be a one-element list, with the only element being equal to what we put

[Haskell-cafe] Category Theory woes

2010-02-02 Thread Mark Spezzano
Hi all, I'm trying to learn Haskell and have come across Monads. I kind of understand monads now, but I would really like to understand where they come from. So I got a copy of Barr and Well's Category Theory for Computing Science Third Edition, but the book has really left me dumbfounded.

Re: [Haskell-cafe] About code style ?

2010-02-02 Thread Jinjing Wang
fac n = let { f = foldr (*) 1 [1..n] } in f :D sorry for double reply, need to cc cafe, this is fun. On Tue, Feb 2, 2010 at 4:33 PM, zaxis z_a...@163.com wrote: thanks for all suggestions. zaxis wrote: For me i like C style instead of layout. For example, func1 a = do      -- ...  

Re: [Haskell-cafe] Category Theory woes

2010-02-02 Thread Mark Spezzano
I should probably add that I am trying various proofs that involve injective and surjective properties of Hom Sets and Hom functions. Does anyone know what Hom stands for? I need a text for a newbie. Mark On 02/02/2010, at 9:56 PM, Mark Spezzano wrote: Hi all, I'm trying to learn Haskell

Re: [Haskell-cafe] Category Theory woes

2010-02-02 Thread Miguel Mitrofanov
Hom(A, B) is just a set of morphisms from A to B. Mark Spezzano wrote: I should probably add that I am trying various proofs that involve injective and surjective properties of Hom Sets and Hom functions. Does anyone know what Hom stands for? I need a text for a newbie. Mark On 02/02/2010,

RE: [Haskell-cafe] About code style ?

2010-02-02 Thread Bayley, Alistair
From: haskell-cafe-boun...@haskell.org [mailto:haskell-cafe-boun...@haskell.org] On Behalf Of zaxis For me i like C style instead of layout. For example, func1 a = do { -- ...; a * 2; -- ...; } The report has all the gory details. The brace+semicolon syntax isn't just

[Haskell-cafe] matrix question

2010-02-02 Thread 조광래
define functions type Matrix=[[Double]] multMM :: Matrix - Matrix - Matrix --multiplies two matrices det :: Matrix - Double --computes the determinant of a matrix inv :: Matrix - Matrix --inverts a matrix i stuck on those problems can any one help me out?

Re: [Haskell-cafe] matrix question

2010-02-02 Thread Hans Aberg
On 2 Feb 2010, at 13:15, 조광래 wrote: define functions type Matrix=[[Double]] multMM :: Matrix - Matrix - Matrix --multiplies two matrices det :: Matrix - Double --computes the determinant of a matrix inv :: Matrix - Matrix --inverts a matrix i stuck on those problems can any one help me out?

[Haskell-cafe] Re: Generating repeatable arbitrary values with QuickCheck 2

2010-02-02 Thread Sean Leather
Correction about the latter part... In the end, I would write something like the following: unGen arbitrary (mkStdGen 11) 5 :: [Int] This produces, for example, [5,1,-2,-4,2]. I also want to generate the same value for a type isomorphic to [Int]. unGen arbitrary (mkStdGen 11) 5 :: List

Re: [Haskell-cafe] Category Theory woes

2010-02-02 Thread Álvaro García Pérez
You may try Pierce's Basic Category Theory for Computer Scientists or Awodey's Category Theory, whose style is rather introductory. Both of them (I think) have a chapter about functors where they explain the Hom functor and related topics. Alvaro. 2010/2/2 Mark Spezzano

Re: [Haskell-cafe] Category Theory woes

2010-02-02 Thread A E Lawrence
Mark Spezzano wrote: I need a text for a newbie. While the other books suggested are excellent, I think that they would be hard going if you find Barr Wells difficult. The simplest introduction to the ideas of category theory that I know is Conceptual Mathematics by F W Lawvere S H

[Haskell-cafe] Tracer for Haskell showing substitutions

2010-02-02 Thread Ulrik Rasmussen
Hi all, I was wondering if someone has written a tracer/debugger that shows you how a given Haskell expression is evaluated, by generating all the intermediate states of the expression until it is in normal form? For instance, given the following code: take' 0 xs = [] take' n (x:xs) = x :

Re: [Haskell-cafe] matrix question

2010-02-02 Thread Job Vranish
I have a little haskell matrix library for fixed sized matricies on github: http://github.com/jvranish/VectorMatix which I've just realized is horribly out of date...I'll update it tonight and probably push it to hackage too... but if you're really want to stick with the [[Double]] type, you can

[Haskell-cafe] GUI programming

2010-02-02 Thread Victor Nazarov
Hello, I've been writing some GUI application with Gtk2hs. It's an interpreter for lambda-calculus and combinatory logic, it's GPL and if you interested I can share it with cafe. The problem is that the GUI code has become very ugly and I'm tempted to rewrite it totally. I've been looking

[Haskell-cafe] Game of life in haskell.

2010-02-02 Thread Lyndon Maydwell
Hi Cafe. I've made a basic game of life implementation with Haskell and OpenGL: https://github.com/sordina/Life/ The basic premise is to generate a random snapshot, then iterate the successor function on it to create an infinite list of snapshots, then output them using OpenGL. I haven't really

Re: [Haskell-cafe] Game of life in haskell.

2010-02-02 Thread Serguey Zefirov
2010/2/2 Lyndon Maydwell maydw...@gmail.com: Hi Cafe. I've made a basic game of life implementation with Haskell and OpenGL: https://github.com/sordina/Life/ I'm intending to improve the performance, and add more advanced features, but I thought I'd get some feedback first. Can anyone see a

Re: [Haskell-cafe] Game of life in haskell.

2010-02-02 Thread Lyndon Maydwell
I chose the array mainly for the fast lookup time compared to lists, are you suggesting something like creating a Map (X,Y) Health? I'm not currently updating any structures, rather creating the successor from scratch. I can see how the map may work very well for the sparse nature of non-early

Re: [Haskell-cafe] Game of life in haskell.

2010-02-02 Thread Serguey Zefirov
2010/2/2 Lyndon Maydwell maydw...@gmail.com: I chose the array mainly for the fast lookup time compared to lists, are you suggesting something like creating a Map (X,Y) Health? I'm not currently updating any structures, rather creating the successor from scratch. I can see how the map may work

Re: [Haskell-cafe] Game of life in haskell.

2010-02-02 Thread Lyndon Maydwell
I'm avoiding hard-coding bools anywhere as I intend to allow fuzzy-representations at some point. On Wed, Feb 3, 2010 at 12:10 AM, Serguey Zefirov sergu...@gmail.com wrote: 2010/2/2 Lyndon Maydwell maydw...@gmail.com: I chose the array mainly for the fast lookup time compared to lists, are you

Re: [Haskell-cafe] matrix question

2010-02-02 Thread man
http://hackage.haskell.org/package/hmatrix-0.8.1.1 it wraps gls, blas and lapack (so you need to install the libraries). On Tue, Feb 2, 2010 at 4:08 PM, Job Vranish jvran...@gmail.com wrote: I have a little haskell matrix library for fixed sized matricies on github:

Re: [Haskell-cafe] Game of life in haskell.

2010-02-02 Thread Jon Harrop
On Tuesday 02 February 2010 16:10:05 Serguey Zefirov wrote: Actually, your solution with arrays is the most often occured solution an imperative programmer will come with. It is simple but not scalable and not particularly fast. What gave you that impression? -- Dr Jon Harrop, Flying Frog

Re: [Haskell-cafe] Category Theory woes

2010-02-02 Thread Creighton Hogg
2010/2/2 Álvaro García Pérez agar...@babel.ls.fi.upm.es You may try Pierce's Basic Category Theory for Computer Scientists or Awodey's Category Theory, whose style is rather introductory. Both of them (I think) have a chapter about functors where they explain the Hom functor and related

Re: [Haskell-cafe] Tracer for Haskell showing substitutions

2010-02-02 Thread Ezra Lalonde
Hi, Hat: The Haskell Tracer. http://www.haskell.org/hat/ From the site: Hat helps locating errors in programs. Furthermore, it is useful for understanding how a (correct) program works, especially for teaching and program maintenance. Hat is not a time or space profiler. Hat can be used for

Re: [Haskell-cafe] Game of life in haskell.

2010-02-02 Thread Serguey Zefirov
2010/2/2 Lyndon Maydwell maydw...@gmail.com: I'm avoiding hard-coding bools anywhere as I intend to allow fuzzy-representations at some point. What is the meaning of fuzzy Game of Life? Where can I read about? Or you're planning to average field over some time interval? In the latter case you

Re: [Haskell-cafe] Game of life in haskell.

2010-02-02 Thread Serguey Zefirov
2010/2/2 Jon Harrop j...@ffconsultancy.com: On Tuesday 02 February 2010 16:10:05 Serguey Zefirov wrote: Actually, your solution with arrays is the most often occured solution an imperative programmer will come with. It is simple but not scalable and not particularly fast. What gave you that

Re: [Haskell-cafe] Game of life in haskell.

2010-02-02 Thread Jon Harrop
On Tuesday 02 February 2010 18:23:59 Serguey Zefirov wrote: 2010/2/2 Jon Harrop j...@ffconsultancy.com: On Tuesday 02 February 2010 16:10:05 Serguey Zefirov wrote: Actually, your solution with arrays is the most often occured solution an imperative programmer will come with. It is simple

Re: [Haskell-cafe] Game of life in haskell.

2010-02-02 Thread David Leimbach
On Tue, Feb 2, 2010 at 11:54 AM, Jon Harrop j...@ffconsultancy.com wrote: On Tuesday 02 February 2010 18:23:59 Serguey Zefirov wrote: 2010/2/2 Jon Harrop j...@ffconsultancy.com: On Tuesday 02 February 2010 16:10:05 Serguey Zefirov wrote: Actually, your solution with arrays is the most

Re: [Haskell-cafe] Game of life in haskell.

2010-02-02 Thread Serguey Zefirov
2010/2/2 Jon Harrop j...@ffconsultancy.com: Or, you're asking about scalability and speed? I meant the scalability and speed. An imperative solution should be simpler, more scalable and faster than any purely functional solution. So, please, provide any and we'll discuss difference between

Re: [Haskell-cafe] Game of life in haskell.

2010-02-02 Thread Don Stewart
leimy2k: On Tue, Feb 2, 2010 at 11:54 AM, Jon Harrop j...@ffconsultancy.com wrote: On Tuesday 02 February 2010 18:23:59 Serguey Zefirov wrote: 2010/2/2 Jon Harrop j...@ffconsultancy.com: On Tuesday 02 February 2010 16:10:05 Serguey Zefirov wrote: Actually, your

Re: [Haskell-cafe] Re: Generating repeatable arbitrary values with QuickCheck 2

2010-02-02 Thread Ryan Ingram
Gen slightly breaks the monad laws: arbitrary = return is not the same as return () = const arbitrary because each bind splits the generator, so you end up with a different seed passed to arbitrary in these two cases. If the observable value is some random object this is a safe fudge, but if

[Haskell-cafe] Failure to load hmatric

2010-02-02 Thread dlb
OK, I'm working on matrix stuff in Haskell now (I've been trying to get the professor to approve that) and when I use cabal install to install hmatrix, it fails at HUnit with: --- Configuring HUnit-1.2.2.1... Preprocessing library HUnit-1.2.2.1... Preprocessing executables for

Re: [Haskell-cafe] Failure to load hmatric

2010-02-02 Thread Gwern Branwen
On Tue, Feb 2, 2010 at 1:59 PM, d...@patriot.net wrote: OK, I'm working on matrix stuff in Haskell now (I've been trying to get the professor to approve that) and when I use cabal install to install hmatrix, it fails at HUnit with: --- Configuring HUnit-1.2.2.1... Preprocessing

Re: [Haskell-cafe] Re: Generating repeatable arbitrary values with QuickCheck 2

2010-02-02 Thread David Menendez
On Tue, Feb 2, 2010 at 1:48 PM, Ryan Ingram ryani.s...@gmail.com wrote: Gen slightly breaks the monad laws: arbitrary = return is not the same as return () = const arbitrary because each bind splits the generator, so you end up with a different seed passed to arbitrary in these two cases.

Re: [Haskell-cafe] Game of life in haskell.

2010-02-02 Thread Arne D Halvorsen
Den 2. feb. 2010 kl. 19.26 skrev Jon Harrop j...@ffconsultancy.com: On Tuesday 02 February 2010 16:10:05 Serguey Zefirov wrote: Actually, your solution with arrays is the most often occured solution an imperative programmer will come with. It is simple but not scalable and not

[Haskell-cafe] SYB/Generics documentation inaccessible

2010-02-02 Thread Arne D Halvorsen
I have tried to access a few of the documents on generics that are referred to from wikipedia, from the GHC documentation, from hackage and from the wiki. These documents (on vu.nl, subdirectory boilerplate and strafunski) are apparently forbidden to me, and have been for some weeks. I

[Haskell-cafe] Re: Category Theory woes

2010-02-02 Thread Dominic Steinitz
Mark Spezzano mark.spezzano at chariot.net.au writes: Maybe there are books on Discrete maths or Algebra or Set Theory that deal more with Hom Sets and Hom Functions? Googling haskell category theory I got: http://en.wikibooks.org/wiki/Haskell/Category_theory

Re: [Haskell-cafe] Re: Generating repeatable arbitrary values with QuickCheck 2

2010-02-02 Thread Sean Leather
On Tue, Feb 2, 2010 at 20:25, David Menendez wrote: On Tue, Feb 2, 2010 at 1:48 PM, Ryan Ingram wrote: Gen slightly breaks the monad laws: arbitrary = return is not the same as return () = const arbitrary because each bind splits the generator, so you end up with a different seed

[Haskell-cafe]SYB/Generics documentation inaccessible

2010-02-02 Thread Arne Dehli Halvorsen
I have tried to access a few of the documents on generics that are referred to from wikipedia, from the GHC documentation, from hackage and from the wiki. These documents (on vu.nl, subdirectory boilerplate and strafunski) are apparently forbidden to me, and have been for some weeks. I tried to

Re: [Haskell-cafe] Game of life in haskell.

2010-02-02 Thread Tony Finch
On Tue, 2 Feb 2010, Arne D Halvorsen wrote: If I may butt in here: to get a scalable, fast Game of Life, you should look into Hashlife (by Gosper?) as exemplified in the open source application Golly. It gives an astonishing speedup, and it would be interesting to see it expressed in Haskell.

Re: [Haskell-cafe] Game of life in haskell.

2010-02-02 Thread Tony Finch
On Tue, 2 Feb 2010, Serguey Zefirov wrote: Creation of new Array is (without knowing some subtle details) is O(max coordinates difference between live cells). Creation of new Set (X,Y) is O(NlogN) (N = number of live objects). Most of the cells in Life are empty, so the Set/Map approach is

Re: [Haskell-cafe] Game of life in haskell.

2010-02-02 Thread edgar
http://dotat.at/prog/life/hslife.hs [], Edgar On Tue, 02/Feb/2010 at 21:10 +0100, Arne D Halvorsen wrote: Den 2. feb. 2010 kl. 19.26 skrev Jon Harrop j...@ffconsultancy.com: On Tuesday 02 February 2010 16:10:05 Serguey Zefirov wrote: Actually, your solution with arrays is the most often

Re: [Haskell-cafe] Re: Generating repeatable arbitrary values with QuickCheck 2

2010-02-02 Thread Ryan Ingram
On Tue, Feb 2, 2010 at 11:25 AM, David Menendez d...@zednenem.com wrote: We could avoid that problem by redefining Gen as a state transformer monad. newtype Gen a = MkGen { unGen :: StdGen - Int - (a, StdGen) } Unfortunately, this makes things like infinite_xs - sequence (repeat arbitrary)

Re: [Haskell-cafe] Anyone up for Google SoC 2010?

2010-02-02 Thread Neil Mitchell
I'd also be happy to mentor. Where is the official place to collect project ideas? We used trac previously, are we still using it or are we now on Reddit? Thanks, Neil 2010/2/1 sterl s.clo...@gmail.com: Malcolm Wallace wrote: Google has announced that the Summer of Code programme will be

Re: [Haskell-cafe] Re: Generating repeatable arbitrary values with QuickCheck 2

2010-02-02 Thread Ryan Ingram
Although now that I think about it, most of these could be pretty easily fixed by a new primitive: splitGen :: Gen a - Gen a splitGen m = MkGen spg where spg g n = (a, g2) where (g1, g2) = split g (a, _) = unGen m g1 n Then you could do infinite_xs - splitGen $

[Haskell-cafe] Hackage Package version ranges

2010-02-02 Thread Neil Mitchell
Hi, I maintain the Haskell package HLint. HLint depends on haskell-src-exts, cpphs, hscolour and uniplate, plus things which are shipped with GHC. For each of the external library dependencies, I have to specify a version constraint. For example, I developed HLint against cpphs-1.10 so I can

Re: [Haskell-cafe] Anyone up for Google SoC 2010?

2010-02-02 Thread Johan Tibell
On Tue, Feb 2, 2010 at 2:06 PM, Neil Mitchell ndmitch...@gmail.com wrote: I'd also be happy to mentor. Where is the official place to collect project ideas? We used trac previously, are we still using it or are we now on Reddit? Is there a way to prune the reddit list? Some of the projects

Re: [Haskell-cafe]SYB/Generics documentation inaccessible

2010-02-02 Thread Neil Mitchell
I emailed Simon Peyton Jones about this a few weeks ago (he links to these pages) and got the reply thanks, will chase - so people are aware of it. The links are in many places, which is a bit of a shame. Thanks, Neil On Tue, Feb 2, 2010 at 8:51 PM, Arne Dehli Halvorsen arne@gmail.com wrote:

Re: [Haskell-cafe] Game of life in haskell.

2010-02-02 Thread Tony Finch
On Tue, 2 Feb 2010, ed...@ymonad.com wrote: http://dotat.at/prog/life/hslife.hs Er, yes, I didn't link to that in my earlier message because it's a half-completed attempt. I think I got to the stage of realising that I needed to write a monad or a monad transformer to thread the hash cons state

Re: [Haskell-cafe]SYB/Generics documentation inaccessible

2010-02-02 Thread Stephen Tetley
Hello The most of the papers the Wikipedia page links to should be publicly accessible, I've just checked the ones hosted at Utrecht University (e.g the Generic Haskell manual and Andres L\ohs thesis). Ralf Hinze has changed universities, so the link to

Re: [Haskell-cafe] SYB/Generics documentation inaccessible

2010-02-02 Thread José Pedro Magalhães
A few days ago I changed the links from the SYB wiki [1] to point to an archived version of the vu.nl webpage: http://web.archive.org/web/20080622204226/http://www.cs.vu.nl/boilerplate/ But it would be nice to have the webpage up again, somewhere. Cheers, Pedro [1]

Re: [Haskell-cafe] Hackage Package version ranges

2010-02-02 Thread Jesper Louis Andersen
On Tue, Feb 2, 2010 at 11:11 PM, Neil Mitchell ndmitch...@gmail.com wrote: Alternatively, if I could sign up to be emailed when something went wrong, I'd happily fix it. i.e. I'd like an email either when my package fails to compile against the latest version of all packages but within my

Re: [Haskell-cafe]SYB/Generics documentation inaccessible

2010-02-02 Thread Stephen Tetley
Apologies for the rather garbled last message (I was trying to type whilst checking a multitude of links in a plethora or browser windows)... The SYB papers are here http://research.microsoft.com/en-us/um/people/simonpj/Papers/hmap/ The code seems to have vanished at the moment, maybe someone

Re: [Haskell-cafe] Hackage Package version ranges

2010-02-02 Thread Neil Mitchell
Alternatively, if I could sign up to be emailed when something went wrong, I'd happily fix it. i.e. I'd like an email either when my package fails to compile against the latest version of all packages but within my constrained range, or when the latest version falls outside my constraint

Re: [Haskell-cafe] Anyone up for Google SoC 2010?

2010-02-02 Thread Gwern Branwen
On Tue, Feb 2, 2010 at 5:11 PM, Johan Tibell johan.tib...@gmail.com wrote: On Tue, Feb 2, 2010 at 2:06 PM, Neil Mitchell ndmitch...@gmail.com wrote: I'd also be happy to mentor. Where is the official place to collect project ideas? We used trac previously, are we still using it or are we now

Re: [Haskell-cafe] Anyone up for Google SoC 2010?

2010-02-02 Thread Max Bolingbroke
2010/1/31 Malcolm Wallace malcolm.wall...@cs.york.ac.uk: Both of these roles are called mentor in the Google system.  Putting together a good team of mentors before applying as an organisation is helpful towards us being accepted into the programme. Having experienced being a student on the

Re: [Haskell-cafe] matrix question

2010-02-02 Thread Richard O'Keefe
On Feb 3, 2010, at 1:15 AM, 조광래 wrote: define functions type Matrix=[[Double]] multMM :: Matrix - Matrix - Matrix --multiplies two matrices det :: Matrix - Double --computes the determinant of a matrix inv :: Matrix - Matrix --inverts a matrix i stuck on those problems Stuck how, exactly?

Re: [Haskell-cafe] Game of life in haskell.

2010-02-02 Thread Richard O'Keefe
I understood the simple but not scalable and not particularly fast claim *NOT* as a claim about imperative languages but in context as a claim about using two-dimensional arrays of booleans to implement Conway's Life. One message in this thread has already pointed to a solution (in C) that in

[Haskell-cafe] functional references and HList?

2010-02-02 Thread Günther Schmidt
Hi all, I wonder if there is some a field of use overlap between HList and functional references aka accessors. Do both tackle the same problem? Günther ___ Haskell-Cafe mailing list Haskell-Cafe@haskell.org

Re: [Haskell-cafe] Game of life in haskell.

2010-02-02 Thread Lyndon Maydwell
Thanks for the replies. I have heard of Hash Life, but I thought I'd try a more naive approach first, build up some type-classes, then create some more interesting implementations (although I think I'd struggle with implementing Hash Life in haskell at this point). What is the meaning of fuzzy

Re: [Haskell-cafe] About code style ?

2010-02-02 Thread zaxis
fac n = let { f = foldr (*) 1 [1..n] } in f VERY interesting :) Jinjing Wang wrote: fac n = let { f = foldr (*) 1 [1..n] } in f :D sorry for double reply, need to cc cafe, this is fun. On Tue, Feb 2, 2010 at 4:33 PM, zaxis z_a...@163.com wrote: thanks for all suggestions.

[Haskell-cafe] setNonBlockingFD?

2010-02-02 Thread Magnus Therning
network-fancy fails to build because Not in scope: 'setNonBlockingFD'. Any pointers to what should be used in 6.12? /M -- Magnus Therning(OpenPGP: 0xAB4DFBA4) magnus@therning.org Jabber: magnus@therning.org http://therning.org/magnus identi.ca|twitter:

Re: [Haskell-cafe] setNonBlockingFD?

2010-02-02 Thread Johan Tibell
On Tue, Feb 2, 2010 at 4:41 PM, Magnus Therning mag...@therning.org wrote: network-fancy fails to build because Not in scope: 'setNonBlockingFD'. Any pointers to what should be used in 6.12? I have the following in 'network': #if __GLASGOW_HASKELL__ 611

Re: [Haskell-cafe] Game of life in haskell.

2010-02-02 Thread Jon Harrop
On Tuesday 02 February 2010 23:54:58 Richard O'Keefe wrote: I understood the simple but not scalable and not particularly fast claim *NOT* as a claim about imperative languages but in context as a claim about using two-dimensional arrays of booleans to implement Conway's Life. Fair enough. If

Re: [Haskell-cafe] Hackage Package version ranges

2010-02-02 Thread Ivan Lazar Miljenovic
Neil Mitchell ndmitch...@gmail.com writes: However, every time I use (1) some distro (usually Arch) emails me to say they need wider ranges so they can get all their packages consistent. Well, in Gentoo we normally resort to using sed to fix these kinds of things. If we can do it, I'm sure

Re: [Haskell-cafe] matrix question

2010-02-02 Thread Ivan Lazar Miljenovic
man manuel.a.cas...@gmail.com writes: http://hackage.haskell.org/package/hmatrix-0.8.1.1 it wraps gls, blas and lapack (so you need to install the libraries). There's also the blas package if you just want blas support. -- Ivan Lazar Miljenovic ivan.miljeno...@gmail.com

Re: [Haskell-cafe] Game of life in haskell.

2010-02-02 Thread Tony Finch
On 3 Feb 2010, at 02:04, Jon Harrop j...@ffconsultancy.com wrote: On Tuesday 02 February 2010 23:54:58 Richard O'Keefe wrote: One message in this thread has already pointed to a solution (in C) that in effect uses a bit-packed sparse representation to achieve high speed. The point is that

Re: [Haskell-cafe] Game of life in haskell.

2010-02-02 Thread Jon Harrop
On Tuesday 02 February 2010 18:44:25 David Leimbach wrote: On Tue, Feb 2, 2010 at 11:54 AM, Jon Harrop j...@ffconsultancy.com wrote: I meant the scalability and speed. An imperative solution should be simpler, more scalable and faster than any purely functional solution. That's a pretty

Re: [Haskell-cafe] matrix question

2010-02-02 Thread Thomas DuBuisson
This is identical to the homework problem posted on stackoverflow: http://stackoverflow.com/questions/2182300/haskell-matrix-scalar-multilple-question Do not post homework problems to the cafe! If you feel compelled to then identify an aspect that is tricky to you, show us what you tried, and

Re: [Haskell-cafe] Game of life in haskell.

2010-02-02 Thread Jon Harrop
On Wednesday 03 February 2010 01:08:33 Richard O'Keefe wrote: On Feb 3, 2010, at 3:04 PM, Jon Harrop wrote: Fair enough. If you want to model either an infinite board or a very sparse one then a sparse data structure will be asymptotically faster. But they won't be simpler and

Re: [Haskell-cafe] GUI programming

2010-02-02 Thread Artyom Shalkhakov
Hello Victor, 2010/2/2, Victor Nazarov asviraspossi...@gmail.com: I've been writing some GUI application with Gtk2hs. It's an interpreter for lambda-calculus and combinatory logic, it's GPL and if you interested I can share it with cafe. Sure, why not? I consider more lightweight and more

Re: [Haskell-cafe] Game of life in haskell.

2010-02-02 Thread Gregory Crosswhite
On Feb 2, 2010, at 7:11 PM, Jon Harrop wrote: I doubt programming paradigms live or die according to whether or not they can implement Conway's Game of Life simply and efficiently. This makes an awesome quote. :-) - Greg ___ Haskell-Cafe

Re: [Haskell-cafe] Game of life in haskell.

2010-02-02 Thread David Leimbach
On Tue, Feb 2, 2010 at 7:33 PM, Gregory Crosswhite gcr...@phys.washington.edu wrote: On Feb 2, 2010, at 7:11 PM, Jon Harrop wrote: I doubt programming paradigms live or die according to whether or not they can implement Conway's Game of Life simply and efficiently. This makes an awesome

Re: [Haskell-cafe] Game of life in haskell.

2010-02-02 Thread Ivan Lazar Miljenovic
Gregory Crosswhite gcr...@phys.washington.edu writes: On Feb 2, 2010, at 7:11 PM, Jon Harrop wrote: I doubt programming paradigms live or die according to whether or not they can implement Conway's Game of Life simply and efficiently. This makes an awesome quote. :-) You mean Jon

[Haskell-cafe] GHC/base API documentation has been generated incorrectly

2010-02-02 Thread John Millikin
Looking at (for example) the docs for 'bracket'[1], the parameter documentation has been shifted up by one. The source code[2] looks correct, so perhaps Haddock is parsing it incorrectly? Docs for other functions, such as 'showSigned'[3], exhibit the same error. [1]

[Haskell-cafe] multMM :: Matrix - Matrix - Matrix --multiplies two matrices question (Homework)

2010-02-02 Thread 조광래
hi i was trying to solve it but All i got is type Matrix=[[Double]] multMM :: Matrix - Matrix - Matrix --multiplies two matrices multMM m t =[[sum (zipWith (*) (head m)(a)) ] ]where a = [head a | a- t] Main multMM [[2,1,-6],[1,-3,2]] [[1,0,-3],[0,4,20],[-2,1,1]] [[14.0]] from this i