basvandijk / regions

Provides the region monad for safely opening and working with scarce resources
Other
30 stars 7 forks source link

Allow mixed stacks of RegionT and other transformers #4

Open basvandijk opened 10 years ago

basvandijk commented 10 years ago

If allowed by GHC, add the instance:

instance (MonadTransControl t, RegionBaseControl b parent) => 
         RegionBaseControl b (t (RegionT s parent)) where
  unsafeLiftBaseWith f = 
    liftWith $ \runT -> 
      unsafeLiftBaseWith $ \runInBase ->
        f $ liftM St . runInBase . runT
  ...

This allows to have mixed stacks of RegionT transformers and other transformers.