wreq-stringless: Simple wrapper to use wreq without Strings

This is a package candidate release! Here you can preview how this package release will appear once published to the main package index (which can be accomplished via the 'maintain' link below). Please note that once a package has been published to the main package index it cannot be undone! Please consult the package uploading documentation for more information.

[maintain] [Publish]

This library wraps all functions from Network.Wreq which expects a String and replaces the String Type with the Network.Wreq.StringLess.StringLike Type-Class.

Instances for Network.Wreq.StringLess.StringLike are given for:

So you can use any of this types instead of String.

To use this library, replace your the wreq dependency from your cabal file with wreq-stringless and import Network.Wreq.StringLess instead of Network.Wreq.

The versions of this library correspond with the version of wreq.

see https://github.com/j-keck/wreq-stringless/examples for examples.


[Skip to Readme]

Properties

Versions 0.4.1.0, 0.4.1.0, 0.5.0.0, 0.5.0.1, 0.5.1.0, 0.5.2.0, 0.5.9.0, 0.5.9.1
Change log None available
Dependencies base (>=4.7 && <5), bytestring, text, utf8-string, wreq (==0.4.1.0) [details]
License MIT
Author Juergen Keck
Maintainer Juergen Keck <jhyphenkeck@gmail.com>
Category Web
Home page https://github.com/j-keck/wreq-stringless#readme
Bug tracker https://github.com/j-keck/wreq-stringless/issues
Source repo head: git clone https://github.com/j-keck/wreq-stringless
Uploaded by jkeck at 2017-01-12T19:02:49Z

Modules

[Index]

Downloads

Maintainer's Corner

Package maintainers

For package maintainers and hackage trustees


Readme for wreq-stringless-0.4.1.0

[back to package description]

wreq-stringless: Simple wrapper to use wreq without Strings

This Haskell library wraps Network.Wreq to use the functions without Strings.

You can use:

for all functions from Network.Wreq where the original implementation use Strings.

Example:

{-# LANGUAGE OverloadedStrings #-}
module Main where

import qualified Data.Text               as T
import           Lens.Micro.Extras       (view)
import qualified Network.Wreq            as Wreq
import qualified Network.Wreq.StringLess as Wreq'


-- say we use a alternate prelude like 'Protolude', and we don't use Strings
-- or we have the url from somewhere else, and it's not a String.
url :: T.Text
url = "http://httpbin.org"


main :: IO ()
main = do
  -- with plain wreq 
  view Wreq.responseStatus  <$> Wreq.get (T.unpack url) >>= print

  -- with wreq-stringless - no manual conversion necessary
  view Wreq'.responseStatus <$> Wreq'.get url >>= print

How to use it:

The versions of this library correspond with the version of wreq. So if you need wreq-0.4.1.0 you add wreq-stringless-0.4.1.0 as a dependency.