File tree Expand file tree Collapse file tree 1 file changed +7
-0
lines changed
semialign/src/Data/Semialign Expand file tree Collapse file tree 1 file changed +7
-0
lines changed Original file line number Diff line number Diff line change @@ -80,6 +80,7 @@ import Data.Semigroup (Option (..))
8080
8181import Data.These
8282import Data.These.Combinators
83+ import Control.Monad.Trans.Reader (ReaderT (.. ))
8384
8485oops :: String -> a
8586oops = error . (" Data.Align: internal error: " ++ )
@@ -454,6 +455,12 @@ instance SemialignWithIndex Int ZipList
454455instance ZipWithIndex Int ZipList
455456instance RepeatWithIndex Int ZipList
456457
458+ instance Semialign m => Semialign (ReaderT r m ) where
459+ align ma mb = ReaderT $ getCompose $ align (Compose (runReaderT ma)) (Compose (runReaderT mb))
460+
461+ instance Align m => Align (ReaderT r m ) where
462+ nil = ReaderT $ Prelude. const nil
463+
457464-------------------------------------------------------------------------------
458465-- semigroups
459466-------------------------------------------------------------------------------
You can’t perform that action at this time.
0 commit comments