monad-classes-0.3.0.1: more flexible mtl

Safe HaskellNone
LanguageHaskell2010

Control.Monad.Classes.Proxied

Description

Proxied monad. Proxied x is a monad transformer that has a global configuration parameter of type x associated with it.

It is used to implement things like ZoomT/runZoom and CustromWriterT/evalWriterWith.

Most of the time you don't need to use this directly. It is exported for two purposes:

  • you can use it to define new monad transformers
  • you can define instances for Proxied x and transformers that are based on it

Synopsis

Documentation

newtype Proxied x m a Source

Constructors

Proxied (forall q. Reifies q x => Proxy# q -> m a) 

Instances

MonadBase b m => MonadBase b (Proxied * x m) 
MonadTrans (Proxied * x) 
MonadTransControl (Proxied * x) 
Alternative m => Alternative (Proxied * x m) 
Monad m => Monad (Proxied * x m) 
Functor m => Functor (Proxied * x m) 
MonadPlus m => MonadPlus (Proxied * x m) 
Applicative m => Applicative (Proxied * x m) 
MonadIO m => MonadIO (Proxied * x m) 
type StT (Proxied * x) a = a 

reify :: a -> (forall q. Reifies q a => Proxy# q -> r) -> r Source

reflect :: Reifies q a => Proxy# q -> a Source

class Reifies s a | s -> a

Minimal complete definition

reflect

Instances

data Proxy# :: k -> (#)

The type constructor Proxy# is used to bear witness to some type variable. It's used when you want to pass around proxy values for doing things like modelling type applications. A Proxy# is not only unboxed, it also has a polymorphic kind, and has no runtime representation, being totally free.

proxy# :: Proxy# k a

Witness for an unboxed Proxy# value, which has no runtime representation.