haskellari / these

An either-or-both data type, with corresponding hybrid error/writer monad transformer.
117 stars 49 forks source link

ReaderT instances for Semialign and Align #196

Open turion opened 6 months ago

turion commented 6 months ago

Since ReaderT r m a is isomorphic to Compose m ((->) r)) a, it has a straightforward Align instance. This PR adds it. If you want, I can add other instances for transformers that are also compositions (ExceptT, MaybeT, possibly others?).

turion commented 6 months ago

Solves part of https://github.com/haskellari/these/issues/135.

In https://github.com/haskellari/these/issues/135#issuecomment-564631426, you say:

"should" should be witnessed.

Is it sufficient to add one monomorphic test case for ReaderT?