Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

What are the differences between layers and extensible-effects?

Tags:

haskell

monads

The extensible effects library and the layers library appear to have the same goals (making it easy to compose different effects together). Both talk about the advantages they offer over mtl, but neither makes reference to the other. Can both accomplish the same thing? Does one subsume the other? Does each have some feature that the other lacks?

like image 209
lmm Avatar asked Sep 23 '14 12:09

lmm


1 Answers

While I'm in no way experienced with any of those, it's quite straighforward from the articles.

While layers are rather building upon MTL, exteff is a wholly different approach. exteff defines one monad that contains information about its effects in its type. exteff claims to solve the problem of monad ordering, i.e. if monads A and B are interchangable, the classic approach would make A (B a) and B (A a) different types. In exteff they're the same.

From the interface of layers it seems that it didn't solve that problem.

like image 131
polkovnikov.ph Avatar answered Oct 08 '22 14:10

polkovnikov.ph