Re: [Haskell-cafe] Is this a correct explanation of FRP?

2012-04-01 Thread Michael Snoyman
On Sat, Mar 31, 2012 at 7:15 PM, Peter Minten peter.min...@orange.nl wrote: On Fri, 2012-03-30 at 09:15 +0300, Michael Snoyman wrote: First you state that we shouldn't use `union` for the `ePitch` Event, and then you used it for `bOctave`. Would it be more efficient to implement bOctave

Re: [Haskell-cafe] ANN: acme-http

2012-04-01 Thread Michael Snoyman
On Sun, Apr 1, 2012 at 8:46 PM, Jeremy Shaw jer...@n-heptane.com wrote: Hello, As we all know, the true measure of performance for a web server is the classic PONG test. And, so the Happstack team is pleased to announce the release of the new acme-http server! hackage:  

Re: [Haskell-cafe] A Modest Records Proposal

2012-04-02 Thread Michael Snoyman
On Mon, Apr 2, 2012 at 3:38 PM, Alp Mestanogullari alpmes...@gmail.com wrote: Lesson learned: for next year, write a Haskell program that tells if a given -cafe thread or reddit discussion is a April Fool's joke or not. import Data.Time main = do now - getCurrentTime let (_, month,

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

2012-04-04 Thread Michael Snoyman
` instance. Regards, Paul Liu On Tue, Dec 27, 2011 at 3:45 PM, Aristid Breitkreuz arist...@googlemail.com wrote: Hi all, As you may have noticed, Michael Snoyman has been working on an alternative approach to I/O, called conduits. You can find it here: https://github.com/snoyberg

Re: [Haskell-cafe] GSOC Proposal 2012 : HDBC

2012-04-04 Thread Michael Snoyman
On Wed, Apr 4, 2012 at 7:59 PM, MightyByte mightyb...@gmail.com wrote: pranjal pandit pranjal5215 at gmail.com writes: Hi,I would like to work on improving the HDBC as a GSOC project 2012. I have a previous working experience with Django and its ORM and I had a look at Amnesia

[Haskell-cafe] Yesod 1.0 Release Candidate

2012-04-05 Thread Michael Snoyman
Hi everyone, I'd like to announce the availability of the Yesod 1.0 release candidate. The code is available on Hackage now, so you should be able to install with a simple `cabal update cabal install yesod` to get up-and-running. If you've been installing from Github or Yackage, you'll probably

Re: [Haskell-cafe] thread killed

2012-04-05 Thread Michael Snoyman
On Thu, Apr 5, 2012 at 12:05 PM, Gregory Collins g...@gregorycollins.net wrote: +haskell-cafe, oops On Thu, Apr 5, 2012 at 11:04 AM, Gregory Collins g...@gregorycollins.net wrote: On Wed, Apr 4, 2012 at 10:09 PM, tsuraan tsur...@gmail.com wrote: It's hard to rule Snap timeouts out; try

Re: [Haskell-cafe] Too much inlining on text package

2012-04-08 Thread Michael Snoyman
On Apr 8, 2012 8:47 AM, Bryan Oapos;Sullivan b...@serpentine.com wrote: On Sun, Mar 18, 2012 at 12:02 AM, Michael Snoyman mich...@snoyman.com wrote: OK, issue created: https://github.com/bos/text/issues/19 I fixed the too-much-inlining bug tonight. As a bonus, Text literals are now decoded

Re: [Haskell-cafe] Guide for converting existing code to Conduit 0.4?

2012-04-09 Thread Michael Snoyman
On Mon, Apr 9, 2012 at 12:58 PM, Erik de Castro Lopo mle...@mega-nerd.com wrote: Hi all, Is there some sort of a guide for converting existing code Conduit 0.4? What happened to Control.Monad.Trans.Resource.with? What happens to stuff that used to to have a type C.Source m a which now

Re: [Haskell-cafe] Guide for converting existing code to Conduit 0.4?

2012-04-09 Thread Michael Snoyman
On Mon, Apr 9, 2012 at 2:27 PM, Erik de Castro Lopo mle...@mega-nerd.com wrote: Michael Snoyman wrote: Hmm... I'd be surprised if you really need the Pipe signature that you're providing. I'm not providing it, the compiler is suggesting it:    Network/HTTP/Proxy.hs:835:47:        Couldn't

Re: [Haskell-cafe] Guide for converting existing code to Conduit 0.4?

2012-04-09 Thread Michael Snoyman
On Mon, Apr 9, 2012 at 2:37 PM, Ivan Lazar Miljenovic ivan.miljeno...@gmail.com wrote: On 9 April 2012 21:34, Michael Snoyman mich...@snoyman.com wrote: It's caused by fmap. This is one of the downsides with the move to a single type: I've been reading the various posts you've been making

[Haskell-cafe] Memory leak from close fields in conduit

2012-04-11 Thread Michael Snoyman
Hi all, Hideyuki Tanaka alerted me[1] to a memory leak in conduit. Long story short: it appears that Pipe composition leads to collection of a large number of `return ()` actions for unnecessary memory cleanup. We came up with a possible solution: a Finalize type[2]. In both of our testing, this

Re: [Haskell-cafe] Conduit Best Practices for leftover data

2012-04-14 Thread Michael Snoyman
On Thu, Apr 12, 2012 at 9:25 AM, Myles C. Maxfield myles.maxfi...@gmail.com wrote: Hello, I am interested in the argument to Done, namely, leftover data. More specifically, when implementing a conduit/sink, what should the conduit specify for the (Maybe i) argument to Done in the following

Re: [Haskell-cafe] Conduit Best Practices for leftover data

2012-04-15 Thread Michael Snoyman
On Mon, Apr 16, 2012 at 12:12 AM, Myles C. Maxfield myles.maxfi...@gmail.com wrote: Thanks for responding to this. Some responses are inline. On Sat, Apr 14, 2012 at 8:30 PM, Michael Snoyman mich...@snoyman.com wrote: [snip] No, nothing so complicated is intended. Most likely you'll never

Re: [Haskell-cafe] Conduit Best Practices for leftover data

2012-04-15 Thread Michael Snoyman
for responding to this. Some responses are inline. On Sat, Apr 14, 2012 at 8:30 PM, Michael Snoyman mich...@snoyman.com wrote: On Thu, Apr 12, 2012 at 9:25 AM, Myles C. Maxfield myles.maxfi...@gmail.com wrote: Hello, I am interested in the argument to Done, namely, leftover data. More

Re: [Haskell-cafe] process-conduit appears to hang on windows

2012-04-15 Thread Michael Snoyman
On Mon, Apr 16, 2012 at 2:50 AM, grant the...@hotmail.com wrote: Hi, I am trying to use process-conduit on windows, but it appears to hang when using the conduitCmd. Is there a reason why this doesn't work? Thanks for any help, Grant I have made an attempt to create a version of process

[Haskell-cafe] Rewrite rules for enumFromTo

2012-04-18 Thread Michael Snoyman
Hi all, Following a little thread on Reddit[1], I'm trying to add rewrite rules to conduit to make some simple usages of `yield` more efficient. I've pushed these changes to a branch on Github[2]. However, I'm not able to fully optimize the following program: import Data.Conduit import qualified

Re: [Haskell-cafe] Rewrite rules for enumFromTo

2012-04-19 Thread Michael Snoyman
On Thu, Apr 19, 2012 at 11:47 AM, Joachim Breitner m...@joachim-breitner.de wrote: Hi Michael, Am Mittwoch, den 18.04.2012, 19:21 +0300 schrieb Michael Snoyman: I'm quite a novice at rewrite rules; can anyone recommend an approach to get my rule to fire first? I’m not an expert of rewrite

[Haskell-cafe] http-enumerator: users?

2012-04-19 Thread Michael Snoyman
Hi all, I'm wondering if there are still active users out there of http-enumerator. Four months ago I released http-conduit, and since then, my development efforts have gone almost exclusively there. At this point, I'm not longer actively using http-enumerator on any of my projects, and while

Re: [Haskell-cafe] http-enumerator: users?

2012-04-22 Thread Michael Snoyman
OK, since no one seems interested in it anymore, I've deprecated the package. On Thu, Apr 19, 2012 at 12:33 PM, Michael Snoyman mich...@snoyman.com wrote: Hi all, I'm wondering if there are still active users out there of http-enumerator. Four months ago I released http-conduit, and since

[Haskell-cafe] Printing call site for partial functions

2012-04-25 Thread Michael Snoyman
I had a bug in a site of mine[1] for a few weeks, where it would just print: Prelude.head: empty list It took a long time to track down the problem, as it came from some other library I was depending on. Eventually I tracked it down, reported it, and the problem was fixed the next day. The

Re: [Haskell-cafe] Printing call site for partial functions

2012-04-26 Thread Michael Snoyman
On Wed, Apr 25, 2012 at 7:28 PM, Ozgur Akgun ozgurak...@gmail.com wrote: Hi, On 25 April 2012 16:36, Michael Snoyman mich...@snoyman.com wrote:    Prelude.head: empty list Recent versions of GHC actually generate a very helpful stack trace, if the program is compiled with profiling turned

Re: [Haskell-cafe] Printing call site for partial functions

2012-04-27 Thread Michael Snoyman
On Thu, Apr 26, 2012 at 5:05 PM, Joachim Breitner m...@joachim-breitner.de wrote: Hi, Am Mittwoch, den 25.04.2012, 18:36 +0300 schrieb Michael Snoyman: I'm sure there are many better ways to approach the problem, and I can't speak to the complexity of implementation within GHC. I *can* say

Re: [Haskell-cafe] using ResourceT with MVars

2012-05-02 Thread Michael Snoyman
On Wed, May 2, 2012 at 11:36 AM, Warren Harris warrensomeb...@gmail.com wrote: I would like to use LevelDB in my code, and the HEAD version of leveldb-haskell now uses runResourceT to manage open db connections and iterators. I would also like to run multiple threads, and coordinate them for

Re: [Haskell-cafe] conduit: Finalize field in PipeM

2012-05-04 Thread Michael Snoyman
On Thu, May 3, 2012 at 11:11 PM, Paolo Capriotti p.caprio...@gmail.com wrote: Hi, I'm trying to write a function to convert a conduit to a Pipe (from pipes-core), and I'm having trouble understanding why the `Finalize` field in a `PipeM` constructor returns `r`. This makes it impossible to

Re: [Haskell-cafe] How to write Source for TChan working with LC.take?

2012-05-20 Thread Michael Snoyman
I agree that this behavior is non-intuitive, but still believe it's the necessary approach. The short answer to why it's happening is that there's no exit path in the yield version of the function. To understand why, let's expand the code a little bit. Realizing that liftIO = lift . liftIO

Re: [Haskell-cafe] How to write Source for TChan working with LC.take?

2012-05-29 Thread Michael Snoyman
/await would be a good solution to the problem? Michael On Mon, May 21, 2012 at 6:07 AM, Michael Snoyman mich...@snoyman.com wrote: I agree that this behavior is non-intuitive, but still believe it's the necessary approach. The short answer to why it's happening is that there's no exit path

Re: [Haskell-cafe] Re-exports of resourcet in conduit

2012-06-03 Thread Michael Snoyman
-class were incompatable. This is just a guess - I have not tried what you are trying. On Jun 2, 2012 6:35 PM, Myles C. Maxfield myles.maxfi...@gmail.com wrote: To: Michael Snoyman CC: haskell-cafe Hello, I'm having a problem working with the conduit library, and was hoping you could help

Re: [Haskell-cafe] Long-running request/response protocol server using enumerator/iterator/iterIO/pipes/conduits/...

2012-06-26 Thread Michael Snoyman
On Tue, Jun 26, 2012 at 10:22 PM, Nicolas Trangez nico...@incubaid.com wrote: Hello Cafe, Some time ago I tried to implement a network service using iteratee (or enumerator, can't remember), but gave up in the end. More recently I wanted to create something similar (a similar protocol), but

Re: [Haskell-cafe] Long-running request/response protocol server using enumerator/iterator/iterIO/pipes/conduits/...

2012-06-28 Thread Michael Snoyman
On Wed, Jun 27, 2012 at 10:41 AM, Erik de Castro Lopo mle...@mega-nerd.com wrote: Michael Snoyman wrote: That's the reason I added connect-and-resume to conduit. I use the technique in warp[1], which in fact *does* support multiple request/response pairs due to connection keep-alive

[Haskell-cafe] Help requested: naming things in conduit

2012-06-28 Thread Michael Snoyman
Hi all, I'm just about ready to make the 0.5 release of conduit. And as usual, I'm running up against the hardest thing in programming: naming things. Here's the crux of the matter: in older versions of conduit, functions would have a type signature of Source, Sink, or Conduit. For example:

Re: [Haskell-cafe] Help requested: naming things in conduit

2012-06-28 Thread Michael Snoyman
On Thu, Jun 28, 2012 at 8:36 PM, Paolo Capriotti p.caprio...@gmail.com wrote: On Thu, Jun 28, 2012 at 6:11 PM, Michael Snoyman mich...@snoyman.com wrote: Hi all, I'm just about ready to make the 0.5 release of conduit. And as usual, I'm running up against the hardest thing in programming

Re: [Haskell-cafe] OpenShift a free PaaS from RedHat

2012-07-05 Thread Michael Snoyman
Hi Kashyap, I'm not sure if it will solve the problem, but I ran across a tool[1] the other day that bundles up applications with all of the libraries and other resources they need. I wouldn't be surprised if, with this, you can get your code to run on OpenShift. Michael [1]

[Haskell-cafe] ghci and TH cannot: unknown symbol `stat64`

2012-07-11 Thread Michael Snoyman
Hi all, A quick search indicates that this problem has come up in the past, but I haven't seen any solutions yet. I'm working on the next Persistent release, and one of the changes is that the included sqlite3 C library has been updated (I believe that's the trigger here). I can compile programs

Re: [Haskell-cafe] ghci and TH cannot: unknown symbol `stat64`

2012-07-11 Thread Michael Snoyman
On Wed, Jul 11, 2012 at 5:47 PM, Brandon Allbery allber...@gmail.com wrote: On Wed, Jul 11, 2012 at 10:25 AM, Michael Snoyman mich...@snoyman.com wrote: test.hs: /home/ubuntu/.cabal/lib/persistent-sqlite-1.0.0/ghc-7.4.1/HSpersistent-sqlite-1.0.0.o: unknown symbol `stat64' test.hs: test.hs

Re: [Haskell-cafe] ghci and TH cannot: unknown symbol `stat64`

2012-07-12 Thread Michael Snoyman
On Wed, Jul 11, 2012 at 9:55 PM, Bardur Arantsson s...@scientician.netwrote: On 07/11/2012 05:12 PM, Michael Snoyman wrote: Thanks for the feedback. However, looking at sqlite3.c, I see the necessary #include statements: #include sys/types.h #include sys/stat.h #include unistd.h

Re: [Haskell-cafe] ghci and TH cannot: unknown symbol `stat64`

2012-07-12 Thread Michael Snoyman
On Thu, Jul 12, 2012 at 6:29 PM, Michael Snoyman mich...@snoyman.comwrote: On Wed, Jul 11, 2012 at 9:55 PM, Bardur Arantsson s...@scientician.netwrote: On 07/11/2012 05:12 PM, Michael Snoyman wrote: Thanks for the feedback. However, looking at sqlite3.c, I see the necessary #include

Re: [Haskell-cafe] ghci and TH cannot: unknown symbol `stat64`

2012-07-12 Thread Michael Snoyman
On Thu, Jul 12, 2012 at 7:07 PM, Tristan Ravitch travi...@cs.wisc.eduwrote: On Thu, Jul 12, 2012 at 06:29:41PM +0300, Michael Snoyman wrote: I've come up with a minimal example that demonstrates this problem. The crux of the matter is the following C code: #include sys/types.h

Re: [Haskell-cafe] ghci and TH cannot: unknown symbol `stat64`

2012-07-12 Thread Michael Snoyman
On Jul 12, 2012 7:13 PM, Tristan Ravitch travi...@cs.wisc.edu wrote: On Thu, Jul 12, 2012 at 11:07:05AM -0500, Tristan Ravitch wrote: Are you trying this on a 32 bit system? And when you compiled that C program, did you try to add -D_FILE_OFFSET_BITS=64 -D_LARGEFILE64_SOURCE to

Re: [Haskell-cafe] ghci and TH cannot: unknown symbol `stat64`

2012-07-13 Thread Michael Snoyman
On Thu, Jul 12, 2012 at 7:30 PM, Tristan Ravitch travi...@cs.wisc.eduwrote: On Thu, Jul 12, 2012 at 07:20:39PM +0300, Michael Snoyman wrote: On Jul 12, 2012 7:13 PM, Tristan Ravitch travi...@cs.wisc.edu wrote: On Thu, Jul 12, 2012 at 11:07:05AM -0500, Tristan Ravitch wrote: Are you

Re: [Haskell-cafe] Key-Parametrized Lookup Table

2012-07-31 Thread Michael Snoyman
On Tue, Jul 31, 2012 at 1:13 PM, Alexander Foremny alexanderfore...@gmail.com wrote: Hello list, I am currently thinking that a problem of mine would best be solved if there was a Map-like data structure in which the value returned is parametrized over the lookup type. I wonder is this

[Haskell-cafe] Upcoming resourcet 0.4

2012-08-15 Thread Michael Snoyman
Hi all, I've been working with Aristid on an enhancement to resourcet[1]. Please see the issue for more details, this email isn't about that change. Instead, now that we're looking at a new breaking release, I was wondering if anyone had ideas of something they thought should be changed in

Re: [Haskell-cafe] Platform Versioning Policy: upper bounds are not our friends

2012-08-15 Thread Michael Snoyman
On Thu, Aug 16, 2012 at 5:38 AM, Conrad Parker con...@metadecks.org wrote: On 16 August 2012 03:38, Bryan O'Sullivan b...@serpentine.com wrote: Hi, folks - I'm sure we are all familiar with the phrase cabal dependency hell at this point, as the number of projects on Hackage that are

Re: [Haskell-cafe] [Pipes] Can pipes solve this problem? How?

2012-08-16 Thread Michael Snoyman
On Wed, Aug 15, 2012 at 9:54 PM, Daniel Hlynskyi abcz2.upr...@gmail.comwrote: Hello Cafe. Consider code, that takes input from handle until special substring matched: matchInf a res s | a `isPrefixOf` s = reverse res matchInf a res (c:cs) = matchInf a (c:res) cs

[Haskell-cafe] Haskell position in Israel

2012-08-20 Thread Michael Snoyman
Hi all, Just passing on this job opportunity for another company. SQream is looking for Haskellers located in Israel. They are working on high performance solutions for large databases using Haskell. If you're interested, please contact me off-list, and I'll pass your information along. Thanks,

Re: [Haskell-cafe] Conduit: Where to run monad stacks?

2012-08-23 Thread Michael Snoyman
I agree that the behavior is a bit confusing (Dan Burton just filed an issue about this[1], I'm guessing this email is related). I put up a wiki page[2] to hopefully explain the issue. Can you review it and let me know if it helps? If so, I'll link to it from the Haddocks. Michael [1]

Re: [Haskell-cafe] Conduit: Where to run monad stacks?

2012-08-28 Thread Michael Snoyman
, Michael Snoyman wrote: I agree that the behavior is a bit confusing (Dan Burton just filed an issue about this[1], I'm guessing this email is related). I put up a wiki page[2] to hopefully explain the issue. Can you review it and let me know if it helps? If so, I'll link to it from the Haddocks

[Haskell-cafe] Call for discussion: OverloadedLists extension

2012-09-22 Thread Michael Snoyman
(Prettier formatting available at: https://gist.github.com/3761252) Many of us use the OverloadedStrings language extension on a regular basis. It provides the ability to keep the ease-of-use of string literal syntax, while getting the performance and correctness advantages of specialized

Re: [Haskell-cafe] Call for discussion: OverloadedLists extension

2012-09-23 Thread Michael Snoyman
On Sun, Sep 23, 2012 at 10:51 AM, Heinrich Apfelmus apfel...@quantentunnel.de wrote: Michael Snoyman wrote: (Prettier formatting available at: https://gist.github.com/3761252) Many of us use the OverloadedStrings language extension on a regular basis. It provides the ability to keep the ease

Re: [Haskell-cafe] Call for discussion: OverloadedLists extension

2012-09-23 Thread Michael Snoyman
On Sun, Sep 23, 2012 at 5:51 PM, Chris Smith cdsm...@gmail.com wrote: Michael Snoyman mich...@snoyman.com wrote: That said, it would be great to come up with ways to mitigate the downsides of unbounded polymorphism that you bring up. One idea I've seen mentioned before is to modify

Re: [Haskell-cafe] Call for discussion: OverloadedLists extension

2012-09-24 Thread Michael Snoyman
On Mon, Sep 24, 2012 at 2:53 PM, George Giorgidze giorgi...@gmail.com wrote: Hi Michael, Here at the University of Tübingen, I am co-supervising (together with Jeroen Weijers) a student project implementing the OverloadedLists extension for GHC. Achim Krause is the student who is working on

Re: [Haskell-cafe] Call for discussion: OverloadedLists extension

2012-09-26 Thread Michael Snoyman
On Tue, Sep 25, 2012 at 6:21 PM, Heinrich Apfelmus apfel...@quantentunnel.de wrote: Michael Snoyman wrote: Note that I wasn't necessarily advocating such a pragma. And a lot of my XML code actually *does* use two IsString instances at the same time, e.g.: Element (img :: Name

Re: [Haskell-cafe] ANN: cabal-install-1.16.0 (and Cabal-1.16.0.1)

2012-10-08 Thread Michael Snoyman
Hi Johan, I reported issue 1058 on Github: https://github.com/haskell/cabal/issues/1058 Installing from separate folder with Custom build type fails Thanks, Michael On Mon, Oct 8, 2012 at 6:39 PM, Johan Tibell johan.tib...@gmail.com wrote: Hi, I'll make a bugfix release for cabal-install

[Haskell-cafe] forkProcess, forkIO, and multithreaded runtime

2012-10-15 Thread Michael Snoyman
Hi all, I think I have a misunderstanding of how forkProcess should be working. Ultimately this relates to some bugs in the development version of keter, but I've found some behavior in a simple test program which I wouldn't have expected either, which may or may not be related. With the program

Re: [Haskell-cafe] forkProcess, forkIO, and multithreaded runtime

2012-10-16 Thread Michael Snoyman
On Mon, Oct 15, 2012 at 6:30 PM, Joey Hess j...@kitenet.net wrote: Michael Snoyman wrote: I think I have a misunderstanding of how forkProcess should be working. Ultimately this relates to some bugs in the development version of keter, but I've found some behavior in a simple test program

Re: [Haskell-cafe] Auto-termination and leftovers in Conduits

2012-10-27 Thread Michael Snoyman
The important issue here is that, when using =$, $=, and =$=, leftovers will discarded. To see this more clearly, realize that the first line of sink is equivalent to: out1 - C.injectLeftovers CT.lines C.+ CL.head So any leftovers from lines are lost once you move past that line. In order to

Re: [Haskell-cafe] How to handle exceptions in conduit?

2012-11-01 Thread Michael Snoyman
Due to various technical reasons regarding the nature of conduit, you can't currently catch exceptions within the Pipe monad. You have two options: * Catch exceptions before `lift`ing. * Catch exceptions thrown from the entire Pipe. Since the exceptions are always originating in the underlying

Re: [Haskell-cafe] haskellers.com: Keterconfig incorrect?

2012-11-04 Thread Michael Snoyman
It might have been caused by an overzealous security mechanism: I was only consuming 1000 bytes of the header, which in some BrowserID cases may not be enough. I've bumped that limit, can you try again? On Sun, Nov 4, 2012 at 9:35 AM, Obscaenvs obscae...@gmail.com wrote: Excerpt from source:

Re: [Haskell-cafe] How to handle exceptions in conduit?

2012-11-05 Thread Michael Snoyman
On Mon, Nov 5, 2012 at 9:51 PM, Michael Snoyman mich...@snoyman.com wrote: On Nov 5, 2012 2:42 PM, Hiromi ISHII konn.ji...@gmail.com wrote: Hi, there On 2012/11/01, at 21:23, Michael Snoyman wrote: Due to various technical reasons regarding the nature of conduit, you can't

Re: [Haskell-cafe] how to inject another source into conduit

2012-11-12 Thread Michael Snoyman
I don't think there's enough information in the snippet you've given to determine what the problem is. And in general, it's a good idea to include the actual error message from the compiler. On Mon, Nov 12, 2012 at 5:02 AM, Alexander V Vershilov alexander.vershi...@gmail.com wrote: Hello. I

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

2012-11-27 Thread Michael Snoyman
I think the stm-conduit package[1] may be helpful for this use case. Each time you get a new command, you can fork a thread and give it the TBMChan to write to, and you can use sourceTBMChan to get a source to send to the client. Michael [1] http://hackage.haskell.org/package/stm-conduit On

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

2012-11-27 Thread Michael Snoyman
On Tue, Nov 27, 2012 at 7:25 PM, Nicolas Trangez nico...@incubaid.comwrote: 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 use case. Each time you get a new command, you can fork a thread and give

[Haskell-cafe] yaml and aeson Was: Growing Haskell Platform

2012-12-07 Thread Michael Snoyman
On Fri, Dec 7, 2012 at 10:54 AM, Roman Cheplyaka r...@ro-che.info wrote: * Michael Snoyman mich...@snoyman.com [2012-12-07 09:52:07+0200] Let me bring up one other package: yaml (written by me). I think it's a pretty good fit for the standard YAML packaging library, since it simply reuses

Re: [Haskell-cafe] yaml and aeson Was: Growing Haskell Platform

2012-12-07 Thread Michael Snoyman
On Fri, Dec 7, 2012 at 12:00 PM, Roman Cheplyaka r...@ro-che.info wrote: * Michael Snoyman mich...@snoyman.com [2012-12-07 11:51:40+0200] As for toYAML/toJSON, I guess most of the time they are different anyway — otherwise it's defeating the purpose of YAML to be more human-readable

Re: [Haskell-cafe] LGPL and Haskell (Was: Re: ANNOUNCE: tie-knot library)

2012-12-13 Thread Michael Snoyman
To take this out of the academic realm and into the real-life realm: I've actually done projects for companies which have corporate policies disallowing the usage of any copyleft licenses in their toolset. My use case was a web application, which would not have been affected by a GPL library usage

Re: [Haskell-cafe] LGPL and Haskell (Was: Re: ANNOUNCE: tie-knot library)

2012-12-13 Thread Michael Snoyman
On Thu, Dec 13, 2012 at 10:14 AM, Colin Adams colinpaulad...@gmail.comwrote: On 13 December 2012 08:09, Michael Snoyman mich...@snoyman.com wrote: To take this out of the academic realm and into the real-life realm: I've actually done projects for companies which have corporate policies

Re: [Haskell-cafe] LGPL and Haskell (Was: Re: ANNOUNCE: tie-knot library)

2012-12-13 Thread Michael Snoyman
On Thu, Dec 13, 2012 at 11:35 AM, Ramana Kumar ramana.ku...@cl.cam.ac.ukwrote: On Thu, Dec 13, 2012 at 8:09 PM, Michael Snoyman mich...@snoyman.comwrote: I also don't think that distributing programs is as small a market as you think, and should also be something we support for commercial

Re: [Haskell-cafe] Hackage suggestion: Gather the list of the licenses of all dependencies of a package

2012-12-13 Thread Michael Snoyman
I think that's a great idea. I just implemented this on PackDeps: http://packdeps.haskellers.com/licenses As with all features on that site, I'll be happy to deprecate it as soon as Hackage incorporates the feature in the future. Michael On Thu, Dec 13, 2012 at 12:41 PM, Petr P

Re: [Haskell-cafe] Hackage suggestion: Gather the list of the licenses of all dependencies of a package

2012-12-13 Thread Michael Snoyman
On Thu, Dec 13, 2012 at 3:53 PM, Vincent Hanquez t...@snarc.org wrote: On 12/13/2012 12:51 PM, Michael Snoyman wrote: I think that's a great idea. I just implemented this on PackDeps: http://packdeps.haskellers.**com/licenseshttp://packdeps.haskellers.com/licenses As with all features

Re: [Haskell-cafe] Hackage suggestion: Gather the list of the licenses of all dependencies of a package

2012-12-13 Thread Michael Snoyman
felipe.le...@gmail.com wrote: While you're at it, maybe whitelisting cpphs would be nice as well =). On Thu, Dec 13, 2012 at 12:03 PM, Michael Snoyman mich...@snoyman.com wrote: On Thu, Dec 13, 2012 at 3:53 PM, Vincent Hanquez t...@snarc.org wrote: On 12/13/2012 12:51 PM, Michael Snoyman

Re: [Haskell-cafe] Hackage suggestion: Gather the list of the licenses of all dependencies of a package

2012-12-13 Thread Michael Snoyman
true ;). [1] http://code.haskell.org/cpphs/README On Thu, Dec 13, 2012 at 1:08 PM, Michael Snoyman mich...@snoyman.com wrote: Are you referring to: http://code.haskell.org/cpphs/LICENCE-commercial If the package is dual-licensed BSD3 and LGPL, maybe Malcolm could change the cabal

Re: [Haskell-cafe] Hackage suggestion: Gather the list of the licenses of all dependencies of a package

2012-12-13 Thread Michael Snoyman
On Thu, Dec 13, 2012 at 9:51 PM, Daniel Trstenjak daniel.trsten...@gmail.com wrote: On Thu, Dec 13, 2012 at 08:40:09PM +0200, Michael Snoyman wrote: If you have a commercial use for cpphs, and feel the terms of the (L)GPL are too onerous, you have the option of distributing unmodified

Re: [Haskell-cafe] Hackage suggestion: Gather the list of the licenses of all dependencies of a package

2012-12-15 Thread Michael Snoyman
On Sat, Dec 15, 2012 at 4:25 PM, Malcolm Wallace malcolm.wall...@me.comwrote: On 13 Dec 2012, at 10:41, Petr P wrote: In particular, we can have a BSD package that depends on a LGPL package, and this is fine for FOSS developers. But for a commercial developer, this can be a serious issue

Re: [Haskell-cafe] Stackage mailing list

2012-12-22 Thread Michael Snoyman
Sorry for the double-post, sent the first one from the wrong email address. Hi Joachim, I have not yet created a mailing list, but it should certainly be done. There is also not yet a web site for Stackage, but there should be one in the near future. At the very least, we'll need to host

Re: [Haskell-cafe] Type error when trying to adapt http-proxy to new conduit

2012-12-27 Thread Michael Snoyman
On Thu, Dec 27, 2012 at 9:42 AM, Erik de Castro Lopo mle...@mega-nerd.comwrote: Pieter Laeremans wrote: Hi, The http-proxy package isn't compatible any longer with the latest conduit. Since it is open source, I thought, I might as well try to adapt it and submit a patch. Have you

Re: [Haskell-cafe] Safe 'chr' function?

2013-01-03 Thread Michael Snoyman
You could wrap chr with a call to spoon[1]. It's not the most elegant solution, but it works. [1] http://hackage.haskell.org/packages/archive/spoon/0.3/doc/html/Control-Spoon.html#v:spoon On Thu, Jan 3, 2013 at 9:50 AM, Myles C. Maxfield myles.maxfi...@gmail.comwrote: Hello, I'm working on a

Re: [Haskell-cafe] Stackage mailing list

2013-01-19 Thread Michael Snoyman
I've now created a Stackage mailing list: https://groups.google.com/d/forum/stackage I encourage anyone who's interested to join the list. On Sat, Dec 22, 2012 at 11:50 AM, Joachim Breitner m...@joachim-breitner.de wrote: Dear Michael, I’m wondering if I missed something, but is there a

Re: [Haskell-cafe] How to store Fixed data type in the database with persistent ?

2013-01-25 Thread Michael Snoyman
I can point you to the line of code causing you trouble[1]. The problem is, as you already pointed out, that we don't have a PersistValue constructor that fits this case correctly. I think the right solution is to go ahead and add such a constructor for the next release. I've opened a ticket on

Re: [Haskell-cafe] How to store Fixed data type in the database with persistent ?

2013-01-26 Thread Michael Snoyman
Very nice to see, I'm happy to stand corrected here. We'll definitely get some support for fixed into the next major release. On Saturday, January 26, 2013, wrote: According to the documentation, SQLite stores whatever you give it, paying very little heed to the declared type. If you get

Re: [Haskell-cafe] How to store Fixed data type in the database with persistent ?

2013-01-27 Thread Michael Snoyman
On Jan 27, 2013 8:46 AM, alexander.vershi...@gmail.com wrote: Sat, Jan 26, 2013 at 12:21:02PM +0600, s9gf4...@gmail.com wrote According to the documentation, SQLite stores whatever you give it, paying very little heed to the declared type. If you get SQLite to *compare* two numbers, it

Re: [Haskell-cafe] branching conduits

2013-01-31 Thread Michael Snoyman
On Thu, Jan 31, 2013 at 11:48 AM, Simon Marechal si...@banquise.net wrote: Hello, I have found the Conduit abstraction to be very well suited to a set of problems I am facing. I am however wondering how to implement branching conduits, and even conduit pools. I am

Re: [Haskell-cafe] Yet another Conduit question

2013-01-31 Thread Michael Snoyman
Firstly, what's the use case that you want to deal with lists? If it's for efficiency, you'd probably be better off using a Vector instead. But I think the inverse of `concat` is `singleton = Data.Conduit.List.map return`, or `awaitForever $ yield . return`, using the list instance for Monad.

Re: [Haskell-cafe] Yet another Conduit question

2013-01-31 Thread Michael Snoyman
On Fri, Feb 1, 2013 at 8:42 AM, Simon Marechal si...@banquise.net wrote: On 02/01/2013 05:21 AM, Michael Snoyman wrote: Firstly, what's the use case that you want to deal with lists? If it's for efficiency, you'd probably be better off using a Vector instead. That is a good point, and I

Re: [Haskell-cafe] Yet another Conduit question

2013-02-04 Thread Michael Snoyman
, Michael Snoyman wrote: So you're saying you want to keep the same grouping that you had originally? Or do you want to batch up a certain number of results? There are lots of ways of approaching this problem, and the types don't imply nearly enough to determine what you're hoping to achieve

Re: [Haskell-cafe] Yet another Conduit question

2013-02-04 Thread Michael Snoyman
On Mon, Feb 4, 2013 at 3:47 PM, Simon Marechal si...@banquise.net wrote: On 03/02/2013 16:06, Felipe Almeida Lessa wrote: I guess you could use the Flush datatype [1] depending on how your data is generated. Thank you for this suggestion. I tried to do exactly this by modifying my bulk

Re: [Haskell-cafe] Yet another Conduit question

2013-02-04 Thread Michael Snoyman
appreciate any other insights regarding concerns, issues, or oddities that I might encounter with the above. Thanks, Kevin On Mon, 04 Feb 2013 02:25:11 -0700, Michael Snoyman mich...@snoyman.com wrote: I think this is probably the right approach. However, there's something important to point

Re: [Haskell-cafe] xml conduit

2013-02-09 Thread Michael Snoyman
Hi Grant, As you might expect from immutable data structures, there's no way to update in place. The approach you'd take to XSLT: traverse the tree, check each node, and output a new structure. I put together the following as an example, but I could certainly imagine adding more combinators to

Re: [Haskell-cafe] xml conduit

2013-02-10 Thread Michael Snoyman
On Sun, Feb 10, 2013 at 8:51 PM, grant the...@hotmail.com wrote: Michael Snoyman michael at snoyman.com writes: Hi Michael, Just one last thought. Does it make any sense that xml-conduit could be rewritten as a lens instead of a cursor? Or leverage the lens package somehow? That's

Re: [Haskell-cafe] xml conduit

2013-02-11 Thread Michael Snoyman
On Sun, Feb 10, 2013 at 8:34 PM, Michael Snoyman mich...@snoyman.comwrote: On Sun, Feb 10, 2013 at 8:51 PM, grant the...@hotmail.com wrote: Michael Snoyman michael at snoyman.com writes: Hi Michael, Just one last thought. Does it make any sense that xml-conduit could be rewritten

[Haskell-cafe] ANNOUNCE: hackage-proxy 0.1.0.0

2013-02-17 Thread Michael Snoyman
I'd like to announce the first release of a new tool called hackage-proxy. The purpose is to provide a local proxy for a Hackage server, which somehow modifies files in transport. The motivating case for this was getting more meaningful error output from Stackage when compiling against GHC HEAD.

[Haskell-cafe] RFC: rewrite-with-location proposal

2013-02-24 Thread Michael Snoyman
Quite a while back, Simon Hengel and I put together a proposal[1] for a new feature in GHC. The basic idea is pretty simple: provide a new pragma that could be used like so: error :: String - a errorLoc :: IO Location - String - a {-# REWRITE_WITH_LOCATION error errorLoc #-} Then all usages of

Re: [Haskell-cafe] RFC: rewrite-with-location proposal

2013-02-25 Thread Michael Snoyman
On Mon, Feb 25, 2013 at 11:13 AM, Simon Hengel s...@typeful.net wrote: On Mon, Feb 25, 2013 at 09:57:04AM +0100, Joachim Breitner wrote: Hi, Am Montag, den 25.02.2013, 08:06 +0200 schrieb Michael Snoyman: Quite a while back, Simon Hengel and I put together a proposal[1] for a new

Re: [Haskell-cafe] RFC: rewrite-with-location proposal

2013-02-25 Thread Michael Snoyman
On Mon, Feb 25, 2013 at 2:15 PM, Alexander Kjeldaas alexander.kjeld...@gmail.com wrote: On Mon, Feb 25, 2013 at 12:46 PM, Simon Hengel s...@typeful.net wrote: On Mon, Feb 25, 2013 at 10:40:29AM +0100, Twan van Laarhoven wrote: I think there is no need to have a separate

Re: [Haskell-cafe] RFC: rewrite-with-location proposal

2013-02-25 Thread Michael Snoyman
On Mon, Feb 25, 2013 at 4:42 PM, Simon Peyton-Jones simo...@microsoft.comwrote: I’m afraid the rewrite-rule idea won’t work. RULES are applied during optimisation, when tons of inlining has happened and the program has been shaken around a lot. No reliable source location information is

Re: [Haskell-cafe] RFC: rewrite-with-location proposal

2013-02-26 Thread Michael Snoyman
is implemented. But would this approach implement the shallow trace, or the full stack trace? Michael Simon ** ** *From:* michael.snoy...@gmail.com [mailto:michael.snoy...@gmail.com] *On Behalf Of *Michael Snoyman *Sent:* 25 February 2013 18:19 *To:* Simon Peyton-Jones *Cc

Re: [Haskell-cafe] Simple way to do something like ArrowChoice.right on a Conduit? (version 1.0.0)

2013-03-03 Thread Michael Snoyman
On Fri, Mar 1, 2013 at 4:18 AM, Joey Adams joeyadams3.14...@gmail.comwrote: 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) This is named after the

Re: [Haskell-cafe] Future of MonadCatchIO

2013-03-03 Thread Michael Snoyman
On Sun, Mar 3, 2013 at 6:07 PM, Ertugrul Söylemez e...@ertes.de wrote: Arie Peterson ar...@xs4all.nl wrote: Would anyone have a problem with a deprecation of MonadCatchIO-transformers, and a failure to update it to work with a base without 'block' and 'unblock'? Yes. This is a

Re: [Haskell-cafe] Simple way to do something like ArrowChoice.right on a Conduit? (version 1.0.0)

2013-03-05 Thread Michael Snoyman
Wow, I hadn't realized that someone had implemented resumable sinks... and now resumable conduits too! Very interesting. 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

Re: [Haskell-cafe] Simple way to do something like ArrowChoice.right on a Conduit? (version 1.0.0)

2013-03-05 Thread Michael Snoyman
On Wed, Mar 6, 2013 at 5:48 AM, Joey Adams joeyadams3.14...@gmail.comwrote: On Tue, Mar 5, 2013 at 9:24 AM, Michael Snoyman mich...@snoyman.comwrote: ... 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

[Haskell-cafe] File I/O benchmark help (conduit, io-streams and Handle)

2013-03-07 Thread Michael Snoyman
Hi all, I'm turning to the community for some help understanding some benchmark results[1]. I was curious to see how the new io-streams would work with conduit, as it looks like a far saner low-level approach than Handles. In fact, the API is so simple that the entire wrapper is just a few lines

<    1   2   3   4   5   6   7   >