git.iko.soy/typeable/transformers-lift
on master help sign in
Initial commit
e800b49Index Int
.gitignorenew file+1
@@ -0,0 +1 @@
1+dist
LICENSEnew file+30
@@ -0,0 +1,30 @@
1+Copyright (c) 2015, Index Int
2+
3+All rights reserved.
4+
5+Redistribution and use in source and binary forms, with or without
6+modification, are permitted provided that the following conditions are met:
7+
8+ * Redistributions of source code must retain the above copyright
9+ notice, this list of conditions and the following disclaimer.
10+
11+ * Redistributions in binary form must reproduce the above
12+ copyright notice, this list of conditions and the following
13+ disclaimer in the documentation and/or other materials provided
14+ with the distribution.
15+
16+ * Neither the name of Index Int nor the names of other
17+ contributors may be used to endorse or promote products derived
18+ from this software without specific prior written permission.
19+
20+THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
21+"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
22+LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
23+A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
24+OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
25+SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
26+LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
27+DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
28+THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
29+(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
30+OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
Setup.hsnew file+2
@@ -0,0 +1,2 @@
1+import Distribution.Simple
2+main = defaultMain
src/Control/Monad/Trans/Lift/CallCC.hsnew file+1
@@ -0,0 +1 @@
1+module Control.Monad.Trans.Lift.CallCC where
src/Control/Monad/Trans/Lift/Catch.hsnew file+1
@@ -0,0 +1 @@
1+module Control.Monad.Trans.Lift.Catch where
src/Control/Monad/Trans/Lift/Listen.hsnew file+1
@@ -0,0 +1 @@
1+module Control.Monad.Trans.Lift.Listen where
src/Control/Monad/Trans/Lift/Local.hsnew file+52
@@ -0,0 +1,52 @@
1+{-# LANGUAGE RankNTypes #-}
2+{-# LANGUAGE DefaultSignatures #-}
3+module Control.Monad.Trans.Lift.Local
4+ ( LiftLocal(..)
5+ , Local
6+ ) where
7+
8+import Control.Monad.Trans.Class
9+import Control.Monad.Morph
10+
11+import Control.Monad.Trans.Except
12+import Control.Monad.Trans.Identity
13+import Control.Monad.Trans.List
14+import Control.Monad.Trans.Maybe
15+import Control.Monad.Trans.Reader
16+import qualified Control.Monad.Trans.Cont as Cont
17+import qualified Control.Monad.Trans.RWS.Lazy as Lazy
18+import qualified Control.Monad.Trans.RWS.Strict as Strict
19+import qualified Control.Monad.Trans.State.Lazy as Lazy
20+import qualified Control.Monad.Trans.State.Strict as Strict
21+import qualified Control.Monad.Trans.Writer.Lazy as Lazy
22+import qualified Control.Monad.Trans.Writer.Strict as Strict
23+
24+type Local r m a = (r -> r) -> m a -> m a
25+
26+class MonadTrans t => LiftLocal t where
27+ liftLocal
28+ :: Monad m
29+ => m r
30+ -> (forall a . Local r m a)
31+ -> (forall a . Local r (t m) a)
32+ default liftLocal
33+ :: (Monad m, MFunctor t)
34+ => m r
35+ -> (forall a . Local r m a)
36+ -> (forall a . Local r (t m) a)
37+ liftLocal _ l f = hoist (l f)
38+
39+instance LiftLocal (Cont.ContT r)
40+ where liftLocal = Cont.liftLocal
41+
42+instance LiftLocal (ExceptT e)
43+instance LiftLocal IdentityT
44+instance LiftLocal ListT
45+instance LiftLocal MaybeT
46+instance LiftLocal (ReaderT r)
47+instance Monoid w => LiftLocal (Lazy.RWST r w s)
48+instance Monoid w => LiftLocal (Strict.RWST r w s)
49+instance LiftLocal (Lazy.StateT s)
50+instance LiftLocal (Strict.StateT s)
51+instance Monoid w => LiftLocal (Lazy.WriterT w)
52+instance Monoid w => LiftLocal (Strict.WriterT w)
src/Control/Monad/Trans/Lift/Pass.hsnew file+1
@@ -0,0 +1 @@
1+module Control.Monad.Trans.Lift.Pass where
transformers-lift.cabalnew file+27
@@ -0,0 +1,27 @@
1+name: transformers-lift
2+version: 0.1.0.0
3+synopsis: Ad-hoc type classes for lifting
4+-- description:
5+license: BSD3
6+license-file: LICENSE
7+author: Index Int
8+maintainer: vlad.z.4096@gmail.com
9+-- copyright:
10+category: Control
11+build-type: Simple
12+-- extra-source-files:
13+cabal-version: >=1.10
14+
15+library
16+ exposed-modules: Control.Monad.Trans.Lift.Local
17+ Control.Monad.Trans.Lift.CallCC
18+ Control.Monad.Trans.Lift.Catch
19+ Control.Monad.Trans.Lift.Listen
20+ Control.Monad.Trans.Lift.Pass
21+ -- other-modules:
22+ -- other-extensions:
23+ build-depends: base >=4.8 && <4.9
24+ , transformers >= 0.4.2
25+ , mmorph >= 1.0.4
26+ hs-source-dirs: src
27+ default-language: Haskell2010