File tree 1 file changed +7
-0
lines changed
semialign/src/Data/Semialign
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 (..))
80
80
81
81
import Data.These
82
82
import Data.These.Combinators
83
+ import Control.Monad.Trans.Reader (ReaderT (.. ))
83
84
84
85
oops :: String -> a
85
86
oops = error . (" Data.Align: internal error: " ++ )
@@ -454,6 +455,12 @@ instance SemialignWithIndex Int ZipList
454
455
instance ZipWithIndex Int ZipList
455
456
instance RepeatWithIndex Int ZipList
456
457
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
+
457
464
-------------------------------------------------------------------------------
458
465
-- semigroups
459
466
-------------------------------------------------------------------------------
You can’t perform that action at this time.
0 commit comments