polysemy-http 0.4.0.6 → 0.5.0.0
raw patch · 32 files changed
+587/−514 lines, 32 filesdep ~polysemydep ~polysemy-logdep ~polysemy-pluginPVP ok
version bump matches the API change (PVP)
Dependency ranges changed: polysemy, polysemy-log, polysemy-plugin
API changes (from Hackage documentation)
- Polysemy.Http: interpretHttpStrict :: Member (Embed IO) r => [Response LByteString] -> [ByteString] -> InterpreterFor (Http LByteString) r
- Polysemy.Http.AesonEntity: decodeWith :: ConvertUtf8 Text s => (s -> Either String a) -> s -> Sem r (Either EntityError a)
- Polysemy.Http.AesonEntity: interpretEntityDecodeAeson :: FromJSON d => Sem (EntityDecode d : r) a -> Sem r a
- Polysemy.Http.AesonEntity: interpretEntityEncodeAeson :: ToJSON d => Sem (EntityEncode d : r) a -> Sem r a
- Polysemy.Http.Data.Entity: EntityError :: Text -> Text -> EntityError
- Polysemy.Http.Data.Entity: [DecodeStrict] :: ByteString -> EntityDecode d m (Either EntityError d)
- Polysemy.Http.Data.Entity: [Decode] :: LByteString -> EntityDecode d m (Either EntityError d)
- Polysemy.Http.Data.Entity: [EncodeStrict] :: d -> EntityEncode d m ByteString
- Polysemy.Http.Data.Entity: [Encode] :: d -> EntityEncode d m LByteString
- Polysemy.Http.Data.Entity: [body] :: EntityError -> Text
- Polysemy.Http.Data.Entity: [message] :: EntityError -> Text
- Polysemy.Http.Data.Entity: data Decode a
- Polysemy.Http.Data.Entity: data Encode a
- Polysemy.Http.Data.Entity: data EntityDecode d :: Effect
- Polysemy.Http.Data.Entity: data EntityEncode d :: Effect
- Polysemy.Http.Data.Entity: data EntityError
- Polysemy.Http.Data.Entity: decode :: forall d r. Member (EntityDecode d) r => LByteString -> Sem r (Either EntityError d)
- Polysemy.Http.Data.Entity: decodeStrict :: forall d r. Member (EntityDecode d) r => ByteString -> Sem r (Either EntityError d)
- Polysemy.Http.Data.Entity: encode :: forall d r. Member (EntityEncode d) r => d -> Sem r LByteString
- Polysemy.Http.Data.Entity: encodeStrict :: forall d r. Member (EntityEncode d) r => d -> Sem r ByteString
- Polysemy.Http.Data.Entity: instance GHC.Classes.Eq Polysemy.Http.Data.Entity.EntityError
- Polysemy.Http.Data.Entity: instance GHC.Show.Show Polysemy.Http.Data.Entity.EntityError
- Polysemy.Http.Data.Entity: type family Decoders ds r :: Constraint
- Polysemy.Http.Data.Http: [ConsumeChunk] :: c -> Http c m (Either HttpError ByteString)
- Polysemy.Http.Data.Http: [Request] :: Request -> Http c m (Either HttpError (Response LByteString))
- Polysemy.Http.Data.Http: [Response] :: Request -> (Response c -> m a) -> Http c m (Either HttpError a)
- Polysemy.Http.Data.Http: [Stream] :: Request -> (Response c -> m a) -> Http c m (Either HttpError a)
- Polysemy.Http.Data.Http: consumeChunk :: forall c r. Member (Http c) r => c -> Sem r (Either HttpError ByteString)
- Polysemy.Http.Data.Http: data Http c :: Effect
- Polysemy.Http.Data.Http: request :: forall c r. Member (Http c) r => Request -> Sem r (Either HttpError (Response LByteString))
- Polysemy.Http.Data.Http: response :: forall c r a. Member (Http c) r => Request -> (Response c -> Sem r a) -> Sem r (Either HttpError a)
- Polysemy.Http.Data.Http: stream :: forall c r a. Member (Http c) r => Request -> (Response c -> Sem r a) -> Sem r (Either HttpError a)
- Polysemy.Http.Data.Manager: [Get] :: Manager m Manager
- Polysemy.Http.Data.Manager: data Manager :: Effect
- Polysemy.Http.Data.Manager: get :: forall r_atBk. MemberWithError Manager r_atBk => Sem r_atBk Manager
- Polysemy.Http.Data.Request: body :: HasRequest c_aByR => Lens' c_aByR Body
- Polysemy.Http.Data.Request: class HasRequest c_aByR
- Polysemy.Http.Data.Request: cookies :: HasRequest c_aByR => Lens' c_aByR CookieJar
- Polysemy.Http.Data.Request: headers :: HasRequest c_aByR => Lens' c_aByR [(HeaderName, HeaderValue)]
- Polysemy.Http.Data.Request: host :: HasRequest c_aByR => Lens' c_aByR Host
- Polysemy.Http.Data.Request: method :: HasRequest c_aByR => Lens' c_aByR Method
- Polysemy.Http.Data.Request: path :: HasRequest c_aByR => Lens' c_aByR Path
- Polysemy.Http.Data.Request: port :: HasRequest c_aByR => Lens' c_aByR (Maybe Port)
- Polysemy.Http.Data.Request: query :: HasRequest c_aByR => Lens' c_aByR [(QueryKey, Maybe QueryValue)]
- Polysemy.Http.Data.Request: request :: HasRequest c_aByR => Lens' c_aByR Request
- Polysemy.Http.Data.Request: tls :: HasRequest c_aByR => Lens' c_aByR Tls
- Polysemy.Http.Http: streamHandler :: forall o r c h. Members [Http c, Error HttpError, Resource] r => (forall x. StreamEvent o c h x -> Sem r x) -> Response c -> Sem r o
- Polysemy.Http.Http: streamLoop :: Members [Http c, Error HttpError] r => (forall x. StreamEvent o c h x -> Sem r x) -> Response c -> h -> Sem r o
- Polysemy.Http.Json: jsonContentType :: (HeaderName, HeaderValue)
- Polysemy.Http.Manager: interpretManager :: Member (Embed IO) r => InterpreterFor Manager r
- Polysemy.Http.Manager: interpretManagerWith :: Manager -> InterpreterFor Manager r
- Polysemy.Http.Native: convertResponse :: Response b -> Response b
- Polysemy.Http.Native: distribEither :: Functor f => Either err (f a) -> Sem (WithTactics e f m r) (f (Either err a))
- Polysemy.Http.Native: executeRequest :: Member (Embed IO) r => Manager -> Request -> Sem r (Either HttpError (Response LByteString))
- Polysemy.Http.Native: internalError :: Member (Embed IO) r => IO a -> Sem r (Either HttpError a)
- Polysemy.Http.Native: interpretHttpNative :: Members [Embed IO, Log, Resource] r => InterpreterFor (Http BodyReader) r
- Polysemy.Http.Native: interpretHttpNativeWith :: Members [Embed IO, Log, Resource, Manager] r => InterpreterFor (Http BodyReader) r
- Polysemy.Http.Native: nativeRequest :: Request -> Request
- Polysemy.Http.Native: withResponse :: Members [Embed IO, Log, Resource, Manager] r => Request -> (Response BodyReader -> Sem r a) -> Sem r (Either HttpError a)
- Polysemy.Http.Prelude: (!!?) :: [a] -> Int -> Maybe a
- Polysemy.Http.Prelude: ($!!) :: NFData a => (a -> b) -> a -> b
- Polysemy.Http.Prelude: ($!) :: forall (r :: RuntimeRep) a (b :: TYPE r). (a -> b) -> a -> b
- Polysemy.Http.Prelude: ($) :: forall (r :: RuntimeRep) a (b :: TYPE r). (a -> b) -> a -> b
- Polysemy.Http.Prelude: ($<) :: Contravariant f => f b -> b -> f a
- Polysemy.Http.Prelude: ($>) :: Functor f => f a -> b -> f b
- Polysemy.Http.Prelude: (&&&) :: Arrow a => a b c -> a b c' -> a b (c, c')
- Polysemy.Http.Prelude: (&&) :: Bool -> Bool -> Bool
- Polysemy.Http.Prelude: (&&^) :: Monad m => m Bool -> m Bool -> m Bool
- Polysemy.Http.Prelude: (&) :: a -> (a -> b) -> b
- Polysemy.Http.Prelude: (*) :: Num a => a -> a -> a
- Polysemy.Http.Prelude: (**) :: Floating a => a -> a -> a
- Polysemy.Http.Prelude: (*>) :: Applicative f => f a -> f b -> f b
- Polysemy.Http.Prelude: (+) :: Num a => a -> a -> a
- Polysemy.Http.Prelude: (++) :: [a] -> [a] -> [a]
- Polysemy.Http.Prelude: (-) :: Num a => a -> a -> a
- Polysemy.Http.Prelude: (.) :: (b -> c) -> (a -> b) -> a -> c
- Polysemy.Http.Prelude: (.:) :: (c -> d) -> (a -> b -> c) -> a -> b -> d
- Polysemy.Http.Prelude: (/) :: Fractional a => a -> a -> a
- Polysemy.Http.Prelude: (/=) :: Eq a => a -> a -> Bool
- Polysemy.Http.Prelude: (:|) :: a -> [a] -> NonEmpty a
- Polysemy.Http.Prelude: (<$!>) :: Monad m => (a -> b) -> m a -> m b
- Polysemy.Http.Prelude: (<$) :: Functor f => a -> f b -> f a
- Polysemy.Http.Prelude: (<$>) :: Functor f => (a -> b) -> f a -> f b
- Polysemy.Http.Prelude: (<&>) :: Functor f => f a -> (a -> b) -> f b
- Polysemy.Http.Prelude: (<) :: Ord a => a -> a -> Bool
- Polysemy.Http.Prelude: (<*) :: Applicative f => f a -> f b -> f a
- Polysemy.Http.Prelude: (<**>) :: Applicative f => f a -> f (a -> b) -> f b
- Polysemy.Http.Prelude: (<*>) :: Applicative f => f (a -> b) -> f a -> f b
- Polysemy.Http.Prelude: (<<$>>) :: (Functor f, Functor g) => (a -> b) -> f (g a) -> f (g b)
- Polysemy.Http.Prelude: (<<<) :: forall k cat (b :: k) (c :: k) (a :: k). Category cat => cat b c -> cat a b -> cat a c
- Polysemy.Http.Prelude: (<=) :: Ord a => a -> a -> Bool
- Polysemy.Http.Prelude: (<=<) :: Monad m => (b -> m c) -> (a -> m b) -> a -> m c
- Polysemy.Http.Prelude: (<>) :: Semigroup a => a -> a -> a
- Polysemy.Http.Prelude: (<|>) :: Alternative f => f a -> f a -> f a
- Polysemy.Http.Prelude: (=<<) :: Monad m => (a -> m b) -> m a -> m b
- Polysemy.Http.Prelude: (==) :: Eq a => a -> a -> Bool
- Polysemy.Http.Prelude: (>$$<) :: Contravariant f => f b -> (a -> b) -> f a
- Polysemy.Http.Prelude: (>$) :: Contravariant f => b -> f b -> f a
- Polysemy.Http.Prelude: (>$<) :: Contravariant f => (a -> b) -> f b -> f a
- Polysemy.Http.Prelude: (>) :: Ord a => a -> a -> Bool
- Polysemy.Http.Prelude: (>=) :: Ord a => a -> a -> Bool
- Polysemy.Http.Prelude: (>=>) :: Monad m => (a -> m b) -> (b -> m c) -> a -> m c
- Polysemy.Http.Prelude: (>>) :: Monad m => m a -> m b -> m b
- Polysemy.Http.Prelude: (>>=) :: Monad m => m a -> (a -> m b) -> m b
- Polysemy.Http.Prelude: (>>>) :: forall k cat (a :: k) (b :: k) (c :: k). Category cat => cat a b -> cat b c -> cat a c
- Polysemy.Http.Prelude: (?:) :: Maybe a -> a -> a
- Polysemy.Http.Prelude: (??) :: Functor f => f (a -> b) -> a -> f b
- Polysemy.Http.Prelude: (^) :: (Num a, Integral b) => a -> b -> a
- Polysemy.Http.Prelude: (^^) :: (Fractional a, Integral b) => a -> b -> a
- Polysemy.Http.Prelude: (||) :: Bool -> Bool -> Bool
- Polysemy.Http.Prelude: (||^) :: Monad m => m Bool -> m Bool -> m Bool
- Polysemy.Http.Prelude: All :: Bool -> All
- Polysemy.Http.Prelude: Alt :: f a -> Alt (f :: k -> Type) (a :: k)
- Polysemy.Http.Prelude: Any :: Bool -> Any
- Polysemy.Http.Prelude: Ap :: f a -> Ap (f :: k -> Type) (a :: k)
- Polysemy.Http.Prelude: AppendMode :: IOMode
- Polysemy.Http.Prelude: BlockBuffering :: Maybe Int -> BufferMode
- Polysemy.Http.Prelude: Bug :: SomeException -> CallStack -> Bug
- Polysemy.Http.Prelude: Comparison :: (a -> a -> Ordering) -> Comparison a
- Polysemy.Http.Prelude: Compose :: f (g a) -> Compose (f :: k -> Type) (g :: k1 -> k) (a :: k1)
- Polysemy.Http.Prelude: Const :: a -> Const a (b :: k)
- Polysemy.Http.Prelude: D# :: Double# -> Double
- Polysemy.Http.Prelude: Down :: a -> Down a
- Polysemy.Http.Prelude: Dual :: a -> Dual a
- Polysemy.Http.Prelude: EQ :: Ordering
- Polysemy.Http.Prelude: Endo :: (a -> a) -> Endo a
- Polysemy.Http.Prelude: Equivalence :: (a -> a -> Bool) -> Equivalence a
- Polysemy.Http.Prelude: ExceptT :: m (Either e a) -> ExceptT e (m :: Type -> Type) a
- Polysemy.Http.Prelude: F# :: Float# -> Float
- Polysemy.Http.Prelude: False :: Bool
- Polysemy.Http.Prelude: First :: Maybe a -> First a
- Polysemy.Http.Prelude: GT :: Ordering
- Polysemy.Http.Prelude: Identity :: a -> Identity a
- Polysemy.Http.Prelude: Just :: a -> Maybe a
- Polysemy.Http.Prelude: LT :: Ordering
- Polysemy.Http.Prelude: Last :: Maybe a -> Last a
- Polysemy.Http.Prelude: Left :: a -> Either a b
- Polysemy.Http.Prelude: LineBuffering :: BufferMode
- Polysemy.Http.Prelude: MaybeT :: m (Maybe a) -> MaybeT (m :: Type -> Type) a
- Polysemy.Http.Prelude: NoBuffering :: BufferMode
- Polysemy.Http.Prelude: Nothing :: Maybe a
- Polysemy.Http.Prelude: Op :: (b -> a) -> Op a b
- Polysemy.Http.Prelude: Option :: Maybe a -> Option a
- Polysemy.Http.Prelude: Predicate :: (a -> Bool) -> Predicate a
- Polysemy.Http.Prelude: Product :: a -> Product a
- Polysemy.Http.Prelude: Proxy :: Proxy (t :: k)
- Polysemy.Http.Prelude: ReadMode :: IOMode
- Polysemy.Http.Prelude: ReadWriteMode :: IOMode
- Polysemy.Http.Prelude: ReaderT :: (r -> m a) -> ReaderT r (m :: Type -> Type) a
- Polysemy.Http.Prelude: Right :: b -> Either a b
- Polysemy.Http.Prelude: SomeException :: e -> SomeException
- Polysemy.Http.Prelude: SomeNat :: Proxy n -> SomeNat
- Polysemy.Http.Prelude: StateT :: (s -> m (a, s)) -> StateT s (m :: Type -> Type) a
- Polysemy.Http.Prelude: Sum :: a -> Sum a
- Polysemy.Http.Prelude: True :: Bool
- Polysemy.Http.Prelude: Undefined :: Undefined
- Polysemy.Http.Prelude: WriteMode :: IOMode
- Polysemy.Http.Prelude: ZipList :: [a] -> ZipList a
- Polysemy.Http.Prelude: [appEndo] :: Endo a -> a -> a
- Polysemy.Http.Prelude: [getAll] :: All -> Bool
- Polysemy.Http.Prelude: [getAlt] :: Alt (f :: k -> Type) (a :: k) -> f a
- Polysemy.Http.Prelude: [getAny] :: Any -> Bool
- Polysemy.Http.Prelude: [getAp] :: Ap (f :: k -> Type) (a :: k) -> f a
- Polysemy.Http.Prelude: [getComparison] :: Comparison a -> a -> a -> Ordering
- Polysemy.Http.Prelude: [getCompose] :: Compose (f :: k -> Type) (g :: k1 -> k) (a :: k1) -> f (g a)
- Polysemy.Http.Prelude: [getConst] :: Const a (b :: k) -> a
- Polysemy.Http.Prelude: [getDown] :: Down a -> a
- Polysemy.Http.Prelude: [getDual] :: Dual a -> a
- Polysemy.Http.Prelude: [getEquivalence] :: Equivalence a -> a -> a -> Bool
- Polysemy.Http.Prelude: [getFirst] :: First a -> Maybe a
- Polysemy.Http.Prelude: [getLast] :: Last a -> Maybe a
- Polysemy.Http.Prelude: [getOp] :: Op a b -> b -> a
- Polysemy.Http.Prelude: [getOption] :: Option a -> Maybe a
- Polysemy.Http.Prelude: [getPredicate] :: Predicate a -> a -> Bool
- Polysemy.Http.Prelude: [getProduct] :: Product a -> a
- Polysemy.Http.Prelude: [getSum] :: Sum a -> a
- Polysemy.Http.Prelude: [getZipList] :: ZipList a -> [a]
- Polysemy.Http.Prelude: [runIdentity] :: Identity a -> a
- Polysemy.Http.Prelude: [runMaybeT] :: MaybeT (m :: Type -> Type) a -> m (Maybe a)
- Polysemy.Http.Prelude: [runReaderT] :: ReaderT r (m :: Type -> Type) a -> r -> m a
- Polysemy.Http.Prelude: [runStateT] :: StateT s (m :: Type -> Type) a -> s -> m (a, s)
- Polysemy.Http.Prelude: abs :: Num a => a -> a
- Polysemy.Http.Prelude: absurd :: Void -> a
- Polysemy.Http.Prelude: acos :: Floating a => a -> a
- Polysemy.Http.Prelude: acosh :: Floating a => a -> a
- Polysemy.Http.Prelude: all :: Foldable t => (a -> Bool) -> t a -> Bool
- Polysemy.Http.Prelude: allM :: (Foldable f, Monad m) => (a -> m Bool) -> f a -> m Bool
- Polysemy.Http.Prelude: and :: Foldable t => t Bool -> Bool
- Polysemy.Http.Prelude: andM :: (Foldable f, Monad m) => f (m Bool) -> m Bool
- Polysemy.Http.Prelude: any :: Foldable t => (a -> Bool) -> t a -> Bool
- Polysemy.Http.Prelude: anyM :: (Foldable f, Monad m) => (a -> m Bool) -> f a -> m Bool
- Polysemy.Http.Prelude: appendFile :: MonadIO m => FilePath -> String -> m ()
- Polysemy.Http.Prelude: appendFileBS :: MonadIO m => FilePath -> ByteString -> m ()
- Polysemy.Http.Prelude: appendFileLBS :: MonadIO m => FilePath -> LByteString -> m ()
- Polysemy.Http.Prelude: appendFileLText :: MonadIO m => FilePath -> LText -> m ()
- Polysemy.Http.Prelude: appendFileText :: MonadIO m => FilePath -> Text -> m ()
- Polysemy.Http.Prelude: appliedTo :: Applicative f => f a -> f (a -> b) -> f b
- Polysemy.Http.Prelude: asTypeOf :: a -> a -> a
- Polysemy.Http.Prelude: asin :: Floating a => a -> a
- Polysemy.Http.Prelude: asinh :: Floating a => a -> a
- Polysemy.Http.Prelude: asum :: (Foldable t, Alternative f) => t (f a) -> f a
- Polysemy.Http.Prelude: asumMap :: forall b m f a. (Foldable f, Alternative m) => (a -> m b) -> f a -> m b
- Polysemy.Http.Prelude: atan :: Floating a => a -> a
- Polysemy.Http.Prelude: atan2 :: RealFloat a => a -> a -> a
- Polysemy.Http.Prelude: atanh :: Floating a => a -> a
- Polysemy.Http.Prelude: atomicModifyIORef :: MonadIO m => IORef a -> (a -> (a, b)) -> m b
- Polysemy.Http.Prelude: atomicModifyIORef' :: MonadIO m => IORef a -> (a -> (a, b)) -> m b
- Polysemy.Http.Prelude: atomicModifyIORef'_ :: MonadIO m => IORef a -> (a -> a) -> m ()
- Polysemy.Http.Prelude: atomicModifyIORef_ :: MonadIO m => IORef a -> (a -> a) -> m ()
- Polysemy.Http.Prelude: atomicWriteIORef :: MonadIO m => IORef a -> a -> m ()
- Polysemy.Http.Prelude: atomically :: MonadIO m => STM a -> m a
- Polysemy.Http.Prelude: biList :: Bifoldable t => t a a -> [a]
- Polysemy.Http.Prelude: biall :: Bifoldable t => (a -> Bool) -> (b -> Bool) -> t a b -> Bool
- Polysemy.Http.Prelude: biand :: Bifoldable t => t Bool Bool -> Bool
- Polysemy.Http.Prelude: biany :: Bifoldable t => (a -> Bool) -> (b -> Bool) -> t a b -> Bool
- Polysemy.Http.Prelude: biasum :: (Bifoldable t, Alternative f) => t (f a) (f a) -> f a
- Polysemy.Http.Prelude: bielem :: (Bifoldable t, Eq a) => a -> t a a -> Bool
- Polysemy.Http.Prelude: bifind :: Bifoldable t => (a -> Bool) -> t a a -> Maybe a
- Polysemy.Http.Prelude: bifold :: (Bifoldable p, Monoid m) => p m m -> m
- Polysemy.Http.Prelude: bifoldMap :: (Bifoldable p, Monoid m) => (a -> m) -> (b -> m) -> p a b -> m
- Polysemy.Http.Prelude: bifoldMapDefault :: (Bitraversable t, Monoid m) => (a -> m) -> (b -> m) -> t a b -> m
- Polysemy.Http.Prelude: bifoldl :: Bifoldable p => (c -> a -> c) -> (c -> b -> c) -> c -> p a b -> c
- Polysemy.Http.Prelude: bifoldl' :: Bifoldable t => (a -> b -> a) -> (a -> c -> a) -> a -> t b c -> a
- Polysemy.Http.Prelude: bifoldlM :: (Bifoldable t, Monad m) => (a -> b -> m a) -> (a -> c -> m a) -> a -> t b c -> m a
- Polysemy.Http.Prelude: bifoldr :: Bifoldable p => (a -> c -> c) -> (b -> c -> c) -> c -> p a b -> c
- Polysemy.Http.Prelude: bifoldr' :: Bifoldable t => (a -> c -> c) -> (b -> c -> c) -> c -> t a b -> c
- Polysemy.Http.Prelude: bifoldrM :: (Bifoldable t, Monad m) => (a -> c -> m c) -> (b -> c -> m c) -> c -> t a b -> m c
- Polysemy.Http.Prelude: bifor :: (Bitraversable t, Applicative f) => t a b -> (a -> f c) -> (b -> f d) -> f (t c d)
- Polysemy.Http.Prelude: bifor_ :: (Bifoldable t, Applicative f) => t a b -> (a -> f c) -> (b -> f d) -> f ()
- Polysemy.Http.Prelude: bilength :: Bifoldable t => t a b -> Int
- Polysemy.Http.Prelude: bimap :: Bifunctor p => (a -> b) -> (c -> d) -> p a c -> p b d
- Polysemy.Http.Prelude: bimapDefault :: Bitraversable t => (a -> b) -> (c -> d) -> t a c -> t b d
- Polysemy.Http.Prelude: binull :: Bifoldable t => t a b -> Bool
- Polysemy.Http.Prelude: bior :: Bifoldable t => t Bool Bool -> Bool
- Polysemy.Http.Prelude: bisequence :: (Bitraversable t, Applicative f) => t (f a) (f b) -> f (t a b)
- Polysemy.Http.Prelude: bisequence_ :: (Bifoldable t, Applicative f) => t (f a) (f b) -> f ()
- Polysemy.Http.Prelude: bitraverse :: (Bitraversable t, Applicative f) => (a -> f c) -> (b -> f d) -> t a b -> f (t c d)
- Polysemy.Http.Prelude: bitraverse_ :: (Bifoldable t, Applicative f) => (a -> f c) -> (b -> f d) -> t a b -> f ()
- Polysemy.Http.Prelude: bool :: a -> a -> Bool -> a
- Polysemy.Http.Prelude: boundedEnumFrom :: (Enum a, Bounded a) => a -> [a]
- Polysemy.Http.Prelude: boundedEnumFromThen :: (Enum a, Bounded a) => a -> a -> [a]
- Polysemy.Http.Prelude: break :: (a -> Bool) -> [a] -> ([a], [a])
- Polysemy.Http.Prelude: bug :: (HasCallStack, Exception e) => e -> a
- Polysemy.Http.Prelude: byteSwap16 :: Word16 -> Word16
- Polysemy.Http.Prelude: byteSwap32 :: Word32 -> Word32
- Polysemy.Http.Prelude: byteSwap64 :: Word64 -> Word64
- Polysemy.Http.Prelude: callStack :: HasCallStack => CallStack
- Polysemy.Http.Prelude: catMaybes :: [Maybe a] -> [a]
- Polysemy.Http.Prelude: catchSTM :: Exception e => STM a -> (e -> STM a) -> STM a
- Polysemy.Http.Prelude: ceiling :: (RealFrac a, Integral b) => a -> b
- Polysemy.Http.Prelude: chainedTo :: Monad m => (a -> m b) -> m a -> m b
- Polysemy.Http.Prelude: chr :: Int -> Char
- Polysemy.Http.Prelude: class Applicative f => Alternative (f :: Type -> Type)
- Polysemy.Http.Prelude: class Functor f => Applicative (f :: Type -> Type)
- Polysemy.Http.Prelude: class Bifoldable (p :: Type -> Type -> Type)
- Polysemy.Http.Prelude: class Bifunctor (p :: Type -> Type -> Type)
- Polysemy.Http.Prelude: class (Bifunctor t, Bifoldable t) => Bitraversable (t :: Type -> Type -> Type)
- Polysemy.Http.Prelude: class Bounded a
- Polysemy.Http.Prelude: class a ~R# b => Coercible (a :: k) (b :: k)
- Polysemy.Http.Prelude: class Contravariant (f :: Type -> Type)
- Polysemy.Http.Prelude: class ConvertUtf8 a b
- Polysemy.Http.Prelude: class Default a
- Polysemy.Http.Prelude: class Enum a
- Polysemy.Http.Prelude: class Eq a
- Polysemy.Http.Prelude: class (Typeable e, Show e) => Exception e
- Polysemy.Http.Prelude: class Fractional a => Floating a
- Polysemy.Http.Prelude: class Foldable (t :: Type -> Type)
- Polysemy.Http.Prelude: class Num a => Fractional a
- Polysemy.Http.Prelude: class FromJSON a
- Polysemy.Http.Prelude: class Functor (f :: Type -> Type)
- Polysemy.Http.Prelude: class Generic a
- Polysemy.Http.Prelude: class Hashable a
- Polysemy.Http.Prelude: class (Real a, Enum a) => Integral a
- Polysemy.Http.Prelude: class IsLabel (x :: Symbol) a
- Polysemy.Http.Prelude: class IsList l
- Polysemy.Http.Prelude: class IsString a
- Polysemy.Http.Prelude: class KnownNat (n :: Nat)
- Polysemy.Http.Prelude: class LazyStrict l s | l -> s, s -> l
- Polysemy.Http.Prelude: class Applicative m => Monad (m :: Type -> Type)
- Polysemy.Http.Prelude: class Monad m => MonadFail (m :: Type -> Type)
- Polysemy.Http.Prelude: class Monad m => MonadIO (m :: Type -> Type)
- Polysemy.Http.Prelude: class (Alternative m, Monad m) => MonadPlus (m :: Type -> Type)
- Polysemy.Http.Prelude: class Monad m => MonadReader r (m :: Type -> Type) | m -> r
- Polysemy.Http.Prelude: class Monad m => MonadState s (m :: Type -> Type) | m -> s
- Polysemy.Http.Prelude: class MonadTrans (t :: Type -> Type -> Type -> Type)
- Polysemy.Http.Prelude: class Semigroup a => Monoid a
- Polysemy.Http.Prelude: class NFData a
- Polysemy.Http.Prelude: class Num a
- Polysemy.Http.Prelude: class One x where {
- Polysemy.Http.Prelude: class Eq a => Ord a
- Polysemy.Http.Prelude: class Read a
- Polysemy.Http.Prelude: class (Num a, Ord a) => Real a
- Polysemy.Http.Prelude: class (RealFrac a, Floating a) => RealFloat a
- Polysemy.Http.Prelude: class (Real a, Fractional a) => RealFrac a
- Polysemy.Http.Prelude: class Semigroup a
- Polysemy.Http.Prelude: class Show a
- Polysemy.Http.Prelude: class ToJSON a
- Polysemy.Http.Prelude: class ToLText a
- Polysemy.Http.Prelude: class ToString a
- Polysemy.Http.Prelude: class ToText a
- Polysemy.Http.Prelude: class (Functor t, Foldable t) => Traversable (t :: Type -> Type)
- Polysemy.Http.Prelude: class Typeable (a :: k)
- Polysemy.Http.Prelude: coerce :: forall (k :: RuntimeRep) (a :: TYPE k) (b :: TYPE k). Coercible a b => a -> b
- Polysemy.Http.Prelude: compare :: Ord a => a -> a -> Ordering
- Polysemy.Http.Prelude: comparing :: Ord a => (b -> a) -> b -> b -> Ordering
- Polysemy.Http.Prelude: comparisonEquivalence :: Comparison a -> Equivalence a
- Polysemy.Http.Prelude: concat :: Foldable t => t [a] -> [a]
- Polysemy.Http.Prelude: concatMap :: Foldable t => (a -> [b]) -> t a -> [b]
- Polysemy.Http.Prelude: const :: a -> b -> a
- Polysemy.Http.Prelude: contramap :: Contravariant f => (a -> b) -> f b -> f a
- Polysemy.Http.Prelude: cos :: Floating a => a -> a
- Polysemy.Http.Prelude: cosh :: Floating a => a -> a
- Polysemy.Http.Prelude: currentCallStack :: IO [String]
- Polysemy.Http.Prelude: curry :: ((a, b) -> c) -> a -> b -> c
- Polysemy.Http.Prelude: cycle :: [a] -> [a]
- Polysemy.Http.Prelude: cycle1 :: Semigroup m => m -> m
- Polysemy.Http.Prelude: data Bool
- Polysemy.Http.Prelude: data BufferMode
- Polysemy.Http.Prelude: data Bug
- Polysemy.Http.Prelude: data ByteString
- Polysemy.Http.Prelude: data CallStack
- Polysemy.Http.Prelude: data Char
- Polysemy.Http.Prelude: data Constraint
- Polysemy.Http.Prelude: data Double
- Polysemy.Http.Prelude: data Either a b
- Polysemy.Http.Prelude: data Embed (m :: Type -> Type) (z :: Type -> Type) a
- Polysemy.Http.Prelude: data Error e (m :: k -> Type) (a :: k)
- Polysemy.Http.Prelude: data Float
- Polysemy.Http.Prelude: data Handle
- Polysemy.Http.Prelude: data HashMap k v
- Polysemy.Http.Prelude: data HashSet a
- Polysemy.Http.Prelude: data IO a
- Polysemy.Http.Prelude: data IOMode
- Polysemy.Http.Prelude: data IORef a
- Polysemy.Http.Prelude: data IdentityT (f :: k -> Type) (a :: k)
- Polysemy.Http.Prelude: data Int
- Polysemy.Http.Prelude: data Int16
- Polysemy.Http.Prelude: data Int32
- Polysemy.Http.Prelude: data Int64
- Polysemy.Http.Prelude: data Int8
- Polysemy.Http.Prelude: data IntMap a
- Polysemy.Http.Prelude: data IntSet
- Polysemy.Http.Prelude: data Integer
- Polysemy.Http.Prelude: data MVar a
- Polysemy.Http.Prelude: data Map k a
- Polysemy.Http.Prelude: data Maybe a
- Polysemy.Http.Prelude: data Nat
- Polysemy.Http.Prelude: data Natural
- Polysemy.Http.Prelude: data NonEmpty a
- Polysemy.Http.Prelude: data Ordering
- Polysemy.Http.Prelude: data Proxy (t :: k)
- Polysemy.Http.Prelude: data Ratio a
- Polysemy.Http.Prelude: data STM a
- Polysemy.Http.Prelude: data Sem (r :: EffectRow) a
- Polysemy.Http.Prelude: data Seq a
- Polysemy.Http.Prelude: data Set a
- Polysemy.Http.Prelude: data ShortByteString
- Polysemy.Http.Prelude: data SomeException
- Polysemy.Http.Prelude: data SomeNat
- Polysemy.Http.Prelude: data State s (m :: k) a
- Polysemy.Http.Prelude: data TMVar a
- Polysemy.Http.Prelude: data TVar a
- Polysemy.Http.Prelude: data Text
- Polysemy.Http.Prelude: data Undefined
- Polysemy.Http.Prelude: data UnicodeException
- Polysemy.Http.Prelude: data Void
- Polysemy.Http.Prelude: data Word
- Polysemy.Http.Prelude: data Word16
- Polysemy.Http.Prelude: data Word32
- Polysemy.Http.Prelude: data Word64
- Polysemy.Http.Prelude: data Word8
- Polysemy.Http.Prelude: data WrappedMonoid m
- Polysemy.Http.Prelude: dbg :: Monad m => Text -> m ()
- Polysemy.Http.Prelude: dbgs :: Monad m => Show a => a -> m ()
- Polysemy.Http.Prelude: dbgs_ :: Monad m => Show a => a -> m a
- Polysemy.Http.Prelude: decodeFloat :: RealFloat a => a -> (Integer, Int)
- Polysemy.Http.Prelude: decodeUtf8 :: ConvertUtf8 a b => b -> a
- Polysemy.Http.Prelude: decodeUtf8' :: ByteString -> Either UnicodeException Text
- Polysemy.Http.Prelude: decodeUtf8Strict :: ConvertUtf8 a b => b -> Either UnicodeException a
- Polysemy.Http.Prelude: decodeUtf8With :: OnDecodeError -> ByteString -> Text
- Polysemy.Http.Prelude: deepseq :: NFData a => a -> b -> b
- Polysemy.Http.Prelude: def :: Default a => a
- Polysemy.Http.Prelude: defaultComparison :: Ord a => Comparison a
- Polysemy.Http.Prelude: defaultEquivalence :: Eq a => Equivalence a
- Polysemy.Http.Prelude: defaultJson :: Name -> Q [Dec]
- Polysemy.Http.Prelude: defaultOptions :: Options
- Polysemy.Http.Prelude: denominator :: Ratio a -> a
- Polysemy.Http.Prelude: deriveFromJSON :: Options -> Name -> Q [Dec]
- Polysemy.Http.Prelude: deriveJSON :: Options -> Name -> Q [Dec]
- Polysemy.Http.Prelude: die :: MonadIO m => String -> m a
- Polysemy.Http.Prelude: displayException :: Exception e => e -> String
- Polysemy.Http.Prelude: div :: Integral a => a -> a -> a
- Polysemy.Http.Prelude: divMod :: Integral a => a -> a -> (a, a)
- Polysemy.Http.Prelude: drop :: Int -> [a] -> [a]
- Polysemy.Http.Prelude: dropWhile :: (a -> Bool) -> [a] -> [a]
- Polysemy.Http.Prelude: either :: (a -> c) -> (b -> c) -> Either a b -> c
- Polysemy.Http.Prelude: elem :: (Foldable f, DisallowElem f, Eq a) => a -> f a -> Bool
- Polysemy.Http.Prelude: embed :: forall m (r :: [(Type -> Type) -> Type -> Type]) a. Member (Embed m) r => m a -> Sem r a
- Polysemy.Http.Prelude: empty :: Alternative f => f a
- Polysemy.Http.Prelude: encodeFloat :: RealFloat a => Integer -> Int -> a
- Polysemy.Http.Prelude: encodeUtf8 :: ConvertUtf8 a b => a -> b
- Polysemy.Http.Prelude: enumFrom :: Enum a => a -> [a]
- Polysemy.Http.Prelude: enumFromThen :: Enum a => a -> a -> [a]
- Polysemy.Http.Prelude: enumFromThenTo :: Enum a => a -> a -> a -> [a]
- Polysemy.Http.Prelude: enumFromTo :: Enum a => a -> a -> [a]
- Polysemy.Http.Prelude: error :: forall (r :: RuntimeRep) (a :: TYPE r) t. (HasCallStack, IsText t) => t -> a
- Polysemy.Http.Prelude: etaReaderT :: forall r (m :: Type -> Type) a. ReaderT r m a -> ReaderT r m a
- Polysemy.Http.Prelude: evalState :: forall s (r :: [(Type -> Type) -> Type -> Type]) a. s -> Sem ((State s :: (Type -> Type) -> Type -> Type) : r) a -> Sem r a
- Polysemy.Http.Prelude: evalStateT :: Monad m => StateT s m a -> s -> m a
- Polysemy.Http.Prelude: evaluateNF :: (NFData a, MonadIO m) => a -> m a
- Polysemy.Http.Prelude: evaluateNF_ :: (NFData a, MonadIO m) => a -> m ()
- Polysemy.Http.Prelude: evaluateWHNF :: MonadIO m => a -> m a
- Polysemy.Http.Prelude: evaluateWHNF_ :: MonadIO m => a -> m ()
- Polysemy.Http.Prelude: evaluatingState :: s -> State s a -> a
- Polysemy.Http.Prelude: evaluatingStateT :: Functor f => s -> StateT s f a -> f a
- Polysemy.Http.Prelude: even :: Integral a => a -> Bool
- Polysemy.Http.Prelude: exceptToMaybeT :: forall (m :: Type -> Type) e a. Functor m => ExceptT e m a -> MaybeT m a
- Polysemy.Http.Prelude: execState :: State s a -> s -> s
- Polysemy.Http.Prelude: execStateT :: Monad m => StateT s m a -> s -> m s
- Polysemy.Http.Prelude: executingState :: s -> State s a -> s
- Polysemy.Http.Prelude: executingStateT :: Functor f => s -> StateT s f a -> f s
- Polysemy.Http.Prelude: exitFailure :: MonadIO m => m a
- Polysemy.Http.Prelude: exitSuccess :: MonadIO m => m a
- Polysemy.Http.Prelude: exitWith :: MonadIO m => ExitCode -> m a
- Polysemy.Http.Prelude: exp :: Floating a => a -> a
- Polysemy.Http.Prelude: fail :: MonadFail m => String -> m a
- Polysemy.Http.Prelude: filter :: (a -> Bool) -> [a] -> [a]
- Polysemy.Http.Prelude: filterM :: Applicative m => (a -> m Bool) -> [a] -> m [a]
- Polysemy.Http.Prelude: find :: Foldable t => (a -> Bool) -> t a -> Maybe a
- Polysemy.Http.Prelude: first :: Bifunctor p => (a -> b) -> p a c -> p b c
- Polysemy.Http.Prelude: fix :: (a -> a) -> a
- Polysemy.Http.Prelude: flap :: Functor f => f (a -> b) -> a -> f b
- Polysemy.Http.Prelude: flip :: (a -> b -> c) -> b -> a -> c
- Polysemy.Http.Prelude: flipfoldl' :: Foldable f => (a -> b -> b) -> b -> f a -> b
- Polysemy.Http.Prelude: floatDigits :: RealFloat a => a -> Int
- Polysemy.Http.Prelude: floatRadix :: RealFloat a => a -> Integer
- Polysemy.Http.Prelude: floatRange :: RealFloat a => a -> (Int, Int)
- Polysemy.Http.Prelude: floor :: (RealFrac a, Integral b) => a -> b
- Polysemy.Http.Prelude: fmap :: Functor f => (a -> b) -> f a -> f b
- Polysemy.Http.Prelude: fold :: (Foldable t, Monoid m) => t m -> m
- Polysemy.Http.Prelude: foldMap :: (Foldable t, Monoid m) => (a -> m) -> t a -> m
- Polysemy.Http.Prelude: foldMap' :: (Foldable t, Monoid m) => (a -> m) -> t a -> m
- Polysemy.Http.Prelude: foldMapA :: (Semigroup b, Monoid b, Applicative m, Foldable f) => (a -> m b) -> f a -> m b
- Polysemy.Http.Prelude: foldMapM :: (Monoid b, Monad m, Foldable f) => (a -> m b) -> f a -> m b
- Polysemy.Http.Prelude: foldl :: Foldable t => (b -> a -> b) -> b -> t a -> b
- Polysemy.Http.Prelude: foldl' :: Foldable t => (b -> a -> b) -> b -> t a -> b
- Polysemy.Http.Prelude: foldlM :: (Foldable t, Monad m) => (b -> a -> m b) -> b -> t a -> m b
- Polysemy.Http.Prelude: foldr :: Foldable t => (a -> b -> b) -> b -> t a -> b
- Polysemy.Http.Prelude: forM :: (Traversable t, Monad m) => t a -> (a -> m b) -> m (t b)
- Polysemy.Http.Prelude: forM_ :: (Foldable t, Monad m) => t a -> (a -> m b) -> m ()
- Polysemy.Http.Prelude: for_ :: (Foldable t, Applicative f) => t a -> (a -> f b) -> f ()
- Polysemy.Http.Prelude: force :: NFData a => a -> a
- Polysemy.Http.Prelude: forever :: Applicative f => f a -> f b
- Polysemy.Http.Prelude: fromEither :: forall e (r :: [(Type -> Type) -> Type -> Type]) a. Member (Error e :: (Type -> Type) -> Type -> Type) r => Either e a -> Sem r a
- Polysemy.Http.Prelude: fromEnum :: Enum a => a -> Int
- Polysemy.Http.Prelude: fromException :: Exception e => SomeException -> Maybe e
- Polysemy.Http.Prelude: fromInteger :: Num a => Integer -> a
- Polysemy.Http.Prelude: fromIntegral :: (Integral a, Num b) => a -> b
- Polysemy.Http.Prelude: fromLabel :: IsLabel x a => a
- Polysemy.Http.Prelude: fromLazy :: LazyStrict l s => l -> s
- Polysemy.Http.Prelude: fromLeft :: a -> Either a b -> a
- Polysemy.Http.Prelude: fromList :: IsList l => [Item l] -> l
- Polysemy.Http.Prelude: fromListN :: IsList l => Int -> [Item l] -> l
- Polysemy.Http.Prelude: fromMaybe :: a -> Maybe a -> a
- Polysemy.Http.Prelude: fromRational :: Fractional a => Rational -> a
- Polysemy.Http.Prelude: fromRight :: b -> Either a b -> b
- Polysemy.Http.Prelude: fromShort :: ShortByteString -> ByteString
- Polysemy.Http.Prelude: fromStrict :: LazyStrict l s => s -> l
- Polysemy.Http.Prelude: fromString :: IsString a => String -> a
- Polysemy.Http.Prelude: fst :: (a, b) -> a
- Polysemy.Http.Prelude: gcd :: Integral a => a -> a -> a
- Polysemy.Http.Prelude: genericDrop :: Integral i => i -> [a] -> [a]
- Polysemy.Http.Prelude: genericLength :: Num i => [a] -> i
- Polysemy.Http.Prelude: genericReplicate :: Integral i => i -> a -> [a]
- Polysemy.Http.Prelude: genericSplitAt :: Integral i => i -> [a] -> ([a], [a])
- Polysemy.Http.Prelude: genericTake :: Integral i => i -> [a] -> [a]
- Polysemy.Http.Prelude: get :: forall s (r :: [Effect]). MemberWithError (State s :: (Type -> Type) -> Type -> Type) r => Sem r s
- Polysemy.Http.Prelude: getArgs :: MonadIO m => m [String]
- Polysemy.Http.Prelude: getCallStack :: CallStack -> [([Char], SrcLoc)]
- Polysemy.Http.Prelude: getLine :: MonadIO m => m Text
- Polysemy.Http.Prelude: getStackTrace :: IO (Maybe [Location])
- Polysemy.Http.Prelude: gets :: forall s a (r :: [(Type -> Type) -> Type -> Type]). Member (State s :: (Type -> Type) -> Type -> Type) r => (s -> a) -> Sem r a
- Polysemy.Http.Prelude: group :: Eq a => [a] -> [[a]]
- Polysemy.Http.Prelude: guard :: Alternative f => Bool -> f ()
- Polysemy.Http.Prelude: guardM :: MonadPlus m => m Bool -> m ()
- Polysemy.Http.Prelude: guarded :: Alternative f => (a -> Bool) -> a -> f a
- Polysemy.Http.Prelude: hFlush :: MonadIO m => Handle -> m ()
- Polysemy.Http.Prelude: hGetBuffering :: MonadIO m => Handle -> m BufferMode
- Polysemy.Http.Prelude: hIsEOF :: MonadIO m => Handle -> m Bool
- Polysemy.Http.Prelude: hSetBuffering :: MonadIO m => Handle -> BufferMode -> m ()
- Polysemy.Http.Prelude: hashNub :: (Eq a, Hashable a) => [a] -> [a]
- Polysemy.Http.Prelude: hashWithSalt :: Hashable a => Int -> a -> Int
- Polysemy.Http.Prelude: head :: IsNonEmpty f a a "head" => f a -> a
- Polysemy.Http.Prelude: hoistEither :: Member (Error e2) r => (e1 -> e2) -> Either e1 a -> Sem r a
- Polysemy.Http.Prelude: hoistMaybe :: forall (m :: Type -> Type) a. Applicative m => Maybe a -> MaybeT m a
- Polysemy.Http.Prelude: id :: a -> a
- Polysemy.Http.Prelude: identity :: a -> a
- Polysemy.Http.Prelude: ifM :: Monad m => m Bool -> m a -> m a -> m a
- Polysemy.Http.Prelude: infinitely :: Applicative f => f a -> f Void
- Polysemy.Http.Prelude: infix 4 >=
- Polysemy.Http.Prelude: infixl 0 `on`
- Polysemy.Http.Prelude: infixl 1 <&>
- Polysemy.Http.Prelude: infixl 3 <|>
- Polysemy.Http.Prelude: infixl 4 <**>
- Polysemy.Http.Prelude: infixl 6 `xor`
- Polysemy.Http.Prelude: infixl 7 *
- Polysemy.Http.Prelude: infixr 0 $!!
- Polysemy.Http.Prelude: infixr 1 =<<
- Polysemy.Http.Prelude: infixr 2 ||
- Polysemy.Http.Prelude: infixr 3 &&
- Polysemy.Http.Prelude: infixr 5 :|
- Polysemy.Http.Prelude: infixr 6 <>
- Polysemy.Http.Prelude: infixr 8 ^
- Polysemy.Http.Prelude: infixr 9 `Compose`
- Polysemy.Http.Prelude: init :: IsNonEmpty f a [a] "init" => f a -> [a]
- Polysemy.Http.Prelude: inits :: [a] -> [[a]]
- Polysemy.Http.Prelude: intNub :: [Int] -> [Int]
- Polysemy.Http.Prelude: intNubOn :: (a -> Int) -> [a] -> [a]
- Polysemy.Http.Prelude: integerToBounded :: (Integral a, Bounded a) => Integer -> Maybe a
- Polysemy.Http.Prelude: integerToNatural :: Integer -> Maybe Natural
- Polysemy.Http.Prelude: intercalate :: [a] -> [[a]] -> [a]
- Polysemy.Http.Prelude: interpret :: forall e (r :: [Effect]) a. FirstOrder e "interpret" => (forall (rInitial :: EffectRow) x. () => e (Sem rInitial) x -> Sem r x) -> Sem (e : r) a -> Sem r a
- Polysemy.Http.Prelude: intersperse :: a -> [a] -> [a]
- Polysemy.Http.Prelude: inverseMap :: (Bounded a, Enum a, Ord k) => (a -> k) -> k -> Maybe a
- Polysemy.Http.Prelude: isDenormalized :: RealFloat a => a -> Bool
- Polysemy.Http.Prelude: isEmptyTMVar :: TMVar a -> STM Bool
- Polysemy.Http.Prelude: isIEEE :: RealFloat a => a -> Bool
- Polysemy.Http.Prelude: isInfinite :: RealFloat a => a -> Bool
- Polysemy.Http.Prelude: isJust :: Maybe a -> Bool
- Polysemy.Http.Prelude: isLeft :: Either a b -> Bool
- Polysemy.Http.Prelude: isNaN :: RealFloat a => a -> Bool
- Polysemy.Http.Prelude: isNegativeZero :: RealFloat a => a -> Bool
- Polysemy.Http.Prelude: isNothing :: Maybe a -> Bool
- Polysemy.Http.Prelude: isPrefixOf :: Eq a => [a] -> [a] -> Bool
- Polysemy.Http.Prelude: isRight :: Either a b -> Bool
- Polysemy.Http.Prelude: iterate :: (a -> a) -> a -> [a]
- Polysemy.Http.Prelude: join :: Monad m => m (m a) -> m a
- Polysemy.Http.Prelude: last :: IsNonEmpty f a a "last" => f a -> a
- Polysemy.Http.Prelude: lcm :: Integral a => a -> a -> a
- Polysemy.Http.Prelude: leftToMaybe :: Either l r -> Maybe l
- Polysemy.Http.Prelude: lefts :: [Either a b] -> [a]
- Polysemy.Http.Prelude: length :: Foldable t => t a -> Int
- Polysemy.Http.Prelude: lenientDecode :: OnDecodeError
- Polysemy.Http.Prelude: lift :: (MonadTrans t, Monad m) => m a -> t m a
- Polysemy.Http.Prelude: liftA2 :: Applicative f => (a -> b -> c) -> f a -> f b -> f c
- Polysemy.Http.Prelude: liftA3 :: Applicative f => (a -> b -> c -> d) -> f a -> f b -> f c -> f d
- Polysemy.Http.Prelude: liftIO :: MonadIO m => IO a -> m a
- Polysemy.Http.Prelude: liftT :: forall m f r e a. Functor f => Sem r a -> Sem (WithTactics e f m r) (f a)
- Polysemy.Http.Prelude: lines :: IsText t "lines" => t -> [t]
- Polysemy.Http.Prelude: listToMaybe :: [a] -> Maybe a
- Polysemy.Http.Prelude: local :: MonadReader r m => (r -> r) -> m a -> m a
- Polysemy.Http.Prelude: logBase :: Floating a => a -> a -> a
- Polysemy.Http.Prelude: lookupEnv :: MonadIO m => String -> m (Maybe String)
- Polysemy.Http.Prelude: makeSem :: Name -> Q [Dec]
- Polysemy.Http.Prelude: many :: Alternative f => f a -> f [a]
- Polysemy.Http.Prelude: map :: (a -> b) -> [a] -> [b]
- Polysemy.Http.Prelude: mapAccumL :: Traversable t => (a -> b -> (a, c)) -> a -> t b -> (a, t c)
- Polysemy.Http.Prelude: mapAccumR :: Traversable t => (a -> b -> (a, c)) -> a -> t b -> (a, t c)
- Polysemy.Http.Prelude: mapAndUnzipM :: Applicative m => (a -> m (b, c)) -> [a] -> m ([b], [c])
- Polysemy.Http.Prelude: mapLeft :: (a -> c) -> Either a b -> Either c b
- Polysemy.Http.Prelude: mapM :: (Traversable t, Monad m) => (a -> m b) -> t a -> m (t b)
- Polysemy.Http.Prelude: mapM_ :: (Foldable t, Monad m) => (a -> m b) -> t a -> m ()
- Polysemy.Http.Prelude: mapMaybe :: (a -> Maybe b) -> [a] -> [b]
- Polysemy.Http.Prelude: mapMaybeM :: Monad m => (a -> m (Maybe b)) -> [a] -> m [b]
- Polysemy.Http.Prelude: mappend :: Monoid a => a -> a -> a
- Polysemy.Http.Prelude: max :: Ord a => a -> a -> a
- Polysemy.Http.Prelude: maxBound :: Bounded a => a
- Polysemy.Http.Prelude: maxInt :: Int
- Polysemy.Http.Prelude: maybe :: b -> (a -> b) -> Maybe a -> b
- Polysemy.Http.Prelude: maybeAt :: Int -> [a] -> Maybe a
- Polysemy.Http.Prelude: maybeToExceptT :: forall (m :: Type -> Type) e a. Functor m => e -> MaybeT m a -> ExceptT e m a
- Polysemy.Http.Prelude: maybeToLeft :: r -> Maybe l -> Either l r
- Polysemy.Http.Prelude: maybeToList :: Maybe a -> [a]
- Polysemy.Http.Prelude: maybeToMonoid :: Monoid m => Maybe m -> m
- Polysemy.Http.Prelude: maybeToRight :: l -> Maybe r -> Either l r
- Polysemy.Http.Prelude: mconcat :: Monoid a => [a] -> a
- Polysemy.Http.Prelude: mempty :: Monoid a => a
- Polysemy.Http.Prelude: memptyIfFalse :: Monoid m => Bool -> m -> m
- Polysemy.Http.Prelude: memptyIfTrue :: Monoid m => Bool -> m -> m
- Polysemy.Http.Prelude: mfilter :: MonadPlus m => (a -> Bool) -> m a -> m a
- Polysemy.Http.Prelude: min :: Ord a => a -> a -> a
- Polysemy.Http.Prelude: minBound :: Bounded a => a
- Polysemy.Http.Prelude: minInt :: Int
- Polysemy.Http.Prelude: mkWeakTMVar :: TMVar a -> IO () -> IO (Weak (TMVar a))
- Polysemy.Http.Prelude: mod :: Integral a => a -> a -> a
- Polysemy.Http.Prelude: modify :: forall s (r :: [(Type -> Type) -> Type -> Type]). Member (State s :: (Type -> Type) -> Type -> Type) r => (s -> s) -> Sem r ()
- Polysemy.Http.Prelude: modify' :: MonadState s m => (s -> s) -> m ()
- Polysemy.Http.Prelude: modifyIORef :: MonadIO m => IORef a -> (a -> a) -> m ()
- Polysemy.Http.Prelude: modifyIORef' :: MonadIO m => IORef a -> (a -> a) -> m ()
- Polysemy.Http.Prelude: modifyTVar' :: TVar a -> (a -> a) -> STM ()
- Polysemy.Http.Prelude: mplus :: MonadPlus m => m a -> m a -> m a
- Polysemy.Http.Prelude: mtimesDefault :: (Integral b, Monoid a) => b -> a -> a
- Polysemy.Http.Prelude: mzero :: MonadPlus m => m a
- Polysemy.Http.Prelude: natVal :: forall (n :: Nat) proxy. KnownNat n => proxy n -> Natural
- Polysemy.Http.Prelude: negate :: Num a => a -> a
- Polysemy.Http.Prelude: newEmptyMVar :: MonadIO m => m (MVar a)
- Polysemy.Http.Prelude: newEmptyTMVar :: STM (TMVar a)
- Polysemy.Http.Prelude: newEmptyTMVarIO :: MonadIO m => m (TMVar a)
- Polysemy.Http.Prelude: newIORef :: MonadIO m => a -> m (IORef a)
- Polysemy.Http.Prelude: newMVar :: MonadIO m => a -> m (MVar a)
- Polysemy.Http.Prelude: newTMVar :: a -> STM (TMVar a)
- Polysemy.Http.Prelude: newTMVarIO :: MonadIO m => a -> m (TMVar a)
- Polysemy.Http.Prelude: newTVar :: a -> STM (TVar a)
- Polysemy.Http.Prelude: newTVarIO :: MonadIO m => a -> m (TVar a)
- Polysemy.Http.Prelude: newtype All
- Polysemy.Http.Prelude: newtype Alt (f :: k -> Type) (a :: k)
- Polysemy.Http.Prelude: newtype Any
- Polysemy.Http.Prelude: newtype Ap (f :: k -> Type) (a :: k)
- Polysemy.Http.Prelude: newtype Comparison a
- Polysemy.Http.Prelude: newtype Compose (f :: k -> Type) (g :: k1 -> k) (a :: k1)
- Polysemy.Http.Prelude: newtype Const a (b :: k)
- Polysemy.Http.Prelude: newtype Down a
- Polysemy.Http.Prelude: newtype Dual a
- Polysemy.Http.Prelude: newtype Endo a
- Polysemy.Http.Prelude: newtype Equivalence a
- Polysemy.Http.Prelude: newtype ExceptT e (m :: Type -> Type) a
- Polysemy.Http.Prelude: newtype First a
- Polysemy.Http.Prelude: newtype Identity a
- Polysemy.Http.Prelude: newtype Last a
- Polysemy.Http.Prelude: newtype MaybeT (m :: Type -> Type) a
- Polysemy.Http.Prelude: newtype Op a b
- Polysemy.Http.Prelude: newtype Option a
- Polysemy.Http.Prelude: newtype Predicate a
- Polysemy.Http.Prelude: newtype Product a
- Polysemy.Http.Prelude: newtype ReaderT r (m :: Type -> Type) a
- Polysemy.Http.Prelude: newtype StateT s (m :: Type -> Type) a
- Polysemy.Http.Prelude: newtype Sum a
- Polysemy.Http.Prelude: newtype ZipList a
- Polysemy.Http.Prelude: nonEmpty :: [a] -> Maybe (NonEmpty a)
- Polysemy.Http.Prelude: not :: Bool -> Bool
- Polysemy.Http.Prelude: notElem :: (Foldable f, DisallowElem f, Eq a) => a -> f a -> Bool
- Polysemy.Http.Prelude: null :: Foldable t => t a -> Bool
- Polysemy.Http.Prelude: numerator :: Ratio a -> a
- Polysemy.Http.Prelude: odd :: Integral a => a -> Bool
- Polysemy.Http.Prelude: on :: (b -> b -> c) -> (a -> b) -> a -> a -> c
- Polysemy.Http.Prelude: one :: One x => OneItem x -> x
- Polysemy.Http.Prelude: optional :: Alternative f => f a -> f (Maybe a)
- Polysemy.Http.Prelude: or :: Foldable t => t Bool -> Bool
- Polysemy.Http.Prelude: orM :: (Foldable f, Monad m) => f (m Bool) -> m Bool
- Polysemy.Http.Prelude: ord :: Char -> Int
- Polysemy.Http.Prelude: ordNub :: Ord a => [a] -> [a]
- Polysemy.Http.Prelude: ordNubOn :: Ord b => (a -> b) -> [a] -> [a]
- Polysemy.Http.Prelude: otherwise :: Bool
- Polysemy.Http.Prelude: partitionEithers :: [Either a b] -> ([a], [b])
- Polysemy.Http.Prelude: partitionWith :: (a -> Either b c) -> [a] -> ([b], [c])
- Polysemy.Http.Prelude: pass :: Applicative f => f ()
- Polysemy.Http.Prelude: pattern Exc :: Exception e => e -> SomeException
- Polysemy.Http.Prelude: permutations :: [a] -> [[a]]
- Polysemy.Http.Prelude: phantom :: (Functor f, Contravariant f) => f a -> f b
- Polysemy.Http.Prelude: pi :: Floating a => a
- Polysemy.Http.Prelude: pred :: Enum a => a -> a
- Polysemy.Http.Prelude: prettyCallStack :: CallStack -> String
- Polysemy.Http.Prelude: prettySrcLoc :: SrcLoc -> String
- Polysemy.Http.Prelude: print :: forall a m. (MonadIO m, Show a) => a -> m ()
- Polysemy.Http.Prelude: product :: forall a f. (Foldable f, Num a) => f a -> a
- Polysemy.Http.Prelude: properFraction :: (RealFrac a, Integral b) => a -> (b, a)
- Polysemy.Http.Prelude: pure :: Applicative f => a -> f a
- Polysemy.Http.Prelude: pureT :: forall f a (e :: Effect) (m :: Type -> Type) (r :: [Effect]). Functor f => a -> Sem (WithTactics e f m r) (f a)
- Polysemy.Http.Prelude: put :: forall s (r :: [Effect]). MemberWithError (State s :: (Type -> Type) -> Type -> Type) r => s -> Sem r ()
- Polysemy.Http.Prelude: putBS :: MonadIO m => ByteString -> m ()
- Polysemy.Http.Prelude: putBSLn :: MonadIO m => ByteString -> m ()
- Polysemy.Http.Prelude: putLBS :: MonadIO m => LByteString -> m ()
- Polysemy.Http.Prelude: putLBSLn :: MonadIO m => LByteString -> m ()
- Polysemy.Http.Prelude: putLText :: MonadIO m => LText -> m ()
- Polysemy.Http.Prelude: putLTextLn :: MonadIO m => LText -> m ()
- Polysemy.Http.Prelude: putMVar :: MonadIO m => MVar a -> a -> m ()
- Polysemy.Http.Prelude: putStr :: MonadIO m => String -> m ()
- Polysemy.Http.Prelude: putStrLn :: MonadIO m => String -> m ()
- Polysemy.Http.Prelude: putTMVar :: TMVar a -> a -> STM ()
- Polysemy.Http.Prelude: putText :: MonadIO m => Text -> m ()
- Polysemy.Http.Prelude: putTextLn :: MonadIO m => Text -> m ()
- Polysemy.Http.Prelude: qt :: QuasiQuoter
- Polysemy.Http.Prelude: quot :: Integral a => a -> a -> a
- Polysemy.Http.Prelude: quotRem :: Integral a => a -> a -> (a, a)
- Polysemy.Http.Prelude: raise :: forall (e :: Effect) (r :: EffectRow) a. Sem r a -> Sem (e : r) a
- Polysemy.Http.Prelude: raiseUnder :: forall (e2 :: Effect) (e1 :: Effect) (r :: [Effect]) a. Sem (e1 : r) a -> Sem (e1 : (e2 : r)) a
- Polysemy.Http.Prelude: raiseUnder2 :: forall (e2 :: Effect) (e3 :: Effect) (e1 :: Effect) (r :: [Effect]) a. Sem (e1 : r) a -> Sem (e1 : (e2 : (e3 : r))) a
- Polysemy.Http.Prelude: raiseUnder3 :: forall (e2 :: Effect) (e3 :: Effect) (e4 :: Effect) (e1 :: Effect) (r :: [Effect]) a. Sem (e1 : r) a -> Sem (e1 : (e2 : (e3 : (e4 : r)))) a
- Polysemy.Http.Prelude: readEither :: Read a => String -> Either Text a
- Polysemy.Http.Prelude: readFileBS :: MonadIO m => FilePath -> m ByteString
- Polysemy.Http.Prelude: readFileLBS :: MonadIO m => FilePath -> m LByteString
- Polysemy.Http.Prelude: readFileLText :: MonadIO m => FilePath -> m LText
- Polysemy.Http.Prelude: readFileText :: MonadIO m => FilePath -> m Text
- Polysemy.Http.Prelude: readIORef :: MonadIO m => IORef a -> m a
- Polysemy.Http.Prelude: readMVar :: MonadIO m => MVar a -> m a
- Polysemy.Http.Prelude: readMaybe :: Read a => String -> Maybe a
- Polysemy.Http.Prelude: readTMVar :: TMVar a -> STM a
- Polysemy.Http.Prelude: readTVar :: TVar a -> STM a
- Polysemy.Http.Prelude: readTVarIO :: MonadIO m => TVar a -> m a
- Polysemy.Http.Prelude: reader :: MonadReader r m => (r -> a) -> m a
- Polysemy.Http.Prelude: reads :: Read a => ReadS a
- Polysemy.Http.Prelude: realToFrac :: (Real a, Fractional b) => a -> b
- Polysemy.Http.Prelude: recip :: Fractional a => a -> a
- Polysemy.Http.Prelude: rem :: Integral a => a -> a -> a
- Polysemy.Http.Prelude: repeat :: a -> [a]
- Polysemy.Http.Prelude: replicate :: Int -> a -> [a]
- Polysemy.Http.Prelude: replicateM :: Applicative m => Int -> m a -> m [a]
- Polysemy.Http.Prelude: replicateM_ :: Applicative m => Int -> m a -> m ()
- Polysemy.Http.Prelude: return :: Monad m => a -> m a
- Polysemy.Http.Prelude: reverse :: [a] -> [a]
- Polysemy.Http.Prelude: rightToMaybe :: Either l r -> Maybe r
- Polysemy.Http.Prelude: rights :: [Either a b] -> [b]
- Polysemy.Http.Prelude: rnf :: NFData a => a -> ()
- Polysemy.Http.Prelude: round :: (RealFrac a, Integral b) => a -> b
- Polysemy.Http.Prelude: runError :: forall e (r :: [(Type -> Type) -> Type -> Type]) a. Sem ((Error e :: (Type -> Type) -> Type -> Type) : r) a -> Sem r (Either e a)
- Polysemy.Http.Prelude: runExceptT :: ExceptT e m a -> m (Either e a)
- Polysemy.Http.Prelude: scanl :: (b -> a -> b) -> b -> [a] -> [b]
- Polysemy.Http.Prelude: scanl' :: (b -> a -> b) -> b -> [a] -> [b]
- Polysemy.Http.Prelude: scanl1 :: (a -> a -> a) -> [a] -> [a]
- Polysemy.Http.Prelude: scanr :: (a -> b -> b) -> b -> [a] -> [b]
- Polysemy.Http.Prelude: scanr1 :: (a -> a -> a) -> [a] -> [a]
- Polysemy.Http.Prelude: sconcat :: Semigroup a => NonEmpty a -> a
- Polysemy.Http.Prelude: second :: Bifunctor p => (b -> c) -> p a b -> p a c
- Polysemy.Http.Prelude: seq :: forall (r :: RuntimeRep) a (b :: TYPE r). a -> b -> b
- Polysemy.Http.Prelude: sequence :: (Traversable t, Monad m) => t (m a) -> m (t a)
- Polysemy.Http.Prelude: sequenceA :: (Traversable t, Applicative f) => t (f a) -> f (t a)
- Polysemy.Http.Prelude: sequenceA_ :: (Foldable t, Applicative f) => t (f a) -> f ()
- Polysemy.Http.Prelude: sequence_ :: (Foldable t, Monad m) => t (m a) -> m ()
- Polysemy.Http.Prelude: show :: forall b a. (Show a, IsString b) => a -> b
- Polysemy.Http.Prelude: showStackTrace :: IO (Maybe String)
- Polysemy.Http.Prelude: signum :: Num a => a -> a
- Polysemy.Http.Prelude: sin :: Floating a => a -> a
- Polysemy.Http.Prelude: sinh :: Floating a => a -> a
- Polysemy.Http.Prelude: snd :: (a, b) -> b
- Polysemy.Http.Prelude: some :: Alternative f => f a -> f [a]
- Polysemy.Http.Prelude: someNatVal :: Natural -> SomeNat
- Polysemy.Http.Prelude: sort :: Ord a => [a] -> [a]
- Polysemy.Http.Prelude: sortBy :: (a -> a -> Ordering) -> [a] -> [a]
- Polysemy.Http.Prelude: sortNub :: Ord a => [a] -> [a]
- Polysemy.Http.Prelude: sortOn :: Ord b => (a -> b) -> [a] -> [a]
- Polysemy.Http.Prelude: sortWith :: Ord b => (a -> b) -> [a] -> [a]
- Polysemy.Http.Prelude: span :: (a -> Bool) -> [a] -> ([a], [a])
- Polysemy.Http.Prelude: splitAt :: Int -> [a] -> ([a], [a])
- Polysemy.Http.Prelude: sqrt :: Floating a => a -> a
- Polysemy.Http.Prelude: stderr :: Handle
- Polysemy.Http.Prelude: stdin :: Handle
- Polysemy.Http.Prelude: stdout :: Handle
- Polysemy.Http.Prelude: stimes :: (Semigroup a, Integral b) => b -> a -> a
- Polysemy.Http.Prelude: stimesIdempotent :: Integral b => b -> a -> a
- Polysemy.Http.Prelude: stimesIdempotentMonoid :: (Integral b, Monoid a) => b -> a -> a
- Polysemy.Http.Prelude: stimesMonoid :: (Integral b, Monoid a) => b -> a -> a
- Polysemy.Http.Prelude: strictDecode :: OnDecodeError
- Polysemy.Http.Prelude: subsequences :: [a] -> [[a]]
- Polysemy.Http.Prelude: subtract :: Num a => a -> a -> a
- Polysemy.Http.Prelude: succ :: Enum a => a -> a
- Polysemy.Http.Prelude: sum :: forall a f. (Foldable f, Num a) => f a -> a
- Polysemy.Http.Prelude: swap :: (a, b) -> (b, a)
- Polysemy.Http.Prelude: swapMVar :: MonadIO m => MVar a -> a -> m a
- Polysemy.Http.Prelude: swapTMVar :: TMVar a -> a -> STM a
- Polysemy.Http.Prelude: tail :: IsNonEmpty f a [a] "tail" => f a -> [a]
- Polysemy.Http.Prelude: tails :: [a] -> [[a]]
- Polysemy.Http.Prelude: take :: Int -> [a] -> [a]
- Polysemy.Http.Prelude: takeMVar :: MonadIO m => MVar a -> m a
- Polysemy.Http.Prelude: takeTMVar :: TMVar a -> STM a
- Polysemy.Http.Prelude: takeWhile :: (a -> Bool) -> [a] -> [a]
- Polysemy.Http.Prelude: tan :: Floating a => a -> a
- Polysemy.Http.Prelude: tanh :: Floating a => a -> a
- Polysemy.Http.Prelude: throw :: forall e (r :: [Effect]) a. MemberWithError (Error e :: (Type -> Type) -> Type -> Type) r => e -> Sem r a
- Polysemy.Http.Prelude: throwSTM :: Exception e => e -> STM a
- Polysemy.Http.Prelude: toEnum :: Enum a => Int -> a
- Polysemy.Http.Prelude: toException :: Exception e => e -> SomeException
- Polysemy.Http.Prelude: toInteger :: Integral a => a -> Integer
- Polysemy.Http.Prelude: toIntegralSized :: (Integral a, Integral b, Bits a, Bits b) => a -> Maybe b
- Polysemy.Http.Prelude: toLText :: ToLText a => a -> LText
- Polysemy.Http.Prelude: toLazy :: LazyStrict l s => s -> l
- Polysemy.Http.Prelude: toList :: Foldable t => t a -> [a]
- Polysemy.Http.Prelude: toRational :: Real a => a -> Rational
- Polysemy.Http.Prelude: toShort :: ByteString -> ShortByteString
- Polysemy.Http.Prelude: toStrict :: LazyStrict l s => l -> s
- Polysemy.Http.Prelude: toString :: ToString a => a -> String
- Polysemy.Http.Prelude: toText :: ToText a => a -> Text
- Polysemy.Http.Prelude: trace :: String -> a -> a
- Polysemy.Http.Prelude: traceId :: String -> String
- Polysemy.Http.Prelude: traceM :: Applicative f => String -> f ()
- Polysemy.Http.Prelude: traceShow :: Show a => a -> b -> b
- Polysemy.Http.Prelude: traceShowId :: Show a => a -> a
- Polysemy.Http.Prelude: traceShowM :: (Show a, Applicative f) => a -> f ()
- Polysemy.Http.Prelude: traceShowWith :: Show b => (a -> b) -> a -> a
- Polysemy.Http.Prelude: transpose :: [[a]] -> [[a]]
- Polysemy.Http.Prelude: traverse :: (Traversable t, Applicative f) => (a -> f b) -> t a -> f (t b)
- Polysemy.Http.Prelude: traverseLeft :: Applicative m => (a -> m b) -> Either a b -> m b
- Polysemy.Http.Prelude: traverse_ :: (Foldable t, Applicative f) => (a -> f b) -> t a -> f ()
- Polysemy.Http.Prelude: truncate :: (RealFrac a, Integral b) => a -> b
- Polysemy.Http.Prelude: tryAny :: Member (Embed IO) r => IO a -> Sem r (Either Text a)
- Polysemy.Http.Prelude: tryHoist :: Member (Embed IO) r => (Text -> e) -> IO a -> Sem r (Either e a)
- Polysemy.Http.Prelude: tryPutMVar :: MonadIO m => MVar a -> a -> m Bool
- Polysemy.Http.Prelude: tryPutTMVar :: TMVar a -> a -> STM Bool
- Polysemy.Http.Prelude: tryReadMVar :: MonadIO m => MVar a -> m (Maybe a)
- Polysemy.Http.Prelude: tryReadTMVar :: TMVar a -> STM (Maybe a)
- Polysemy.Http.Prelude: tryTakeMVar :: MonadIO m => MVar a -> m (Maybe a)
- Polysemy.Http.Prelude: tryTakeTMVar :: TMVar a -> STM (Maybe a)
- Polysemy.Http.Prelude: tryThrow :: Members [Embed IO, Error e] r => (Text -> e) -> IO a -> Sem r a
- Polysemy.Http.Prelude: tuple :: Applicative f => f a -> f b -> f (a, b)
- Polysemy.Http.Prelude: type Effect = Type -> Type -> Type -> Type
- Polysemy.Http.Prelude: type FilePath = String
- Polysemy.Http.Prelude: type HasCallStack = ?callStack :: CallStack
- Polysemy.Http.Prelude: type LByteString = ByteString
- Polysemy.Http.Prelude: type LText = Text
- Polysemy.Http.Prelude: type Member (e :: k) (r :: [k]) = MemberNoError e r
- Polysemy.Http.Prelude: type OnDecodeError = OnError Word8 Char
- Polysemy.Http.Prelude: type OnError a b = String -> Maybe a -> Maybe b
- Polysemy.Http.Prelude: type Rational = Ratio Integer
- Polysemy.Http.Prelude: type InterpreterFor (e :: Effect) (r :: [Effect]) = forall a. () => Sem e : r a -> Sem r a
- Polysemy.Http.Prelude: type String = [Char]
- Polysemy.Http.Prelude: type WithTactics (e :: Effect) (f :: Type -> Type) (m :: Type -> Type) (r :: [Effect]) = Tactics f m e : r :: Type -> Type -> Type -> Type : r
- Polysemy.Http.Prelude: type family OneItem x
- Polysemy.Http.Prelude: uncons :: [a] -> Maybe (a, [a])
- Polysemy.Http.Prelude: uncurry :: (a -> b -> c) -> (a, b) -> c
- Polysemy.Http.Prelude: undefined :: forall (r :: RuntimeRep) (a :: TYPE r). HasCallStack => a
- Polysemy.Http.Prelude: unfoldr :: (b -> Maybe (a, b)) -> b -> [a]
- Polysemy.Http.Prelude: unit :: Applicative f => f ()
- Polysemy.Http.Prelude: universe :: (Bounded a, Enum a) => [a]
- Polysemy.Http.Prelude: universeNonEmpty :: (Bounded a, Enum a) => NonEmpty a
- Polysemy.Http.Prelude: unless :: Applicative f => Bool -> f () -> f ()
- Polysemy.Http.Prelude: unlessM :: Monad m => m Bool -> m () -> m ()
- Polysemy.Http.Prelude: unlines :: IsText t "unlines" => [t] -> t
- Polysemy.Http.Prelude: unsafeLogAnd :: Text -> b -> b
- Polysemy.Http.Prelude: unsafeLogS :: Show a => a -> a
- Polysemy.Http.Prelude: unsafeLogSAnd :: Show a => a -> b -> b
- Polysemy.Http.Prelude: unstableNub :: (Eq a, Hashable a) => [a] -> [a]
- Polysemy.Http.Prelude: unwords :: IsText t "unwords" => [t] -> t
- Polysemy.Http.Prelude: unzip :: [(a, b)] -> ([a], [b])
- Polysemy.Http.Prelude: unzip3 :: [(a, b, c)] -> ([a], [b], [c])
- Polysemy.Http.Prelude: usingReader :: r -> Reader r a -> a
- Polysemy.Http.Prelude: usingReaderT :: r -> ReaderT r m a -> m a
- Polysemy.Http.Prelude: usingState :: s -> State s a -> (a, s)
- Polysemy.Http.Prelude: usingStateT :: s -> StateT s m a -> m (a, s)
- Polysemy.Http.Prelude: vacuous :: Functor f => f Void -> f a
- Polysemy.Http.Prelude: viaNonEmpty :: (NonEmpty a -> b) -> [a] -> Maybe b
- Polysemy.Http.Prelude: void :: Functor f => f a -> f ()
- Polysemy.Http.Prelude: when :: Applicative f => Bool -> f () -> f ()
- Polysemy.Http.Prelude: whenJust :: Applicative f => Maybe a -> (a -> f ()) -> f ()
- Polysemy.Http.Prelude: whenJustM :: Monad m => m (Maybe a) -> (a -> m ()) -> m ()
- Polysemy.Http.Prelude: whenLeft :: Applicative f => a -> Either l r -> (l -> f a) -> f a
- Polysemy.Http.Prelude: whenLeftM :: Monad m => a -> m (Either l r) -> (l -> m a) -> m a
- Polysemy.Http.Prelude: whenLeftM_ :: Monad m => m (Either l r) -> (l -> m ()) -> m ()
- Polysemy.Http.Prelude: whenLeft_ :: Applicative f => Either l r -> (l -> f ()) -> f ()
- Polysemy.Http.Prelude: whenM :: Monad m => m Bool -> m () -> m ()
- Polysemy.Http.Prelude: whenNotNull :: Applicative f => [a] -> (NonEmpty a -> f ()) -> f ()
- Polysemy.Http.Prelude: whenNotNullM :: Monad m => m [a] -> (NonEmpty a -> m ()) -> m ()
- Polysemy.Http.Prelude: whenNothing :: Applicative f => Maybe a -> f a -> f a
- Polysemy.Http.Prelude: whenNothingM :: Monad m => m (Maybe a) -> m a -> m a
- Polysemy.Http.Prelude: whenNothingM_ :: Monad m => m (Maybe a) -> m () -> m ()
- Polysemy.Http.Prelude: whenNothing_ :: Applicative f => Maybe a -> f () -> f ()
- Polysemy.Http.Prelude: whenRight :: Applicative f => a -> Either l r -> (r -> f a) -> f a
- Polysemy.Http.Prelude: whenRightM :: Monad m => a -> m (Either l r) -> (r -> m a) -> m a
- Polysemy.Http.Prelude: whenRightM_ :: Monad m => m (Either l r) -> (r -> m ()) -> m ()
- Polysemy.Http.Prelude: whenRight_ :: Applicative f => Either l r -> (r -> f ()) -> f ()
- Polysemy.Http.Prelude: withFile :: FilePath -> IOMode -> (Handle -> IO r) -> IO r
- Polysemy.Http.Prelude: withFrozenCallStack :: HasCallStack => (HasCallStack => a) -> a
- Polysemy.Http.Prelude: withReader :: (r' -> r) -> Reader r a -> Reader r' a
- Polysemy.Http.Prelude: withReaderT :: forall r' r (m :: Type -> Type) a. (r' -> r) -> ReaderT r m a -> ReaderT r' m a
- Polysemy.Http.Prelude: withState :: (s -> s) -> State s a -> State s a
- Polysemy.Http.Prelude: words :: IsText t "words" => t -> [t]
- Polysemy.Http.Prelude: writeFile :: MonadIO m => FilePath -> String -> m ()
- Polysemy.Http.Prelude: writeFileBS :: MonadIO m => FilePath -> ByteString -> m ()
- Polysemy.Http.Prelude: writeFileLBS :: MonadIO m => FilePath -> LByteString -> m ()
- Polysemy.Http.Prelude: writeFileLText :: MonadIO m => FilePath -> LText -> m ()
- Polysemy.Http.Prelude: writeFileText :: MonadIO m => FilePath -> Text -> m ()
- Polysemy.Http.Prelude: writeIORef :: MonadIO m => IORef a -> a -> m ()
- Polysemy.Http.Prelude: writeTVar :: TVar a -> a -> STM ()
- Polysemy.Http.Prelude: xor :: Bits a => a -> a -> a
- Polysemy.Http.Prelude: zip :: [a] -> [b] -> [(a, b)]
- Polysemy.Http.Prelude: zip3 :: [a] -> [b] -> [c] -> [(a, b, c)]
- Polysemy.Http.Prelude: zipWith :: (a -> b -> c) -> [a] -> [b] -> [c]
- Polysemy.Http.Prelude: zipWithM :: Applicative m => (a -> b -> m c) -> [a] -> [b] -> m [c]
- Polysemy.Http.Prelude: zipWithM_ :: Applicative m => (a -> b -> m c) -> [a] -> [b] -> m ()
- Polysemy.Http.Prelude: }
- Polysemy.Http.Request: epoch :: UTCTime
- Polysemy.Http.Request: invalidScheme :: Text -> Text -> Either Text a
- Polysemy.Http.Request: neverExpire :: UTCTime
- Polysemy.Http.Request: parseHostPort :: Text -> (Text, Maybe Text) -> Either Text (Host, Maybe Port)
- Polysemy.Http.Request: parseScheme :: Text -> (Text, Maybe Text) -> Either Text (Tls, Text)
- Polysemy.Http.Request: parseUrl :: Text -> Either Text (Tls, Host, Maybe Port, Path)
- Polysemy.Http.Request: split :: Text -> Text -> (Text, Maybe Text)
- Polysemy.Http.Strict: interpretHttpStrict :: Member (Embed IO) r => [Response LByteString] -> [ByteString] -> InterpreterFor (Http LByteString) r
- Polysemy.Http.Strict: interpretHttpStrictWithState :: Members [State [ByteString], State [Response LByteString], Embed IO] r => InterpreterFor (Http LByteString) r
- Polysemy.Http.Strict: streamResponse :: Response LByteString
- Polysemy.Http.Strict: takeChunk :: Member (State [ByteString]) r => [ByteString] -> Sem r ByteString
- Polysemy.Http.Strict: takeResponse :: Member (State [Response LByteString]) r => [Response LByteString] -> Sem r (Response LByteString)
+ Polysemy.Http: interpretEntityDecodeAesonAs :: FromJSON j => (j -> d) -> Sem (EntityDecode d : r) a -> Sem r a
+ Polysemy.Http: interpretEntityEncodeAesonAs :: ToJSON j => (d -> j) -> Sem (EntityEncode d : r) a -> Sem r a
+ Polysemy.Http: interpretHttpPure :: Member (Embed IO) r => [Response LByteString] -> [ByteString] -> InterpretersFor [Http LByteString, State [Response LByteString], State [ByteString]] r
+ Polysemy.Http: interpretManager :: Member (Embed IO) r => InterpreterFor Manager r
+ Polysemy.Http: jsonRequest :: Member (Http c) r => Request -> Sem r (Either HttpError (Response LByteString))
+ Polysemy.Http.Data.Request: instance GHC.Classes.Ord Polysemy.Http.Data.Request.Port
+ Polysemy.Http.Data.Request: instance GHC.Enum.Enum Polysemy.Http.Data.Request.Port
+ Polysemy.Http.Data.Request: instance GHC.Num.Num Polysemy.Http.Data.Request.Port
+ Polysemy.Http.Data.Request: instance GHC.Read.Read Polysemy.Http.Data.Request.Port
+ Polysemy.Http.Data.Request: instance GHC.Real.Integral Polysemy.Http.Data.Request.Port
+ Polysemy.Http.Data.Request: instance GHC.Real.Real Polysemy.Http.Data.Request.Port
+ Polysemy.Http.Effect.Entity: EntityError :: Text -> Text -> EntityError
+ Polysemy.Http.Effect.Entity: [DecodeStrict] :: ByteString -> EntityDecode d m (Either EntityError d)
+ Polysemy.Http.Effect.Entity: [Decode] :: LByteString -> EntityDecode d m (Either EntityError d)
+ Polysemy.Http.Effect.Entity: [EncodeStrict] :: d -> EntityEncode d m ByteString
+ Polysemy.Http.Effect.Entity: [Encode] :: d -> EntityEncode d m LByteString
+ Polysemy.Http.Effect.Entity: [body] :: EntityError -> Text
+ Polysemy.Http.Effect.Entity: [message] :: EntityError -> Text
+ Polysemy.Http.Effect.Entity: data Decode a
+ Polysemy.Http.Effect.Entity: data Encode a
+ Polysemy.Http.Effect.Entity: data EntityDecode d :: Effect
+ Polysemy.Http.Effect.Entity: data EntityEncode d :: Effect
+ Polysemy.Http.Effect.Entity: data EntityError
+ Polysemy.Http.Effect.Entity: decode :: forall d r. Member (EntityDecode d) r => LByteString -> Sem r (Either EntityError d)
+ Polysemy.Http.Effect.Entity: decodeStrict :: forall d r. Member (EntityDecode d) r => ByteString -> Sem r (Either EntityError d)
+ Polysemy.Http.Effect.Entity: encode :: forall d r. Member (EntityEncode d) r => d -> Sem r LByteString
+ Polysemy.Http.Effect.Entity: encodeStrict :: forall d r. Member (EntityEncode d) r => d -> Sem r ByteString
+ Polysemy.Http.Effect.Entity: instance GHC.Classes.Eq Polysemy.Http.Effect.Entity.EntityError
+ Polysemy.Http.Effect.Entity: instance GHC.Show.Show Polysemy.Http.Effect.Entity.EntityError
+ Polysemy.Http.Effect.Entity: type family Decoders ds r :: Constraint
+ Polysemy.Http.Effect.Http: [ConsumeChunk] :: c -> Http c m (Either HttpError ByteString)
+ Polysemy.Http.Effect.Http: [Request] :: Request -> Http c m (Either HttpError (Response LByteString))
+ Polysemy.Http.Effect.Http: [Response] :: Request -> (Response c -> m a) -> Http c m (Either HttpError a)
+ Polysemy.Http.Effect.Http: [Stream] :: Request -> (Response c -> m a) -> Http c m (Either HttpError a)
+ Polysemy.Http.Effect.Http: data Http c :: Effect
+ Polysemy.Http.Effect.Http: request :: forall c r. Member (Http c) r => Request -> Sem r (Either HttpError (Response LByteString))
+ Polysemy.Http.Effect.Http: response :: forall c r a. Member (Http c) r => Request -> (Response c -> Sem r a) -> Sem r (Either HttpError a)
+ Polysemy.Http.Effect.Http: stream :: forall c r a. Member (Http c) r => Request -> (Response c -> Sem r a) -> Sem r (Either HttpError a)
+ Polysemy.Http.Effect.Manager: [Get] :: Manager m Manager
+ Polysemy.Http.Effect.Manager: data Manager :: Effect
+ Polysemy.Http.Interpreter.AesonEntity: interpretEntityDecodeAeson :: FromJSON d => Sem (EntityDecode d : r) a -> Sem r a
+ Polysemy.Http.Interpreter.AesonEntity: interpretEntityDecodeAesonAs :: FromJSON j => (j -> d) -> Sem (EntityDecode d : r) a -> Sem r a
+ Polysemy.Http.Interpreter.AesonEntity: interpretEntityEncodeAeson :: ToJSON d => Sem (EntityEncode d : r) a -> Sem r a
+ Polysemy.Http.Interpreter.AesonEntity: interpretEntityEncodeAesonAs :: ToJSON j => (d -> j) -> Sem (EntityEncode d : r) a -> Sem r a
+ Polysemy.Http.Interpreter.Manager: interpretManager :: Member (Embed IO) r => InterpreterFor Manager r
+ Polysemy.Http.Interpreter.Native: interpretHttpNative :: Members [Embed IO, Log, Resource] r => InterpreterFor (Http BodyReader) r
+ Polysemy.Http.Interpreter.Native: interpretHttpNativeWith :: Members [Embed IO, Log, Resource, Manager] r => InterpreterFor (Http BodyReader) r
+ Polysemy.Http.Interpreter.Native: nativeRequest :: Request -> Request
+ Polysemy.Http.Interpreter.Pure: interpretHttpPure :: Member (Embed IO) r => [Response LByteString] -> [ByteString] -> InterpretersFor [Http LByteString, State [Response LByteString], State [ByteString]] r
Files
- changelog.md +7/−0
- integration/Polysemy/Http/CookieTest.hs +2/−2
- integration/Polysemy/Http/RequestTest.hs +2/−2
- integration/Polysemy/Http/StreamTest.hs +3/−3
- lib/Polysemy/Http.hs +50/−35
- lib/Polysemy/Http/AesonEntity.hs +0/−41
- lib/Polysemy/Http/Data/Entity.hs +0/−87
- lib/Polysemy/Http/Data/Header.hs +2/−0
- lib/Polysemy/Http/Data/Http.hs +0/−48
- lib/Polysemy/Http/Data/HttpError.hs +2/−0
- lib/Polysemy/Http/Data/Manager.hs +0/−9
- lib/Polysemy/Http/Data/Request.hs +4/−1
- lib/Polysemy/Http/Data/Response.hs +3/−1
- lib/Polysemy/Http/Data/StreamChunk.hs +2/−0
- lib/Polysemy/Http/Data/StreamEvent.hs +2/−0
- lib/Polysemy/Http/Effect/Entity.hs +89/−0
- lib/Polysemy/Http/Effect/Http.hs +50/−0
- lib/Polysemy/Http/Effect/Manager.hs +11/−0
- lib/Polysemy/Http/Http.hs +7/−5
- lib/Polysemy/Http/Interpreter/AesonEntity.hs +65/−0
- lib/Polysemy/Http/Interpreter/Manager.hs +28/−0
- lib/Polysemy/Http/Interpreter/Native.hs +145/−0
- lib/Polysemy/Http/Interpreter/Pure.hs +62/−0
- lib/Polysemy/Http/Json.hs +5/−2
- lib/Polysemy/Http/Manager.hs +0/−26
- lib/Polysemy/Http/Native.hs +0/−143
- lib/Polysemy/Http/Prelude.hs +15/−12
- lib/Polysemy/Http/Request.hs +8/−6
- lib/Polysemy/Http/Strict.hs +0/−70
- lib/Prelude.hs +2/−0
- polysemy-http.cabal +19/−19
- readme.md +2/−2
changelog.md view
@@ -1,3 +1,10 @@+# Unreleased++# 0.5.0.0+* Add `Num Port`.+* Add json interpreters that transform payloads.+* Change pure `Http` interpreter to use supplied responses for streaming requests.+ # 0.4.0.0 * Use `CookieJar` in the `Response` instead of requiring users to extract them from the headers.
integration/Polysemy/Http/CookieTest.hs view
@@ -6,13 +6,13 @@ import Polysemy.Log (interpretLogNull) import Polysemy.Resource (resourceToIOFinal) -import qualified Polysemy.Http.Data.Http as Http+import qualified Polysemy.Http.Effect.Http as Http import Polysemy.Http.Data.HttpError (HttpError) import qualified Polysemy.Http.Data.Request as Request import Polysemy.Http.Data.Request (Port(Port), Tls(Tls)) import qualified Polysemy.Http.Data.Response as Response import Polysemy.Http.Data.Response (Response)-import Polysemy.Http.Native (interpretHttpNative)+import Polysemy.Http.Interpreter.Native (interpretHttpNative) import qualified Polysemy.Http.Request as Request import Polysemy.Http.Request (addCookie) import Polysemy.Http.Server (withServer)
integration/Polysemy/Http/RequestTest.hs view
@@ -7,14 +7,14 @@ import Polysemy.Log (interpretLogNull) import Polysemy.Resource (resourceToIOFinal) -import qualified Polysemy.Http.Data.Http as Http+import qualified Polysemy.Http.Effect.Http as Http import Polysemy.Http.Data.HttpError (HttpError) import qualified Polysemy.Http.Data.Request as Request import Polysemy.Http.Data.Request (Body(Body), Port(Port), Tls(Tls)) import qualified Polysemy.Http.Data.Response as Response import Polysemy.Http.Data.Response (Response) import Polysemy.Http.Json (jsonContentType)-import Polysemy.Http.Native (interpretHttpNative)+import Polysemy.Http.Interpreter.Native (interpretHttpNative) import qualified Polysemy.Http.Request as Request import Polysemy.Http.Server (Payload(Payload), withServer) import Polysemy.Http.Test (UnitTest)
integration/Polysemy/Http/StreamTest.hs view
@@ -10,12 +10,12 @@ import Polysemy.Http.Data.HttpError (HttpError) import qualified Polysemy.Http.Data.Request as Request-import Polysemy.Http.Data.Request (Port(Port), Request, Tls(Tls))-import Polysemy.Http.Data.StreamChunk (StreamChunk(StreamChunk))+import Polysemy.Http.Data.Request (Port (Port), Request, Tls (Tls))+import Polysemy.Http.Data.StreamChunk (StreamChunk (StreamChunk)) import qualified Polysemy.Http.Data.StreamEvent as StreamEvent import Polysemy.Http.Data.StreamEvent (StreamEvent) import qualified Polysemy.Http.Http as Http-import Polysemy.Http.Native (interpretHttpNative)+import Polysemy.Http.Interpreter.Native (interpretHttpNative) import qualified Polysemy.Http.Request as Request import Polysemy.Http.Server (withServer) import Polysemy.Http.Test (UnitTest)
lib/Polysemy/Http.hs view
@@ -1,9 +1,12 @@+-- |Description: Polysemy Effects for HTTP clients module Polysemy.Http ( -- $intro- module Polysemy.Http.Data.Http,+ module Polysemy.Http.Effect.Http,+ -- * Interpreters- module Polysemy.Http.Native,- module Polysemy.Http.Strict,+ module Polysemy.Http.Interpreter.Native,+ module Polysemy.Http.Interpreter.Pure,+ -- * Request and Response module Polysemy.Http.Data.Request, module Polysemy.Http.Data.Response,@@ -24,9 +27,11 @@ addCookies, addCookie, HttpError(..),+ -- * Streaming module Polysemy.Http.Http, module Polysemy.Http.Data.StreamEvent,+ -- * Entity EntityDecode, decode,@@ -40,16 +45,40 @@ Decoders, Encoders, EntityError(EntityError),- module Polysemy.Http.AesonEntity,+ module Polysemy.Http.Interpreter.AesonEntity,+ -- * Utilities -- ** Connection Pool- module Polysemy.Http.Data.Manager,+ module Polysemy.Http.Effect.Manager,+ interpretManager,+ jsonRequest, ) where import Prelude hiding (get, put) -import Polysemy.Http.AesonEntity (interpretEntityDecodeAeson, interpretEntityEncodeAeson)-import Polysemy.Http.Data.Entity (+import Polysemy.Http.Data.Header (Header (..), HeaderName (..), HeaderValue (..))+import Polysemy.Http.Data.HttpError (HttpError (..))+import Polysemy.Http.Data.Request (+ Body (..),+ Host (..),+ Method (..),+ Path (..),+ Port (..),+ QueryKey (..),+ QueryValue (..),+ Request (Request),+ Tls (..),+ )+import Polysemy.Http.Data.Response (+ pattern Client,+ pattern Info,+ pattern Redirect,+ Response (Response),+ pattern Server,+ pattern Success,+ )+import Polysemy.Http.Data.StreamEvent (StreamEvent (..))+import Polysemy.Http.Effect.Entity ( Decode, Decoders, Encode,@@ -57,38 +86,25 @@ Entities, EntityDecode, EntityEncode,- EntityError(EntityError),+ EntityError (EntityError), decode, decodeStrict, encode, encodeStrict, )-import Polysemy.Http.Data.Header (Header(..), HeaderName(..), HeaderValue(..))-import Polysemy.Http.Data.Http (Http, request, response, stream)-import Polysemy.Http.Data.HttpError (HttpError(..))-import Polysemy.Http.Data.Manager (Manager)-import Polysemy.Http.Data.Request (- Body(..),- Host(..),- Method(..),- Path(..),- Port(..),- QueryKey(..),- QueryValue(..),- Request(Request),- Tls(..),- )-import Polysemy.Http.Data.Response (- Response(Response),- pattern Client,- pattern Info,- pattern Redirect,- pattern Server,- pattern Success,- )-import Polysemy.Http.Data.StreamEvent (StreamEvent(..))+import Polysemy.Http.Effect.Http (Http, request, response, stream)+import Polysemy.Http.Effect.Manager (Manager) import Polysemy.Http.Http (streamResponse)-import Polysemy.Http.Native (interpretHttpNative)+import Polysemy.Http.Interpreter.AesonEntity (+ interpretEntityDecodeAeson,+ interpretEntityDecodeAesonAs,+ interpretEntityEncodeAeson,+ interpretEntityEncodeAesonAs,+ )+import Polysemy.Http.Interpreter.Manager (interpretManager)+import Polysemy.Http.Interpreter.Native (interpretHttpNative)+import Polysemy.Http.Interpreter.Pure (interpretHttpPure)+import Polysemy.Http.Json (jsonRequest) import Polysemy.Http.Request ( addCookie, addCookies,@@ -106,14 +122,13 @@ withPort, withTls, )-import Polysemy.Http.Strict (interpretHttpStrict) -- $intro -- A basic 'Polysemy' effect abstracting HTTP requests: -- -- @ -- import Polysemy (resourceToIO, runM)--- import Polysemy.Log.Colog (interpretLogStdout)+-- import Polysemy.Log (interpretLogStdout) -- import qualified Polysemy.Http as Http -- import Polysemy.Http (interpretHttpNative, interpretLogStdout) --
− lib/Polysemy/Http/AesonEntity.hs
@@ -1,41 +0,0 @@-module Polysemy.Http.AesonEntity where--import Data.Aeson (eitherDecode', eitherDecodeStrict', encode)--import Polysemy.Http.Data.Entity (EntityDecode, EntityEncode, EntityError(EntityError))-import qualified Polysemy.Http.Data.Entity as Entity (EntityDecode(..), EntityEncode(..))---- |Interpreter for 'EntityEncode' that uses Aeson.-interpretEntityEncodeAeson ::- ToJSON d =>- Sem (EntityEncode d : r) a ->- Sem r a-interpretEntityEncodeAeson =- interpret \case- Entity.Encode a ->- pure (encode a)- Entity.EncodeStrict a ->- pure (toStrict (encode a))-{-# INLINE interpretEntityEncodeAeson #-}--decodeWith ::- ConvertUtf8 Text s =>- (s -> Either String a) ->- s ->- Sem r (Either EntityError a)-decodeWith dec body =- pure . mapLeft (EntityError (decodeUtf8 body) . toText) $ dec body-{-# INLINE decodeWith #-}---- |Interpreter for 'EntityDecode' that uses Aeson.-interpretEntityDecodeAeson ::- FromJSON d =>- Sem (EntityDecode d : r) a ->- Sem r a-interpretEntityDecodeAeson =- interpret \case- Entity.Decode body ->- decodeWith eitherDecode' body- Entity.DecodeStrict body ->- decodeWith eitherDecodeStrict' body-{-# INLINE interpretEntityDecodeAeson #-}
− lib/Polysemy/Http/Data/Entity.hs
@@ -1,87 +0,0 @@-module Polysemy.Http.Data.Entity where--import Polysemy (makeSem_)---- |Generic error type for decoders.-data EntityError =- EntityError {- body :: Text,- message :: Text- }- deriving (Eq, Show)---- |Abstraction of json encoding, potentially usable for other content types like xml.-data EntityEncode d :: Effect where- Encode :: d -> EntityEncode d m LByteString- EncodeStrict :: d -> EntityEncode d m ByteString--makeSem_ ''EntityEncode---- |Lazily encode a value of type @d@ to a 'LByteString'-encode ::- ∀ d r .- Member (EntityEncode d) r =>- d ->- Sem r LByteString---- |Strictly encode a value of type @d@ to a 'ByteString'-encodeStrict ::- ∀ d r .- Member (EntityEncode d) r =>- d ->- Sem r ByteString---- |Abstraction of json decoding, potentially usable for other content types like xml.-data EntityDecode d :: Effect where- Decode :: LByteString -> EntityDecode d m (Either EntityError d)- DecodeStrict :: ByteString -> EntityDecode d m (Either EntityError d)--makeSem_ ''EntityDecode---- |Lazily decode a 'LByteString' to a value of type @d@-decode ::- ∀ d r .- Member (EntityDecode d) r =>- LByteString ->- Sem r (Either EntityError d)---- |Strictly decode a 'ByteString' to a value of type @d@-decodeStrict ::- ∀ d r .- Member (EntityDecode d) r =>- ByteString ->- Sem r (Either EntityError d)---- |Marker type to be used with 'Entities'-data Encode a---- |Marker type to be used with 'Entities'-data Decode a---- |Convenience constraint for requiring multiple entity effects, to be used like 'Polysemy.Members'.------ @--- foo :: Entities [Encode Int, Decode Double] r => Sem r ()--- @-type family Entities es r :: Constraint where- Entities '[] r = ()- Entities (Encode d ': ds) r = (Member (EntityEncode d) r, Entities ds r)- Entities (Decode d ': ds) r = (Member (EntityDecode d) r, Entities ds r)---- |Convenience constraint for requiring multiple encoders.------ @--- foo :: Encoders [Int, Double] r => Sem r ()--- @-type family Encoders es r :: Constraint where- Encoders '[] r = ()- Encoders (d ': ds) r = (Member (EntityEncode d) r, Encoders ds r)---- |Convenience constraint for requiring multiple decoders.------ @--- foo :: Decoders [Int, Double] r => Sem r ()--- @-type family Decoders ds r :: Constraint where- Decoders '[] r = ()- Decoders (d ': ds) r = (Member (EntityDecode d) r, Decoders ds r)
lib/Polysemy/Http/Data/Header.hs view
@@ -1,3 +1,5 @@+{-# options_haddock prune #-}+-- |Description: Header Data Types, Internal module Polysemy.Http.Data.Header where -- |The name of a header.
− lib/Polysemy/Http/Data/Http.hs
@@ -1,48 +0,0 @@-module Polysemy.Http.Data.Http where--import Polysemy (makeSem_)--import Polysemy.Http.Data.HttpError (HttpError)-import Polysemy.Http.Data.Request (Request)-import Polysemy.Http.Data.Response (Response)---- |The main effect for HTTP requests.--- The parameter @c@ determines the representation of raw chunks.-data Http c :: Effect where- Response :: Request -> (Response c -> m a) -> Http c m (Either HttpError a)- Request :: Request -> Http c m (Either HttpError (Response LByteString))- Stream :: Request -> (Response c -> m a) -> Http c m (Either HttpError a)- -- |Internal action for streaming transfers.- ConsumeChunk :: c -> Http c m (Either HttpError ByteString)--makeSem_ ''Http---- |Bracket a higher-order action with a 'Response' that has been opened while its body hasn't been fetched.-response ::- ∀ c r a .- Member (Http c) r =>- Request ->- (Response c -> Sem r a) ->- Sem r (Either HttpError a)---- |Synchronously run an HTTP request and return the response.-request ::- ∀ c r .- Member (Http c) r =>- Request ->- Sem r (Either HttpError (Response LByteString))---- |Open a connection without consuming data and pass the response to a handler for custom transmission.--- The intended purpose is to allow streaming transfers.-stream ::- ∀ c r a .- Member (Http c) r =>- Request ->- (Response c -> Sem r a) ->- Sem r (Either HttpError a)--consumeChunk ::- ∀ c r .- Member (Http c) r =>- c ->- Sem r (Either HttpError ByteString)
lib/Polysemy/Http/Data/HttpError.hs view
@@ -1,3 +1,5 @@+{-# options_haddock prune #-}+-- |Description: HttpError Data Type, Internal module Polysemy.Http.Data.HttpError where -- |Indicates a critical error caused by an exception in the http-client backend.
− lib/Polysemy/Http/Data/Manager.hs
@@ -1,9 +0,0 @@-module Polysemy.Http.Data.Manager where--import qualified Network.HTTP.Client as HTTP (Manager)---- |This effect abstracts the creation of a 'Manager' in order to allow pool sharing in a flexible way.-data Manager :: Effect where- Get :: Manager m HTTP.Manager--makeSem ''Manager
lib/Polysemy/Http/Data/Request.hs view
@@ -1,3 +1,5 @@+{-# options_haddock prune #-}+-- |Description: Request Data Types, Internal module Polysemy.Http.Data.Request where import Control.Lens (makeClassy)@@ -71,6 +73,7 @@ newtype Port = Port { unPort :: Int } deriving (Eq, Show, Generic)+ deriving newtype (Num, Ord, Enum, Real, Integral, Read) defaultJson ''Port @@ -115,7 +118,7 @@ deriving (Eq, Show, Generic) deriving newtype (IsString) --- |HTTP request parameters, used by 'Polysemy.Http.Data.Http'.+-- |HTTP request parameters, used by 'Polysemy.Http.Effect.Http'. data Request = Request { _method :: Method,
lib/Polysemy/Http/Data/Response.hs view
@@ -1,3 +1,5 @@+{-# options_haddock prune #-}+-- |Description: Response Data Types, Internal module Polysemy.Http.Data.Response ( module Polysemy.Http.Data.Response, Status(Status),@@ -16,7 +18,7 @@ import Polysemy.Http.Data.Header (Header) --- |The response produced by 'Polysemy.Http.Data.Http'.+-- |The response produced by 'Polysemy.Http.Effect.Http'. data Response b = Response { -- |Uses the type from 'Network.HTTP' for convenience.
lib/Polysemy/Http/Data/StreamChunk.hs view
@@ -1,3 +1,5 @@+{-# options_haddock prune #-}+-- |Description: StreamChunk Data Type, Internal module Polysemy.Http.Data.StreamChunk where -- |A single chunk produced by 'Network.HTTP.Client.BodyReader'.
lib/Polysemy/Http/Data/StreamEvent.hs view
@@ -1,3 +1,5 @@+{-# options_haddock prune #-}+-- |Description: StreamEvent Data Type, Internal module Polysemy.Http.Data.StreamEvent where import Polysemy.Http.Data.Response (Response)
+ lib/Polysemy/Http/Effect/Entity.hs view
@@ -0,0 +1,89 @@+{-# options_haddock prune #-}+-- |Description: Entity Effects, Internal+module Polysemy.Http.Effect.Entity where++import Polysemy (makeSem_)++-- |Generic error type for decoders.+data EntityError =+ EntityError {+ body :: Text,+ message :: Text+ }+ deriving (Eq, Show)++-- |Abstraction of json encoding, potentially usable for other content types like xml.+data EntityEncode d :: Effect where+ Encode :: d -> EntityEncode d m LByteString+ EncodeStrict :: d -> EntityEncode d m ByteString++makeSem_ ''EntityEncode++-- |Lazily encode a value of type @d@ to a 'LByteString'+encode ::+ ∀ d r .+ Member (EntityEncode d) r =>+ d ->+ Sem r LByteString++-- |Strictly encode a value of type @d@ to a 'ByteString'+encodeStrict ::+ ∀ d r .+ Member (EntityEncode d) r =>+ d ->+ Sem r ByteString++-- |Abstraction of json decoding, potentially usable for other content types like xml.+data EntityDecode d :: Effect where+ Decode :: LByteString -> EntityDecode d m (Either EntityError d)+ DecodeStrict :: ByteString -> EntityDecode d m (Either EntityError d)++makeSem_ ''EntityDecode++-- |Lazily decode a 'LByteString' to a value of type @d@+decode ::+ ∀ d r .+ Member (EntityDecode d) r =>+ LByteString ->+ Sem r (Either EntityError d)++-- |Strictly decode a 'ByteString' to a value of type @d@+decodeStrict ::+ ∀ d r .+ Member (EntityDecode d) r =>+ ByteString ->+ Sem r (Either EntityError d)++-- |Marker type to be used with 'Entities'+data Encode a++-- |Marker type to be used with 'Entities'+data Decode a++-- |Convenience constraint for requiring multiple entity effects, to be used like 'Polysemy.Members'.+--+-- @+-- foo :: Entities [Encode Int, Decode Double] r => Sem r ()+-- @+type family Entities es r :: Constraint where+ Entities '[] r = ()+ Entities (Encode d ': ds) r = (Member (EntityEncode d) r, Entities ds r)+ Entities (Decode d ': ds) r = (Member (EntityDecode d) r, Entities ds r)++-- |Convenience constraint for requiring multiple encoders.+--+-- @+-- foo :: Encoders [Int, Double] r => Sem r ()+-- @+type family Encoders es r :: Constraint where+ Encoders '[] r = ()+ Encoders (d ': ds) r = (Member (EntityEncode d) r, Encoders ds r)++-- |Convenience constraint for requiring multiple decoders.+--+-- @+-- foo :: Decoders [Int, Double] r => Sem r ()+-- @+type family Decoders ds r :: Constraint where+ Decoders '[] r = ()+ Decoders (d ': ds) r = (Member (EntityDecode d) r, Decoders ds r)
+ lib/Polysemy/Http/Effect/Http.hs view
@@ -0,0 +1,50 @@+{-# options_haddock prune #-}+-- |Description: Http Effect, Internal+module Polysemy.Http.Effect.Http where++import Polysemy (makeSem_)++import Polysemy.Http.Data.HttpError (HttpError)+import Polysemy.Http.Data.Request (Request)+import Polysemy.Http.Data.Response (Response)++-- |The main effect for HTTP requests.+-- The parameter @c@ determines the representation of raw chunks.+data Http c :: Effect where+ Response :: Request -> (Response c -> m a) -> Http c m (Either HttpError a)+ Request :: Request -> Http c m (Either HttpError (Response LByteString))+ Stream :: Request -> (Response c -> m a) -> Http c m (Either HttpError a)+ -- |Internal action for streaming transfers.+ ConsumeChunk :: c -> Http c m (Either HttpError ByteString)++makeSem_ ''Http++-- |Bracket a higher-order action with a 'Response' that has been opened while its body hasn't been fetched.+response ::+ ∀ c r a .+ Member (Http c) r =>+ Request ->+ (Response c -> Sem r a) ->+ Sem r (Either HttpError a)++-- |Synchronously run an HTTP request and return the response.+request ::+ ∀ c r .+ Member (Http c) r =>+ Request ->+ Sem r (Either HttpError (Response LByteString))++-- |Open a connection without consuming data and pass the response to a handler for custom transmission.+-- The intended purpose is to allow streaming transfers.+stream ::+ ∀ c r a .+ Member (Http c) r =>+ Request ->+ (Response c -> Sem r a) ->+ Sem r (Either HttpError a)++consumeChunk ::+ ∀ c r .+ Member (Http c) r =>+ c ->+ Sem r (Either HttpError ByteString)
+ lib/Polysemy/Http/Effect/Manager.hs view
@@ -0,0 +1,11 @@+{-# options_haddock prune #-}+-- |Description: Manager Effect, Internal+module Polysemy.Http.Effect.Manager where++import qualified Network.HTTP.Client as HTTP (Manager)++-- |This effect abstracts the creation of a 'Manager' in order to allow pool sharing in a flexible way.+data Manager :: Effect where+ Get :: Manager m HTTP.Manager++makeSem ''Manager
lib/Polysemy/Http/Http.hs view
@@ -1,16 +1,18 @@+{-# options_haddock prune #-}+-- |Description: Streaming Implementation, Internal module Polysemy.Http.Http where import qualified Data.ByteString as ByteString+import Polysemy.Resource (Resource, bracket) -import qualified Polysemy.Http.Data.Http as Http-import Polysemy.Http.Data.Http (Http) import Polysemy.Http.Data.HttpError (HttpError) import Polysemy.Http.Data.Request (Request)-import Polysemy.Http.Data.Response (Response(Response))-import Polysemy.Http.Data.StreamChunk (StreamChunk(StreamChunk))+import Polysemy.Http.Data.Response (Response (Response))+import Polysemy.Http.Data.StreamChunk (StreamChunk (StreamChunk)) import qualified Polysemy.Http.Data.StreamEvent as StreamEvent import Polysemy.Http.Data.StreamEvent (StreamEvent)-import Polysemy.Resource (Resource, bracket)+import qualified Polysemy.Http.Effect.Http as Http+import Polysemy.Http.Effect.Http (Http) streamLoop :: Members [Http c, Error HttpError] r =>
+ lib/Polysemy/Http/Interpreter/AesonEntity.hs view
@@ -0,0 +1,65 @@+{-# options_haddock prune #-}+-- |Description: Entity Aeson Interpreters, Internal+module Polysemy.Http.Interpreter.AesonEntity where++import Data.Aeson (eitherDecode', eitherDecodeStrict', encode)++import Polysemy.Http.Effect.Entity (EntityDecode, EntityEncode, EntityError (EntityError))+import qualified Polysemy.Http.Effect.Entity as Entity (EntityDecode (..), EntityEncode (..))++-- |Interpreter for 'EntityEncode' that uses Aeson and a different codec type.+-- The first parameter is the conversion function.+interpretEntityEncodeAesonAs ::+ ToJSON j =>+ (d -> j) ->+ Sem (EntityEncode d : r) a ->+ Sem r a+interpretEntityEncodeAesonAs convert =+ interpret \case+ Entity.Encode a ->+ pure (encode (convert a))+ Entity.EncodeStrict a ->+ pure (toStrict (encode (convert a)))+{-# inline interpretEntityEncodeAesonAs #-}++-- |Interpreter for 'EntityEncode' that uses Aeson.+interpretEntityEncodeAeson ::+ ToJSON d =>+ Sem (EntityEncode d : r) a ->+ Sem r a+interpretEntityEncodeAeson =+ interpretEntityEncodeAesonAs id+{-# inline interpretEntityEncodeAeson #-}++decodeWith ::+ ConvertUtf8 Text s =>+ (s -> Either String a) ->+ s ->+ Sem r (Either EntityError a)+decodeWith dec body =+ pure . mapLeft (EntityError (decodeUtf8 body) . toText) $ dec body+{-# inline decodeWith #-}++-- |Interpreter for 'EntityDecode' that uses Aeson and a different codec type.+-- The first parameter is the conversion function.+interpretEntityDecodeAesonAs ::+ FromJSON j =>+ (j -> d) ->+ Sem (EntityDecode d : r) a ->+ Sem r a+interpretEntityDecodeAesonAs convert =+ interpret \case+ Entity.Decode body ->+ fmap convert <$> decodeWith eitherDecode' body+ Entity.DecodeStrict body ->+ fmap convert <$> decodeWith eitherDecodeStrict' body+{-# inline interpretEntityDecodeAesonAs #-}++-- |Interpreter for 'EntityDecode' that uses Aeson.+interpretEntityDecodeAeson ::+ FromJSON d =>+ Sem (EntityDecode d : r) a ->+ Sem r a+interpretEntityDecodeAeson =+ interpretEntityDecodeAesonAs id+{-# inline interpretEntityDecodeAeson #-}
+ lib/Polysemy/Http/Interpreter/Manager.hs view
@@ -0,0 +1,28 @@+{-# options_haddock prune #-}+-- |Description: Manager Interpreters, Internal+module Polysemy.Http.Interpreter.Manager where++import Network.HTTP.Client (newManager)+import qualified Network.HTTP.Client as HTTP (Manager)+import Network.HTTP.Client.TLS (mkManagerSettings)++import Polysemy.Http.Effect.Manager (Manager (..))++interpretManagerWith ::+ HTTP.Manager ->+ InterpreterFor Manager r+interpretManagerWith manager = do+ interpret \ Get -> pure manager+{-# inline interpretManagerWith #-}++-- |Trivial interpreter with a globally shared 'Manager' instance.+interpretManager ::+ Member (Embed IO) r =>+ InterpreterFor Manager r+interpretManager sem = do+ manager <- embed (newManager settings)+ interpretManagerWith manager sem+ where+ settings =+ mkManagerSettings def Nothing+{-# inline interpretManager #-}
+ lib/Polysemy/Http/Interpreter/Native.hs view
@@ -0,0 +1,145 @@+{-# options_haddock prune #-}+-- |Description: Http Interpreters, Internal+module Polysemy.Http.Interpreter.Native where++import qualified Data.CaseInsensitive as CaseInsensitive+import Data.CaseInsensitive (foldedCase)+import qualified Network.HTTP.Client as HTTP+import Network.HTTP.Client (BodyReader, httpLbs, responseClose, responseOpen)+import Network.HTTP.Client.Internal (CookieJar (CJ))+import Polysemy (getInitialStateT, interpretH, runTSimple)+import qualified Polysemy.Log as Log+import Polysemy.Log (Log)+import Polysemy.Resource (Resource, bracket)++import Polysemy.Http.Data.Header (Header (Header), unHeaderName, unHeaderValue)+import qualified Polysemy.Http.Data.HttpError as HttpError+import Polysemy.Http.Data.HttpError (HttpError)+import Polysemy.Http.Data.Request (+ Body (Body),+ Host (Host),+ Path (Path),+ Request (Request),+ Tls (Tls),+ methodUpper,+ unPort,+ unQueryKey,+ unQueryValue,+ )+import Polysemy.Http.Data.Response (Response (Response))+import qualified Polysemy.Http.Effect.Http as Http+import Polysemy.Http.Effect.Http (Http)+import qualified Polysemy.Http.Effect.Manager as Manager+import Polysemy.Http.Effect.Manager (Manager)+import Polysemy.Http.Interpreter.Manager (interpretManager)++-- |Converts a 'Request' to a native 'N.Request'.+nativeRequest :: Request -> HTTP.Request+nativeRequest (Request method (Host host) portOverride (Tls tls) (Path path) headers (CJ cookies) query (Body body)) =+ HTTP.setQueryString queryParams HTTP.defaultRequest {+ HTTP.host = encodeUtf8 host,+ HTTP.port = port,+ HTTP.secure = tls,+ HTTP.method = encodeUtf8 (methodUpper method),+ HTTP.requestHeaders = encodedHeaders,+ HTTP.path = encodeUtf8 path,+ HTTP.requestBody = HTTP.RequestBodyLBS body,+ HTTP.cookieJar = CJ . toList <$> nonEmpty cookies+ }+ where+ queryParams =+ bimap (encodeUtf8 . unQueryKey) (fmap (encodeUtf8 . unQueryValue)) <$> query+ port =+ maybe (if tls then 443 else 80) unPort portOverride+ encodedHeaders =+ bimap (CaseInsensitive.mk . encodeUtf8 . unHeaderName) (encodeUtf8 . unHeaderValue) <$> headers++convertResponse :: HTTP.Response b -> Response b+convertResponse response =+ Response (HTTP.responseStatus response) (HTTP.responseBody response) headers (HTTP.responseCookieJar response)+ where+ headers =+ header <$> HTTP.responseHeaders response+ header (foldedCase -> decodeUtf8 -> name, decodeUtf8 -> value) =+ Header (fromString name) (fromString value)++internalError ::+ Member (Embed IO) r =>+ IO a ->+ Sem r (Either HttpError a)+internalError =+ tryHoist HttpError.Internal++executeRequest ::+ Member (Embed IO) r =>+ HTTP.Manager ->+ Request ->+ Sem r (Either HttpError (Response LByteString))+executeRequest manager request =+ fmap convertResponse <$> internalError (httpLbs (nativeRequest request) manager)++withResponse ::+ Members [Embed IO, Log, Resource, Manager] r =>+ Request ->+ (Response BodyReader -> Sem r a) ->+ Sem r (Either HttpError a)+withResponse request f =+ bracket acquire release use+ where+ acquire = do+ manager <- Manager.get+ internalError (responseOpen (nativeRequest request) manager)+ release (Right response) =+ tryAny (responseClose response) >>= traverseLeft closeFailed+ release (Left _) =+ unit+ use (Right response) = do+ Right <$> f (convertResponse response)+ use (Left err) =+ pure (Left err)+ closeFailed err =+ Log.error [qt|closing response failed: #{err}|]+{-# inline withResponse #-}++distribEither ::+ Functor f =>+ Either err (f a) ->+ Sem (WithTactics e f m r) (f (Either err a))+distribEither = \case+ Right fa ->+ pure (Right <$> fa)+ Left err -> do+ s <- getInitialStateT+ pure (Left err <$ s)+{-# inline distribEither #-}++-- |Same as 'interpretHttpNative', but the interpretation of 'Manager' is left to the user.+interpretHttpNativeWith ::+ Members [Embed IO, Log, Resource, Manager] r =>+ InterpreterFor (Http BodyReader) r+interpretHttpNativeWith =+ interpretH \case+ Http.Response request f -> do+ distribEither =<< withResponse request ((\x -> runTSimple x) . f)+ Http.Request request -> do+ Log.debug [qt|http request: #{request}|]+ manager <- Manager.get+ liftT do+ response <- executeRequest manager request+ response <$ Log.debug [qt|http response: #{response}|]+ Http.Stream request handler -> do+ Log.debug [qt|http stream request: #{request}|]+ distribEither =<< withResponse request ((\x -> runTSimple x). handler)+ Http.ConsumeChunk body ->+ pureT . first HttpError.ChunkFailed =<< tryAny body+{-# inline interpretHttpNativeWith #-}++-- |Interpret @'Http' 'BodyReader'@ using the native 'Network.HTTP.Client' implementation.+-- 'BodyReader' is an alias for @'IO' 'ByteString'@, it is how http-client represents chunks.+-- This uses the default interpreter for 'Manager'.+interpretHttpNative ::+ Members [Embed IO, Log, Resource] r =>+ InterpreterFor (Http BodyReader) r+interpretHttpNative =+ interpretManager . interpretHttpNativeWith . raiseUnder+{-# inline interpretHttpNative #-}
+ lib/Polysemy/Http/Interpreter/Pure.hs view
@@ -0,0 +1,62 @@+{-# options_haddock prune #-}+-- |Description: Pure Http Interpreters, Internal+module Polysemy.Http.Interpreter.Pure where++import Network.HTTP.Client.Internal (CookieJar (CJ))+import Polysemy (interpretH)+import Polysemy.Internal.Tactics (bindT, bindTSimple)++import Polysemy.Http.Data.Response (Response (Response))+import qualified Polysemy.Http.Effect.Http as Http+import Polysemy.Http.Effect.Http (Http)++takeResponse ::+ Member (State [Response LByteString]) r =>+ [Response LByteString] ->+ Sem r (Response LByteString)+takeResponse (response : rest) =+ response <$ put rest+takeResponse [] =+ pure (Response (toEnum 502) "test responses exhausted" [] (CJ mempty))++takeChunk ::+ Member (State [ByteString]) r =>+ [ByteString] ->+ Sem r ByteString+takeChunk (chunk : rest) =+ chunk <$ put rest+takeChunk [] =+ pure ""++interpretHttpPureWithState ::+ Members [State [ByteString], State [Response LByteString], Embed IO] r =>+ InterpreterFor (Http LByteString) r+interpretHttpPureWithState =+ interpretH \case+ Http.Response _ f -> do+ res <- liftT . takeResponse =<< raise get+ fmap Right <$> bindTSimple f res+ Http.Request _ ->+ liftT . fmap Right . takeResponse =<< raise get+ Http.Stream _ handler -> do+ handle <- bindT handler+ res <- liftT . takeResponse =<< raise get+ fmap Right <$> raise (interpretHttpPureWithState (handle res))+ Http.ConsumeChunk _ ->+ liftT . fmap Right . takeChunk =<< raise get+{-# inline interpretHttpPureWithState #-}++-- |In-Memory interpreter for 'Http'.+interpretHttpPure ::+ Member (Embed IO) r =>+ -- |When a request is made, one response is popped of the list and returned.+ -- If the list is exhausted, a 502 response is returned.+ [Response LByteString] ->+ -- |Chunks used for streaming responses.+ [ByteString] ->+ InterpretersFor [Http LByteString, State [Response LByteString], State [ByteString]] r+interpretHttpPure responses chunks =+ evalState chunks .+ evalState responses .+ interpretHttpPureWithState+{-# inline interpretHttpPure #-}
lib/Polysemy/Http/Json.hs view
@@ -1,19 +1,22 @@+{-# options_haddock prune #-}+-- |Description: Json Request Combinator, Internal module Polysemy.Http.Json where import Control.Lens ((%~)) import Polysemy.Http.Data.Header (HeaderName, HeaderValue)-import qualified Polysemy.Http.Data.Http as Http-import Polysemy.Http.Data.Http (Http) import Polysemy.Http.Data.HttpError (HttpError) import qualified Polysemy.Http.Data.Request as Request import Polysemy.Http.Data.Request (Request) import Polysemy.Http.Data.Response (Response)+import qualified Polysemy.Http.Effect.Http as Http+import Polysemy.Http.Effect.Http (Http) jsonContentType :: (HeaderName, HeaderValue) jsonContentType = ("content-type", "application/json") +-- |Make a request, setting the @content-type@ header to @application/json@ jsonRequest :: Member (Http c) r => Request ->
− lib/Polysemy/Http/Manager.hs
@@ -1,26 +0,0 @@-module Polysemy.Http.Manager where--import Network.HTTP.Client (newManager)-import qualified Network.HTTP.Client as HTTP (Manager)-import Network.HTTP.Client.TLS (mkManagerSettings)--import Polysemy.Http.Data.Manager (Manager(..))--interpretManagerWith ::- HTTP.Manager ->- InterpreterFor Manager r-interpretManagerWith manager = do- interpret \ Get -> pure manager-{-# INLINE interpretManagerWith #-}---- |Trivial interpreter with a globally shared 'Manager' instance.-interpretManager ::- Member (Embed IO) r =>- InterpreterFor Manager r-interpretManager sem = do- manager <- embed (newManager settings)- interpretManagerWith manager sem- where- settings =- mkManagerSettings def Nothing-{-# INLINE interpretManager #-}
− lib/Polysemy/Http/Native.hs
@@ -1,143 +0,0 @@-module Polysemy.Http.Native where--import qualified Data.CaseInsensitive as CaseInsensitive-import Data.CaseInsensitive (foldedCase)-import qualified Network.HTTP.Client as HTTP-import Network.HTTP.Client (BodyReader, httpLbs, responseClose, responseOpen)-import Network.HTTP.Client.Internal (CookieJar(CJ))-import Polysemy (getInitialStateT, interpretH, runTSimple)-import qualified Polysemy.Log as Log-import Polysemy.Log (Log)-import Polysemy.Resource (Resource, bracket)--import Polysemy.Http.Data.Header (Header(Header), unHeaderName, unHeaderValue)-import qualified Polysemy.Http.Data.Http as Http-import Polysemy.Http.Data.Http (Http)-import qualified Polysemy.Http.Data.HttpError as HttpError-import Polysemy.Http.Data.HttpError (HttpError)-import qualified Polysemy.Http.Data.Manager as Manager-import Polysemy.Http.Data.Manager (Manager)-import Polysemy.Http.Data.Request (- Body(Body),- Host(Host),- Path(Path),- Request(Request),- Tls(Tls),- methodUpper,- unPort,- unQueryKey,- unQueryValue,- )-import Polysemy.Http.Data.Response (Response(Response))-import Polysemy.Http.Manager (interpretManager)---- |Converts a 'Request' to a native 'N.Request'.-nativeRequest :: Request -> HTTP.Request-nativeRequest (Request method (Host host) portOverride (Tls tls) (Path path) headers (CJ cookies) query (Body body)) =- HTTP.setQueryString queryParams HTTP.defaultRequest {- HTTP.host = encodeUtf8 host,- HTTP.port = port,- HTTP.secure = tls,- HTTP.method = encodeUtf8 (methodUpper method),- HTTP.requestHeaders = encodedHeaders,- HTTP.path = encodeUtf8 path,- HTTP.requestBody = HTTP.RequestBodyLBS body,- HTTP.cookieJar = CJ . toList <$> nonEmpty cookies- }- where- queryParams =- bimap (encodeUtf8 . unQueryKey) (fmap (encodeUtf8 . unQueryValue)) <$> query- port =- maybe (if tls then 443 else 80) unPort portOverride- encodedHeaders =- bimap (CaseInsensitive.mk . encodeUtf8 . unHeaderName) (encodeUtf8 . unHeaderValue) <$> headers--convertResponse :: HTTP.Response b -> Response b-convertResponse response =- Response (HTTP.responseStatus response) (HTTP.responseBody response) headers (HTTP.responseCookieJar response)- where- headers =- header <$> HTTP.responseHeaders response- header (foldedCase -> decodeUtf8 -> name, decodeUtf8 -> value) =- Header (fromString name) (fromString value)--internalError ::- Member (Embed IO) r =>- IO a ->- Sem r (Either HttpError a)-internalError =- tryHoist HttpError.Internal--executeRequest ::- Member (Embed IO) r =>- HTTP.Manager ->- Request ->- Sem r (Either HttpError (Response LByteString))-executeRequest manager request =- fmap convertResponse <$> internalError (httpLbs (nativeRequest request) manager)--withResponse ::- Members [Embed IO, Log, Resource, Manager] r =>- Request ->- (Response BodyReader -> Sem r a) ->- Sem r (Either HttpError a)-withResponse request f =- bracket acquire release use- where- acquire = do- manager <- Manager.get- internalError (responseOpen (nativeRequest request) manager)- release (Right response) =- tryAny (responseClose response) >>= traverseLeft closeFailed- release (Left _) =- unit- use (Right response) = do- Right <$> f (convertResponse response)- use (Left err) =- pure (Left err)- closeFailed err =- Log.error [qt|closing response failed: #{err}|]-{-# INLINE withResponse #-}--distribEither ::- Functor f =>- Either err (f a) ->- Sem (WithTactics e f m r) (f (Either err a))-distribEither = \case- Right fa ->- pure (Right <$> fa)- Left err -> do- s <- getInitialStateT- pure (Left err <$ s)-{-# INLINE distribEither #-}---- |Same as 'interpretHttpNative', but the interpretation of 'Manager' is left to the user.-interpretHttpNativeWith ::- Members [Embed IO, Log, Resource, Manager] r =>- InterpreterFor (Http BodyReader) r-interpretHttpNativeWith =- interpretH \case- Http.Response request f -> do- distribEither =<< withResponse request ((\x -> runTSimple x) . f)- Http.Request request -> do- Log.debug [qt|http request: #{request}|]- manager <- Manager.get- liftT do- response <- executeRequest manager request- response <$ Log.debug [qt|http response: #{response}|]- Http.Stream request handler -> do- Log.debug [qt|http stream request: #{request}|]- distribEither =<< withResponse request ((\x -> runTSimple x). handler)- Http.ConsumeChunk body ->- pureT . first HttpError.ChunkFailed =<< tryAny body-{-# INLINE interpretHttpNativeWith #-}---- |Interpret @'Http' 'BodyReader'@ using the native 'Network.HTTP.Client' implementation.--- 'BodyReader' is an alias for @'IO' 'ByteString'@, it is how http-client represents chunks.--- This uses the default interpreter for 'Manager'.-interpretHttpNative ::- Members [Embed IO, Log, Resource] r =>- InterpreterFor (Http BodyReader) r-interpretHttpNative =- interpretManager . interpretHttpNativeWith . raiseUnder-{-# INLINE interpretHttpNative #-}
lib/Polysemy/Http/Prelude.hs view
@@ -1,3 +1,5 @@+{-# options_haddock hide #-}+-- |Description: Prelude, Internal {-# LANGUAGE NoImplicitPrelude #-} module Polysemy.Http.Prelude (@@ -21,7 +23,7 @@ import Data.Aeson.TH (deriveFromJSON, deriveJSON) import qualified Data.Aeson.TH as Aeson (Options, defaultOptions, unwrapUnaryRecords) import Data.Composition ((.:))-import Data.Default (Default(def))+import Data.Default (Default (def)) import Data.Either.Combinators (mapLeft) import Data.Foldable (foldl, traverse_) import Data.Map.Strict (Map)@@ -34,6 +36,7 @@ Effect, Embed, InterpreterFor,+ InterpretersFor, Member, Members, Sem,@@ -72,24 +75,24 @@ dbg msg = do () <- return $ unsafePerformIO (putStrLn (toString msg)) return ()-{-# INLINE dbg #-}+{-# inline dbg #-} dbgs :: Monad m => Show a => a -> m () dbgs a = dbg (show a)-{-# INLINE dbgs_ #-}+{-# inline dbgs_ #-} dbgs_ :: Monad m => Show a => a -> m a dbgs_ a = a <$ dbg (show a)-{-# INLINE dbgs #-}+{-# inline dbgs #-} unit :: Applicative f => f () unit = pure ()-{-# INLINE unit #-}+{-# inline unit #-} tuple :: Applicative f =>@@ -98,27 +101,27 @@ f (a, b) tuple fa fb = (,) <$> fa <*> fb-{-# INLINE tuple #-}+{-# inline tuple #-} unsafeLogSAnd :: Show a => a -> b -> b unsafeLogSAnd a b = unsafePerformIO $ print a >> return b-{-# INLINE unsafeLogSAnd #-}+{-# inline unsafeLogSAnd #-} unsafeLogAnd :: Text -> b -> b unsafeLogAnd a b = unsafePerformIO $ putStrLn (toString a) >> return b-{-# INLINE unsafeLogAnd #-}+{-# inline unsafeLogAnd #-} unsafeLogS :: Show a => a -> a unsafeLogS a = unsafePerformIO $ print a >> return a-{-# INLINE unsafeLogS #-}+{-# inline unsafeLogS #-} qt :: QuasiQuoter qt = i-{-# INLINE qt #-}+{-# inline qt #-} liftT :: forall m f r e a .@@ -127,7 +130,7 @@ Sem (WithTactics e f m r) (f a) liftT = pureT <=< raise-{-# INLINE liftT #-}+{-# inline liftT #-} defaultOptions :: Aeson.Options defaultOptions =@@ -171,7 +174,7 @@ m b traverseLeft f = either f pure-{-# INLINE traverseLeft #-}+{-# inline traverseLeft #-} defaultJson :: TH.Name -> TH.Q [TH.Dec] defaultJson =
lib/Polysemy/Http/Request.hs view
@@ -1,16 +1,18 @@+{-# options_haddock prune #-}+-- |Description: Request Combinators, Internal module Polysemy.Http.Request where import Control.Lens ((%~)) import qualified Data.Text as Text-import Data.Time (UTCTime(UTCTime))-import Network.HTTP.Client (Cookie(Cookie))-import Network.HTTP.Client.Internal (CookieJar(CJ, expose))-import Prelude hiding (get, put)-+import Data.Time (UTCTime (UTCTime)) import Data.Time.Calendar (fromGregorian) import Data.Time.Clock.POSIX (posixSecondsToUTCTime)+import Network.HTTP.Client (Cookie (Cookie))+import Network.HTTP.Client.Internal (CookieJar (CJ, expose))+import Prelude hiding (get, put)+ import qualified Polysemy.Http.Data.Request as Request-import Polysemy.Http.Data.Request (Body, Host(Host), Method(..), Path(Path), Port(Port), Request(Request), Tls(Tls))+import Polysemy.Http.Data.Request (Body, Host (Host), Method (..), Path (Path), Port (Port), Request (Request), Tls (Tls)) invalidScheme :: Text ->
− lib/Polysemy/Http/Strict.hs
@@ -1,70 +0,0 @@-module Polysemy.Http.Strict where--import Polysemy (interpretH)-import Polysemy.Internal.Tactics (bindT, bindTSimple)--import Polysemy.Http.Data.Header (Header(Header))-import qualified Polysemy.Http.Data.Http as Http-import Polysemy.Http.Data.Http (Http)-import Polysemy.Http.Data.Response (Response(Response))-import Network.HTTP.Client.Internal (CookieJar(CJ))--takeResponse ::- Member (State [Response LByteString]) r =>- [Response LByteString] ->- Sem r (Response LByteString)-takeResponse (response : rest) =- response <$ put rest-takeResponse [] =- pure (Response (toEnum 502) "test responses exhausted" [] (CJ mempty))--takeChunk ::- Member (State [ByteString]) r =>- [ByteString] ->- Sem r ByteString-takeChunk (chunk : rest) =- chunk <$ put rest-takeChunk [] =- pure ""--streamResponse :: Response LByteString-streamResponse =- Response (toEnum 200) "stream response" [- Header "content-disposition" [qt|filename="file.txt"|],- Header "content-length" "5000000"- ] (CJ mempty)--interpretHttpStrictWithState ::- Members [State [ByteString], State [Response LByteString], Embed IO] r =>- InterpreterFor (Http LByteString) r-interpretHttpStrictWithState =- interpretH \case- Http.Response _ f -> do- res <- liftT . takeResponse =<< raise get- fmap Right <$> bindTSimple f res- Http.Request _ ->- liftT . fmap Right . takeResponse =<< raise get- Http.Stream _ handler -> do- handle <- bindT handler- resp <- pureT streamResponse- fmap Right <$> raise (interpretHttpStrictWithState (handle resp))- Http.ConsumeChunk _ ->- liftT . fmap Right . takeChunk =<< raise get-{-# INLINE interpretHttpStrictWithState #-}---- |In-Memory interpreter for 'Http'.-interpretHttpStrict ::- Member (Embed IO) r =>- -- |When a request is made, one response is popped of the head and returned.- -- If the list is exhausted, a 502 response is returned.- [Response LByteString] ->- -- |Chunks used for streaming responses.- [ByteString] ->- InterpreterFor (Http LByteString) r-interpretHttpStrict responses chunks =- evalState chunks .- evalState responses .- interpretHttpStrictWithState .- raiseUnder .- raiseUnder-{-# INLINE interpretHttpStrict #-}
lib/Prelude.hs view
@@ -1,3 +1,5 @@+{-# options_haddock hide #-}+-- |Description: Prelude, Internal module Prelude ( module Polysemy.Http.Prelude, ) where
polysemy-http.cabal view
@@ -5,14 +5,14 @@ -- see: https://github.com/sol/hpack name: polysemy-http-version: 0.4.0.6-synopsis: Polysemy Effect for Http-Client+version: 0.5.0.0+synopsis: Polysemy Effects for HTTP clients description: See <https://hackage.haskell.org/package/polysemy-http/docs/Polysemy-Http.html> category: Network homepage: https://github.com/tek/polysemy-http#readme bug-reports: https://github.com/tek/polysemy-http/issues author: Torsten Schmits-maintainer: tek@tryp.io+maintainer: haskell@tryp.io copyright: 2020 Torsten Schmits license: BSD-2-Clause-Patent license-file: LICENSE@@ -28,23 +28,23 @@ library exposed-modules: Polysemy.Http- Polysemy.Http.AesonEntity- Polysemy.Http.Data.Entity Polysemy.Http.Data.Header- Polysemy.Http.Data.Http Polysemy.Http.Data.HttpError- Polysemy.Http.Data.Manager Polysemy.Http.Data.Request Polysemy.Http.Data.Response Polysemy.Http.Data.StreamChunk Polysemy.Http.Data.StreamEvent+ Polysemy.Http.Effect.Entity+ Polysemy.Http.Effect.Http+ Polysemy.Http.Effect.Manager Polysemy.Http.Http+ Polysemy.Http.Interpreter.AesonEntity+ Polysemy.Http.Interpreter.Manager+ Polysemy.Http.Interpreter.Native+ Polysemy.Http.Interpreter.Pure Polysemy.Http.Json- Polysemy.Http.Manager- Polysemy.Http.Native Polysemy.Http.Prelude Polysemy.Http.Request- Polysemy.Http.Strict other-modules: Prelude Paths_polysemy_http@@ -119,9 +119,9 @@ , http-client-tls >=0.3.5 , http-types >=0.12.3 , lens >=4- , polysemy >=1.5- , polysemy-log >=0.2.2.1- , polysemy-plugin >=0.3+ , polysemy >=1.6+ , polysemy-log >=0.2.2.4+ , polysemy-plugin >=0.4 , relude >=0.7 , string-interpolate >=0.2.1 , template-haskell@@ -212,10 +212,10 @@ , http-types >=0.12.3 , lens >=4 , network- , polysemy >=1.5+ , polysemy >=1.6 , polysemy-http- , polysemy-log >=0.2.2.1- , polysemy-plugin >=0.3+ , polysemy-log >=0.2.2.4+ , polysemy-plugin >=0.4 , relude >=0.7 , servant , servant-client@@ -311,10 +311,10 @@ , http-client-tls >=0.3.5 , http-types >=0.12.3 , lens >=4- , polysemy >=1.5+ , polysemy >=1.6 , polysemy-http- , polysemy-log >=0.2.2.1- , polysemy-plugin >=0.3+ , polysemy-log >=0.2.2.4+ , polysemy-plugin >=0.4 , relude >=0.7 , string-interpolate >=0.2.1 , tasty
readme.md view
@@ -152,7 +152,7 @@ # Testing Polysemy makes it very easy to switch the native interpreter for a mock, and-there is a convenience interpreter named `interpretHttpStrict` that allows you+there is a convenience interpreter named `interpretHttpPure` that allows you to specify a list of responses and chunks that should be produced: ```haskell@@ -161,7 +161,7 @@ result <- runM $ resourceToIO $ interpretLogStdout $- interpretHttpStrict [Response (toEnum 200) "foo" []] [] $+ interpretHttpPure [Response (toEnum 200) "foo" []] [] $ Http.request (Http.get "hackage.haskell.org" "package/polysemy-http") print result ```