free-http alternatives and similar packages
Based on the "Networking" category.
Alternatively, view free-http alternatives based on common mentions on social networks and blogs.
-
snap-core
Core type definitions (Snap monad, HTTP types, etc) and utilities for web handlers. -
snap-server
A fast HTTP server library, which runs Snap web handlers. -
call-haskell-from-anything
Call Haskell functions from any programming language via serialization and dynamic libraries -
PortFusion
Haskell-powered cross-platform transport-layer distributed reverse / forward proxy & tunneling solution – currently available for all TCP protocols (RDP, VNC, HTTP(S), SSH, ...). -
glirc
Haskell IRC library and console client - Join us on libera.chat #glirc -
network-transport-zeromq
ZeroMQ transport for distributed-process (aka Cloud Haskell) -
io-streams
Simple, composable, and easy-to-use stream I/O for Haskell -
HaskellNet
Haskell library which provides client support for POP3, SMTP, and IMAP protocols. -
graphula
A simple interface for generating persistent data and linking its dependencies -
ngx-export
Nginx module for binding Haskell code in configuration files for great good! -
http-types
Generic HTTP types for Haskell (for both client and server code) -
secure-sockets
A library for making secure connections between servers. -
network-transport-tcp
TCP Realisation of Network.Transport -
linklater
A Haskell library for the Slack API (including real-time messaging!) -
http-client-streams
http-client for io-streams supporting openssl
Build time-series-based applications quickly and at scale.
* Code Quality Rankings and insights are calculated and provided by Lumnify.
They vary from L1 to L5 with "L5" being the highest.
Do you think we are missing an alternative of free-http or a related project?
README
Free Your Client... and Your Requests Will Follow
free-http
is an http-client based on Free Monads. free-http
exposes a Free Monad to express standard http verbs as well as several backends to interpet programs written in the free monad using various http clients (currently: a pure client, an http-client
-backed client, and a random client).
See here for an example.
To use free-http, simply:
- Import Network.HTTP.Client.Free to use the library.
- Choose your base request type by defining your own instance of the
RequestType
type family or importing one from an interpreter. E.g.
data MyClient
type instance RequestType MyClient = Request
or
import Network.HTTP.Free.Client.HttpClient (HttpClient)
- Choose your base response type by defining your own instance of the
ResponseTYpe
type family or importing one from an interpreter. E.g.
type instance ResponseType MyClient = Response ByteString
or
import Network.HTTP.Free.Client.HttpClient (HttpClient)
- Write a program in the 'FreeHttp MyClient m a' free monad.
- Import an interpreter, such as 'HttpClient'
import Network.HTTP.Free.Client.HttpClient
- Run your program against the interpreter:
runHttp (myProgram :: FreeHttp MyClient IO String)
Design Choices
RequestType
and ResponseType
Haskell is fortunate to have several very well-designed http clients: http-client, wreq, http-conduit, pipes-http, etc. Unfortunately, a few of those clients support several different Request and Response types. To keep free-http
flexible, we use two type families defined as:
type family RequestType client :: *
type family ResponseType client :: *
Our HttpF
functor is thus defined as:
data HttpF client a = HttpF StdMethod (RequestType client) (ResponseType client -> a)
deriving Functor
This allows our HttpF
functor to be agnostic of the foundational request and response type, while allowing interpreter authors to specify the concrete types they need for their http client libraries (e.g. Request
in the case of http-client
). A consequence of this is that free-http
clients (you) need to specify, at some point, the foundation you're using. This can be done in two ways:
- You can define your own foundation (see above).
- You can import one from an interpreter.
To specify your request and response foundation, use replace the client
type in HttpF client a
or FreeHttp client m a
to the type signalling your foundation. For example, the http-client, pure, and arbitrary interpreters use HttpClient
, PureClient
, and ArbitraryClient
respectively.