morpheus-graphql-core-0.14.0: Morpheus GraphQL Core

Safe HaskellNone
LanguageHaskell2010

Data.Morpheus.Internal.Utils

Documentation

class Collection a coll | coll -> a where Source #

Methods

empty :: coll Source #

singleton :: a -> coll Source #

Instances
Collection a [a] Source # 
Instance details

Defined in Data.Morpheus.Internal.Utils

Methods

empty :: [a] Source #

singleton :: a -> [a] Source #

KeyOf FieldName def => Collection def (Fields def) Source # 
Instance details

Defined in Data.Morpheus.Types.Internal.AST.Fields

Methods

empty :: Fields def Source #

singleton :: def -> Fields def Source #

KeyOf k v => Collection v (HashMap k v) Source # 
Instance details

Defined in Data.Morpheus.Internal.Utils

Methods

empty :: HashMap k v Source #

singleton :: v -> HashMap k v Source #

(KeyOf k a, Hashable k) => Collection a (OrdMap k a) Source # 
Instance details

Defined in Data.Morpheus.Types.Internal.AST.OrdMap

Methods

empty :: OrdMap k a Source #

singleton :: a -> OrdMap k a Source #

Collection (ArgumentDefinition s) (ArgumentsDefinition s) Source # 
Instance details

Defined in Data.Morpheus.Types.Internal.AST.Fields

class Selectable k a c | c -> a where Source #

Methods

selectOr :: d -> (a -> d) -> k -> c -> d Source #

Instances
Selectable OperationType RootOperationTypeDefinition SchemaDefinition Source # 
Instance details

Defined in Data.Morpheus.Types.Internal.AST.TypeSystem

KeyOf k a => Selectable k a [a] Source # 
Instance details

Defined in Data.Morpheus.Internal.Utils

Methods

selectOr :: d -> (a -> d) -> k -> [a] -> d Source #

KeyOf k a => Selectable k a (HashMap k a) Source # 
Instance details

Defined in Data.Morpheus.Internal.Utils

Methods

selectOr :: d -> (a -> d) -> k -> HashMap k a -> d Source #

(Eq k, Hashable k) => Selectable k a (OrdMap k a) Source # 
Instance details

Defined in Data.Morpheus.Types.Internal.AST.OrdMap

Methods

selectOr :: d -> (a -> d) -> k -> OrdMap k a -> d Source #

Selectable FieldName (ArgumentDefinition s) (ArgumentsDefinition s) Source # 
Instance details

Defined in Data.Morpheus.Types.Internal.AST.Fields

Methods

selectOr :: d -> (ArgumentDefinition s -> d) -> FieldName -> ArgumentsDefinition s -> d Source #

Selectable FieldName (ArgumentDefinition s) (DirectiveDefinition s) Source # 
Instance details

Defined in Data.Morpheus.Types.Internal.AST.Fields

Methods

selectOr :: d -> (ArgumentDefinition s -> d) -> FieldName -> DirectiveDefinition s -> d Source #

Selectable FieldName (ArgumentDefinition s) (FieldDefinition OUT s) Source # 
Instance details

Defined in Data.Morpheus.Types.Internal.AST.Fields

Methods

selectOr :: d -> (ArgumentDefinition s -> d) -> FieldName -> FieldDefinition OUT s -> d Source #

Selectable TypeName (TypeDefinition ANY s) (Schema s) Source # 
Instance details

Defined in Data.Morpheus.Types.Internal.AST.TypeSystem

Methods

selectOr :: d -> (TypeDefinition ANY s -> d) -> TypeName -> Schema s -> d Source #

Selectable FieldName (FieldDefinition cat s) (Fields (FieldDefinition cat s)) Source # 
Instance details

Defined in Data.Morpheus.Types.Internal.AST.Fields

Methods

selectOr :: d -> (FieldDefinition cat s -> d) -> FieldName -> Fields (FieldDefinition cat s) -> d Source #

class Listable a coll | coll -> a where Source #

Methods

elems :: coll -> [a] Source #

fromElems :: (Monad m, Failure ValidationErrors m) => [a] -> m coll Source #

Instances
(KeyOf FieldName def, NameCollision def) => Listable def (Fields def) Source # 
Instance details

Defined in Data.Morpheus.Types.Internal.AST.Fields

Methods

elems :: Fields def -> [def] Source #

fromElems :: (Monad m, Failure ValidationErrors m) => [def] -> m (Fields def) Source #

(NameCollision a, KeyOf k a) => Listable a (HashMap k a) Source # 
Instance details

Defined in Data.Morpheus.Internal.Utils

Methods

elems :: HashMap k a -> [a] Source #

fromElems :: (Monad m, Failure ValidationErrors m) => [a] -> m (HashMap k a) Source #

(NameCollision a, KeyOf k a, Hashable k) => Listable a (OrdMap k a) Source # 
Instance details

Defined in Data.Morpheus.Types.Internal.AST.OrdMap

Methods

elems :: OrdMap k a -> [a] Source #

fromElems :: (Monad m, Failure ValidationErrors m) => [a] -> m (OrdMap k a) Source #

Listable (ArgumentDefinition s) (ArgumentsDefinition s) Source # 
Instance details

Defined in Data.Morpheus.Types.Internal.AST.Fields

Listable (TypeDefinition ANY s) (Schema s) Source # 
Instance details

Defined in Data.Morpheus.Types.Internal.AST.TypeSystem

class Merge a where Source #

Methods

merge :: (Monad m, Failure ValidationErrors m) => [Ref] -> a -> a -> m a Source #

Instances
Merge UnionTag Source # 
Instance details

Defined in Data.Morpheus.Types.Internal.AST.Selection

Merge (Schema s) Source # 
Instance details

Defined in Data.Morpheus.Types.Internal.AST.TypeSystem

Methods

merge :: (Monad m, Failure ValidationErrors m) => [Ref] -> Schema s -> Schema s -> m (Schema s) Source #

Merge (SelectionSet a) => Merge (Selection a) Source # 
Instance details

Defined in Data.Morpheus.Types.Internal.AST.Selection

Methods

merge :: (Monad m, Failure ValidationErrors m) => [Ref] -> Selection a -> Selection a -> m (Selection a) Source #

Merge (SelectionSet s) => Merge (SelectionContent s) Source # 
Instance details

Defined in Data.Morpheus.Types.Internal.AST.Selection

(NameCollision a, KeyOf k a) => Merge (HashMap k a) Source # 
Instance details

Defined in Data.Morpheus.Internal.Utils

Methods

merge :: (Monad m, Failure ValidationErrors m) => [Ref] -> HashMap k a -> HashMap k a -> m (HashMap k a) Source #

(NameCollision a, KeyOf k a) => Merge (OrdMap k a) Source # 
Instance details

Defined in Data.Morpheus.Types.Internal.AST.OrdMap

Methods

merge :: (Monad m, Failure ValidationErrors m) => [Ref] -> OrdMap k a -> OrdMap k a -> m (OrdMap k a) Source #

Merge (FieldsDefinition cat s) Source # 
Instance details

Defined in Data.Morpheus.Types.Internal.AST.Fields

Methods

merge :: (Monad m, Failure ValidationErrors m) => [Ref] -> FieldsDefinition cat s -> FieldsDefinition cat s -> m (FieldsDefinition cat s) Source #

class Applicative f => Failure error (f :: * -> *) where Source #

Methods

failure :: error -> f v Source #

Instances
Failure error (Either error) Source # 
Instance details

Defined in Data.Morpheus.Internal.Utils

Methods

failure :: error -> Either error v Source #

Monad m => Failure GQLErrors (ResultT event m) Source # 
Instance details

Defined in Data.Morpheus.Types.Internal.Resolving.Core

Methods

failure :: GQLErrors -> ResultT event m v Source #

(Monad m, Failure errors m) => Failure errors (ReaderT ctx m) Source # 
Instance details

Defined in Data.Morpheus.Internal.Utils

Methods

failure :: errors -> ReaderT ctx m v Source #

(LiftOperation o, Monad m) => Failure GQLErrors (Resolver o e m) Source # 
Instance details

Defined in Data.Morpheus.Types.Internal.Resolving.Resolver

Methods

failure :: GQLErrors -> Resolver o e m v Source #

(Stream s, Ord e, Failure GQLErrors m) => Failure ValidationErrors (ParsecT e s m) Source # 
Instance details

Defined in Data.Morpheus.Internal.Utils

Methods

failure :: ValidationErrors -> ParsecT e s m v Source #

(LiftOperation o, Monad m) => Failure Message (Resolver o e m) Source # 
Instance details

Defined in Data.Morpheus.Types.Internal.Resolving.Resolver

Methods

failure :: Message -> Resolver o e m v Source #

Failure [GQLError] (Result ev) Source # 
Instance details

Defined in Data.Morpheus.Types.Internal.Resolving.Core

Methods

failure :: [GQLError] -> Result ev v Source #

Failure [ValidationError] (Result ev) Source # 
Instance details

Defined in Data.Morpheus.Types.Internal.Resolving.Core

Methods

failure :: [ValidationError] -> Result ev v Source #

class (Eq k, Hashable k) => KeyOf k a | a -> k where Source #

Methods

keyOf :: a -> k Source #

Instances
KeyOf OperationType RootOperationTypeDefinition Source # 
Instance details

Defined in Data.Morpheus.Types.Internal.AST.TypeSystem

KeyOf TypeName TypeNameRef Source # 
Instance details

Defined in Data.Morpheus.Internal.Utils

KeyOf TypeName SchemaDefinition Source # 
Instance details

Defined in Data.Morpheus.Types.Internal.AST.TypeSystem

KeyOf TypeName UnionTag Source # 
Instance details

Defined in Data.Morpheus.Types.Internal.AST.Selection

KeyOf FieldName Ref Source # 
Instance details

Defined in Data.Morpheus.Internal.Utils

Methods

keyOf :: Ref -> FieldName Source #

KeyOf FieldName (ObjectEntry s) Source # 
Instance details

Defined in Data.Morpheus.Types.Internal.AST.Value

KeyOf FieldName (Variable s) Source # 
Instance details

Defined in Data.Morpheus.Types.Internal.AST.Value

KeyOf FieldName (DirectiveDefinition s) Source # 
Instance details

Defined in Data.Morpheus.Types.Internal.AST.Fields

KeyOf FieldName (Directive s) Source # 
Instance details

Defined in Data.Morpheus.Types.Internal.AST.Fields

KeyOf FieldName (Argument stage) Source # 
Instance details

Defined in Data.Morpheus.Types.Internal.AST.Fields

Methods

keyOf :: Argument stage -> FieldName Source #

KeyOf FieldName (Selection s) Source # 
Instance details

Defined in Data.Morpheus.Types.Internal.AST.Selection

KeyOf FieldName (Fragment s) Source # 
Instance details

Defined in Data.Morpheus.Types.Internal.AST.Selection

(Eq k, Hashable k) => KeyOf k (k, a) Source # 
Instance details

Defined in Data.Morpheus.Internal.Utils

Methods

keyOf :: (k, a) -> k Source #

KeyOf TypeName (TypeDefinition a s) Source # 
Instance details

Defined in Data.Morpheus.Types.Internal.AST.TypeSystem

KeyOf TypeName (UnionMember cat s) Source # 
Instance details

Defined in Data.Morpheus.Types.Internal.AST.TypeSystem

Methods

keyOf :: UnionMember cat s -> TypeName Source #

KeyOf FieldName (FieldDefinition cat s) Source # 
Instance details

Defined in Data.Morpheus.Types.Internal.AST.Fields

toPair :: KeyOf k a => a -> (k, a) Source #

selectBy :: (Failure e m, Selectable k a c, Monad m) => e -> k -> c -> m a Source #

member :: Selectable k a c => k -> c -> Bool Source #

keys :: (KeyOf k a, Listable a coll) => coll -> [k] Source #

size :: Listable a coll => coll -> Int Source #

(<:>) :: (Monad m, Merge a, Failure ValidationErrors m) => a -> a -> m a Source #

mapFst :: (a -> a') -> (a, b) -> (a', b) Source #

mapSnd :: (b -> b') -> (a, b) -> (a, b') Source #

mapTuple :: (a -> a') -> (b -> b') -> (a, b) -> (a', b') Source #

newtype UpdateT m a Source #

Constructors

UpdateT 

Fields

resolveUpdates :: Monad m => a -> [UpdateT m a] -> m a Source #

concatUpdates :: Monad m => [UpdateT m a] -> UpdateT m a Source #

failUpdates :: Failure e m => e -> UpdateT m a Source #

ordTraverse :: (Monad f, KeyOf k b, Listable a (t a), Listable b (t b), Failure ValidationErrors f) => (a -> f b) -> t a -> f (t b) Source #

ordTraverse_ :: (Monad f, Listable a (t a)) => (a -> f b) -> t a -> f () Source #

traverseCollection :: (Monad f, KeyOf k b, Listable a (t a), Listable b (t' b), Failure ValidationErrors f) => (a -> f b) -> t a -> f (t' b) Source #

(<.>) :: SemigroupM m a => a -> a -> m a Source #

class SemigroupM m a where Source #

Methods

mergeM :: [Ref] -> a -> a -> m a Source #

Instances
(Monad f, Failure InternalError f) => SemigroupM f (ResModel o e m) Source # 
Instance details

Defined in Data.Morpheus.Types.Internal.Resolving.Resolver

Methods

mergeM :: [Ref] -> ResModel o e m -> ResModel o e m -> f (ResModel o e m) Source #

Applicative f => SemigroupM f (ObjectResModel o e m) Source # 
Instance details

Defined in Data.Morpheus.Types.Internal.Resolving.Resolver

Methods

mergeM :: [Ref] -> ObjectResModel o e m -> ObjectResModel o e m -> f (ObjectResModel o e m) Source #