regions-monadstf (empty) → 0.1
raw patch · 4 files changed
+128/−0 lines, 4 filesdep +monads-tfdep +regionsdep +transformerssetup-changed
Dependencies added: monads-tf, regions, transformers, unicode-symbols
Files
- Control/Monad/Trans/Region/Instances/MonadsTF.hs +69/−0
- LICENSE +31/−0
- Setup.hs +3/−0
- regions-monadstf.cabal +25/−0
+ Control/Monad/Trans/Region/Instances/MonadsTF.hs view
@@ -0,0 +1,69 @@+{-# LANGUAGE UnicodeSyntax #-}+{-# LANGUAGE TypeFamilies #-}+{-# LANGUAGE NoImplicitPrelude #-}++-------------------------------------------------------------------------------+-- |+-- Module : Control.Monad.Trans.Region.Instances.MonadsTF+-- Copyright : (c) 2009 Bas van Dijk+-- License : BSD3 (see the file LICENSE)+-- Maintainer : Bas van Dijk <v.dijk.bas@gmail.com>+--+-- This module provides instances for the monads-tf classes for 'RegionT's.+--+--------------------------------------------------------------------------------++module Control.Monad.Trans.Region.Instances.MonadsTF where++-- from monads-fd:+-- TODO: import Control.Monad.Cont.Class ( MonadCont, callCC )+import Control.Monad.Error.Class ( MonadError, ErrorType, throwError, catchError )+import Control.Monad.RWS.Class ( MonadRWS )+import Control.Monad.Reader.Class ( MonadReader, EnvType, ask, local )+import Control.Monad.State.Class ( MonadState, StateType, get, put )+import Control.Monad.Writer.Class ( MonadWriter, WriterType, tell, listen, pass )++-- from transformers:+import Control.Monad.Trans ( lift )++-- from unicode-symbols:+import Prelude.Unicode ( (∘) )++-- from regions:+import Control.Monad.Trans.Region.Internal ( RegionT+ , liftCatch+ , mapRegionT+ -- TODO: , liftCallCC+ )++-- TODO:+-- instance Monad pr ⇒ MonadCont (RegionT resource s pr) where+-- callCC = liftCallCC callCC++instance MonadError pr ⇒ MonadError (RegionT resource s pr) where++ type ErrorType (RegionT resource s pr) = ErrorType pr++ throwError = lift ∘ throwError+ catchError = liftCatch catchError++instance MonadRWS pr ⇒ MonadRWS (RegionT resource s pr)++instance MonadReader pr ⇒ MonadReader (RegionT resource s pr) where+ type EnvType (RegionT resource s pr) = EnvType pr++ ask = lift ask+ local = mapRegionT ∘ local++instance MonadWriter pr ⇒ MonadWriter (RegionT resource s pr) where+ type WriterType (RegionT resource s pr) = WriterType pr++ tell = lift ∘ tell+ listen = mapRegionT listen+ pass = mapRegionT pass++instance MonadState pr ⇒ MonadState (RegionT resource s pr) where+ type StateType (RegionT resource s pr) = StateType pr++ get = lift get+ put = lift ∘ put
+ LICENSE view
@@ -0,0 +1,31 @@+Copyright (c) 2009 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-monadstf.cabal view
@@ -0,0 +1,25 @@+name: regions-monadstf+version: 0.1+cabal-version: >=1.6+build-type: Simple+license: BSD3+license-file: LICENSE+copyright: 2009 Bas van Dijk+author: Bas van Dijk+maintainer: Bas van Dijk <v.dijk.bas@gmail.com>+stability: experimental+category: Control+synopsis: Monads-tf instances for the RegionT monad transformer++source-repository head+ Type: darcs+ Location: http://code.haskell.org/~basvandijk/code/regions-monadstf++Library+ GHC-Options: -O2 -Wall -fno-warn-orphans+ build-depends: unicode-symbols == 0.1.*+ , transformers >= 0.1.4 && < 0.2+ , regions == 0.1.*+ , monads-tf == 0.0.*+ exposed-modules: Control.Monad.Trans.Region.Instances.MonadsTF+