{-# LANGUAGE FlexibleContexts #-}
{-# LANGUAGE FlexibleInstances #-}
{-# LANGUAGE OverloadedStrings #-}
{-# LANGUAGE RankNTypes #-}
module Imm.HTTP where
import Imm.Logger hiding (Handle)
import qualified Imm.Logger as Logger
import Imm.Pretty
import Pipes.Core
import URI.ByteString
newtype Handle m = Handle
{ _withGet :: forall a. URI -> (Producer' ByteString m () -> m a) -> m a
}
withGet :: Monad m => Logger.Handle m -> Handle m -> URI -> (Producer' ByteString m () -> m a) -> m a
withGet logger handle uri f = do
log logger Debug $ "GET" <+> prettyURI uri
_withGet handle uri f