[Haskell-cafe] What magic has the new parallel io manager done to improve performance?

2013-02-16 Thread yi huang
I'm curious about the design and trade offs in IO manager, I can point out two changes that should boost performance: 1. Run an IO manager thread on each capability. 2. Use ONESHOT flag to save a system call. I wonder is there anything else? It must be interesting. --

[Haskell-cafe] What magic has the new IO manager done to improve performance ?

2013-02-16 Thread yi huang
I' m curious about the design and trade offs behind the new IO manager. I see two changes from the code: 1. Run IO manager thread on each capability. 2. Use ONESHOT flag to save a system call. Is there other interesting things to know? Is it possible to use epoll's ET mode to save even more

Re: [Haskell-cafe] What magic has the new parallel io manager done to improve performance?

2013-02-16 Thread yi huang
Sorry for the duplicate post, please ignore this one. On Sunday, February 17, 2013, yi huang wrote: I'm curious about the design and trade offs in IO manager, I can point out two changes that should boost performance: 1. Run an IO manager thread on each capability. 2. Use ONESHOT flag

Re: [Haskell-cafe] How to implement instance of MonadBaseControl IO

2012-08-24 Thread yi huang
. restoreM . unStMGeoServer Thank you all, i've adapted Chris's code which is similar to yours, and it works now. Erik On Wed, Aug 22, 2012 at 9:16 AM, yi huang yi.codepla...@gmail.com wrote: I have a `newtype Yun a = Yun { unYun :: ReaderT YunEnv (ResourceT IO) a }` , and i need to define

[Haskell-cafe] How to implement instance of MonadBaseControl IO

2012-08-22 Thread yi huang
I have a `newtype Yun a = Yun { unYun :: ReaderT YunEnv (ResourceT IO) a }` , and i need to define an instance of `MonadBaseControl IO` for it. Newtype instance deriving don't work here. I guess the answer is simple, i just can't figure it out, hope anybody can lightening me. Best regards.

Re: [Haskell-cafe] Cloud Haskell real usage example

2012-08-21 Thread yi huang
On Wed, Aug 22, 2012 at 8:30 AM, Felipe Almeida Lessa felipe.le...@gmail.com wrote: On Tue, Aug 21, 2012 at 9:01 PM, Thiago Negri evoh...@gmail.com wrote: My view of Cloud Haskell usage would be something similar to this: a master node sending work to slaves; slave instances getting up or

Re: [Haskell-cafe] Conduits: Is Source a valid instance of Monad?

2012-04-03 Thread yi huang
On Wed, Apr 4, 2012 at 4:48 AM, Paul Liu nine...@gmail.com wrote: Is there any follow up on this? I was wondering what is the best way to sequence a number of sources together. Anybody gave a further thought on this? I believe sequence sources together can already be done by `Monoid`

Re: [Haskell-cafe] Conduit experiment: Is this correct?

2012-02-03 Thread yi huang
2012/2/3 Michael Snoyman mich...@snoyman.com 2012/2/3 Ertugrul Söylemez e...@ertes.de: Hello there, I'm trying to build a server for testing the conduit and network-conduit packages. As a contrived example the goal is to pick the first three lines from the client and send them back

Re: [Haskell-cafe] how to print out intermediate results in a recursive function?

2012-02-03 Thread yi huang
You can use trace from Debug.Trace, change the code like this: mergesort l = case trace l l of [] - ... [x] - ... (x:xs) - ... On Sun, Feb 5, 2012 at 2:23 AM, Qi Qi qiqi...@gmail.com wrote: Hello, I have a question;how can I print out the intermediate number lists in a mergesort

Re: [Haskell-cafe] Comparison Haskell, Java, C and LISP

2011-10-18 Thread yi huang
If i understand correctly, what we called generics is what so called reflection. It allow you to introspect type structure. http://haskell.org/ghc/docs/latest/html/libraries/ghc-prim-0.2.0.0/GHC-Generics.html#g:4 On Wed, Oct 19, 2011 at 12:03 AM, yrazes yra...@gmail.com wrote: Hi, Maybe you

Re: [Haskell-cafe] [Haskell] [ANNOUNCE] Haskdogs-0.1

2011-09-13 Thread yi huang
Cabal compains about Unknown build tool hasktags. It seems not necessary to set Build-tools: hasktags in cabal file? On Wed, Sep 14, 2011 at 4:39 AM, Sergey Mironov ier...@gmail.com wrote: Hi! I am pleased to announce haskdogs - project-level ctag file generator. haskdogs is a small

Re: [Haskell-cafe] file splitter with enumerator package

2011-07-26 Thread yi huang
On Tue, Jul 26, 2011 at 12:19 PM, yi huang yi.codepla...@gmail.com wrote: Actually, i'm wondering how to do exception handling and resource cleanup in iteratee, e.g. your `writer` iteratee, i found it difficult, because iteratee is designed to let enumerator manage resources. I've found

Re: [Haskell-cafe] file splitter with enumerator package

2011-07-25 Thread yi huang
Actually, i'm wondering how to do exception handling and resource cleanup in iteratee, e.g. your `writer` iteratee, i found it difficult, because iteratee is designed to let enumerator manage resources. On Sat, Jul 23, 2011 at 2:41 AM, Eric Rasmussen ericrasmus...@gmail.comwrote: Hi everyone,

Re: [Haskell-cafe] pointer equality

2011-07-20 Thread yi huang
2011/7/20 Eugene Kirpichov ekirpic...@gmail.com reallyUnsafePointerEq#, and it really is as unsafe as it sounds :) Why is it so unsafe? i can't find any documentation on it. I think always compare pointer first is a good optimization. 20.07.2011, в 7:51, Nikhil A. Patil

[Haskell-cafe] How to determine minimal dependency of package

2011-07-15 Thread yi huang
I'm writing my first haskell package, how do i determine the minimal dependency of it, for example, it use Data.Data, how do i know which version of base package first introduce Data.Data module, i can't find the answer with google. -- http://www.yi-programmer.com/blog/

[Haskell-cafe] compare iteratee with python's yield

2011-07-01 Thread yi huang
I just read several tutorials on iteratee, i find that iteratee is similar to python's generator, both allow streamlined data processing. For example, i can implement enumFile and printChunks in python like this: EOF = None def enum_file(bufsize, filename): with open(filename) as

[Haskell-cafe] Is there Functor instance of Enumerator'

2011-07-01 Thread yi huang
Say i want to compose Enumerator ByteString m b and Iteratee Builder m b, so I try to transform the enum to Enumerator Builder m b, providing function ByteString - Builder. It's like implement a Functor instance for Enumerator. But i failed, there are no way to make type system happy. Am I right