Haskell-MMorph-Library icon indicating copy to clipboard operation
Haskell-MMorph-Library copied to clipboard

Add `readOnly`

Open Gabriella439 opened this issue 10 years ago • 0 comments

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

Gabriella439 avatar Oct 21 '14 17:10 Gabriella439