| 61 | | ''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. |
| | 61 | ''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 {{{Reader r}}} and {{{ReaderT r}}} and ensuring that they are consistent. |
| | 62 | * The instance {{{Error String}}} is restructured to avoid a type synonym instance: |
| | 63 | {{{ |
| | 64 | instance Error String where |
| | 65 | noMsg = "" |
| | 66 | strMsg = id |
| | 67 | }}} |
| | 68 | is replaced by |
| | 69 | {{{ |
| | 70 | instance ErrorList a => Error [a] where |
| | 71 | strMsg = listMsg |
| | 72 | |
| | 73 | class ErrorList a where |
| | 74 | listMsg :: String -> [a] |
| | 75 | |
| | 76 | instance ErrorList Char where |
| | 77 | listMsg = id |
| | 78 | }}} |
| | 79 | ''Rationale:'' This makes the instance Haskell 98, so it can be included in the transformers package. |