Changes between Version 6 and Version 7 of Proposals/transformers

Show
Ignore:
Timestamp:
09/15/10 00:18:20 (4 years ago)
Author:
ross (IP: 81.98.180.212)
Comment:

--

Legend:

Unmodified
Added
Removed
Modified
  • Proposals/transformers

    v6 v7  
    1313 
    1414The idea is to factor out the monad transformers as a Haskell 98 package, which can be used by itself or with type classes based on either functional dependencies or type functions.  Interfaces referring to the monad transformers would be compatible across the different libraries. 
     15 
     16The transformers package has been in use for over 18 months, and is used by more than 100 packages.  It is time to complete the transition, and save authors from having to worry about two distinct monad transformer packages. 
    1517 
    1618== Structure == 
     
    4345 
    4446 ''Rationale:'' These instances are more general, and are consistent with the instances of other classes. 
    45  * simple monads now aliases for monad trasformers applied to {{{Identity}}}, e.g. 
     47 * simple monads are now aliases for monad trasformers applied to {{{Identity}}}, e.g. 
    4648   {{{ 
    4749newtype Reader r a = Reader { runReader :: r -> a } 
     
    5557}}} 
    5658 ''Rationale:'' This avoids repetition in the interfaces of both transformers and the proposed mtl-2.  It makes transformers more useful on its own, and also saves clients of mtl from defining instances for both {{{State s}}} and {{{StateT s Identity}}} and ensuring that they are consistent. 
    57  
    58 == Other issues == 
    59  
    60 Some other issues have been raised with mtl over the years, but they are orthogonal to this proposal: 
    61  * The {{{MonadCont}}} instance for {{{StateT}}} is not compatible with the monad transformer.  The transformers package provides the correct lifting (in which callcc causes the state to rollback on entering the saved continuation), but also provides the MTL lifting for compatibility, and this is used by monads-fd.  It could be switched to the correct lifting later. 
    62  * The {{{ErrorT}}} monad transformer has an {{{Error}}} constraint, so that errors can be passed to the fail method of the Monad class. 
    63  * {{{ListT}}} only works on commutative monads. 
    6459 
    6560== Transition issues == 
     
    7671    * 2 that defined instances for base monads ([http://hackage.haskell.org/package/jmacro jmacro] and [http://hackage.haskell.org/package/yhccore yhccore]) 
    7772 * 248 failed for other reasons (e.g. failed anyway or depended on one of the other failures) 
     73 
     74== Other issues == 
     75 
     76Some other issues have been raised with mtl over the years, but they are orthogonal to this proposal: 
     77 * The {{{MonadCont}}} instance for {{{StateT}}} is not compatible with the monad transformer.  The transformers package provides the correct lifting (in which callcc causes the state to rollback on entering the saved continuation), but also provides the MTL lifting for compatibility, and this is used by monads-fd.  It could be switched to the correct lifting later. 
     78 * The {{{ErrorT}}} monad transformer has an {{{Error}}} constraint, so that errors can be passed to the fail method of the Monad class. 
     79 * {{{ListT}}} only works on commutative monads.