[Haskell-cafe] Haskell Weekly News: Issue 252

2012-11-28 Thread Daniel Santa Cruz
Welcome to issue 252 of the HWN, an issue covering crowd-sourced bits of information about Haskell from around the web. This issue covers the week of November 18 to 24, 2012. Quotes of the Week * rwbarton: edwardk now has Lens under Control * atriq: My son looks a bit like me, he can put a

Re: [Haskell-cafe] delete http://www.haskell.org/haskellwiki/Haskell_IDE

2012-11-28 Thread Conrad Parker
On 29 November 2012 01:08, Roman Beslik wrote: > Hi. There is more verbose page http://www.haskell.org/haskellwiki/IDEs . I > registered on http://www.haskell.org/haskellwiki/ , but have not found the > "Delete Page" command, wiki software help pages, or feedback channel, so I'm > writing here. I

Re: [Haskell-cafe] Why Kleisli composition is not in the Monad signature?

2012-11-28 Thread Ben Franksen
Dan Doel wrote: > On Tue, Oct 16, 2012 at 10:37 AM, AUGER Cédric wrote: >> join IS the most important from the categorical point of view. >> In a way it is natural to define 'bind' from 'join', but in Haskell, it >> is not always possible (see the Monad/Functor problem). >> >> As I said, from the

Re: [Haskell-cafe] Why Kleisli composition is not in the Monad signature?

2012-11-28 Thread Ben Franksen
Tony Morris wrote: > As a side note, I think a direct superclass of Functor for Monad is not > a good idea, just sayin' > > class Functor f where > fmap :: (a -> b) -> f a -> f b > > class Functor f => Apply f where > (<*>) :: f (a -> b) -> f a -> f b > > class Apply f => Bind f where > (=

[Haskell-cafe] A big hurray for lambda-case (and all the other good stuff)

2012-11-28 Thread Ben Franksen
Hi Everyone just wanted to drop by to say how much I like the new lambda case extension. I use it all the time and I just *love* how it relieves me from conjuring up dummy variables, which makes teh code not only esier to write but also to read. A big, huge thank you to the ghc developers. Thi

Re: [Haskell-cafe] Can a GC delay TCP connection formation?

2012-11-28 Thread Neil Davies
No - the difference is 6.5ms each way On 28 Nov 2012, at 14:44, Alexander Kjeldaas wrote: > > Jeff, this is somewhat off topic, but interesting. Are "telehouse" and AWS > physically close? Was this latency increase not expected due to geography? > > Alexander > > On 28 November 2012 06:

Re: [Haskell-cafe] How can I avoid buffered reads?

2012-11-28 Thread Leon Smith
If you have rdrand, there is no need to build your own PRNG on top of rdrand. RdRand already incorporates one so that it can produce random numbers as fast as they can be requested, and this number is continuously re-seeded with the on-chip entropy source. It would be nice to have a little mor

Re: [Haskell-cafe] Can a GC delay TCP connection formation?

2012-11-28 Thread Nicolas Wu
On Wed, Nov 28, 2012 at 8:36 PM, Jeff Shaw wrote: > On 11/27/2012 4:59 PM, Nicolas Wu wrote: > I pulled the latest version of HDBC-odbc, and it appears to be working MUCH > better than before. I now have 0% timeouts from httperf with 50 > connections/second and timeout set to 0.1 seconds. It's loo

Re: [Haskell-cafe] How can I avoid buffered reads?

2012-11-28 Thread Vincent Hanquez
On 11/28/2012 09:31 PM, Leon Smith wrote: Quite possibly, entropy does seem to be a pretty lightweight dependency... Though doesn't recent kernels use rdrand to seed /dev/urandom if it's available? So /dev/urandom is the most portable source of random numbers on unix systems, though rdran

Re: [Haskell-cafe] How can I avoid buffered reads?

2012-11-28 Thread Leon Smith
Quite possibly, entropy does seem to be a pretty lightweight dependency... Though doesn't recent kernels use rdrand to seed /dev/urandom if it's available? So /dev/urandom is the most portable source of random numbers on unix systems, though rdrand does have the advantage of avoiding system ca

Re: [Haskell-cafe] Can a GC delay TCP connection formation?

2012-11-28 Thread Jeff Shaw
On 11/27/2012 4:59 PM, Nicolas Wu wrote: Hi, I'm the maintainer of HDBC. I haven't yet released this code since it hasn't yet been fully tested. However, if you're happy with it, I'll push the version with proper ffi bindings up to Hackage. Nick Nick, I pulled the latest version of HDBC-odbc,

Re: [Haskell-cafe] delete http://www.haskell.org/haskellwiki/Haskell_IDE

2012-11-28 Thread Gwern Branwen
On Wed, Nov 28, 2012 at 3:24 PM, Roman Beslik wrote: > A humble link "What links here" to the right will help you find those pages. Only for wikipages, nowhere else on the Internet. -- gwern http://www.gwern.net ___ Haskell-Cafe mailing list Haskell-

Re: [Haskell-cafe] delete http://www.haskell.org/haskellwiki/Haskell_IDE

2012-11-28 Thread Roman Beslik
A humble link "What links here" to the right will help you find those pages. On 28.11.12 21:53, Brent Yorgey wrote: is probably not a good idea anyway -- what if there are other pages that link to it? On Wed, Nov 28, 2012 at 07:08:16PM +0200, Roman Beslik wrote: Hi. There is more verbose pag

Re: [Haskell-cafe] How can I avoid buffered reads?

2012-11-28 Thread Bardur Arantsson
On 11/28/2012 08:38 PM, Leon Smith wrote: > I have some code that reads (infrequently) small amounts of data from > /dev/urandom, and because this is pretty infrequent, I simply open the > handle and close it every time I need some random bytes. > > The problem is that I recently discovered that

Re: [Haskell-cafe] Can not use ST monad with polymorphic function

2012-11-28 Thread MigMit
Yes, monomorphism. "do" binding requires your fold'' to be of some monomorphic type, but runST requires some polymorphism. If you want, you can use special type like that: data FoldSTVoid = FoldSTVoid {runFold :: forall a. (Int -> ST a ()) -> ST a ()} fold :: Monad m => (Int -> m ()) -> m () fo

Re: [Haskell-cafe] delete http://www.haskell.org/haskellwiki/Haskell_IDE

2012-11-28 Thread Brent Yorgey
On Wed, Nov 28, 2012 at 07:08:16PM +0200, Roman Beslik wrote: > Hi. There is more verbose page > http://www.haskell.org/haskellwiki/IDEs . I registered on > http://www.haskell.org/haskellwiki/ , but have not found the "Delete > Page" command, wiki software help pages, or feedback channel, so I'm >

Re: [Haskell-cafe] How can I avoid buffered reads?

2012-11-28 Thread Thomas DuBuisson
As an alternative, If there existed a Haskell package to give you fast cryptographically secure random numbers or use the new Intel RDRAND instruction (when available) would that interest you? Also, what you are doing is identical to the "entropy" package on hackage, which probably suffers from th

[Haskell-cafe] How can I avoid buffered reads?

2012-11-28 Thread Leon Smith
I have some code that reads (infrequently) small amounts of data from /dev/urandom, and because this is pretty infrequent, I simply open the handle and close it every time I need some random bytes. The problem is that I recently discovered that, thanks to buffering within GHC, I was actually

Re: [Haskell-cafe] OpenAL - compiling problem

2012-11-28 Thread Stephen Tetley
I think OpenAL is now unmaintained. You could try to find AndrewMiller who updated the last version, otherwise you might have to patch it yourself or ask a developer of a dependent package if they would consider pushing another "unmaintained" release to Hackage. ___

Re: [Haskell-cafe] OpenAL - compiling problem

2012-11-28 Thread Gary Klindt
On 11/28/2012 07:01 PM, Stephen Tetley wrote: Hi Gary Which version of GHC are you using? My suspicion is that ALCdevice might be a newtype falling foul of recent changes to GHC... v7.4.1: "GHC now requires, as per the standard, that if a newtype is used in an FFI declaration, then the constr

Re: [Haskell-cafe] OpenAL - compiling problem

2012-11-28 Thread Stephen Tetley
Hi Gary Which version of GHC are you using? My suspicion is that ALCdevice might be a newtype falling foul of recent changes to GHC... v7.4.1: "GHC now requires, as per the standard, that if a newtype is used in an FFI declaration, then the constructor for that type must be in scope. For now you

[Haskell-cafe] computation over containers, greatly simplified notation.

2012-11-28 Thread Takayuki Muranushi
Dear all, I came up with an idea to greatly simplify some kinds of array computations. It should work well with many kinds of arrays. Is this new? https://gist.github.com/4162375 These few days, I've been trying to rewrite a hydrodynamic simulation code that used Data.Vector (~250 lines), to R

[Haskell-cafe] Can not use ST monad with polymorphic function

2012-11-28 Thread Dmitry Kulagin
Hi Cafe, I try to implement some sort of monadic fold, where traversing is polymorphic over monad type. The problem is that the code below does not compile. It works with any monad except for ST. I suspect that monomorphism is at work here, but it is unclear for me how to change the code to make i

[Haskell-cafe] delete http://www.haskell.org/haskellwiki/Haskell_IDE

2012-11-28 Thread Roman Beslik
Hi. There is more verbose page http://www.haskell.org/haskellwiki/IDEs . I registered on http://www.haskell.org/haskellwiki/ , but have not found the "Delete Page" command, wiki software help pages, or feedback channel, so I'm writing here. ___ Haske

Re: [Haskell-cafe] Equality test between types that returns type-level Bool ?

2012-11-28 Thread Takayuki Muranushi
By tracing how unittyped produced the 'True-s and 'False-s in the error messages, and by Oleg's lecture, > 1 meter + 5 second :17:9: Couldn't match type 'False with 'True When using functional dependencies to combine UnitTyped.And 'False 'False 'False, arising from the depen

Re: [Haskell-cafe] Can a GC delay TCP connection formation?

2012-11-28 Thread Alexander Kjeldaas
Jeff, this is somewhat off topic, but interesting. Are "telehouse" and AWS physically close? Was this latency increase not expected due to geography? Alexander On 28 November 2012 06:21, Neil Davies wrote: > Jeff > > Are you certain that all the delay can be laid at the GHC runtime? > > How mu

[Haskell-cafe] SOX - play simple

2012-11-28 Thread Gary Klindt
Dear Cafe, after installing the Sox library (cabal install sox) I wanted to let run a minimal example from http://hackage.haskell.org/packages/archive/sox/0.2.2.2/doc/html/Sound-Sox-Play.html module Main where import Sound.Sox.Play import Sound.Sox.Signal.List --import Sound.Sox.Option.Format

Re: [Haskell-cafe] How to incrementally update list

2012-11-28 Thread Branimir Maksimovic
Thank you very much! That solved it ;)I had to put explicit type signature in front of advance in order to compile From: cgae...@uwaterloo.ca Date: Wed, 28 Nov 2012 08:01:38 -0500 Subject: Re: [Haskell-cafe] How to incrementally update list To: edwards.b...@gmail.com CC: bm...@hotmail.com; haskel

[Haskell-cafe] OpenAL - compiling problem

2012-11-28 Thread Gary Klindt
Dear Haskell Cafe, I tried installing the haskell openal library via cabal install openal I get the following error: ... [ 7 of 30] Compiling Sound.OpenAL.ALC.QueryUtils ( Sound/OpenAL/ALC/QueryUtils.hs, dist/build/Sound/OpenAL/ALC/QueryUtils.o ) Sound/OpenAL/ALC/QueryUtils.hs:66:1: Unac

Re: [Haskell-cafe] How to incrementally update list

2012-11-28 Thread Kim-Ee Yeoh
> I want to incrementally update list lot of times, but don't know how to do this. Are you using the right data structure for the job? Maybe you want an array instead? -- Kim-Ee On Wed, Nov 28, 2012 at 6:43 PM, Branimir Maksimovic wrote: > Problem is following short program: > list = [1,2,3,4

Re: [Haskell-cafe] How to incrementally update list

2012-11-28 Thread Clark Gaebel
Here's a version that works: *import Control.DeepSeq* list = [1,2,3,4,5] advance l = *force $* map (\x -> x+1) l run 0 s = s run n s = run (n-1) $ advance s main = do let s = run 5000 list putStrLn $ show s The problem is that you build of a huge chain of updates to the l

Re: [Haskell-cafe] How to incrementally update list

2012-11-28 Thread Benjamin Edwards
TCO + strictnesses annotations should take care of your problem. On 28 Nov 2012 11:44, "Branimir Maksimovic" wrote: > Problem is following short program: > list = [1,2,3,4,5] > > advance l = map (\x -> x+1) l > > run 0 s = s > run n s = run (n-1) $ advance s > > main = do > let s = run

[Haskell-cafe] How to incrementally update list

2012-11-28 Thread Branimir Maksimovic
Problem is following short program:list = [1,2,3,4,5] advance l = map (\x -> x+1) l run 0 s = srun n s = run (n-1) $ advance s main = dolet s = run 5000 listputStrLn $ show s I want to incrementally update list lot of times, but don't knowhow to do this.Since Haskell does not

Re: [Haskell-cafe] Can a GC delay TCP connection formation?

2012-11-28 Thread Neil Davies
Jeff Are you certain that all the delay can be laid at the GHC runtime? How much of the end-to-end delay budget is being allocated to you? I recently moved a static website from a 10-year old server in telehouse into AWS in Ireland and watched the access time (HTTP GET to check time on top ind

Re: [Haskell-cafe] Conduit and pipelined protocol processing using a threadpool

2012-11-28 Thread Nicolas Trangez
On Wed, 2012-11-28 at 09:17 +0200, Michael Snoyman wrote: > > > > On Tue, Nov 27, 2012 at 7:25 PM, Nicolas Trangez > wrote: > Michael, > > On Tue, 2012-11-27 at 17:14 +0200, Michael Snoyman wrote: > > I think the stm-conduit package[1] may be helpful for this >