Re: [Haskell-cafe] Lazy object deserialization

2013-03-13 Thread Jeff Shaw
On 3/13/2013 12:15 AM, Scott Lawrence wrote: Hey all, All the object serialization/deserialization libraries I could find (pretty much just binary and cereal) seem to be strict with respect to the actual data being serialized. In particular, if I've serialized a large [Int] to a file, and I

Re: [Haskell-cafe] Lazy object deserialization

2013-03-13 Thread Jeff Shaw
, Jeff Shaw wrote: On 3/13/2013 12:15 AM, Scott Lawrence wrote: Hey all, All the object serialization/deserialization libraries I could find (pretty much just binary and cereal) seem to be strict with respect to the actual data being serialized. In particular, if I've serialized a large [Int

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

2012-11-30 Thread Jeff Shaw
On 11/30/2012 1:29 PM, Bryan O'Sullivan wrote: On Tue, Nov 27, 2012 at 11:02 AM, Jeff Shaw shawj...@gmail.com mailto:shawj...@gmail.com wrote: Once each minute, a thread of my program updates a global state, stored in an IORef, and updated with atomicModifyIORef', based on query

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] Can a GC delay TCP connection formation?

2012-11-27 Thread Jeff Shaw
Hello Timothy and others, One of my clients hosts their HTTP clients in an Amazon cloud, so even when they turn on persistent HTTP connections, they use many connections. Usually they only end up sending one HTTP request per TCP connection. My specific problem is that they want a response in

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

2012-11-27 Thread Jeff Shaw
On 11/27/2012 2:45 PM, Gershom Bazerman wrote: HDBC-odbc has long used the wrong type of FFI imports, resulting in long-running database queries potentially blocking all other IO. I just checked, and apparently a patch was made to the repo in September that finally fixes this [1], but

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

2012-11-26 Thread Jeff Shaw
Hello, I've run into an issue that makes me think that when the GHC GC runs while a Snap or Warp HTTP server is serving connections, the GC prevents or delays TCP connections from forming. My application requires that TCP connections form within a few tens of milliseconds. I'm wondering if

[Haskell-cafe] in the vector library, why define unbox tuples 2?

2012-09-25 Thread Jeff Shaw
I'm looking at storing a data type with 7 fields in an unboxed vector, which means that I'll have to use GenUnboxTuple to create an instance for Unbox (a,b,c,d,e,f,g), but I was thinking that another solution is to use instance (Unbox a, Unbox b) = Unbox (a,b) recursively to create instance

Re: [Haskell-cafe] Cabal try to install a package I already have

2012-04-29 Thread Jeff Shaw
Hello Daniel, Did you perhaps install a newer version of bytestring or parsec? Jeff ___ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http://www.haskell.org/mailman/listinfo/haskell-cafe

[Haskell-cafe] JSON library suggestions?

2012-04-24 Thread Jeff Shaw
Hello, Up until now I've been using Aeson, but I've found that its number type isn't going to work for me. I need to use decimal numbers while avoiding conversions from and to Double, which Aeson doesn't allow. There are quite a few more JSON libraries for Haskell, which all appear to use

Re: [Haskell-cafe] JSON library suggestions?

2012-04-24 Thread Jeff Shaw
Hi Jeremy, Sorry if I was unclear. Rational is acceptable to me as the result of a JSON parse, but Double (which Aeson uses), is not. Also acceptable would be Data.Decimal.Decimal, or maybe one of the types from Data.Fixed. JSON doesn't specify a data type for numbers, only a format. Jeff

Re: [Haskell-cafe] Parallel Strategy

2012-04-18 Thread Jeff Shaw
Hello Mukesh Tiwari, I'm wondering what happens if you replace return () with print (last xs). Jeff ___ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http://www.haskell.org/mailman/listinfo/haskell-cafe

Re: [Haskell-cafe] Is there a generic way to detect mzero?

2012-03-26 Thread Jeff Shaw
can :: (MonadPlus m) = (a - m b) - a - Bool can f x = case f x of mzero - False _ - True I got a warning: __testError.hs:31:11: Warning: Pattern match(es) are overlapped In a case alternative: _ - ... Ok, modules loaded: Main. The problem here is that

Re: [Haskell-cafe] Theoretical question: are side effects necessary?

2012-03-16 Thread Jeff Shaw
It is the third or the fourth time that somebody recently puts the equivalence between the communication with the outer world, and side effects. I contest that very strongly, perhaps a TRUE guru might instruct me. I think there are three key concepts rumbling around in this discussion that

[Haskell-cafe] Is there a better way to subtyping?

2012-03-12 Thread Jeff Shaw
More specifically, if I have a record type from which I construct multiple sub-record types, and I want to store these in a collection which I want to map over while preserving the ability to get at the sub-fields, is there a better way to do it than to have an enumeration for the sub-types