-
Notifications
You must be signed in to change notification settings - Fork 86
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
1539: Improve support for monad stacks r=edsko a=edsko The main change in this commit is split in MonadSTM, which avoids the injectivity requirement, enabling GeneralizedNewtypeDeriving for MonadSTM. The remainder of the changes are related, and similarly intended to faciliate the derivation of monad stacks. Note that a similar change could be made to `MonadTimer`, but I didn't need it and so I've not done that yet. With this PR, we can define something like ```haskell newtype MockTime m a = MockTime (ReaderT () m a) deriving ( Functor , Applicative , Monad , MonadTrans , MonadThrow , MonadSTM , MonadDelay , MonadTime ) ``` and have it Just Work (TM). (Of course, this particular definition isn't very useful, just a proof of concept.) Co-authored-by: Edsko de Vries <[email protected]>
- Loading branch information
Showing
22 changed files
with
500 additions
and
405 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.