Changes between Version 16 and Version 17 of Proposals/transformers

Show
Ignore:
Timestamp:
11/04/10 18:19:21 (4 years ago)
Author:
ross (IP: 81.98.180.212)
Comment:

suggestions for upgrading

Legend:

Unmodified
Added
Removed
Modified
  • Proposals/transformers

    v16 v17  
    100100The attached test report lists the packages involved. 
    101101 
     102=== Transition to mtl-2 === 
     103Most packages build unchanged with mtl-2.  Most of the remainder require only small changes to upgrade to it, though that will usually render them incompatible with mtl-1 without some CPP directives.  Here are the fixes for common messages: 
     104 
     105''Illegal instance declaration for Applicative (State a)'' 
     106 This usually means that the instance you're defining is now defined in the {{{transformers}}} package.  You may wish to check it's the same, so you can just delete it. 
     107 
     108''Could not deduce (Functor m) from the context (Monad m)'' 
     109 This will be in a situation where you're using a monad constructed with a transformer as a Functor.  You can replace the {{{Monad m}} with {{{Functor m}}}.  Alternatively, if you add a {{{Functor m}}} constraint it will work with old and new versions of mtl. 
     110 
     111''Not in scope: data constructor State'' 
     112 The {{{State}}} type is now a type synonym.  You could replace the {{State}} data constructor with the {{state}} function from {{{Control.Monad.Trans.State}}} in the {{{transformers}}} package. 
     113 
     114''Not in scope: runState'' 
     115 You probably imported {{{State(..)}}}, which won't work now that {{{State}}} is a type synonym.  You need to import {{{State}}} and {{{runState}}}.  (That will work with old versions on mtl too.) 
     116 
     117''Illegal instance declaration for MyClass (State Foo)'' 
     118 If you have a matching instance for {{StateT}}, you can delete this one.  Otherwise you need to generalize your instance to {{StateT}}.  If that's not possible, you may need to introduce a newtype. 
     119 
     120 
    102121== Issues raised in the discussion == 
    103122 
     
    105124 
    106125 The two should generate the same code ([http://www.haskell.org/pipermail/libraries/2010-September/014323.html example]). 
     126 
     127 * The {{{transformers}}} package provides a function {{{state}}} as a replacement for the removed data constructors {{{State}}} when used as a function (and similarly for the others).  Should mtl re-export those? 
    107128 
    108129== Other issues ==