urlpath 6.0.1 → 6.0.2
raw patch · 2 files changed
+32/−1 lines, 2 filesdep +monad-control-aligned
Dependencies added: monad-control-aligned
Files
- src/Data/Url.hs +30/−0
- urlpath.cabal +2/−1
src/Data/Url.hs view
@@ -34,6 +34,7 @@ import Path.Extended import Data.Functor.Identity+import Data.Functor.Compose import Data.URI (URI (..)) import Data.URI.Auth (URIAuth (..)) import Data.URI.Auth.Host (URIAuthHost (Localhost))@@ -49,6 +50,7 @@ import Control.Monad.Trans.Error (Error, ErrorT) import Control.Monad.Except import Control.Monad.Trans.Control+import qualified Control.Monad.Trans.Control.Aligned as Aligned import Control.Monad.Trans.Identity import Control.Monad.Trans.Maybe import Control.Monad.List@@ -183,12 +185,21 @@ liftWith f = RelativeUrlT (f runRelativeUrlT) restoreT = RelativeUrlT +instance Aligned.MonadTransControl RelativeUrlT Identity where+ liftWith f = RelativeUrlT (f (\x -> Identity <$> runRelativeUrlT x))+ restoreT x = RelativeUrlT (runIdentity <$> x)+ instance ( MonadBaseControl b m ) => MonadBaseControl b (RelativeUrlT m) where type StM (RelativeUrlT m) a = ComposeSt RelativeUrlT m a liftBaseWith = defaultLiftBaseWith restoreM = defaultRestoreM +instance ( Aligned.MonadBaseControl b m stM+ ) => Aligned.MonadBaseControl b (RelativeUrlT m) (Compose stM Identity) where+ liftBaseWith = Aligned.defaultLiftBaseWith+ restoreM = Aligned.defaultRestoreM+ instance MFunctor RelativeUrlT where hoist f (RelativeUrlT x) = RelativeUrlT (f x) @@ -228,12 +239,21 @@ liftWith f = GroundedUrlT (f runGroundedUrlT) restoreT = GroundedUrlT +instance Aligned.MonadTransControl GroundedUrlT Identity where+ liftWith f = GroundedUrlT (f (\x -> Identity <$> runGroundedUrlT x))+ restoreT x = GroundedUrlT (runIdentity <$> x)+ instance ( MonadBaseControl b m ) => MonadBaseControl b (GroundedUrlT m) where type StM (GroundedUrlT m) a = ComposeSt GroundedUrlT m a liftBaseWith = defaultLiftBaseWith restoreM = defaultRestoreM +instance ( Aligned.MonadBaseControl b m stM+ ) => Aligned.MonadBaseControl b (GroundedUrlT m) (Compose stM Identity) where+ liftBaseWith = Aligned.defaultLiftBaseWith+ restoreM = Aligned.defaultRestoreM+ instance MFunctor GroundedUrlT where hoist f (GroundedUrlT x) = GroundedUrlT (f x) @@ -332,11 +352,21 @@ f $ \t -> runAbsoluteUrlT t r restoreT = AbsoluteUrlT . const +instance Aligned.MonadTransControl AbsoluteUrlT Identity where+ liftWith f = AbsoluteUrlT $ \r ->+ f $ \x -> Identity <$> runAbsoluteUrlT x r+ restoreT x = AbsoluteUrlT $ \_ -> runIdentity <$> x+ instance ( MonadBaseControl b m ) => MonadBaseControl b (AbsoluteUrlT m) where type StM (AbsoluteUrlT m) a = ComposeSt AbsoluteUrlT m a liftBaseWith = defaultLiftBaseWith restoreM = defaultRestoreM++instance ( Aligned.MonadBaseControl b m stM+ ) => Aligned.MonadBaseControl b (AbsoluteUrlT m) (Compose stM Identity) where+ liftBaseWith = Aligned.defaultLiftBaseWith+ restoreM = Aligned.defaultRestoreM instance ( MonadThrow m ) => MonadThrow (AbsoluteUrlT m) where
urlpath.cabal view
@@ -1,5 +1,5 @@ Name: urlpath-Version: 6.0.1+Version: 6.0.2 Author: Athan Clark <athan.clark@gmail.com> Maintainer: Athan Clark <athan.clark@gmail.com> License: MIT@@ -21,6 +21,7 @@ , exceptions , mmorph , monad-control+ , monad-control-aligned , monad-logger , mtl , path-extra >= 0.0.5