remote-json-client (empty) → 0.2
raw patch · 5 files changed
+94/−0 lines, 5 filesdep +aesondep +basedep +lenssetup-changed
Dependencies added: aeson, base, lens, natural-transformation, remote-json, wreq
Files
- Control/Remote/Monad/JSON/Client.hs +29/−0
- LICENSE +28/−0
- README.md +2/−0
- Setup.hs +2/−0
- remote-json-client.cabal +33/−0
+ Control/Remote/Monad/JSON/Client.hs view
@@ -0,0 +1,29 @@+{-# LANGUAGE GADTs #-}+{-# LANGUAGE LambdaCase #-}+{-# LANGUAGE RankNTypes #-}+{-# LANGUAGE OverloadedStrings #-}+{-# LANGUAGE TypeOperators #-}++module Control.Remote.Monad.JSON.Client+ ( clientSendAPI+ ) where++import Control.Lens ((^.))+import Control.Monad (void)+import Control.Natural+import Control.Remote.Monad.JSON (SendAPI(..))+import Data.Aeson+import Network.Wreq++-- Public APIs+-- http://www.raboof.com/projects/jayrock/demo.ashx+-- https://s1.ripple.com:51234/ ++-- | A way of building client 'SendAPI' support, using wreq.+clientSendAPI :: String -> (SendAPI :~> IO)+clientSendAPI url = nat $ \ case+ Sync v -> do+ r <- asJSON =<< post url (toJSON v)+ return $ r ^. responseBody+ Async v -> do+ void $ post url (toJSON v)
+ LICENSE view
@@ -0,0 +1,28 @@+Copyright (c) 2015, Functional Programming at the University of Kansas+All rights reserved.++Redistribution and use in source and binary forms, with or without+modification, are permitted provided that the following conditions are met:++* Redistributions of source code must retain the above copyright notice, this+ list of conditions and the following disclaimer.++* Redistributions in binary form must reproduce the above copyright notice,+ this list of conditions and the following disclaimer in the documentation+ and/or other materials provided with the distribution.++* Neither the name of remote-json nor the names of its+ contributors may be used to endorse or promote products derived from+ this software without specific prior written permission.++THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"+AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE+IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE+DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE+FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL+DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR+SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER+CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,+OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE+OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.+
+ README.md view
@@ -0,0 +1,2 @@+A sub-package of remote-json that provides the SendAPI capabilities.+
+ Setup.hs view
@@ -0,0 +1,2 @@+import Distribution.Simple+main = defaultMain
+ remote-json-client.cabal view
@@ -0,0 +1,33 @@+name: remote-json-client+version: 0.2+synopsis: Web client wrapper for remote-json+description: Web client, using wreq, for the JSON RPC protcol.+license: BSD3+license-file: LICENSE+author: Justin Dawson and Andy Gill+maintainer: JDawson@ku.edu+copyright: (c) 2016 The University of Kansas+category: Network+build-type: Simple+extra-source-files: README.md+tested-with: GHC == 7.10.3+cabal-version: >=1.10++source-repository head+ type: git+ location: git://github.com/ku-fpg/remote-json++library+ exposed-modules: Control.Remote.Monad.JSON.Client++ -- other-modules:+ build-depends: aeson >= 0.8 && < 0.12+ , base >= 4 && < 5+ , lens >= 4.5+ , wreq >= 0.4.1.0 && < 0.5+ , natural-transformation >= 0.3.1 && < 0.4+ , remote-json >= 0.2 && < 0.3+ hs-source-dirs: .+ default-language: Haskell2010+ ghc-options: -Wall+