On Mon, Jul 8, 2013 at 9:03 PM, Leon Smith wrote:
> I just fixed a fairly serious performance problem with postgresql-libpq's
> binding to PQescapeStringConn; in was exhibiting a non-linear slowdown
> when more strings are escaped and retained.
>
I'd like to point out a somewhat related bottl
On Sun, Jul 14, 2013 at 7:31 AM, Clark Gaebel wrote:
> Similarly, I've always used:
>
> import qualified Data.HashSet as S
>
> nub :: Hashable a => [a] -> [a]
> nub = S.toList . S.fromList
>
> And i can't think of any type which i can't write a Hashable instance, so
> this is extremely practical.
On Thu, Aug 8, 2013 at 12:22 PM, Lyle Kopnicky wrote:
> ...
>
> So I went to the Data.Hashable page and looked up examples on how to
> derive a Hashable instance for my datatype:
>
> http://hackage.haskell.org/packages/archive/hashable/latest/doc/html/Data-Hashable.html
>
> The problem occurs eve
On Wed, Aug 21, 2013 at 4:55 AM, Rogan Creswick wrote:
> Does anyone have PPC binaries for GHC 7.x?
>
> I've been trying to help a PPC user compile a large haskell application,
> and it (and it's dependencies) require a newer ghc; the latest ppc binaries
> we've found are for 6.10, and we have be
On Tue, Sep 3, 2013 at 6:56 PM, Simon Yarde wrote:
> I'm new to Haskell and have reached an impasse in understanding the
> behaviour of sockets.
>
> The crux of my line of enquiry is this; how can my application know when
> to pause in generating its chunked output if send doesn't block and the
On Thu, Jan 12, 2012 at 7:48 AM, Johan Brinch wrote:
> Hi all,
>
> I'm seeing the "Control.Concurrent.STM.atomically was nested" error,
> but I just can't figure out what's happening. I'm not using any unsafe
> IO (only for debug printing), and the test program is only running one
> thread. Where
I'm not happy with asynchronous I/O in Haskell. It's hard to reason
about, and doesn't compose well. At least in my code.
I'm currently trying to build a networking layer for my application
using Network.TLS. Here is a rather minimalist API:
newtype Connection = Connection (TLSCtx Handle)
On Sat, Jan 14, 2012 at 1:29 AM, Bardur Arantsson wrote:
> So, the API becomes something like:
>
> runSocketServer :: ((Chan a, Chan b) -> IO ()) -> ... -> IO ()
>
> where the first parameter contains the "client logic" and "A" is the type of
> the messages from the client and "B" is the type of
On Tue, Jan 17, 2012 at 3:20 PM, David Barbour wrote:
> I'd say use of asynchronous exceptions should be a last resort. ...
I agree. However, network libraries in Haskell (e.g. Handle,
Network.TLS) generally don't provide the primitives needed to do that
on the receiving end. For example, if a
I uploaded a package that creates an STM layer over a network connection:
http://hackage.haskell.org/package/stm-channelize
I haven't used it in anger yet, but I hope it's a step in the right
direction. I included a sample chat client and server. The client is
pretty cute:
main =
ough, perhaps the network
package can absorb it, as was done with network-bytestring.
-Joey Adams
___
Haskell-Cafe mailing list
Haskell-Cafe@haskell.org
http://www.haskell.org/mailman/listinfo/haskell-cafe
On Tue, Feb 21, 2012 at 7:36 PM, Conrad Parker wrote:
> awesome! I've prepared some patches for network to add this module and
> its tests, in this branch:
>
> https://github.com/kfish/network/tree/options
Cool, thanks!
> I didn't modify any other modules, perhaps Network.Socket.Options
> should
I released network-socket-options 0.2, adding setSocketTimeouts and
setHandleTimeouts. I'll post an announcement in a separate thread
once the Haddock documentation is generated.
-Joey
___
Haskell-Cafe mailing list
Haskell-Cafe@haskell.org
http://www.h
On Wed, Feb 22, 2012 at 5:56 AM, L Corbijn wrote:
> On Wed, Feb 22, 2012 at 5:58 AM, Joey Adams
> wrote:
>> I released network-socket-options 0.2, adding setSocketTimeouts and
>> setHandleTimeouts. I'll post an announcement in a separate thread
>> once the Haddo
Thanks for the review!
On Wed, Feb 22, 2012 at 11:15 AM, Johan Tibell wrote:
> The API looks fine except:
>
> HasSocket - I don't think we want to abstract over sockets here, as we
> don't do so in the rest of the module.
I know it's a bit ugly, but not having it makes it hard to work with
unman
On Wed, Feb 22, 2012 at 10:23 PM, Johan Tibell wrote:
> But the network package doesn't try to let you work with raw file
> descriptors elsewhere (e.g. send and recv.) I'm not saying that
> functions on Fds aren't useful, they are, just that the network
> package is the wrong place for them. I'd p
On Fri, Mar 2, 2012 at 3:04 PM, Alexander V Vershilov
wrote:
> Hello, Paul.
>
> It seems you should not use 3 threads, but run in a data-driven behaviour with
> one thread per client.
I don't think this will work for Paul's situation. He needs to be
able to send notifications to clients. This m
On Fri, Mar 2, 2012 at 7:34 PM, Joey Adams wrote:
> I'll try to put together a simple chat server example, like the one I
> wrote for stm-channelize.
Here it is:
https://github.com/joeyadams/haskell-chat-server-example
See, in particular, the serveLoop function. When a message
On Sun, Mar 4, 2012 at 1:27 PM, Arnaud Bailly wrote:
> Hello Cafe,
> I am looking for a data structure that would have the following
> informal properties:
> - allow efficient retrieval of minimum element for some ordering
> relation on a computed property of the elements
> - allow efficient upd
On Sat, Apr 28, 2012 at 2:23 PM, H. M. wrote:
> There are two threads, one which is waits on input via
> hGetLine
> and another, which should terminate this thread or close this handle.
>
> hClose
> as well as
> killThread
> doesn't seem to work, caused by the fact, that the thread is blocked unti
This package provides imperative-style loops supporting "continue" and
"break". For example:
import Control.Monad
import Control.Monad.IO.Class
import Control.Monad.Trans.Loop
import Control.Monad.Trans.Class
main :: IO ()
main =
foreach [0..] $ \i ->
fore
On Mon, Jul 9, 2012 at 8:28 AM, Roman Cheplyaka wrote:
> Very nice!
>
> Here's a patch to generalize foreach to any Foldable:
> https://github.com/joeyadams/haskell-control-monad-loop/pull/1
Thanks for the patch! I merged it, but I plan to wait a little while
before uploading another release to
On Mon, Jul 9, 2012 at 3:56 AM, Eugene Dzhurinsky wrote:
> Hi all!
>
> I created simple application, which uses sqlite3 as it's datastore back-end. I
> faced no problems when building and running it on Linux, but after I tried to
> build it on Windows, I see weird linking error:
You could use the
On Fri, Jul 13, 2012 at 2:26 PM, Joey Hess wrote:
> Are there any common gotchas with converting to the threaded runtime
> that might provide a hint to what's wrong? My code does not currently
> use Control.Concurrent or threads, although it does use some libraries
> like MissingH that use forkIO
Here's a useful little function:
-- | Fork a thread, but wait for the main thread to perform a setup action
-- using the child's 'ThreadID' before beginning work in the child thread.
forkSetup :: (ThreadId -> IO (Maybe a, r))
-- ^ Setup action to be called before the t
On Fri, Jul 27, 2012 at 9:52 AM, Marco Túlio Gontijo e Silva
wrote:
> I thought that the only thing I needed to take care while using
> unsafePerformIO was knowing that the time of execution is undetermined
> and that it could even run more than once. This is not a problem for
> my logging. Is t
This package provides a bounded channel type for STM. TBChan (in
stm-chans) and TBQueue (introduced in stm 2.4) are bounded channels
that limit the number of items in the channel. SBChan, on the other
hand, limits the total size of items in the channel, where "size" is
defined by providing an ins
system-time-monotonic [1] provides access to the system's monotonic
clock. Usage looks like this:
* Use 'newClock' to create a new monotonic clock
* Use 'clockGetTime' to see how much time has elapsed since the clock
was created.
This package currently supports Linux and Windows. It might al
On Tue, Aug 7, 2012 at 2:03 PM, Daniel Trstenjak
wrote:
> Data structure containing elements which are instances of the same type class
Are you looking for existential quantification [1]?
data SomeFoo = forall a. Foo a => a
[1]:
http://www.haskell.org/ghc/docs/latest/html/users_guide/data
On Wed, Aug 15, 2012 at 3:38 PM, Bryan O'Sullivan wrote:
> I propose that the sense of the recommendation around upper bounds in the
> PVP be reversed: upper bounds should be specified only when there is a known
> problem with a new version of a depended-upon package.
I, too, agree. Here is my a
On Sat, Sep 29, 2012 at 8:46 PM, KC wrote:
> http://martinfowler.com/eaaDev/EventSourcing.html
>
> http://martinfowler.com/articles/lmax.html
This notion of "Capture all changes to an application state as a
sequence of events" sounds a lot like what John Carmack did in Quake 3
[1]:
> I settled o
On Tue, Oct 23, 2012 at 5:03 PM, "José A. Lopes" wrote:
> Hey everyone,
>
> I changed my code I now I get the following error message
> Main: thread blocked indefinitely in an MVar operation
>
> Before the change, I was using the State monad with runState.
> Then, I changed the code to use the
On Thu, Feb 28, 2013 at 9:18 PM, Joey Adams wrote:
> Can I transform a conduit so some values are passed through unchanged, but
> others go through the conduit? For example:
>
> right :: Conduit i m o -> Conduit (Either x i) m (Either x o)
>
Actually, I didn't ne
Thanks for the response. I spent some time thinking about leftovers and
understand the Category issue now. Thanks for clearing that up.
While trying to work conduits into a program I'm working on, I find myself
wanting something more powerful: a resumable Conduit.
For example, consider receivin
On Sun, Mar 3, 2013 at 10:24 PM, Joey Adams wrote:
> ...
> Here's a possible API for a resumable Conduit:
>
> newtype ResumableConduit i m o = -- hidden --
>
> newResumableConduit :: Monad m => Conduit i m o -> ResumableConduit i
> m o
>
> -- |
On Mon, Mar 4, 2013 at 5:50 PM, Rob Stewart wrote:
> ...
> -
> import Control.Concurrent
>
> -- API approach 1: Using type classes
> class FooC a where
> mkFooC :: IO a
> readFooC :: a -> IO Int
> incrFooC :: a -> IO ()
>
I recommend taking 'mkFooC' out of the typeclass. It keeps you
On Tue, Mar 5, 2013 at 9:24 AM, Michael Snoyman wrote:
> ...
> I'm not sure if I entirely understand your use case, but in general it
> should be possible to have multiple Conduits running one after the other.
> Here's an example of restarting an accumulator after every multiple of 5:
>
>
> https
On Wed, Mar 6, 2013 at 1:42 AM, Michael Snoyman wrote:
>
> I'm still not sure I follow this. In the example I linked to, the go
> function within breaker could arbitrarily modify the data before it gets
> passed on to the inner Conduit. So it seems like it should be possible to
> achieve your goa
I've been struggling with a similar situation: a client and server that
communicate with binary-encoded messages, sending "heartbeats" (dummy
messages) every 30 seconds, and timing out the connection if no response is
received in 3 minutes. The client sends data to the server, while also
listening
On Wed, Oct 26, 2011 at 4:24 PM, Bas van Dijk wrote:
> I have one question regarding your use of atomicModifyIORef:
>
> x <- atomicModifyIORef ref (\_ -> (tmstr, ()))
> x `seq` return ()
>
> Can't you write that as just: writeIORef ref tmstr? If you're not
> using the previous value of the IORef
40 matches
Mail list logo