
Hello, I come back to my reverse proxy work today. But I could not find wai and warp repository (or branch) based on conduit. Where can I find them? --Kazu

On Thu, Jan 12, 2012 at 7:41 AM, Kazu Yamamoto
Hello,
I come back to my reverse proxy work today. But I could not find wai and warp repository (or branch) based on conduit. Where can I find them?
--Kazu

Ah. The master branch is already integrated with conduit! Thanks. --Kazu

Hello, I have modified Mighttpd 2 to use Conduit and it is now running on my domain, Mew.org. Using Conduit made my code much much simpler than before. And Conduit is much easier to use especially on passing Source around and error handling. I was excited. I believe that Conduit is a right way to go. Michael, thank you for great work! What's missing for me is null source. I added the followings to my code but I would be happy if Conduit provide them. Note that we should choose better names and parameterize their types. eof :: PreparedSource IO Builder eof = PreparedSource { sourcePull = return Closed , sourceClose = return () } nullSource :: Source IO Builder nullSource = Source (return eof) --Kazu
On Thu, Jan 12, 2012 at 7:41 AM, Kazu Yamamoto
wrote: Hello,
I come back to my reverse proxy work today. But I could not find wai and warp repository (or branch) based on conduit. Where can I find them?
--Kazu

Thanks for the positive feedback Kazu!
For the nullSource, you can actually use mempty, since Source is an
instance of Monoid. I realize now that I didn't even think about this
when I was writing http-conduit, and instead used `sourceList []` in a
few places. I think in conduit 0.0.4 I'll include
Data.Conduit.List.sourceNull, with a comment that it's just a
type-restricted synonym for mempty. Sound good?
Michael
On Fri, Jan 13, 2012 at 8:45 AM, Kazu Yamamoto
Hello,
I have modified Mighttpd 2 to use Conduit and it is now running on my domain, Mew.org.
Using Conduit made my code much much simpler than before. And Conduit is much easier to use especially on passing Source around and error handling. I was excited. I believe that Conduit is a right way to go. Michael, thank you for great work!
What's missing for me is null source. I added the followings to my code but I would be happy if Conduit provide them. Note that we should choose better names and parameterize their types.
eof :: PreparedSource IO Builder eof = PreparedSource { sourcePull = return Closed , sourceClose = return () }
nullSource :: Source IO Builder nullSource = Source (return eof)
--Kazu
On Thu, Jan 12, 2012 at 7:41 AM, Kazu Yamamoto
wrote: Hello,
I come back to my reverse proxy work today. But I could not find wai and warp repository (or branch) based on conduit. Where can I find them?
--Kazu
_______________________________________________ web-devel mailing list web-devel@haskell.org http://www.haskell.org/mailman/listinfo/web-devel

For the nullSource, you can actually use mempty, since Source is an instance of Monoid. I realize now that I didn't even think about this when I was writing http-conduit, and instead used `sourceList []` in a few places. I think in conduit 0.0.4 I'll include Data.Conduit.List.sourceNull, with a comment that it's just a type-restricted synonym for mempty. Sound good?
Yes, sounds great. Thank you. --Kazu

I'd like to add that sourceNull is a rather confusing name, and
sourceEmpty would be more consistent with the other libraries out
there.
See e.g.
Data.Map.null :: Map k a -> Bool
Data.Map.empty :: Map k a
Cheers,
Jasper
On Fri, Jan 13, 2012 at 7:57 AM, Kazu Yamamoto
For the nullSource, you can actually use mempty, since Source is an instance of Monoid. I realize now that I didn't even think about this when I was writing http-conduit, and instead used `sourceList []` in a few places. I think in conduit 0.0.4 I'll include Data.Conduit.List.sourceNull, with a comment that it's just a type-restricted synonym for mempty. Sound good?
Yes, sounds great. Thank you.
--Kazu
_______________________________________________ web-devel mailing list web-devel@haskell.org http://www.haskell.org/mailman/listinfo/web-devel

I went for sourceNull as a parallel to sinkNull. As Felipe points out,
sinkNull makes a lot of sense since it was named after /dev/null. I
don't really have any strong naming opinions here, especially since I
would recommend people stick with mempty anyway.
On Fri, Jan 13, 2012 at 10:06 AM, Jasper Van der Jeugt
I'd like to add that sourceNull is a rather confusing name, and sourceEmpty would be more consistent with the other libraries out there.
See e.g.
Data.Map.null :: Map k a -> Bool Data.Map.empty :: Map k a
Cheers, Jasper
On Fri, Jan 13, 2012 at 7:57 AM, Kazu Yamamoto
wrote: For the nullSource, you can actually use mempty, since Source is an instance of Monoid. I realize now that I didn't even think about this when I was writing http-conduit, and instead used `sourceList []` in a few places. I think in conduit 0.0.4 I'll include Data.Conduit.List.sourceNull, with a comment that it's just a type-restricted synonym for mempty. Sound good?
Yes, sounds great. Thank you.
--Kazu
_______________________________________________ web-devel mailing list web-devel@haskell.org http://www.haskell.org/mailman/listinfo/web-devel
_______________________________________________ web-devel mailing list web-devel@haskell.org http://www.haskell.org/mailman/listinfo/web-devel

One more thing: It was easy for me to understand how to convert BufferedSource to Source thanks to "unbufferSource". But I took a time to understand how to convert PreparedSource to Source. I would like to have a helper function by giving a proper name to "Source . return". --Kazu
Thanks for the positive feedback Kazu!
For the nullSource, you can actually use mempty, since Source is an instance of Monoid. I realize now that I didn't even think about this when I was writing http-conduit, and instead used `sourceList []` in a few places. I think in conduit 0.0.4 I'll include Data.Conduit.List.sourceNull, with a comment that it's just a type-restricted synonym for mempty. Sound good?
Michael
On Fri, Jan 13, 2012 at 8:45 AM, Kazu Yamamoto
wrote: Hello,
I have modified Mighttpd 2 to use Conduit and it is now running on my domain, Mew.org.
Using Conduit made my code much much simpler than before. And Conduit is much easier to use especially on passing Source around and error handling. I was excited. I believe that Conduit is a right way to go. Michael, thank you for great work!
What's missing for me is null source. I added the followings to my code but I would be happy if Conduit provide them. Note that we should choose better names and parameterize their types.
eof :: PreparedSource IO Builder eof = PreparedSource { sourcePull = return Closed , sourceClose = return () }
nullSource :: Source IO Builder nullSource = Source (return eof)
--Kazu
On Thu, Jan 12, 2012 at 7:41 AM, Kazu Yamamoto
wrote: Hello,
I come back to my reverse proxy work today. But I could not find wai and warp repository (or branch) based on conduit. Where can I find them?
--Kazu
_______________________________________________ web-devel mailing list web-devel@haskell.org http://www.haskell.org/mailman/listinfo/web-devel
participants (4)
-
Felipe Almeida Lessa
-
Jasper Van der Jeugt
-
Kazu Yamamoto
-
Michael Snoyman