[Haskell-cafe] Trouble with numbers

2008-02-29 Thread Lloyd Smith
I have a question about how numeric classes and type checking works. I have two functions that I think should behave the same but don't. -- I want to split n things up using a given list of fractions -- for example allocate' 100 [1/3,1/3,1/3] -- [33,33,33] allocate' n fs = vs where vs = map

Re: [Haskell-cafe] Trouble with numbers

2008-02-29 Thread Ryan Ingram
The important thing is the type of floor: floor :: (Integral b, RealFrac a) = a - b That is, if you have a real, fractional type, and you apply floor to it, you'll get some integral type. If you look at allocate', you'll see allocate' :: (RealFrac in, Integral out) = in - [in] - [out] When you

Re: [Haskell-cafe] Trouble with numbers

2008-02-29 Thread Stuart Cook
On Fri, Feb 29, 2008 at 7:09 PM, Lloyd Smith [EMAIL PROTECTED] wrote: I mixed up my types when finding the allocated and unallocated, but I am not sure why it produces an error when unallocated and allocated are never used? Shouldn't the two functions be compiled down to the same thing?

Re: [Haskell-cafe] Re: ANN: Hoogle 3.1

2008-02-29 Thread Henning Thielemann
On Fri, 29 Feb 2008, Neil Mitchell wrote: Hi Steve, Would you consider adding auto-complete feature on Hoogle in the forth coming release? http://wiki.script.aculo.us/scriptaculous/show/Ajax.Autocompleter I am slightly hoping that I'll be able to remove the Search button entirely, and

Re: [Haskell-cafe] Re: ANN: Hoogle 3.1

2008-02-29 Thread Neil Mitchell
Hi Henning, For the WWW version of Hoogle this means that data must be transmitted constantly and I think that rises a privacy problem. I don't want that my typing behaviour can be observed and analysed somewhere. Such technique would also require JavaScript which is disabled in browsers

Re: [Haskell-cafe] cabal errors

2008-02-29 Thread Duncan Coutts
On Thu, 2008-02-28 at 07:10 -0500, Kristofer Buffington wrote: Hi I installed ghc 6.8 from source and I've been installing packages from hackage. I'm not sure when the problem started, but I've been getting this error trying to install any cabal package.. accept apparently, Cabal itself.

Re: [Haskell-cafe] ANN: Hoogle 3.1

2008-02-29 Thread Steve Lihn
Interesting to know people are looking for \where\. As a fairly new Haskeller, I bumped into frequent indentation issues (if-then-else, case, where, let, do, etc) and sometimes not sure where to place \where\ properly. Maybe beginners are having problem with syntax more than other things and they

Re: [Haskell-cafe] ANN: Hoogle 3.1

2008-02-29 Thread Neil Mitchell
Hi Interesting to know people are looking for \where\. As a fairly new Haskeller, I bumped into frequent indentation issues (if-then-else, case, where, let, do, etc) and sometimes not sure where to place \where\ properly. Maybe beginners are having problem with syntax more than other

Re: [Haskell-cafe] cabal errors

2008-02-29 Thread Ross Paterson
On Thu, Feb 28, 2008 at 07:10:03AM -0500, Kristofer Buffington wrote: I installed ghc 6.8 from source and I've been installing packages from hackage. I'm not sure when the problem started, but I've been getting this error trying to install any cabal package.. accept apparently, Cabal itself.

[Haskell-cafe] Re: ANN: Hoogle 3.1

2008-02-29 Thread Aaron Denney
On 2008-02-29, Neil Mitchell [EMAIL PROTECTED] wrote: Hi Interesting to know people are looking for \where\. As a fairly new Haskeller, I bumped into frequent indentation issues (if-then-else, case, where, let, do, etc) and sometimes not sure where to place \where\ properly. Maybe

Re: [Haskell-cafe] to stimulate discussion concerning where Haskell is going .. ...

2008-02-29 Thread Galchin Vasili
1) http://research.sun.com/spotlight/2007/2007-08-13_transactional_memory.html 2) http://www.jamesward.org/wordpress/2007/11/29/can-sun-monetize-java-with-transactional-memory/ 3)http://research.sun.com/scalable/pubs/index.html http://research.sun.com/scalable/ On 2/29/08, Benjamin L.

[Haskell-cafe] Re: static constants -- ideas?

2008-02-29 Thread Don Stewart
jay: Don Stewart [EMAIL PROTECTED]: jay: Don Stewart [EMAIL PROTECTED]: jay: I also have constants that are too large to compile. I am resigned to loading them from data files--other solutions seem even worse. ... Data.Binary eases the irritation somewhat. Did you try

[Haskell-cafe] Connection helpers: for people interested in network code

2008-02-29 Thread Adam Langley
I generally find that I'm wrapping sockets in the same functions a lot and now I'm looking writings code which works with both Sockets and SSL connections. So I wrote a module, presumptuously called Network.Connection, although I'm not actually going to try and take that name (even in Hackage)

[Haskell-cafe] Re: static constants -- ideas?

2008-02-29 Thread Don Stewart
jay: Don Stewart [EMAIL PROTECTED]: jay: Don Stewart [EMAIL PROTECTED]: jay: Don Stewart [EMAIL PROTECTED]: jay: I also have constants that are too large to compile. I am resigned to loading them from data files--other solutions seem even worse. ... Data.Binary eases

[Haskell-cafe] Announce: category-extras 0.1

2008-02-29 Thread Dan Doel
Hello everyone, While fooling about with generalized tries a night or two ago, I found myself once again interacting with fixed points of shape functors and the like, and so decided it was time to finish cabalizing David Menendez' excellent category theory inspired modules.[1] So, it is my

[Haskell-cafe] Generating a random list

2008-02-29 Thread Milos Hasan
Hi, so let's say I want to generate a list of N random floats. The elegant way of doing it would be to create an infinite lazy list of floats and take the first N, but for N = 1,000,000 or more, this overflows the stack. The reason is apparently that the take function is not tail-recursive,

Re: [Haskell-cafe] Generating a random list

2008-02-29 Thread Luke Palmer
On Sat, Mar 1, 2008 at 6:50 AM, Milos Hasan [EMAIL PROTECTED] wrote: Hi, so let's say I want to generate a list of N random floats. The elegant way of doing it would be to create an infinite lazy list of floats and take the first N, but for N = 1,000,000 or more, this overflows the

Re: [Haskell-cafe] Generating a random list

2008-02-29 Thread Bryan O'Sullivan
Milos Hasan wrote: so let's say I want to generate a list of N random floats. The elegant way of doing it would be to create an infinite lazy list of floats and take the first N, but for N = 1,000,000 or more, this overflows the stack. The reason is apparently that the take function is not