@@ -29,18 +29,35 @@ instance MonadReader tag r m => Class.MonadReader r (WrappedEther tag m) where
2929 ask = WrapEther $ ask (Proxy :: Proxy tag)
3030 local f = WrapEther . local (Proxy :: Proxy tag) f . unwrapEther
3131
32+instance MonadReader tag r m => MonadReader tag r (WrappedEther tag' m) where
33+ ask t = WrapEther $ ask t
34+ local t f = WrapEther . local t f . unwrapEther
35+
3236instance MonadState tag s m => Class.MonadState s (WrappedEther tag m) where
3337 get = WrapEther $ get (Proxy :: Proxy tag)
3438 put = WrapEther . put (Proxy :: Proxy tag)
3539
40+instance MonadState tag s m => MonadState tag s (WrappedEther tag' m) where
41+ get t = WrapEther $ get t
42+ put t = WrapEther . put t
43+
3644instance MonadExcept tag e m => Class.MonadError e (WrappedEther tag m) where
3745 throwError = WrapEther . throw (Proxy :: Proxy tag)
3846 catchError m h = WrapEther $ catch (Proxy :: Proxy tag) (unwrapEther m) (unwrapEther . h)
3947
48+instance MonadExcept tag e m => MonadExcept tag e (WrappedEther tag' m) where
49+ throw t = WrapEther . throw t
50+ catch t m h = WrapEther $ catch t (unwrapEther m) (unwrapEther . h)
51+
4052instance MonadWriter tag w m => Class.MonadWriter w (WrappedEther tag m) where
4153 tell = WrapEther . tell (Proxy :: Proxy tag)
4254 listen = WrapEther . listen (Proxy :: Proxy tag) . unwrapEther
4355 pass = WrapEther . pass (Proxy :: Proxy tag) . unwrapEther
4456
57+instance MonadWriter tag w m => MonadWriter tag w (WrappedEther tag' m) where
58+ tell t = WrapEther . tell t
59+ listen t = WrapEther . listen t . unwrapEther
60+ pass t = WrapEther . pass t . unwrapEther
61+
4562ethered :: proxy tag -> WrappedEther tag m a -> m a
4663ethered _proxy = unwrapEther