git.iko.soy/typeable/control-has
on master help sign in
Add payment fields to hotels booking request and response types (#4886)

* Add aeson instances to credit-card types. * Rename function, fix instance Arbitrary CreditCardDate. * Add payment fields to hotels API book request and response. * Make postgresql-simple an optional dependency for credit-card. * Fix expiration date parsing. Fix Arbitrary instances. Add tests for JSON instances. * Add payment stubs for the sake of making it build. * Oops! Missed this one. * Review changes. * Change 'APIBookResponse' to a sum type. * Move katip-related lens from missing-lens to control-has. * Remove sessionId from successful booking response. * Remove unused import. * Remove APIBookResponse cases.

commite0f70a4f2f6a1b4f8172c5776256e05beb380129 authorNick <nick@typeable.io> dateThu 20 Aug 2020, 07:41 (6 years ago) parent8f86b64
2 files changed+9−2
control-has.cabal−1 src/Control/EnvT.hs+9−1
control-has.cabal−1
@@ -19,7 +19,6 @@ library
1919 , transformers-base
2020 if !impl(ghcjs)
2121 build-depends: katip
22− , missing-lens
2322 default-language: Haskell2010
2423 default-extensions: ConstraintKinds
2524 , DataKinds
src/Control/EnvT.hs+9−1
@@ -1,4 +1,5 @@
11{-# LANGUAGE CPP #-}
2+{-# LANGUAGE TemplateHaskell #-}
23
34module Control.EnvT
45 ( EnvT(..)
@@ -18,7 +19,6 @@ import Control.Monad.Trans.Control
1819import Control.Monad.Trans.Resource
1920import Control.Monad.Zip
2021#ifndef ghcjs_HOST_OS
21−import Control.Lens.Missing
2222import Katip
2323import Katip.Monadic
2424#endif
@@ -56,6 +56,14 @@ runEnvT :: forall r m a. EnvT r m a -> r -> m a
5656runEnvT m r = flip runReaderT r . unEnvT $ m
5757
5858#ifndef ghcjs_HOST_OS
59+-- FIXME: These lens should probably be moved into a separate package
60+-- or sent to upstream katip.
61+makeLensesFor
62+ [ ("ltsLogEnv", "_ltsLogEnv")
63+ , ("ltsContext", "_ltsContext")
64+ , ("ltsNamespace", "_ltsNamespace")
65+ ] ''KatipContextTState
66+
5967instance (Has KatipContextTState r, MonadIO m)
6068 => KatipContext (EnvT r m) where
6169 getKatipContext = view $ part . _ltsContext