It uses the 1.0 types. :)
Looks good to me. I would recommend using the Conduit nomenclature for the 4-connection-operators section, since conduit used to be implemented just like that.
$$, $=, =$, and =$=
-- Dan Burton
First impression: it's not really a pearl; reads more like expandedOn Thu, 2013-06-13 at 07:25 -0700, Gabriel Gonzalez wrote:
> One of the reasons I've been busy lately is that I've been busy writing
> up a small `pipes` functional pearl for the Haskell symposium. I would
> be really grateful if any of you guys have time to review it.
documentation of a library API — which is sorely needed (I've been
fighting to keep up with the melange of blog posts, reddit comments,
and .Tutorial packages to understand enough of pipes to work with it,
and losing) — but my sense of the Functional Pearls over time has been
that they show a solution to an interesting [practical] problem; ie,
Suduko solver, the Financial Contract DSLs, etc. I think even the
original pretty print paper might have been one.
So if you were to take what you have and beef it up with a practical (vs
contrived) example of all the theory being applied to a problem
neophytes can understand (say, oh, I don't know, applying pipes to
process a stock ticker feed or something).
This represents several more pages of writing, of course; not what you
really wanted to hear.
++
Now that said, I look forward to reading it so I can learn something!
Does this use all the new 4.0 types?
Can you [in preprint form] output it as a single column? Double column
PDFs are a pain to read on mobile devices.
Lazy linked lists sit at the intersection of Haskell's two biggest strengths:laziness and purity. However, they are strictly less powerful than Python'sgenerators because they cannot embed effects. We require effectful streams ifwe wish to meaningfully communicate with the outside world.Effectful streams come in three flavors: input streams, output streams, andstream transformers. Most streaming libraries treat input streamsor output streams as first-class citizens, building rich domain-specific languages for them, but thenallow stream transformers to languish as second-class citizens. Here we shall alsobegin from input streams by implementing Python-style generators in Haskell, butthen gravitate towards an approach that places transformations front and center,generalizing other approaches in the process.This transformations-first approach is not only general, but also theoreticallyinspired. We draw a parallel between streaming transformations and themorphisms of category theory and show how the category laws correspond tostreaming best practices.
Haskell's lazy lists are less powerful than Python's generators because purelists do not embed effects. We require effectful streams if we wish tocompete with Python and meaningfully communicate with the outside world.
Effectful streams come in three flavors: input streams, output streams, andstream transformers. Most streaming libraries treat input streamsor output streams as first-class citizens, building rich domain-specific languages forthem, but then allow stream transformers to languish as second-class citizens.
Here we also begin from input streams by reimplementing Python-style generatorsin Haskell, but then gravitate towards using stream transformers as the centralabstraction. This transformations-first approach not only generalizes otherapproaches, but also draws inspiration from theory. We draw a parallel between
transformations and the morphisms of category theory and show how the categorylaws correspond to streaming best practices.
It uses the 1.0 types. :)
Looks good to me. I would recommend using the Conduit nomenclature for the 4-connection-operators section, since conduit used to be implemented just like that.
$$, $=, =$, and =$=
--
You received this message because you are subscribed to the Google Groups "Haskell Pipes" group.
To unsubscribe from this group and stop receiving emails from it, send an email to haskell-pipe...@googlegroups.com.
To post to this group, send email to haskel...@googlegroups.com.
The reason I avoided the conduit operators was to deliberately to avoid the paper being misinterpreted as a dig against conduit. I was trying to keep the tone of the paper as neutral as possible and not single out other libraries.
--
Hi,I have read the first part with attention and skimmed the last parts. Here are some remarks (from a Haskell beginners).1° In the Generator section, the two first definitions didn't help much. "data List" and "data Step" sounded like extra noise to me.
2° To stick with the "Python-style", I would use "next" instead of "stepG" in the record syntax of data Generator. Then I would rename "next" into "stepG" in the Sinks section. I am not even sure "stepG/stepS" are the best names (I much prefer request/respond or something alike).
3° data Generator cannot use "newtype" ?
4° I find it easier to read StepG first and then Generator (page one). Small point but it makes a difference for a newbie like me.
5° The inline of "getFirst" is confusing at this point. I would remove that section (and make a note).
6° Again because this is not real code, the suffix "G" is noisy (knowing the purpose is to emulate "Python-style generator"). Maybe it could be introduced later from the Sink section ?
7° The inlining process of "oneTwo" is not much fun (but the monadic instance is)
8° Beginning of page 3, "echoAndLoop" is rather a strange example at that point. Maybe it should be a simple echo and then in the Sink section "echoAndLoop" would be introduced.
9° The Sinks transition is a bit abrupt. The "python" conductor line has been dropped without notice. We are leaving the strict realm of "input stream" after all.
I am a bit disappointed that the article (given its title) does not say anything about the Proxy, Request or Respond category.Overall I have found the current text more difficult to read than the Pipes tutorials. I think it should be possible to add some more fun in there.
Thanks for the read,