Re: [Haskell-cafe] Contributing to http-conduit

2012-02-07 Thread Erik de Castro Lopo
Michael Snoyman wrote: > Actually, this is just a setting: you can override with checkStatus[1]. > > [1] > http://hackage.haskell.org/packages/archive/http-conduit/1.2.4/doc/html/Network-HTTP-Conduit.html#v:checkStatus Absolutely! I use that in my http-proxy package [0]. Elegant and easy to use

Re: [Haskell-cafe] Contributing to http-conduit

2012-02-07 Thread Michael Snoyman
On Wed, Feb 8, 2012 at 6:28 AM, Myles C. Maxfield wrote: > I have been looking around at possibly making a Browser module for > Network.HTTP.Conduit on top of Control.Monad.State. I came across this > roadbump: > > In order to implement redirection following, client code must call 'http' > with a

Re: [Haskell-cafe] Loading a texture in OpenGL

2012-02-07 Thread Alex Mason
It's possible ResourceT from the yesod guys could be quite useful. It allows you to manually release things, but also ensures that things are released in case of exceptions. It also supports, from what I can tell, some kind of reference counting for use with multiple threads (the deallocator isn't

Re: [Haskell-cafe] Contributing to http-conduit

2012-02-07 Thread Antoine Latter
On Tue, Feb 7, 2012 at 10:28 PM, Myles C. Maxfield wrote: > I have been looking around at possibly making a Browser module for > Network.HTTP.Conduit on top of Control.Monad.State. I came across this > roadbump: > > In order to implement redirection following, client code must call 'http' > with a

Re: [Haskell-cafe] Loading a texture in OpenGL

2012-02-07 Thread Clark Gaebel
Sounds hairy. Is there any way to get reference counting garbage collection in Haskell? On Tue, Feb 7, 2012 at 9:26 AM, L Corbijn wrote: > On Tue, Feb 7, 2012 at 5:23 AM, Austin Seipp wrote: > > Just to clarify, this guarantee possibly could be made, ghc just doesn't > do > > it now. In the pas

Re: [Haskell-cafe] The State of Testing?

2012-02-07 Thread Thomas Tuegel
On Tue, Feb 7, 2012 at 3:23 PM, Austin Seipp wrote: > If you're writing a library, you need to compile the library with > `-fhpc`, i.e. put it in the library stanza, not the testsuite stanza, > and then you can compile the test program using your library - the > resulting 'tix' file will contain t

Re: [Haskell-cafe] -XPolyKinds and undefined arguments

2012-02-07 Thread John Meacham
Can't you do something like have the kind be unlifted? for instance data Proxy (a :: #) data Type1 :: # data Type2 :: # John On Tue, Feb 7, 2012 at 12:19 PM, Douglas McClean wrote: > There are all sorts of useful functions that would otherwise require > explicit type applications which w

Re: [Haskell-cafe] [Haskell] ANNOUNCE: system-filepath 0.4.5 and system-fileio 0.3.4

2012-02-07 Thread John Meacham
On Tue, Feb 7, 2012 at 4:24 AM, Simon Marlow wrote: > Separately the unix package added support for undecoded FilePaths > (RawFilePath), but unfortunately at the same time we started using a new > extension in GHC 7.4.1 (CApiFFI), which we decided not to document because > it was still experimenta

Re: [Haskell-cafe] network-2.3.0.10 compiled for ghc 7.4.1 windows

2012-02-07 Thread Alberto G. Corona
I switched to Git bash and the runtime error produced by the library is the same. This error may be produced because the configuration it does not detect the netwiorkin related includes such is socket.h. This does not exist neither in the ghc installation neither in GIT/Mingw 2012/2/7 Holger Rei

Re: [Haskell-cafe] The State of Testing?

2012-02-07 Thread Michael Craig
How do you control where the .mix files are generated? GHC is putting them in .hpc/, but I'm getting errors like "hpc: can not find test-0.0.0/Data.Test in ["./dist/hpc/mix/test-0.0.0"]". Mike Craig On Tue, Feb 7, 2012 at 5:12 PM, Ryan Newton wrote: > By the way, has anyone else had trouble w

Re: [Haskell-cafe] Some thoughts on Type-Directed Name Resolution

2012-02-07 Thread Richard O'Keefe
On 8/02/2012, at 2:11 AM, Steve Horne wrote: > On 06/02/2012 23:58, Richard O'Keefe wrote: >> On 4/02/2012, at 12:13 AM, Gábor Lehel wrote: >>> All of this said, record.field is still the most readable, intuitive, >>> and familiar syntax for selecting a field from a record that I know >>> of. >>

Re: [Haskell-cafe] network-2.3.0.10 compiled for ghc 7.4.1 windows

2012-02-07 Thread Holger Reinhardt
I just use the version of MSys that is included with Git [1]. This puts a "Git bash" icon on your desktop which you can then use to build the network library. [1] http://code.google.com/p/msysgit/ 2012/2/7 Alberto G. Corona > Nothing bur a long history of failures. The problem is the > configur

Re: [Haskell-cafe] Some thoughts on Type-Directed Name Resolution

2012-02-07 Thread wren ng thornton
On 2/7/12 4:52 PM, Richard O'Keefe wrote: Anyone who has had occasion to write Fortran in the last 20+ years has had to discover just how quickly you can get used to using 'record%field'. I'm not really a COBOL programmer, but Prolog and Erlang and Smalltalk taught me well that '.' in a programm

Re: [Haskell-cafe] FP activities and researchers in Warwickshire

2012-02-07 Thread Malcolm Wallace
"Fun in the afternoon", a termly gathering of UK FP people, will be in Oxford on 28th Feb. http://sneezy.cs.nott.ac.uk/fun/ On 7/02/2012, at 18:32, Ivan Perez wrote: > Hello, > I recently moved to Kenilworth, Warwickshire, UK, and I'd like > to know if there are meetings, talks, or any FP-rel

Re: [Haskell-cafe] The State of Testing?

2012-02-07 Thread Ryan Newton
By the way, has anyone else had trouble with "cabal test" diverging? I've been running into this issue with cabal 0.10.2, but ONLY in conjunction with GHC 6.12.3. It's hard to make a small reproducer for (and therefore I haven't filed a bug yet), but you can see the below Jenkins run stalled for

Re: [Haskell-cafe] Some thoughts on Type-Directed Name Resolution

2012-02-07 Thread Richard O'Keefe
On 7/02/2012, at 1:41 PM, AntC wrote: > Richard, now you're just being playful. "Half fun and full earnest." I *do* regard 'field OF record' as far more readable, intuitive, &c than 'record.field'. With the number of meanings '.' already has in Haskell, I *do* regard any attempt to overload it

Re: [Haskell-cafe] The State of Testing?

2012-02-07 Thread Austin Seipp
If you're writing a library, you need to compile the library with `-fhpc`, i.e. put it in the library stanza, not the testsuite stanza, and then you can compile the test program using your library - the resulting 'tix' file will contain the library coverage reports. You can link a HPC-built library

Re: [Haskell-cafe] The State of Testing?

2012-02-07 Thread Michael Craig
Thanks for the advice, all. I've got test-framework, quickcheck, and cabal's test-suite all working together nicely. Cabal seems to support using hpc to check test coverage. If I add -fhpc to the ghc-options under the test-suite, I get output like "Test coverage report written to dist/hpc/html/tes

Re: [Haskell-cafe] Evaluating parallel computations in order of finishing (approximately)

2012-02-07 Thread Ryan Newton
In stream processing frameworks this is a (common) non-deterministic merge operation. Because it's nondeterministic it would need to happen in IO: parCompletionOrder :: [a] -> IO [a] But it can be nonblocking (returns immediately, and "lazy IO" happens in the background). The Chan library has

Re: [Haskell-cafe] network-2.3.0.10 compiled for ghc 7.4.1 windows

2012-02-07 Thread Alberto G. Corona
The "problem" this time is in "Configure" : case "$host" in *-mingw32) EXTRA_SRCS="cbits/initWinSock.c, cbits/winSockErr.c, cbits/asyncAccept.c" EXTRA_LIBS=ws2_32 CALLCONV=stdcall ;; *-solaris2*) EXTRA_SRCS="cbits/ancilData.c" EXTRA_LIBS="nsl, socket"

[Haskell-cafe] -XPolyKinds and undefined arguments

2012-02-07 Thread Douglas McClean
There are all sorts of useful functions that would otherwise require explicit type applications which we work around by passing undefined and ignoring its value. (See http://www.haskell.org/pipermail/libraries/2010-October/014742.html for a prior discussion of why this is, how the use of undefined

Re: [Haskell-cafe] network-2.3.0.10 compiled for ghc 7.4.1 windows

2012-02-07 Thread Holger Reinhardt
Did you also change the files in the /cbits/ folder? Because they also check for HAVE_WINSOCK_H. 2012/2/7 Alberto G. Corona > The code is evolving and none of the versions match exactily with the > patch, but substituting HAVE_WINSOCK by HAVE WINSOCK2 in these files > solves the compilation prob

Re: [Haskell-cafe] network-2.3.0.10 compiled for ghc 7.4.1 windows

2012-02-07 Thread Alberto G. Corona
The code is evolving and none of the versions match exactily with the patch, but substituting HAVE_WINSOCK by HAVE WINSOCK2 in these files solves the compilation problem at least in the network 2.3.0.10 version from hackage. However it produces the same undefined references when this library is im

Re: [Haskell-cafe] network-2.3.0.10 compiled for ghc 7.4.1 windows

2012-02-07 Thread Johan Tibell
Note that there are two branches on github, master and stable. You want the latter. On Feb 7, 2012 8:23 AM, "Alberto G. Corona" wrote: > This is quite different. > I don´t know how but I was looking at some other older patch around > the same issue and I supposed that it was the one refered by Yo

[Haskell-cafe] FP activities and researchers in Warwickshire

2012-02-07 Thread Ivan Perez
Hello, I recently moved to Kenilworth, Warwickshire, UK, and I'd like to know if there are meetings, talks, or any FP-related activities going on around here. I contacted somebody at Warwick University but, from what I understood, their Formal Methods group doesn't exist as such any longer and the

Re: [Haskell-cafe] network-2.3.0.10 compiled for ghc 7.4.1 windows

2012-02-07 Thread Alberto G. Corona
This is quite different. I don´t know how but I was looking at some other older patch around the same issue and I supposed that it was the one refered by Yohan Tibell. I´ll try your patch. Thanks!. 2012/2/7 Holger Reinhardt : > Hi, > > (I submitted the patch that Johan linked to) > Network/Socke

[Haskell-cafe] Domain Specific Languages and better Error messages

2012-02-07 Thread Victor Miller
This week, at work, I've been attending a workshop which is concerned with writing (actually rewriting) a domain specific language that we've been using.Although I've only known Haskell for four months, I can see that it's infected my brain, since I kept seeing Haskell solutions to all sorts of

[Haskell-cafe] [ANNOUNCE] JuicyPixels 1.1 - image loading library (maintenance release)

2012-02-07 Thread Vincent Berthoux
Hello list, This is a maintenance release without new functionality, the central change is the switch from Haskell Array to Data.Vector (to ease it's use for OpenGL texture loading). Juicy.Pixels 1.1 change log : - Fixing automatic bitmap decoding, the decodeImage function wasn't trying to

Re: [Haskell-cafe] network-2.3.0.10 compiled for ghc 7.4.1 windows

2012-02-07 Thread Holger Reinhardt
Hi, (I submitted the patch that Johan linked to) Network/Socket/Internal.hsc has the following code: #if defined(WITH_WINSOCK) || defined(cygwin32_HOST_OS) type CSaFamily = (#type unsigned short) #elif defined(darwin_HOST_OS) type CSaFamily = (#type u_char) #else type CSaFamily = (#type sa_family

Re: [Haskell-cafe] Some thoughts on Type-Directed Name Resolution

2012-02-07 Thread David Thomas
Crash blossoms, while amusing, are not a desirable feature of a programming language. They are specifically a failure to communicate clearly. On Feb 6, 2012 6:38 PM, "AntC" wrote: > Donn Cave avvanta.com> writes: > > > > > You can find stuff like "fromIntegral.ord" in > > packages downloaded to

Re: [Haskell-cafe] Switching GHC Version

2012-02-07 Thread Sean Leather
Hi Yusaku, On Tue, Feb 7, 2012 at 00:27, HASHIMOTO, Yusaku wrote: > Hi, I wrote a simple shell function for switching GHC version on the > system. It works only under Mac OSX, and only switch GHCs installed > via .pkg installers. It's useful to experiment newer features without > worrying breakin

Re: [Haskell-cafe] Loading a texture in OpenGL

2012-02-07 Thread L Corbijn
On Tue, Feb 7, 2012 at 5:23 AM, Austin Seipp wrote: > Just to clarify, this guarantee possibly could be made, ghc just doesn't do > it now. In the past ghc never guaranteed a finalizer would ever be run. > > Regardless I would be wary of trusting finalizers to clean up very scarce > resources. A m

Re: [Haskell-cafe] ANN: exists-0.1

2012-02-07 Thread Gábor Lehel
2012/2/7 Mikhail Vorozhtsov : > Ah, sorry, I got sloppy. Have you encountered situations where partial > application of such "constraint aliases" becomes a problem? In the particular case of the Existential class I'm not sure (it's hard to imagine a real-world application for it in the first place

Re: [Haskell-cafe] network-2.3.0.10 compiled for ghc 7.4.1 windows

2012-02-07 Thread Alberto G. Corona
Hi Johan, The patch is not for the current version of network and the code is quite different. Basically it is necesary to define this variable as "unsigned short" that is the thing intended in the patch. however I put it by brute force, without regard of the prerpocessor directives. With this cha

Re: [Haskell-cafe] Some thoughts on Type-Directed Name Resolution

2012-02-07 Thread Steve Horne
On 06/02/2012 23:58, Richard O'Keefe wrote: On 4/02/2012, at 12:13 AM, Gábor Lehel wrote: All of this said, record.field is still the most readable, intuitive, and familiar syntax for selecting a field from a record that I know of. Having learned COBOL and Algol 68 before Haskell was dreamed of

Re: [Haskell-cafe] ANN: exists-0.1

2012-02-07 Thread Mikhail Vorozhtsov
On 02/07/2012 04:05 PM, Gábor Lehel wrote: On Tue, Feb 7, 2012 at 7:23 AM, Mikhail Vorozhtsov wrote: Even better, you can write type ExistentialWith c e = (Existential e, c ~ ConstraintOf e) instead of class(Existential e, c ~ ConstraintOf e) => ExistentialWith c e instance (Existentia

Re: [Haskell-cafe] [Haskell] ANNOUNCE: system-filepath 0.4.5 and system-fileio 0.3.4

2012-02-07 Thread Simon Marlow
On 06/02/2012 20:32, Ian Lynagh wrote: On Sun, Feb 05, 2012 at 07:17:32PM -0800, John Millikin wrote: That was my understanding also, then QuickCheck found a counter-example. It turns out that there are cases where a valid path cannot be roundtripped in the GHC 7.2 encoding. This is fixed in

Re: [Haskell-cafe] ANN: exists-0.1

2012-02-07 Thread Mikhail Vorozhtsov
On 02/07/2012 06:49 PM, Yves Parès wrote: Are there documentation on constraints being types, how they can be declared/handled and what are the interests? The GHC User's Guide has (somewhat short) section http://www.haskell.org/ghc/docs/latest/html/users_guide/constraint-kind.html Blog posts: h

Re: [Haskell-cafe] ANN: exists-0.1

2012-02-07 Thread Yves Parès
Are there documentation on constraints being types, how they can be declared/handled and what are the interests? 2012/2/7 Mikhail Vorozhtsov > On 02/06/2012 03:32 AM, Gábor Lehel wrote: > >> There's a common pattern in Haskell of writing: >> >> data E where E :: C a => a -> E >> also written >

Re: [Haskell-cafe] ANNOUNCE MFlow-0.0.3 an Application Server for stateful web apps with statically typed widget combinators

2012-02-07 Thread Alberto G. Corona
Here you can take a look at a complete example included in the package: http://haskell-web.blogspot.com/2012/02/web-application-server-with-stateful.html This snippet is the web page in declarative form: shopProds :: V.Vector Int -> [Prod] -> View Html IO (Either Int Prod)shopProds ca

[Haskell-cafe] ANNOUNCE MFlow-0.0.3 an Application Server for stateful web apps with statically typed widget combinators

2012-02-07 Thread Alberto G. Corona
Hi Haskellers I I´m happy to announce the first version of MFlow http://hackage.haskell.org/package/MFlow MFlow permits the execution of web applications in a procedural form, that is, with multiple requests-response interactions in a single procedure. MFlow stores the execution state, manage t

Re: [Haskell-cafe] ANN: exists-0.1

2012-02-07 Thread Gábor Lehel
On Tue, Feb 7, 2012 at 7:23 AM, Mikhail Vorozhtsov wrote: > Even better, you can write > > type ExistentialWith c e = (Existential e, c ~ ConstraintOf e) > > instead of > > class    (Existential e, c ~ ConstraintOf e) => ExistentialWith c e > instance (Existential e, c ~ ConstraintOf e) => Existen

Re: [Haskell-cafe] Exceeding OS limits for simultaneous socket connections

2012-02-07 Thread Alexander Kjeldaas
On 30 January 2012 14:22, Rob Stewart wrote: > Hi, > > I'm experiencing the "accept: resource exhausted (Too many open > files)" exception when trying to use sockets in my Haskell program. > > The situation: > - Around a dozen Linux machines running my Haskell program, > transmitting thousands of