{-# LANGUAGE FlexibleContexts #-}
{-# LANGUAGE FlexibleInstances #-}
{-# LANGUAGE NoImplicitPrelude #-}
{-# LANGUAGE OverloadedStrings #-}
module Imm.HTTP where
import qualified Imm.Logger as Logger
import Imm.Logger hiding(Handle)
import Imm.Prelude
import Imm.Pretty
import URI.ByteString
newtype Handle m = Handle
{ httpGet :: URI -> m LByteString
}
get :: Monad m => Logger.Handle m -> Handle m -> URI -> m LByteString
get logger handle uri = do
log logger Debug $ "Fetching " <> prettyURI uri
httpGet handle uri