-
Notifications
You must be signed in to change notification settings - Fork 2.8k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
server: refactor
Hasura.Metadata.Class
- Remove `MonadMetadataStorageQueryAPI` which was only implemented by a default implementation - Introduce `TransT` which can be used to easily derive `lift`ing implementations for `MonadBlaBlaBla` classes PR-URL: hasura/graphql-engine-mono#8579 GitOrigin-RevId: 4f804fda7e2de5c9d75ee4df269f500ebd46b8c9
- Loading branch information
1 parent
ed4f3b7
commit 7cc33dd
Showing
12 changed files
with
103 additions
and
280 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
module Control.Monad.Trans.Extended | ||
( TransT (..), | ||
) | ||
where | ||
|
||
import Control.Monad.Morph | ||
import Data.Kind | ||
import Prelude | ||
|
||
-- | Utility newtype that can be used to derive type class instances just using | ||
-- `MonadTrans`. | ||
-- | ||
-- We often derive some `MonadBlaBla` instance for `ReaderT` by using `lift` | ||
-- from `MonadTrans`. Which is fine, but it gets laborious if you do the same | ||
-- for `ExceptT`, `StateT` and `WriterT`, even though the method implementations | ||
-- are exactly the same. `TransT` allows you to write one `MonadTrans`-based | ||
-- instance, which can then be used with `DerivingVia` to use that one | ||
-- implementation for all monad transformers that use that same lifting | ||
-- implementation. | ||
newtype TransT t (m :: Type -> Type) a = TransT (t m a) | ||
deriving (Functor, Applicative, Monad, MonadTrans, MFunctor, MMonad) |
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
Large diffs are not rendered by default.
Oops, something went wrong.
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
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
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
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