1 -- |Re-exports the entire Cryptsy.API.Public.* heirarchy.
2 module Cryptsy
.API
.Public
3 ( module Cryptsy
.API
.Public
.Types
4 , module Cryptsy
.API
.Public
.MarketData
.Old
5 , module Cryptsy
.API
.Public
.MarketData
.New
6 , module Cryptsy
.API
.Public
.Market
7 , module Cryptsy
.API
.Public
.OrderData
8 , module Cryptsy
.API
.Public
.OrderBook
9 , defaultEvalPubCryptsy
10 , defaultRunPubCryptsy
15 import Data
.Maybe (fromMaybe)
16 import Data
.Monoid
(mempty
)
19 import Control
.Monad
.Trans
.Either (runEitherT
)
22 import Network
.HTTP
.Client
(CookieJar
, withManager
)
25 import Network
.HTTP
.Client
.TLS
(tlsManagerSettings
)
28 import Control
.Monad
.Trans
.Reader
(runReaderT
)
29 import Control
.Monad
.Trans
.State
(runStateT
)
32 import Cryptsy
.API
.Public
.Market
33 import Cryptsy
.API
.Public
.MarketData
.New
34 import Cryptsy
.API
.Public
.MarketData
.Old
35 import Cryptsy
.API
.Public
.OrderBook
36 import Cryptsy
.API
.Public
.OrderData
37 import Cryptsy
.API
.Public
.Types
40 Like 'defaultRunPubCryptsy', but the resulting cookir jar is ignored.
42 defaultEvalPubCryptsy
:: PubCryptsy a
-> IO (Either CryptsyError a
)
43 defaultEvalPubCryptsy
= fmap fst . defaultRunPubCryptsy
44 {-# INLINABLE defaultEvalPubCryptsy #-}
47 Converts a public cryptsy action to an action in the IO Monad, using a new
48 manager created from 'tlsManagerSettings' and closed as the last part of the IO
49 action and starting from an empty cookie jar. Both the resulting cookie jar
50 and either the resolt of the public cryptsy action or the first cryptsy error
51 encountered are the results of the IO action.
53 defaultRunPubCryptsy
:: PubCryptsy a
-> IO (Either CryptsyError a
, CookieJar
)
54 defaultRunPubCryptsy
= withManager tlsManagerSettings
55 . (defaultRunInReader
.) . runReaderT
57 defaultRunInReader
= fmap (msnd
(fromMaybe mempty
)) . ($ Just mempty
)
58 . runStateT
. runEitherT
59 msnd f
(x
, y
) = (x
, f y
)
60 {-# INLINABLE defaultRunPubCryptsy #-}