[Haskell-cafe] Re: HGL on Mac OS X

2007-04-01 Thread apfelmus
Ruben Zilibowitz wrote: Has anyone got the GHC module HGL to work on Mac OS X? If so I'd be very interested to know how. As HGL uses X-Windows, you have to start /Programs/Utilities/X11.app before using HGL. Here is a terminal transcript of testing whether HGL works in ghci. localhost:~

Re: [Haskell-cafe] Why the Prelude must die

2007-04-01 Thread Isaac Dupree
-BEGIN PGP SIGNED MESSAGE- Hash: SHA1 David House wrote: On 24/03/07, Stefan O'Rear [EMAIL PROTECTED] wrote: This is a ranty request for comments, and the more replies the better. Without responding to any particular comment, my opinion is that we should have a minimal Prelude with

[Haskell-cafe] ghc-6.7.20070330 on Mac OS X

2007-04-01 Thread Ruben Zilibowitz
I am trying to build this version of GHC on Mac OS X. I'm currently using GHC 6.6. The build is failing with the following error: ghci/InteractiveUI.hs:69:7: Could not find module `System.Console.Readline': Use -v to see a list of the files searched for. ghc: 310591992 bytes, 51 GCs,

Re: [Haskell-cafe] Unresolved overloading error

2007-04-01 Thread David House
On 31/03/07, Bryan Burgers [EMAIL PROTECTED] wrote: As a matter of style suggestion, it might make 'binom' more clear if you use 'div' as an infix operator: binom n j = (fac n) `div` ( fac j * fac (n - j) ) You can even drop the first set of parentheses: binom n r = fac n `div` (fac r * fac

[Haskell-cafe] Josephus problem and style

2007-04-01 Thread Anthony Chaumas-Pellet
Hello, I've written a function to compute the general Josephus problem, giving both the number of the survivor and the order in which the others are killed. However, I am not overly fond of my actual Haskell implementation, so I would like some comments on elegance. My current function is as

Re: [Haskell-cafe] Josephus problem and style

2007-04-01 Thread Ross Paterson
On Sun, Apr 01, 2007 at 06:24:23PM +0200, Anthony Chaumas-Pellet wrote: I've written a function to compute the general Josephus problem, giving both the number of the survivor and the order in which the others are killed. However, I am not overly fond of my actual Haskell implementation, so I

[Haskell-cafe] String to Word64 Conversion

2007-04-01 Thread Ian Sefferman
I've been spending a lot of time trying to find a clean way to convert from a String to a Word64 for the Crypto library. Specifically, we're trying to encrypt the strings with Blowfish. The type for the encrypt function is: encrypt :: (Integral a) = a - Word64 - Word64 I assume I would want

Re: [Haskell-cafe] Josephus problem and style

2007-04-01 Thread Paul Hudak
Here's a solution that I think is a bit more elegant. -Paul josephus n k = let loop xs = let d:r = drop (k-1) xs in d : loop (filter (/= d) r) in take n (loop (cycle [1..n])) Anthony Chaumas-Pellet wrote: Hello, I've written a function to compute the general

Re: [Haskell-cafe] Josephus problem and style

2007-04-01 Thread Duncan Coutts
On Sun, 2007-04-01 at 16:46 -0400, Paul Hudak wrote: Here's a solution that I think is a bit more elegant. -Paul josephus n k = let loop xs = let d:r = drop (k-1) xs in d : loop (filter (/= d) r) in take n (loop (cycle [1..n])) Lovely. .. must.. resist

Re: [Haskell-cafe] Data.ByteStream.Char8.words performance

2007-04-01 Thread Duncan Coutts
On Sun, 2007-04-01 at 17:25 +0200, Thomas Schilling wrote: On 31 mar 2007, at 04.09, Duncan Coutts wrote: The ByteString libs was more-or-less the first high performance thing that we wrote and we've learnt plenty more since then. I think there's a good deal more performance too eek

Re: [Haskell-cafe] Josephus problem and style

2007-04-01 Thread Ross Paterson
On Mon, Apr 02, 2007 at 09:12:17AM +1000, Duncan Coutts wrote: On Sun, 2007-04-01 at 16:46 -0400, Paul Hudak wrote: Here's a solution that I think is a bit more elegant. -Paul josephus n k = let loop xs = let d:r = drop (k-1) xs in d : loop (filter (/=

Re: [Haskell-cafe] Josephus problem and style

2007-04-01 Thread Ross Paterson
Here's the sequence version: import Data.Sequence as Seq josephus k n = reduce (fromList [1..n]) where reduce xs | Seq.null xs = [] | otherwise = case viewl (rotate (k-1) xs) of x : xs' - x : reduce xs' rotate i xs = back front

Re: [Haskell-cafe] ghc-6.7.20070330 on Mac OS X

2007-04-01 Thread Ruben Zilibowitz
Hi, I managed to build it eventually using the instructions on: http://hackage.haskell.org/trac/ghc/wiki/Building/MacOSX Sorry to Greg - I accidentally sent this to your personal email address first. Ruben On 02/04/2007, at 4:34 AM, Gregory Wright wrote: Hi Ruben, The GHC wiki also has

[Haskell-cafe] Re: A wish for relaxed layout syntax

2007-04-01 Thread Stefan Monnier
list := '[' item* ';'? ']' Indeed, it's the same idea as the 'else' in do-blocks. Stefan ___ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http://www.haskell.org/mailman/listinfo/haskell-cafe

[Haskell-cafe] Mutable variables eliminated from .NET | Lambda the Ultimate

2007-04-01 Thread Donald Bruce Stewart
As seen on reputable language news site, Lambda the Ultimate. http://lambda-the-ultimate.org/node/2164 Mutable variables eliminated from .NET Redmond, WA: At an unusual press conference held this Sunday morning, Bill Taylor, Microsoft's General Manager of Platform Strategy,

[Haskell-cafe] Memory leak in streaming parser

2007-04-01 Thread Oren Ben-Kiki
I just created an initial version of a streaming parser. This parser is intended to serve as a reference parser for the YAML spec. Efficiency isn't the main concern; the priority was to have it use the BNF productions from the spec without any changes (ok, with tiny, minor, insignificant changes