Important conduit updates

19 views
Skip to first unread message

Michael Snoyman

unread,
May 29, 2012, 1:20:46 PM5/29/12
to yeso...@googlegroups.com
Hi everyone,

I'm not sure to what extent people on this list follow Reddit, Planet
Haskell, and the Yesod blog, but there have been a few important posts
recently that I thought should be brought to everyone's attention.

* Most importantly, I'm asking for input for the next set of changes
to conduit[1]. Nothing on the table is revolutionary, it's just minor
breaking changes. I'm not even sure if it will require a breaking
change in Yesod, but if it does, it will be a minor one. There's no
rush on this coming out, so no need to worry, but I would like the
Yesod community in particular to be involved in the discussion.
* There was a post written that made some serious accusations against
conduit. They are all false. Not only are they false, but the code
samples in the blog post do not generate the output that the author
claims, and the author admits it. I've written to him offlist to give
him a chance to correct this himself. But in the meanwhile, I wanted
to let everyone know that there's no concern about your Yesod sites
blowing up.

Also, for those of you who have been following Reddit: thank you for
keeping our side of the conversation to a high standard of decorum.
There have been plenty of opportunities to get upset, and I don't
think there's been a single word out of line from our side.

Michael

[1] http://www.yesodweb.com/blog/2012/05/next-conduit-changes

Jeremy Shaw

unread,
May 29, 2012, 3:44:49 PM5/29/12
to yeso...@googlegroups.com
On Tue, May 29, 2012 at 12:20 PM, Michael Snoyman <mic...@snoyman.com> wrote

> * [snip] the code
> samples in the blog post do not generate the output that the author
> claims, and the author admits it.

Can you clarify what you mean? I typed in all the examples here:

http://hpaste.org/69217

And after fixing some typos, I get the same output shown in the
blog... I am using conduit 0.4.2.

- jeremy

Michael Snoyman

unread,
May 29, 2012, 9:26:52 PM5/29/12
to yeso...@googlegroups.com
Sure. After I pointed out that the original code was flawed, he
changed it. (I think I have the original code on my other computer, I
can probably send it to you in a few hours if you're interested.)

Either way, the claim "The right-associative grouping accidentally
drops the finalizer." itself is incorrect: there's no question of
whether or not finalization occurs, the question is how it occurs. The
way he's structured the code, the finalizer for the first field in
mySink will be called, not the second field. Since he's not provided a
finalizer, no finalizer is being called. It's not a bug, it's intended
behavior.

The only aspect of all this that you can claim is a bug is that
returning leftovers without consuming input produces non-associative
behavior. Doing so is a violation of the invariants, and this same
condition has existed since enumerator. My proposed Leftover
constructor lets code work even when violating this invariant, even
though it makes no sense to use it.

The author did admit that his other claim about finalizers was
incorrect, but only did so by striking out the text at the end of the
post. As for the other two points in the post, I think it's already
been thoroughly shown that they have no basis, but I can clarify that
as well if it will set people's minds at ease.

In other words, the only claim from the blog that is true is that data
loss can occur if you return leftovers without consuming input. I do
not consider that buggy behavior, but even so my 0.5 proposal fixes
it.

Michael

Rodrigo Gadea

unread,
May 30, 2012, 2:46:59 AM5/30/12
to yeso...@googlegroups.com

I agree, everyone "kept the tone", seems a "good call for unity" between the Haskell community by really discussing ideas in a proper way. I think this way has made Haskell community grow in terms of software - despite its size (and I think it will always be relatively small by nature).

It seems to me that "baseless-editor-war" habits (the original was won by Emacs) will remain a bit in people (probably because they use vi[m]) but rational discussion may fix it. (Whereas you can't fix vi[m], just port Emacs to Haskell).
 

Michael

[1] http://www.yesodweb.com/blog/2012/05/next-conduit-changes

Michael Snoyman

unread,
May 30, 2012, 3:04:10 AM5/30/12
to yeso...@googlegroups.com
Doesn't it make more sense to port Haskell to Emacs? I mean, after
all, I usually run GHC in my OS, not vice-versa. ;)

Michael

-- Sent from Vim
Reply all
Reply to author
Forward
0 new messages