Gabriella439 / Haskell-MMorph-Library

Monad morphisms
BSD 3-Clause "New" or "Revised" License
47 stars 26 forks source link

Add `readOnly` #16

Open Gabriella439 opened 10 years ago

Gabriella439 commented 10 years ago
    readOnly :: Monad m => ReaderT s m r -> StateT s m r
    readOnly readerT = StateT $ \s -> do
        r <- runReaderT readerT s
        return (r, s)