regions-mtl (empty) → 0.3.1.4
raw patch · 4 files changed
+118/−0 lines, 4 filesdep +base-unicode-symbolsdep +mtldep +regionssetup-changed
Dependencies added: base-unicode-symbols, mtl, regions
Files
- Control/Monad/Trans/Region/Instances/MTL.hs +61/−0
- LICENSE +31/−0
- Setup.hs +3/−0
- regions-mtl.cabal +23/−0
+ Control/Monad/Trans/Region/Instances/MTL.hs view
@@ -0,0 +1,61 @@+{-# LANGUAGE UnicodeSyntax+ , NoImplicitPrelude+ , MultiParamTypeClasses+ , FlexibleInstances+ , UndecidableInstances+ #-}++-------------------------------------------------------------------------------+-- |+-- Module : Control.Monad.Trans.Region.Instances.MTL+-- Copyright : (c) 2010 Bas van Dijk+-- License : BSD3 (see the file LICENSE)+-- Maintainer : Bas van Dijk <v.dijk.bas@gmail.com>+--+-- This module provides instances for the mtl monad classes for 'RegionT's.+--+--------------------------------------------------------------------------------++module Control.Monad.Trans.Region.Instances.MTL where++-- from mtl:+import Control.Monad.Cont.Class ( MonadCont, callCC )+import Control.Monad.Error.Class ( MonadError, throwError, catchError )+import Control.Monad.RWS.Class ( MonadRWS )+import Control.Monad.Reader.Class ( MonadReader, ask, local )+import Control.Monad.State.Class ( MonadState, get, put )+import Control.Monad.Writer.Class ( MonadWriter, tell, listen, pass )++import Control.Monad.Trans ( lift )++-- from unicode-symbols:+import Data.Function.Unicode ( (∘) )++-- from regions:+import Control.Monad.Trans.Region ( RegionT+ , liftCallCC+ , liftCatch+ , mapRegionT+ )++instance MonadCont pr ⇒ MonadCont (RegionT s pr) where+ callCC = liftCallCC callCC++instance MonadError e pr ⇒ MonadError e (RegionT s pr) where+ throwError = lift ∘ throwError+ catchError = liftCatch catchError++instance MonadRWS r w st pr ⇒ MonadRWS r w st (RegionT s pr)++instance MonadReader r pr ⇒ MonadReader r (RegionT s pr) where+ ask = lift ask+ local = mapRegionT ∘ local++instance MonadWriter w pr ⇒ MonadWriter w (RegionT s pr) where+ tell = lift ∘ tell+ listen = mapRegionT listen+ pass = mapRegionT pass++instance MonadState st pr ⇒ MonadState st (RegionT s pr) where+ get = lift get+ put = lift ∘ put
+ LICENSE view
@@ -0,0 +1,31 @@+Copyright (c) 2010 Bas van Dijk++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.++ * The name of Bas van Dijk and the names of contributors may NOT+ 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+OWNER 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.
+ Setup.hs view
@@ -0,0 +1,3 @@+import Distribution.Simple++main = defaultMain
+ regions-mtl.cabal view
@@ -0,0 +1,23 @@+name: regions-mtl+version: 0.3.1.4+cabal-version: >=1.6+build-type: Simple+license: BSD3+license-file: LICENSE+copyright: 2010 Bas van Dijk+author: Bas van Dijk+maintainer: Bas van Dijk <v.dijk.bas@gmail.com>+stability: experimental+category: Control, Monadic Regions+synopsis: mtl instances for the RegionT monad transformer++source-repository head+ Type: darcs+ Location: http://code.haskell.org/~basvandijk/code/regions-mtl++Library+ GHC-Options: -Wall -fno-warn-orphans+ build-depends: base-unicode-symbols >= 0.1.1 && < 0.3+ , mtl >= 2.0 && < 2.1+ , regions >= 0.4 && < 0.9+ exposed-modules: Control.Monad.Trans.Region.Instances.MTL