Re: [Haskell-cafe] ANN: bloxorz clone

2009-07-06 Thread Patai Gergely
Here's a video of bloxorz at work, very cool! http://archhaskell.wordpress.com/2009/07/04/bloxorz-an-opengl-logic-game-written-in-haskell/ I see it wasn't rehearsed in advance. ;) Gergely -- http://www.fastmail.fm - The professional email service

[Haskell-cafe] Haskell Platform 2009.2.0.1 and GLUT32.DLL on Windows: which version?

2009-07-06 Thread Peter Verswyvelen
I know GLUT32.DLL is not bundled with the Haskell Platform installer, but which GLUT32.DLL should I use? Every DLL I tried (even building FreeGLUT myselfhttp://netsuperbrain.com/blog/posts/freeglut-windows-hopengl-hglut/#more-136) gives the error: *The procedure entry point glutAddMenuEntry could

[Haskell-cafe] Re: Documentation design

2009-07-06 Thread Peter Hercek
I like your proposal. Few notes below. On Sun, 05 Jul 2009 23:45:31 -0400, Isaac Dupree wrote: My dream situation: both haddock-pages and hscolour-pages would be super-hyperlinked and super-readable. For example, haddock would list all a module's definitions, not just its exports. In

Re: [Haskell-cafe] Monoid wants a (++) equivalent

2009-07-06 Thread Mattias Bengtsson
On Sun, 2009-07-05 at 22:30 +0200, Henning Thielemann wrote: (?) is also undefined in Prelude. Which i think is a good thing. I think it's quite nice to use (?) as an operator in higher order functions. Eg. foldr _ z [] = z foldr (?) z (x:xs) = x ? foldr (?) z xs

Re: [Haskell-cafe] Monoid wants a (++) equivalent

2009-07-06 Thread Ketil Malde
Mattias Bengtsson moonl...@dtek.chalmers.se writes: (?) is also undefined in Prelude. Which i think is a good thing. I think it's quite nice to use (?) as an operator in higher order functions. Also, it clashes with the implicit parameters extension, and combining the extension with a

[Haskell-cafe] Re: Haskell Platform 2009.2.0.1 and GLUT32.DLL on Windows: which version?

2009-07-06 Thread Mikhail Glushenkov
Hi Peter, Peter Verswyvelen bugfact at gmail.com writes: I know GLUT32.DLL is not bundled with the Haskell Platform installer, but which GLUT32.DLL should I use? I compiled a basic example [1] successfully using the DLL downloaded from [2]. But since that's the first hit in Google, you've

Re: [Haskell-cafe] ANN: bloxorz clone

2009-07-06 Thread Daniel van den Eijkel
Very nice! Just to give feedback: It installs and works perfectly on windows. kind regards, daniel Patai Gergely schrieb: Hello all, This post is not about my own creation, it's just a little fun program written by a student of mine. You can install the bloxorz package to try it out, and

[Haskell-cafe] simple state monad exercises? (besides labeling trees)

2009-07-06 Thread Thomas Hartman
Can someone give some simple common scenarios where the state monad is useful, besides labeling trees? References to puzzles like those in project Euler or similar would be nice. Thanks! ___ Haskell-Cafe mailing list Haskell-Cafe@haskell.org

Re: [Haskell-cafe] ANN: bloxorz clone

2009-07-06 Thread Don Stewart
patai_gergely: Here's a video of bloxorz at work, very cool! http://archhaskell.wordpress.com/2009/07/04/bloxorz-an-opengl-logic-game-written-in-haskell/ I see it wasn't rehearsed in advance. ;) Will the darcs (or.. ) repository for the code be made public? I'm sure there are

Re: [Haskell-cafe] Re: Haskell Platform 2009.2.0.1 and GLUT32.DLL on Windows: which version?

2009-07-06 Thread Peter Verswyvelen
Okay, thanks for this feedback. I tried [2] but that failed. Since it works on your system I'll double check again tomorrow, it must be picking an incorrect GLUT32.dll I guess On Mon, Jul 6, 2009 at 5:11 PM, Mikhail Glushenkov the.dead.shall.r...@gmail.com wrote: Hi Peter, Peter Verswyvelen

Re: [Haskell-cafe] simple state monad exercises? (besides labeling trees)

2009-07-06 Thread Thomas ten Cate
I used the State monad to implement a Brainfuck [1] interpreter a few months ago. It stored the program counter, pointer and the memory of the machine. There might have been a different (better?) way, but as I was trying to learn more about monads, it was an obvious choice. Thomas [1]

Re: [Haskell-cafe] ANN: bloxorz clone

2009-07-06 Thread Patai Gergely
Will the darcs (or.. ) repository for the code be made public? I'm sure there are people in the community who'd like to contribute new levels, etc. I don't think there is a repository at all, and I'm not even sure if Viktor wants to maintain it. I'll ask and direct him to the list. Gergely --

Re: [Haskell-cafe] simple state monad exercises? (besides labeling trees)

2009-07-06 Thread Matthias Görgens
Can someone give some simple common scenarios where the state monad is useful, besides labeling trees? Emulating the VM given in this years ICFP programming contest was also a good application of the state monad. Of course you interprate much simpler language imperative languages, too.

[Haskell-cafe] excercise - a completely lazy sorting algorithm

2009-07-06 Thread Petr Pudlak
Hi all, about a month ago, we were discussing sorting in Haskell with a friend. We realized a nice property of lazy merge-sort (which is AFAIK the implementation of Data.List.sort): Getting the first element of the sorted list actually requires O(n) time, not O(n * log n) as in imperative

Re: [Haskell-cafe] excercise - a completely lazy sorting algorithm

2009-07-06 Thread Matthias Görgens
Interesting problem. I have been toying with the same problem for some time. To solve the problem in theory, I'd concentrate on getting the number of comparisons into the required O(n) resp. O(n log n) ranges. Afterwards we can think about building the infrastructure to keep the number of all

[Haskell-cafe] Haskell Platform on Ubuntu

2009-07-06 Thread Rafael Gustavo da Cunha Pereira Pinto
Is there anyone working on a Haskell Platform package for Ubuntu? GHC in Ubuntu is a pain! Regards Rafael Gustavo da Cunha Pereira Pinto ___ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http://www.haskell.org/mailman/listinfo/haskell-cafe

Re: [Haskell-cafe] excercise - a completely lazy sorting algorithm

2009-07-06 Thread Andrew Hunter
On Mon, Jul 6, 2009 at 12:26 PM, Petr Pudlakd...@pudlak.name wrote: More precisely: The result of sorting an n-element list or array should be a structure that allows to ask i-th element of the result (for example, a lazy array). Asking k arbitrary elements should take no more than  O(min(n *

Re: [Haskell-cafe] excercise - a completely lazy sorting algorithm

2009-07-06 Thread Matthias Görgens
If someone can translate my algorithm into a non-side-effecting one, I'd appreciate it, but I think that like disjoint set/union, this is probably inherently side-effecting.  Yes, yes, we could use functional arrays, but short of that I don't see a way to avoid side effects to take care of my

Re: [Haskell-cafe] excercise - a completely lazy sorting algorithm

2009-07-06 Thread Mads Lindstrøm
Hi Petr, Maybe this will give inspiration http://en.wikipedia.org/wiki/Selection_algorithm It seems to me, that you just need a selection algorithm which works in O(n * k) time for k arbitrary elements. If you combine O(n*k) selection algorithm with any O(n * lg n) sort, you furfil your time

Re: [Haskell-cafe] Haskell Platform on Ubuntu

2009-07-06 Thread Don Stewart
RafaelGCPP.Linux: Is there anyone working on a Haskell Platform package for Ubuntu? GHC in Ubuntu is a pain! The Debian team is working on packaging, but until then (or if someone on Ubuntu steps up), you'll need to use the Unix tarball:

Re: [Haskell-cafe] Haskell Platform on Ubuntu

2009-07-06 Thread Erik de Castro Lopo
Rafael Gustavo da Cunha Pereira Pinto wrote: Is there anyone working on a Haskell Platform package for Ubuntu? For Haskell on Ubuntu, the vast majority of all the work is done by the Debian Haskell maintainers. Ubuntu simply takes that work and rolls packages for Ubuntu. GHC in Ubuntu is a

Re: [Haskell-cafe] Haskell Platform on Ubuntu

2009-07-06 Thread Rafael Gustavo da Cunha Pereira Pinto
Thanks. I may even be the one to step up, if nothing happens till 9.10... I really miss up-to-date ghc in Ubuntu. 2009/7/6 Don Stewart d...@galois.com RafaelGCPP.Linux: Is there anyone working on a Haskell Platform package for Ubuntu? GHC in Ubuntu is a pain! The Debian team is

Re: [Haskell-cafe] Haskell Platform on Ubuntu

2009-07-06 Thread Stefan Roggensack
Hello, I have uploaded the ghc package to my ppa: https://launchpad.net/~someone561/+archive/ppa But I don't work on it. I simple backport the debian sid packages. Also there are not the haskell libraries as debs. Maybe this helps you. Stefan Rafael Gustavo da Cunha Pereira Pinto wrote:

[Haskell-cafe] LINQ, SQL and hs-dotnet

2009-07-06 Thread Günther Schmidt
Hi all, is there anyone who has already tried using LINQ2SQL with hs-dotnet and would care to share the experience? I'm trying to figure out what exactly it would take to access an SQL database via LINQ / hs-dotnet. Ie. whether or not it's necessary to create Entity classes, or if one

Re: [Haskell-cafe] excercise - a completely lazy sorting algorithm

2009-07-06 Thread Matthias Görgens
It seems to me, that you just need a selection algorithm which works in O(n * k) time for k arbitrary elements. If you combine O(n*k) selection algorithm with any O(n * lg n) sort, you furfil your time constrain. I guess, we also want the list to be sorted in O(1) after having selected every

Re: [Haskell-cafe] simple state monad exercises? (besides labeling trees)

2009-07-06 Thread Lanny Ripple
Off the top of my head state is important when getting from A to B depends on the path you took. As such a common scenario I find myself in all the time is not having a good CLI craps game. (And which I resolve by rewriting in every language I learn.) Stake, current bet, bets outstanding,

Re: [Haskell-cafe] excercise - a completely lazy sorting algorithm

2009-07-06 Thread Andrew Hunter
On Mon, Jul 6, 2009 at 4:32 PM, Matthias Görgensmatthias.goerg...@googlemail.com wrote: It seems to me, that you just need a selection algorithm which works in O(n * k) time for k arbitrary elements. If you combine O(n*k) selection algorithm with any O(n * lg n) sort, you furfil your time

Re: [Haskell-cafe] Catering for similar operations with and without state

2009-07-06 Thread phil
Well, the simplest solution I can think of is below. The OtherNormalStateT doesn't actually have any state at all, but still gets state from the StateT 'below' it and returns a result. This is still a bit ugly, but it compiles - and although I haven't tested it properly yet, simply

Re: [Haskell-cafe] excercise - a completely lazy sorting algorithm

2009-07-06 Thread Matthias Görgens
The sorted array of bags of unsorted input is a nice idea. However, you have to use the data structure in a single-threaded [1] fashion to obtain the claimed bounds. Here's a pure solution that uses amortization and laziness. import qualified Data.Sequence as S import Data.Sequence (())

[Haskell-cafe] Implementing Las Vegas algorithms in Haskell

2009-07-06 Thread Matthias Görgens
A Las Vegas algorithm, like randomized quicksort, uses a source of randomness to make certain decisions. However its output is unaffected by the randomness. So a function f :: RandomGen g = g - a - b implementing a Las-Vegas-Algorithm 'looks' like a pure function, ignoring its first argument

[Haskell-cafe] Re: what about moving the record system to an addendum?

2009-07-06 Thread John Meacham
Well, without a replacement, it seems odd to remove it. Also, Haskell currently doesn't _have_ a record syntax (I think it was always a misnomer to call it that) it has 'labeled fields'. None of the proposed record syntaxes fit the same niche as labeled fields so I don't see them going away even

Re: [Haskell-cafe] Re: Could FFI support pass-by-value of structs?

2009-07-06 Thread John Meacham
On Thu, Jul 02, 2009 at 03:01:48AM +0400, Bulat Ziganshin wrote: Hello Duncan, Thursday, July 2, 2009, 2:57:29 AM, you wrote: You don't need it to be the same between Windows and Unix, it just has to be standard on each platform, which it is. There are really only two ABIs in common

Re: [Haskell-cafe] golf, predicate check function for MonadPlus (was Re: How to read safely?)

2009-07-06 Thread Dan Doel
On Thursday 02 July 2009 6:36:09 am Jon Fairbairn wrote: check :: (MonadPlus m) = (a - Bool) - a - m a check p a | p a = return a | otherwise = mzero I tried Hoogling for a function like check, but couldn't find it. Surely there's one in a library somewhere? It looks useful to me.

Re: [Haskell-cafe] Implementing Las Vegas algorithms in Haskell

2009-07-06 Thread Luke Palmer
2009/7/6 Matthias Görgens matthias.goerg...@googlemail.com A Las Vegas algorithm, like randomized quicksort, uses a source of randomness to make certain decisions. However its output is unaffected by the randomness. So a function f :: RandomGen g = g - a - b implementing a

[Haskell-cafe] BostonHaskell: Next meeting - July 16th at MIT CSAIL Reading Room (32-G882)

2009-07-06 Thread Ravi Nanavati
I'm pleased to announce the July meeting of the Boston Area Haskell Users' Group. Based on the feedback from the June meeting and the constraints of our speakers, the July meeting has been scheduled for Thursday, July 16th from 6:30pm - 8:30pm. Like the June meeting, it will be held in the MIT

Re: [Haskell-cafe] Implementing Las Vegas algorithms in Haskell

2009-07-06 Thread Jason Dagit
2009/7/6 Matthias Görgens matthias.goerg...@googlemail.com A Las Vegas algorithm, like randomized quicksort, uses a source of randomness to make certain decisions. However its output is unaffected by the randomness. So a function f :: RandomGen g = g - a - b implementing a

Re: [Haskell-cafe] golf, predicate check function for MonadPlus (was Re: How to read safely?)

2009-07-06 Thread Antoine Latter
On Mon, Jul 6, 2009 at 8:49 PM, Dan Doeldan.d...@gmail.com wrote: I've often noticed the need for a similar function in conjunction with unfoldr:  -- This is overly general for unfoldr, but it lines up with check  stopAt :: (MonadPlus m) = (a - Bool) - (a - b) - a - m b  stopAt p f x    |