Re: [Haskell-cafe] GHC 6.6.1 and SELinux issues

2007-08-29 Thread Alexander Vodomerov
On Tue, Aug 28, 2007 at 08:53:05PM -0600, Stuart Jansen wrote: On Wed, 2007-08-29 at 00:59 +0400, Alexander Vodomerov wrote: In what domain do you run GHC? Sorry about that, should've dug deeper. And here we have the difference: $ ls -Z /usr/lib/ghc-6.6.1/ghc-6.6.1 -rwxr-xr-x root root

Re: [Haskell-cafe] Serial Communications in Haskell

2007-08-29 Thread Esa Ilari Vuokko
On 8/29/07, Ronald Guida [EMAIL PROTECTED] wrote: I'm on a Windows box and I'm looking for a way to talk to a serial port (for example, RS-232) from Haskell. I couldn't find a library to do this, so I am wondering how to create one. I have a fairly thorough understanding of how to open and

Re: [Haskell-cafe] Serial Communications in Haskell

2007-08-29 Thread Bas van Dijk
On 8/29/07, Esa Ilari Vuokko [EMAIL PROTECTED] wrote: On 8/29/07, Ronald Guida [EMAIL PROTECTED] wrote: I'm on a Windows box and I'm looking for a way to talk to a serial port (for example, RS-232) from Haskell. I couldn't find a library to do this, so I am wondering how to create one.

Re: [Haskell-cafe] cabal install of HDBC-odbc fails on ghc 6.7, -I flag causes problems

2007-08-29 Thread Thomas Hartman
Ah ok, so I did echo :main build -v3 | /usr/local/bin/ghci-6.7.20070816 Setup.hs 1build.out 2build.err and this does indeed seem more informative. advice? build.err: [1 of 1] Compiling Main ( Setup.hs, interpreted ) ghc-6.6.1: unrecognised flags: -I Usage: For basic

Re: [Haskell-cafe] runInteractiveCommand behaves differently on linux and windows

2007-08-29 Thread Thomas Hartman
I probably should have also mentioned that the fail on windows is for me ssh-ed to that box remotely, where the sshd program is cygwin. Thomas Hartman [EMAIL PROTECTED] Sent by: [EMAIL PROTECTED] 08/28/2007 06:03 PM To haskell-cafe@haskell.org cc Subject [Haskell-cafe]

Re: [Haskell-cafe] GHC 6.6.1 and SELinux issues

2007-08-29 Thread Bryan O'Sullivan
Alexander Vodomerov wrote: I've put GHC in unconfined_execmem_t and it started to work fine. But the problem is not in GHC -- it is in programs compiled by GHC. They also require exec/write memory. Only root can grant unconfined_execmem privileges, so simple user can not run binaries compiled

[Haskell-cafe] trouble compiling regex posix head (I think 0.92) on ghc 6.7

2007-08-29 Thread Thomas Hartman
I'm trying to compile regex-posix on ghc 6.7. (Ultimate goal: happs on 6.7). First, I patched by changing the cabal file to be compatible with the new libraries broken out of base. I also had to add HsRegexPosixConfig.h to include/regex (I just copied it from somewhere else on my hard drive

Re: [Haskell-cafe] GHC 6.6.1 and SELinux issues

2007-08-29 Thread Alexander Vodomerov
On Wed, Aug 29, 2007 at 08:41:12AM -0700, Bryan O'Sullivan wrote: The underlying problem is harder to fix: the default SELinux policy doesn't allow PROT_EXEC pages to be mapped with PROT_WRITE, for obvious reasons. The solution is expensive in terms of address space and TLB entries: map

Re: [Haskell-cafe] GHC 6.6.1 and SELinux issues

2007-08-29 Thread Stefan O'Rear
On Wed, Aug 29, 2007 at 10:40:41PM +0400, Alexander Vodomerov wrote: On Wed, Aug 29, 2007 at 08:41:12AM -0700, Bryan O'Sullivan wrote: The underlying problem is harder to fix: the default SELinux policy doesn't allow PROT_EXEC pages to be mapped with PROT_WRITE, for obvious reasons.

[Haskell-cafe] defining mapPairs function

2007-08-29 Thread Alexteslin
Hello, I just came across with this question on the exam and can not think of implementing it. mapPair :: (a - a - a) - [a] - [a] such that mapPairs f [x1, x2, x3, x4...] = [f x1 x2, f x3 x4,...] and if the list contains an odd number of elements, the last one is kept unchanged, for example

Re: [Haskell-cafe] defining mapPairs function

2007-08-29 Thread Alexteslin
Alexteslin wrote: Hello, I just came across with this question on the exam and can not think of implementing it. mapPair :: (a - a - a) - [a] - [a] such that mapPairs f [x1, x2, x3, x4...] = [f x1 x2, f x3 x4,...] and if the list contains an odd number of elements, the last one

Re: [Haskell-cafe] defining mapPairs function

2007-08-29 Thread Neil Mitchell
Hi Alexteslin, I just came across with this question on the exam and can not think of implementing it. mapPair :: (a - a - a) - [a] - [a] such that mapPairs f [x1, x2, x3, x4...] = [f x1 x2, f x3 x4,...] I would implement this using direct recursion. As a starting point, the standard

Re: [Haskell-cafe] defining mapPairs function

2007-08-29 Thread Neil Mitchell
Hi mapPairs :: (a - a - a) - [a] - [a] mapPairs f [x] = [x] mapPairs f [] = [] mapPairs f (x:xs) = f x (head xs) : mapPairs f (tail xs) It looks like it works, but you can get a better version by changing the last line: mapPairs f (x:y:zs) = ... - left as an exercise, but no need for head

[Haskell-cafe] Looking for suggestions to improve my algorithm

2007-08-29 Thread David Frey
Hello Haskellers, I have been trying to learn a bit about Haskell by solving Project Euler problems. For those of you who don't know what Project Euler is, see http://projecteuler.net After solving problem 21, which is related to amicable pairs, I decided to attempt problem 95 since it is an

Re: [Haskell-cafe] defining mapPairs function

2007-08-29 Thread Brent Yorgey
On 8/29/07, Alexteslin [EMAIL PROTECTED] wrote: Hello, I just came across with this question on the exam and can not think of implementing it. Wait, is this an exam for a class you're taking? Or just a problem from an exam that you're trying to solve for fun? If the former, it really

[Haskell-cafe] compiling happs under 6.7 (unbound implicit parameter error)

2007-08-29 Thread Thomas Hartman
After much progress and learning, I'm stuck again trying to get happs to compile under ghc 6.7. (Hoping that running happs under the new ghc debugger will help me understand it better.) I was trying to compile from the stable 8.8 version, unzipped and with just a few modifications. (see

Re: [Haskell-cafe] Looking for suggestions to improve my algorithm

2007-08-29 Thread Brent Yorgey
On 8/29/07, David Frey [EMAIL PROTECTED] wrote: Hello Haskellers, I have been trying to learn a bit about Haskell by solving Project Euler problems. For those of you who don't know what Project Euler is, see http://projecteuler.net After solving problem 21, which is related to amicable

Re: [Haskell-cafe] Looking for suggestions to improve my algorithm

2007-08-29 Thread Daniel Fischer
Am Mittwoch, 29. August 2007 23:12 schrieb David Frey: Hello Haskellers, I have been trying to learn a bit about Haskell by solving Project Euler problems. Good :) For those of you who don't know what Project Euler is, see http://projecteuler.net After solving problem 21, which is

Re: [Haskell-cafe] Looking for suggestions to improve my algorithm

2007-08-29 Thread Daniel Fischer
Am Donnerstag, 30. August 2007 01:08 schrieb Brent Yorgey: Hi David, Project Euler is a good way to learn some Haskell, although it does tend to give you a crash course in understanding laziness, efficiency and such in Haskell (whether that's good or bad depends on your point of view!). All

Re: [Haskell-cafe] Looking for suggestions to improve my algorithm

2007-08-29 Thread Ryan Ingram
The algorithm I would use: Treat the problem as a directed graph of 1 million vertices where each vertex has at most 1 outgoing edge. Each vertex is labeled with a number N(v). For each vertex v, if sum(divisors(N(v))) = 1 million, that vertex has an outgoing edge to vertex v', where N(v') ==

Re: [Haskell-cafe] Haskell on the Playstation 3? :-)

2007-08-29 Thread Tony Sloane
On 26/08/2007, at 10:07 AM, Jeremy Shaw wrote: There is also an old project to port nhc98 to PalmOS -- not sure if it is still active, or how far they got. AFAIK, nothing was ever released. Yes, we were working on this at Macquarie Uni. The project has suffered a bit from a lack of

Re: [Haskell-cafe] Haskell on the Playstation 3? :-)

2007-08-29 Thread Derek Elkins
On Thu, 2007-08-30 at 11:34 +0800, Hugh Perkins wrote: On 8/26/07, Peter Verswyvelen [EMAIL PROTECTED] wrote: Game developers are really struggling to get performance out of the Playstation 3 console. This console has a single PowerPC CPU with 6 Cell SPU coprocessors, all running at 3.3GHz.

Re: [Haskell-cafe] Haskell on the Playstation 3? :-)

2007-08-29 Thread Hugh Perkins
On 8/30/07, Derek Elkins [EMAIL PROTECTED] wrote: Either the language of the graphics card is Turing complete and the answer is yes or the language isn't and the answer is no. Well, a quick google for are graphics cards turing complete? suggests that some nVidia cards are Turing complete, but I

Re: [Haskell-cafe] defining mapPairs function

2007-08-29 Thread Max Vasin
2007/8/30, Neil Mitchell [EMAIL PROTECTED]: Hi mapPairs :: (a - a - a) - [a] - [a] mapPairs f [x] = [x] mapPairs f [] = [] mapPairs f (x:xs) = f x (head xs) : mapPairs f (tail xs) It looks like it works, but you can get a better version by changing the last line: mapPairs f (x:y:zs)

Re: [Haskell-cafe] Haskell on the Playstation 3? :-)

2007-08-29 Thread Brandon S. Allbery KF8NH
On Aug 29, 2007, at 23:34 , Hugh Perkins wrote: Hmmm, random thought along similar lines, I mean I know the answer to this thought is no, but I'm curious: could we get Haskell to run on a graphics card??? I thought someone had done that recently as a graduate thesis. -- brandon s. allbery

Re: [Haskell-cafe] Haskell on the Playstation 3? :-)

2007-08-29 Thread Dan Piponi
On 8/29/07, Hugh Perkins [EMAIL PROTECTED] wrote: Well, a quick google for are graphics cards turing complete? suggests that some nVidia cards are Turing complete http://developer.nvidia.com/object/cuda.html It's a C compiler with multiprocessor streaming extensions that targets nvidia cards.

Re: [Haskell-cafe] Haskell on the Playstation 3? :-)

2007-08-29 Thread Miguel
Hmmm, random thought along similar lines, I mean I know the answer to this thought is no, but I'm curious: could we get Haskell to run on a graphics card??? I mean, I'm guessing the answer is no (not a difficult guess ;-) ), but curious what it would take to make a graphics card able to run