tag:blogger.com,1999:blog-1777990983847811806.post5027778649124539337..comments2024-03-16T16:29:29.582-07:00Comments on Haskell for all: pipes-3.0 - A simpler, unified APIGabriella Gonzalezhttp://www.blogger.com/profile/01917800488530923694noreply@blogger.comBlogger12125tag:blogger.com,1999:blog-1777990983847811806.post-18403086855650857122012-12-28T14:17:42.313-08:002012-12-28T14:17:42.313-08:00Oh, thanks!Oh, thanks!Ørjan johansennoreply@blogger.comtag:blogger.com,1999:blog-1777990983847811806.post-35760924562297586632012-12-28T14:10:38.920-08:002012-12-28T14:10:38.920-08:00If you use `p C a () b`, then you can't compos...If you use `p C a () b`, then you can't compose two pipes. For example, if you had:<br /><br />p1 :: () -> p C a () b m r<br />p2 :: () -> p C b () c m r<br /><br />... then composition would not type-check because their connected interface would not match:<br /><br />p1 >-> p2 -- Type error<br /><br />This implies that Producers are NOT special cases of pipes. A producer can never await, but a pipe always can. This is actually a feature of the Proxy model over the original Pipe model. With classic pipes, there was no way to forbid awaits for producers.Gabriella Gonzalezhttps://www.blogger.com/profile/01917800488530923694noreply@blogger.comtag:blogger.com,1999:blog-1777990983847811806.post-47813228721754526132012-12-28T14:05:16.328-08:002012-12-28T14:05:16.328-08:00Hi, I am just reading the tutorial, and shouldn...Hi, I am just reading the tutorial, and shouldn't <br />type Pipe p a b = p () a () b<br />really have been<br />type Pipe p a b = p C a () b<br />?Ørjan Johansennoreply@blogger.comtag:blogger.com,1999:blog-1777990983847811806.post-67137644703001856252012-12-25T17:59:13.460-08:002012-12-25T17:59:13.460-08:00Yeah. I fixed all the tutorial examples in the Gi...Yeah. I fixed all the tutorial examples in the Github repository and the fixed versions will be included in the next minor release in January.Gabriella Gonzalezhttps://www.blogger.com/profile/01917800488530923694noreply@blogger.comtag:blogger.com,1999:blog-1777990983847811806.post-89370851363677536752012-12-23T21:21:58.529-08:002012-12-23T21:21:58.529-08:00In your tutorial, withFile needs a second argument...In your tutorial, withFile needs a second argument of ReadMode for the code to compile.rirelanhttps://www.blogger.com/profile/05528476163374428037noreply@blogger.comtag:blogger.com,1999:blog-1777990983847811806.post-30412623575721092292012-12-13T11:33:04.982-08:002012-12-13T11:33:04.982-08:00Thank you!Thank you!Gabriella Gonzalezhttps://www.blogger.com/profile/01917800488530923694noreply@blogger.comtag:blogger.com,1999:blog-1777990983847811806.post-30083620042252775542012-12-13T11:32:01.599-08:002012-12-13T11:32:01.599-08:00Yes, but there is still the dependency issue, plus...Yes, but there is still the dependency issue, plus the fact that `void` is not in the Haskell platform yet. However, if it does get in the Haskell platform then I probably would reconsider and switch `C` to a type synonym around `Void` or maybe just get rid of `C` completely.Gabriella Gonzalezhttps://www.blogger.com/profile/01917800488530923694noreply@blogger.comtag:blogger.com,1999:blog-1777990983847811806.post-6335044027083846282012-12-13T05:54:26.015-08:002012-12-13T05:54:26.015-08:00Props for the excellent tutorial. I'm finally ...Props for the excellent tutorial. I'm finally seeing the beauty behind that inscrutable API.<br /><br />Will be using from now on :).Quentin Moserhttp://null.orgnoreply@blogger.comtag:blogger.com,1999:blog-1777990983847811806.post-87111376779621286802012-12-12T17:05:02.806-08:002012-12-12T17:05:02.806-08:00By using void you get to use "Void", whi...By using void you get to use "Void", which is good because it's a known name for the empty data type. "C" in undoubtedly shorter, but doesn't mean anything (I read it as "constructor" on my head).Anonymousnoreply@blogger.comtag:blogger.com,1999:blog-1777990983847811806.post-50743409498378282322012-12-12T16:11:16.884-08:002012-12-12T16:11:16.884-08:00*very easily
Not "verily"; I don't ...*very easily<br /><br />Not "verily"; I don't want to come across as pompous :)Gabriella Gonzalezhttps://www.blogger.com/profile/01917800488530923694noreply@blogger.comtag:blogger.com,1999:blog-1777990983847811806.post-51204123374323221552012-12-12T16:09:42.074-08:002012-12-12T16:09:42.074-08:00There are three reasons I hand-roll my own empty t...There are three reasons I hand-roll my own empty type.<br /><br />First, the `void` package brings in several dependencies transitively by virtue of its `semigroups` dependency, such as `containers` and `deepseq` and `array`, and I was trying to minimize dependencies.<br /><br />Second, you don't gain anything from reusing the `Void` type. The classic reason to use Edward's `void` instead of rolling your own is so that you can reuse his absurd function and his variations on it, but you don't actually need any of those with `pipes`. You can verily cast blocked ends to polymorphic ends without using any tricks. See the implementation of `unitD` and `unitU` in `Control.Proxy.Prelude.Base`, neither of which require any of the fancy tricks from the `void` package.<br /><br />Finally, it's a shorter type name. This helps a lot when users get a type error or ask for an inferred type and the type synonym does not stick. It's just one less thing to intimidate users of the library.Gabriella Gonzalezhttps://www.blogger.com/profile/01917800488530923694noreply@blogger.comtag:blogger.com,1999:blog-1777990983847811806.post-74027636667327934582012-12-12T16:04:25.028-08:002012-12-12T16:04:25.028-08:00Nice. Is there any particular reason for wanting t...Nice. Is there any particular reason for wanting to have your own uninhabited type (C)? I think it'd be nice to see people consolidate on http://hackage.haskell.org/package/void for empty types; unless there's a real reason for distinguishing different notions of emptiness.Anonymousnoreply@blogger.com