morpheus-graphql-core-0.27.0: Morpheus GraphQL Core
Safe HaskellSafe-Inferred
LanguageHaskell2010

Data.Morpheus.Internal.Utils

Documentation

class IsMap k m | m -> k where Source #

Minimal complete definition

unsafeFromList, singleton, lookup, toAssoc

Methods

unsafeFromList :: [(k, a)] -> m a Source #

singleton :: k -> a -> m a Source #

lookup :: k -> m a -> Maybe a Source #

member :: k -> m a -> Bool Source #

toAssoc :: m a -> [(k, a)] Source #

Instances

Instances details
IsMap Key KeyMap Source # 
Instance details

Defined in Data.Mergeable.IsMap

Methods

unsafeFromList :: [(Key, a)] -> KeyMap a Source #

singleton :: Key -> a -> KeyMap a Source #

lookup :: Key -> KeyMap a -> Maybe a Source #

member :: Key -> KeyMap a -> Bool Source #

toAssoc :: KeyMap a -> [(Key, a)] Source #

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

Defined in Data.Mergeable.OrdMap

Methods

unsafeFromList :: [(k, a)] -> OrdMap k a Source #

singleton :: k -> a -> OrdMap k a Source #

lookup :: k -> OrdMap k a -> Maybe a Source #

member :: k -> OrdMap k a -> Bool Source #

toAssoc :: OrdMap k a -> [(k, a)] Source #

(Eq k, Hashable k) => IsMap k (HashMap k) Source # 
Instance details

Defined in Data.Mergeable.IsMap

Methods

unsafeFromList :: [(k, a)] -> HashMap k a Source #

singleton :: k -> a -> HashMap k a Source #

lookup :: k -> HashMap k a -> Maybe a Source #

member :: k -> HashMap k a -> Bool Source #

toAssoc :: HashMap k a -> [(k, a)] Source #

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

Methods

keyOf :: a -> k Source #

Instances

Instances details
KeyOf TypeName UnionTag Source # 
Instance details

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

KeyOf TypeName SchemaDefinition Source # 
Instance details

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

KeyOf OperationType RootOperationTypeDefinition Source # 
Instance details

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

KeyOf FieldName (Argument stage) Source # 
Instance details

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

Methods

keyOf :: Argument stage -> FieldName Source #

KeyOf FieldName (ArgumentDefinition 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 (DirectiveDefinition s) Source # 
Instance details

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

KeyOf FieldName (Selection s) Source # 
Instance details

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

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 FragmentName (Fragment s) Source # 
Instance details

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

(Eq name, Hashable name) => KeyOf name (Ref name) Source # 
Instance details

Defined in Data.Morpheus.Ext.KeyOf

Methods

keyOf :: Ref name -> name Source #

KeyOf FieldName (FieldDefinition cat s) Source # 
Instance details

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

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.Union

Methods

keyOf :: UnionMember cat s -> TypeName Source #

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

Defined in Data.Morpheus.Ext.KeyOf

Methods

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

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

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

traverseCollection :: (Monad m, MonadError GQLError m, KeyOf k b, FromList m map k b, Foldable t) => (a -> m b) -> t a -> m (map k b) Source #

prop :: (b -> b -> m b) -> (a -> b) -> a -> a -> m b Source #

mergeT :: (KeyOf k a, Foldable t, Monad m) => t a -> t a -> ResolutionT k a c m c Source #

class Empty coll where Source #

Methods

empty :: coll Source #

Instances

Instances details
Empty [a] Source # 
Instance details

Defined in Data.Morpheus.Ext.Empty

Methods

empty :: [a] Source #

Empty (OrdMap k a) Source # 
Instance details

Defined in Data.Mergeable.OrdMap

Methods

empty :: OrdMap k a Source #

Empty (HashMap k v) Source # 
Instance details

Defined in Data.Morpheus.Ext.Empty

Methods

empty :: HashMap k v Source #

addPath :: MonadReader [a1] m => a1 -> m a2 -> m a2 Source #

mergeConcat :: (Monad m, Merge m a, MonadError e m) => NonEmpty a -> m a Source #

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

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

insert :: (NameCollision e a, KeyOf k a, MonadError e m) => a -> SafeHashMap k a -> m (SafeHashMap k a) Source #

fromElems :: (Monad m, KeyOf k a, FromList m map k a) => [a] -> m (map k a) Source #