int-index / ether

Monad Transformers and Classes
https://int-index.github.io/ether/
BSD 3-Clause "New" or "Revised" License
78 stars 7 forks source link

Flattening monadic layers #13

Open int-index opened 8 years ago

int-index commented 8 years ago

I believe that the performance could be improved greatly if there was a way to flatten monadic effects.

int-index commented 8 years ago

Ok, there's a working prototype for ReaderT now (and the benchmarks show that it's as fast as mtl).

int-index commented 7 years ago

compound-types looks like a good candidate for Sum/Product types to use with flattening of implicitly tagged transformers.

jberryman commented 7 years ago

I'm just exploring this space, but there is also http://hackage.haskell.org/package/data-has which might be useful

int-index commented 7 years ago

Yes, I've seen it. What I don't like about the data-has package is that its Has class doesn't define a lens, it defines a getter and a setter. For types with non constant time access this is important, because with a lens you traverse the structure just once to modify a value, whereas with a getter/setter pair you'd have to do it twice (first to get a value, then to set a new one).