Re: [Haskell-cafe] Why were unfailable patterns removed and "fail" added to Monad?

2012-01-19 Thread Michael Snoyman
On Fri, Jan 20, 2012 at 5:23 AM, Edward Z. Yang wrote: > Oh, I'm sorry! On a closer reading of your message, you're asking not > only asking why 'fail' was added to Monad, but why unfailable patterns > were removed. > > Well, from the message linked: > >    In Haskell 1.4 g would not be in MonadZe

Re: [Haskell-cafe] Why were unfailable patterns removed and "fail" added to Monad?

2012-01-19 Thread Michael Snoyman
On Fri, Jan 20, 2012 at 6:41 AM, Edward Z. Yang wrote: > Aw, that is really suboptimal.  Have you filed a bug? I think it's a feature, not a bug. When dealing with monads that provide nice[1] implementations of `fail`, you can (ab)use this to avoid writing a bunch of case expressions. I remember

Re: [Haskell-cafe] Why were unfailable patterns removed and "fail" added to Monad?

2012-01-19 Thread Michael Snoyman
On Jan 20, 2012 8:31 AM, "John Meacham" wrote: > > > As expected, no warnings. But if I change this "unfailable" code above > > to the following failable version: > > > >data MyType = Foo | Bar > > > >test myType = do > >Foo <- myType > >return () > > > > I *still* get no w

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

2012-01-21 Thread Michael Snoyman
Hi Myles, These sound like two solid features, and I'd be happy to merge in code to support it. Some comments below. On Sat, Jan 21, 2012 at 8:38 AM, Myles C. Maxfield wrote: > To: Michael Snoyman, author and maintainer of http-conduit > CC: haskell-cafe > > Hello! >

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

2012-01-22 Thread Michael Snoyman
On Sun, Jan 22, 2012 at 11:07 PM, Myles C. Maxfield wrote: > Replies are inline. Thanks for the quick and thoughtful response! > > On Sat, Jan 21, 2012 at 8:56 AM, Michael Snoyman > wrote: >> >> Hi Myles, >> >> These sound like two solid features, and I'

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

2012-01-22 Thread Michael Snoyman
On Mon, Jan 23, 2012 at 8:31 AM, Myles C. Maxfield wrote: > 1. Oops - I overlooked the fact that the redirectCount attribute of a > Request is exported (it isn't listed on the documentation probably because > the constructor itself isn't exported. This seems like a flaw in > Haddock...). Silly me.

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

2012-01-22 Thread Michael Snoyman
, Aristid Breitkreuz wrote: > Just make sure Cookie handling can be disabled completely. > > Aristid > > Am 23.01.2012 07:44 schrieb "Michael Snoyman" : >> >> On Mon, Jan 23, 2012 at 8:31 AM, Myles C. Maxfield >> wrote: >> > 1. Oops - I overl

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

2012-01-22 Thread Michael Snoyman
eitkreuz wrote: > Indeed, I disagree on 2. Sometimes there is an API and cookies are just not > part of it (and redirects are). > > Aristid > > Am 23.01.2012 08:16 schrieb "Michael Snoyman" : > >> The only times cookies would be used would be: >> >> 1. If y

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

2012-01-23 Thread Michael Snoyman
On Mon, Jan 23, 2012 at 1:20 PM, Aristid Breitkreuz wrote: > Rejecting cookies is not without precedent. > > If you must force cookie handling upon us, at least make it possible to > selectively reject them. > > Aristid If you turn off automatic redirects, then you won't have cookie handling. I'd

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

2012-01-23 Thread Michael Snoyman
On Tue, Jan 24, 2012 at 8:37 AM, Myles C. Maxfield wrote: > I have attached a patch to add a redirect chain to the Response datatype. > Comments on this patch are very welcome. I thought that this isn't necessary since a client wanting to track all the redirects could just handle them manually by

Re: [Haskell-cafe] Why were unfailable patterns removed and "fail" added to Monad?

2012-01-24 Thread Michael Snoyman
On Fri, Jan 20, 2012 at 6:52 AM, Michael Snoyman wrote: > On Fri, Jan 20, 2012 at 6:41 AM, Edward Z. Yang wrote: >> Aw, that is really suboptimal.  Have you filed a bug? > > I think it's a feature, not a bug. When dealing with monads that > provide nice[1] implementations

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

2012-01-24 Thread Michael Snoyman
On Tue, Jan 24, 2012 at 6:57 PM, Myles C. Maxfield wrote: > > On Mon, Jan 23, 2012 at 10:43 PM, Michael Snoyman > wrote: >> >> On Tue, Jan 24, 2012 at 8:37 AM, Myles C. Maxfield >> wrote: >> > I have attached a patch to add a redirect chain to the Response

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

2012-01-24 Thread Michael Snoyman
; --Myles > > > On Tue, Jan 24, 2012 at 10:47 AM, Michael Snoyman > wrote: >> >> On Tue, Jan 24, 2012 at 6:57 PM, Myles C. Maxfield >> wrote: >> > >> > On Mon, Jan 23, 2012 at 10:43 PM, Michael Snoyman >> > wrote: >> >> >> &g

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

2012-01-24 Thread Michael Snoyman
On Wed, Jan 25, 2012 at 9:01 AM, Myles C. Maxfield wrote: > Sorry, I think I'm still a little confused about this. > > From the point of view of a library user, if I use the 'http' function, but > want to know what final URL I ended up at, I would have to set redirects to > 0, call http, call chec

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

2012-01-25 Thread Michael Snoyman
On Wed, Jan 25, 2012 at 8:18 PM, Myles C. Maxfield wrote: > Alright, that's fine. I just wanted to be explicit about the interface we'd > be providing. Taking the Request construction code out of 'http' and putting > it into its own function should be a quick change - I'll have it to you > soon. O

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

2012-01-26 Thread Michael Snoyman
st chains. >> >> Do you think that Network.HTTP.Conduit should have a persistent cookie jar >> between caller's requests? I don't really think so. >> >> --Myles >> >> >> On Wed, Jan 25, 2012 at 9:28 PM, Michael Snoyman >> wrote: >>

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

2012-01-28 Thread Michael Snoyman
On Sat, Jan 28, 2012 at 1:20 AM, Myles C. Maxfield wrote: > the fromJust should never fail, beceause of the guard statement: > >     | 300 <= code && code < 400 && isJust l'' && isJust l' = Just $ req > > Because of the order of the && operators, it will only evaluate fromJust > after it makes sur

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

2012-01-28 Thread Michael Snoyman
the Maybe monad was designed for. > > Here is a revised patch. > > > On Sat, Jan 28, 2012 at 8:28 AM, Michael Snoyman > wrote: >> >> On Sat, Jan 28, 2012 at 1:20 AM, Myles C. Maxfield >> wrote: >> > the fromJust should never fail, beceause of the guard

Re: [Haskell-cafe] TCP Server

2012-01-29 Thread Michael Snoyman
On Sun, Jan 29, 2012 at 2:21 PM, Felipe Almeida Lessa wrote: > On Sun, Jan 29, 2012 at 10:14 AM, Jean-Marie Gaillourdet > wrote: >> But it does try to solve the problem, doesn't it? Obviously conduit is an >> alternative to the iteratee-like packages. Why else would Yesod replace >> enumerator

Re: [Haskell-cafe] Stuck on HXT basics

2012-01-30 Thread Michael Snoyman
On Mon, Jan 30, 2012 at 3:06 PM, Pēteris Paikens wrote: > I'm quite stuck on getting HXT working to do my xml parsing, can you > help me to get started? > Even in > http://www.haskell.org/haskellwiki/HXT#Getting_started:_Hello_world_examples > the basic filter example that's given there in sectio

Re: [Haskell-cafe] TCP Server

2012-01-31 Thread Michael Snoyman
On Sat, Jan 28, 2012 at 12:51 PM, Jean-Marie Gaillourdet wrote: > Hello, > > On 27.01.2012, at 00:47, Alexander V Vershilov wrote: >> Recently I asked about tcp server libraries [1] and there was only one >> answer haskell-scallable-server [2], but in that package there was some >> dependencies an

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

2012-02-01 Thread Michael Snoyman
gt;> the Public Suffix List so I know that sub1.sub2.pvt.k12.wy.us can set a >> cookie for sub2.pvt.k12.wy.us but not for k12.wy.us (because pvt.k12.wy.us >> is a "suffix"). There are a variety of ways to implement this. >> >> As far as I can tell, Chrome d

Re: [Haskell-cafe] network-conduit failing to close sockets

2012-02-01 Thread Michael Snoyman
2012/2/1 Felipe Almeida Lessa : > 2012/2/1 Ertugrul Söylemez : >> Hello there, >> >> I have tried to implement a simple echo server using the network-conduit >> library version 0.2.1.  This is the code: >> >>    module Main where >> >>    import Data.Conduit >>    import Data.Conduit.Network >> >>

[Haskell-cafe] zlib 0.5.3.2 broken?

2012-02-01 Thread Michael Snoyman
Hi all, I've received a number of reports of a broken zlib 0.5.3.2 (and experienced it myself). Is this a generally known issue? As a temporary workaround, I've released a new version of zlib-bindings that has an upper bound on zlib to avoid 0.5.3.2 (and later). Once a new patched version is rele

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

2012-02-02 Thread Michael Snoyman
' (responseHeaders res) (W.statusCode > (statusCode res)) of >             Just req -> go (count - 1) req cookie_jar >             Nothing -> return res > > I plan to not allow for a user-supplied cookieFilter function. If they want > that functionality, they can re-impl

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

2012-02-03 Thread Michael Snoyman
2012/2/3 Ertugrul Söylemez : > 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 without the line feeds.  After > that, I'd like to switch to a

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

2012-02-04 Thread Michael Snoyman
late 3) `connectReturnSink` snk bsrc $$ sink2 That might be generally useful in other places as well, I'm not sure. Michael 2012/2/3 Michael Snoyman : > 2012/2/3 Ertugrul Söylemez : >> Hello there, >> >> I'm trying to build a server for testing the conduit and network-conduit >

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

2012-02-04 Thread Michael Snoyman
hat contains each element in the >> list. The list should export `elem`-type queries. I'm not quite sure how to >> handle wildcards that appear in the list - that part is up to you. Thanks >> for helping out with this :] >> >> --Myles >> >> >> On Thu,

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

2012-02-06 Thread Michael Snoyman
> 2. Yes - 1.3 is the first version that lists DiffTime as an instance of > RealFrac (so I can use the 'floor' function to pull out the number of > seconds to render it) > 3. I'll see what I can do. > > --Myles > > > On Sat, Feb 4, 2012 at 9:06 PM, Michael

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

2012-02-06 Thread Michael Snoyman
kind >> of functionality on top of http-conduit. >> >> I was originally going to do it and release it as its own package, but it >> may be beneficial to add such a module to the existing http-conduit package. >> Should I add it in to the existing package, or release i

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

2012-02-07 Thread Michael Snoyman
t; alleviated by exporting httpRaw. > > What do you think? > --Myles > > On Tue, Feb 7, 2012 at 12:35 AM, Myles C. Maxfield > wrote: >> >> Alright. I'll issue another pull request to you when it's done (expect in >> a couple weeks). >> >> Thanks

Re: [Haskell-cafe] Yesod and dependencies hell

2012-02-08 Thread Michael Snoyman
Are you talking about starting a new site, or running an existing site? For a new site, it's probably a good idea to wait until 0.10 comes out, as it includes a lot of nice enhancements, and we'll be releasing it this week. If an existing site, you probably need to have more strict upper bounds on

Re: [Haskell-cafe] [Yesod] Re: Yesod and dependencies hell

2012-02-09 Thread Michael Snoyman
On Thu, Feb 9, 2012 at 3:45 PM, Joachim Breitner wrote: > Hi, > > Am Donnerstag, den 09.02.2012, 11:39 + schrieb Chris Dornan: >> (I do think that we could be delivering the tools with a little more >> packaging that could significantly help with these situations. I have >> found them to be hi

Re: [Haskell-cafe] some question about conduit usage

2012-02-11 Thread Michael Snoyman
On Fri, Feb 10, 2012 at 4:26 PM, Alexander V Vershilov wrote: > Hello, cafe! > > I have somq questions about proper conduit usage in some usecases, > I can't find a good way to solve this problems > > 1). adding additional source to conduit processing [1] > Sometimes I want to run a Source and sen

Re: [Haskell-cafe] Subject: A universal data store interface

2012-02-13 Thread Michael Snoyman
Actually, Persistent is fully usable without any special syntax, DSLs, or Template Haskell. In fact, Persistent itself has no template-haskell dependencies, specifically so that it can be built on ghc-iphone. Additionally, the Persistent DSL syntax is completely separate from any other Yesod DSL sy

Re: [Haskell-cafe] Subject: A universal data store interface

2012-02-13 Thread Michael Snoyman
You make it sound like your options are "use the crippled abstraction layer" or "use the full-powered database layer." You're leaving out two very important points: 1. There's a reason the abstraction layer exists: it can be clumsy to go directly to the full-powered database for simple stuff. 2. Y

Re: [Haskell-cafe] Simple GUI library to view JSON?

2012-02-20 Thread Michael Snoyman
An extra step beyond that could be launching the application with wai-handler-launch[1], so that the user's default browser is automatically opened. [1] http://hackage.haskell.org/package/wai-handler-launch On Mon, Feb 20, 2012 at 9:24 PM, Clark Gaebel wrote: > You could set up a simple web serv

Re: [Haskell-cafe] Conduit Error Output: Control.Monad.Trans.Resource.stateCleanup

2012-02-20 Thread Michael Snoyman
On Tue, Feb 21, 2012 at 5:46 AM, Lyndon Maydwell wrote: > Hi Michael, Café. > > I'm writing some code using the conduit library and am encountering > the following error output (while the program appears to function > correctly) when using Data.Conduit.Lazy. > > The error given is: > >> profile_si

Re: [Haskell-cafe] Conduit Error Output: Control.Monad.Trans.Resource.stateCleanup

2012-02-20 Thread Michael Snoyman
On Tue, Feb 21, 2012 at 7:40 AM, Michael Snoyman wrote: > On Tue, Feb 21, 2012 at 5:46 AM, Lyndon Maydwell wrote: >> Hi Michael, Café. >> >> I'm writing some code using the conduit library and am encountering >> the following error output (while the program appear

Re: [Haskell-cafe] Conduit Error Output: Control.Monad.Trans.Resource.stateCleanup

2012-02-21 Thread Michael Snoyman
utput nothing > with no errors. I'm not sure of the significance of this as my code > was incorrect, however, using the code you demonstrated gives the > desired results. > > Thanks for the blindingly quick response! > > > On Tue, Feb 21, 2012 at 3:30 PM, Michael

Re: [Haskell-cafe] Inject cabal version or VCS version as a CPP macro

2012-02-22 Thread Michael Snoyman
I have a project at work that embeds the Mercurial version in the final executable. I use Template Haskell to call the hg executable and parse its output. Here's the relevant code snippet: putStrLn $ "Mercurial commit: " ++ $(do let getChangeset s =

Re: [Haskell-cafe] how to add monad-stack to network-conduit

2012-02-22 Thread Michael Snoyman
On Tue, Feb 21, 2012 at 5:10 PM, Alexander V Vershilov wrote: > Hello. > > I have got next problem: I want to have database connection pool > in server based on network-conduit. > So I wanted to be able to do > >> runTCPServer options action >>   where >>     action src snk = >>       pool <- ask

Re: [Haskell-cafe] question about conduit source

2012-02-28 Thread Michael Snoyman
On Tue, Feb 28, 2012 at 6:04 PM, Alexander V Vershilov wrote: > Hello, cafe. > > Is it possible to read data from different concurrent sources, > i.e. read data from source as soon as it become avaliable, e.g. > >  runResourceT $ (source1 stdin $= CL.map Left) >                   >=> (source2 hand

Re: [Haskell-cafe] Conduits and large ConduitResult chunks

2012-03-01 Thread Michael Snoyman
On Thu, Mar 1, 2012 at 11:50 PM, Nathan Howell wrote: > I'm porting lzma-enumerator over to conduits and I've run into a snag. > The output chunks from lzma can be quite large, so I'd like to stream > the results out in smaller chunks instead of tens (or hundreds) of > megabytes at a time. It seem

Re: [Haskell-cafe] Conduit Sink fork

2012-03-05 Thread Michael Snoyman
On Mon, Mar 5, 2012 at 1:54 AM, t helfferich wrote: > Hi! > So, it turns out I have a need for a sink that forks input into two other > sinks using the Conduit package. Here is what I came up > with: https://gist.github.com/1975383 > > Is this the right way to write it? Also, what left over value(

Re: [Haskell-cafe] Summer of Code idea: Haskell Web Toolkit

2012-03-06 Thread Michael Snoyman
On Tue, Mar 6, 2012 at 11:40 PM, Alejandro Serrano Mena wrote: > Hi, > I'm really looking forward to helping in the Summer of Code, if Haskell goes > into it this year (something I take for granted :). I would like to propose > an idea for a project, and I'm looking for suggestions about whether i

Re: [Haskell-cafe] Summer of Code idea: Haskell Web Toolkit

2012-03-06 Thread Michael Snoyman
use things like what Yesod > provides in a client-side context. And both sides would benefit: they can > share common code for datatypes (as it's done in Google Web Toolkit), and > autogenerate some code for sending or receiving AJAX requests, for example. > > > 2012/3/6 Mi

Re: [Haskell-cafe] Summer of Code idea: Haskell Web Toolkit

2012-03-07 Thread Michael Snoyman
Toolkit), and >> autogenerate some code for sending or receiving AJAX requests, for example. >> >> >> 2012/3/6 Michael Snoyman >>> >>> On Tue, Mar 6, 2012 at 11:40 PM, Alejandro Serrano Mena >>> wrote: >>> > Hi, >>> > I&#x

Re: [Haskell-cafe] ANNOUNCE: string-conversions-0.1

2012-03-09 Thread Michael Snoyman
On Fri, Mar 9, 2012 at 1:40 PM, Joachim Breitner wrote: > Hi Sönke, > > Am Freitag, den 09.03.2012, 11:17 +0100 schrieb Sönke Hahn: >> Any comments welcome. > > you could elaborate the documenatation “Assumes UTF-8” – I guess this > only applies to the two ByteString variants, as String and Text _

Re: [Haskell-cafe] ANNOUNCE: string-conversions-0.1

2012-03-09 Thread Michael Snoyman
On Fri, Mar 9, 2012 at 4:36 PM, Sönke Hahn wrote: > Michael Snoyman wrote: >> I'm the author of convertible-text, and I consider it deprecated (it's >> marked as such in the synopsis). >> >> As far as string-conversions, I'm a little concerned that

Re: [Haskell-cafe] network-conduit proxy

2012-03-10 Thread Michael Snoyman
I think I missed something in this thread. What's the bug in network-conduit? I'd like to have it patched in the next release. On Sat, Mar 10, 2012 at 9:19 AM, grant wrote: > Excellent. registering killThread works great. Hopefully the library will be > fixed correctly. > Thanks a lot for your he

Re: [Haskell-cafe] network-conduit proxy

2012-03-10 Thread Michael Snoyman
Seems to work perfectly for me. The statement you're expecting to be printed won't be printed until the original server (running on 5000) closes its socket. If I connect it to Warp, this takes about 30 seconds, which is the slowloris timeout period. On Sat, Mar 10, 2012 at 10:01 PM, grant wrote:

Re: [Haskell-cafe] network-conduit proxy

2012-03-10 Thread Michael Snoyman
You're running `clientSrc $$ serverSink` in a separate thread. What it's doing is blocking for any kind of input from clientSrc before it can continue. That thread knows nothing about the rest of the program, including that serverSink is closed. This is inherent to the network functions involved he

Re: [Haskell-cafe] cabal-install problem with alex dependency in bytestring-lexing

2012-03-16 Thread Michael Snoyman
The Yesod docs all state very explicitly that we depend on the Haskell Platform, and in particular that alex needs to be installed. However, that doesn't stop this issue from confusing people. I think a good short term solution could be what Alan Zimmerman did with language-javascript: include the

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

2012-03-18 Thread Michael Snoyman
On Sat, Mar 17, 2012 at 1:28 AM, Johan Tibell wrote: > On Fri, Mar 16, 2012 at 3:48 PM, Aleksey Khudyakov > wrote: >> On 17.03.2012 02:24, Johan Tibell wrote: >>> >>> I suggest you file a bug. :) >>> >> I'm way too lazy for that. Also I don't want to steal >> joy of reporting a bug from people wh

Re: [Haskell-cafe] adding the elements of two lists

2012-03-25 Thread Michael Snoyman
On Sun, Mar 25, 2012 at 2:01 PM, TP wrote: > Hello, > > My primary problem may be reduced to adding elements of two lists: > [1,2,3] + [4,5,6] = [5,7,9] > > My first idea was to declare a list of Int as an instance of Num, and define > (+) > in the correct way. > However, it seems it is not possi

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

2012-03-29 Thread Michael Snoyman
On Thu, Mar 29, 2012 at 7:15 PM, Peter Minten wrote: > Hi, > > I've been trying to get my head around Functional Reactive Programming > by writing a basic explanation of it, following the logic that > explaining something is the best way to understand it. > > Am I on the right track with this expl

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 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 >> imple

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

2012-04-01 Thread Michael Snoyman
On Sun, Apr 1, 2012 at 8:46 PM, Jeremy Shaw 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: >  http://hackage.haskell.org/packa

Re: [Haskell-cafe] A Modest Records Proposal

2012-04-02 Thread Michael Snoyman
On Mon, Apr 2, 2012 at 3:38 PM, Alp Mestanogullari 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, day) = toGregorian $

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

2012-04-04 Thread Michael Snoyman
s? >> >> >> I believe sequence sources together can already be done by `Monoid` >> instance. >> >>> >>> >>> Regards, >>> Paul Liu >>> >>> On Tue, Dec 27, 2011 at 3:45 PM, Aristid Breitkreuz >>> wrote: >>> > H

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

2012-04-04 Thread Michael Snoyman
On Wed, Apr 4, 2012 at 7:59 PM, MightyByte wrote: > pranjal pandit 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 (http://amnesia.sourceforge.net/use

[Haskell-cafe] Yesod 1.0 Release Candidate

2012-04-04 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 wrote: > +haskell-cafe, oops > > On Thu, Apr 5, 2012 at 11:04 AM, Gregory Collins > wrote: >> >> On Wed, Apr 4, 2012 at 10:09 PM, tsuraan wrote: >>> >>> > It's hard to rule Snap timeouts out; try building snap-core with the >>> > "-fdebug" flag an

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

2012-04-08 Thread Michael Snoyman
On Apr 8, 2012 8:47 AM, "Bryan O'Sullivan" wrote: > > On Sun, Mar 18, 2012 at 12:02 AM, Michael Snoyman wrote: >> >> >> OK, issue created: https://github.com/bos/text/issues/19 > > > I fixed the too-much-inlining bug tonight. As a bonus, Text lit

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 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 seems to need 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:27 PM, Erik de Castro Lopo 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/

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 wrote: > On 9 April 2012 21:34, Michael Snoyman 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'v

[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 e

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 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 > scenarios (Please note

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 wrote: > Thanks for responding to this. Some responses are inline. > > On Sat, Apr 14, 2012 at 8:30 PM, Michael Snoyman wrote: [snip] >> No, nothing so complicated is intended. Most likely you'll never >> return any

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

2012-04-15 Thread Michael Snoyman
       | otherwise = takeConduitHelper (x - 1) (head lin : lout) $ tail >> lin >> >> partial :: (Num t, Monad m, Enum t) => m ([[t]], [[t]]) >> partial = do >>  (source, output) <- CL.sourceList [[1..8]] C.$$+ (takeConduit 5 C.=$ >> CL.consume) >>  ou

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 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 co

[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 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 a

[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 I've

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 wrote: > Hi all, > > I'm wondering if there are still active users out there of > http-enumerator. Four months ago I released http-conduit

[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 we

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 wrote: > Hi, > > On 25 April 2012 16:36, Michael Snoyman wrote: >> >>    Prelude.head: empty list > > > Recent versions of GHC actually generate a very helpful stack trace, if the > program is compiled with pro

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 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

Re: [Haskell-cafe] using ResourceT with MVars

2012-05-02 Thread Michael Snoyman
On Wed, May 2, 2012 at 11:36 AM, Warren Harris 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 transaction-like behav

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 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 create it from the

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 an

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

2012-05-29 Thread Michael Snoyman
yield/await would be a good solution to the problem? Michael On Mon, May 21, 2012 at 6:07 AM, Michael Snoyman 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

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

2012-06-03 Thread Michael Snoyman
uilt >> against version 2? This would make GHC think the type-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" >> wrote: >>> >>>

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 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 failed > again. >

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 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 conne

[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 wrote: > On Thu, Jun 28, 2012 at 6:11 PM, Michael Snoyman 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 programmin

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] http://www.pgbovine.

[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 a

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 wrote: > On Wed, Jul 11, 2012 at 10:25 AM, Michael Snoyman > 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' >>

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 wrote: > 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 > > #include > >

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 wrote: > > > On Wed, Jul 11, 2012 at 9:55 PM, Bardur Arantsson wrote: > >> On 07/11/2012 05:12 PM, Michael Snoyman wrote: >> > >> > Thanks for the feedback. However, looking at sqlite3.c, I see th

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 wrote: > 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: > > > >

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" 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 the com

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 wrote: > On Thu, Jul 12, 2012 at 07:20:39PM +0300, Michael Snoyman wrote: > > On Jul 12, 2012 7:13 PM, "Tristan Ravitch" wrote: > > > > > > On Thu, Jul 12, 2012 at 11:07:05AM -0500, Tristan Ravitch wrote: &g

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

2012-07-31 Thread Michael Snoyman
On Tue, Jul 31, 2012 at 1:13 PM, Alexander Foremny 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 makes sense and if such

[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 resourc

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 wrote: > On 16 August 2012 03:38, Bryan O'Sullivan 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 intended to hack > around > > t

<    1   2   3   4   5   6   7   >