Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Transition from ErrorT to ExceptT

A recent cabal install upgraded my version of transformers from 0.3.0.0 to 0.4.1.0. With this upgrade came depreciation warnings about ErrorT.

The documentation is not clear is this just a renaming or is there a functional change? Why was this change made?

like image 997
John F. Miller Avatar asked Sep 13 '14 05:09

John F. Miller


1 Answers

There is a functional change. ErrorT demands that the e type be a member of the Error type class—for example, consider its Monad instance constraints. This is fairly arbitrary and certainly not needed for the functionality of ErrorT.

ExceptT lifts this restriction.

The renaming was introduced in order to create a more smooth upgrade pathway. People who currently use and depend upon the Error constraint in their ErrorT stacks should not have to change code. People who'd like to use the strictly more general ExceptT module can freely choose to do so. At some point the ErrorT module may be removed.

like image 113
J. Abrahamson Avatar answered Oct 17 '22 06:10

J. Abrahamson