Safe Haskell | None |
---|---|
Language | Haskell2010 |
Synopsis
- class MonadGraphulaBackend m where
- class GHasDependencies nodeTyProxy depsTyProxy node deps where
- genericDependsOn :: nodeTyProxy -> depsTyProxy -> node -> deps -> node
- data KeySourceType
- class GenerateKeyInternal (s :: KeySourceType) a where
- type KeyConstraint s a :: Constraint
- generateKey :: KeyConstraint s a => Gen (Maybe (Key a))
- class NoConstraint a
Documentation
class MonadGraphulaBackend m where Source #
type Logging m :: Type -> Constraint Source #
Instances
(MonadGraphulaBackend m, MonadIO m) => MonadGraphulaBackend (GraphulaLoggedT m) Source # | |
Defined in Graphula type Logging (GraphulaLoggedT m) :: Type -> Constraint Source # askGen :: GraphulaLoggedT m (IORef QCGen) Source # logNode :: Logging (GraphulaLoggedT m) a => a -> GraphulaLoggedT m () Source # | |
MonadIO m => MonadGraphulaBackend (GraphulaT n m) Source # | |
class GHasDependencies nodeTyProxy depsTyProxy node deps where Source #
genericDependsOn :: nodeTyProxy -> depsTyProxy -> node -> deps -> node Source #
Instances
(TypeError ('Text "Use \8216()\8217 instead of \8216Void\8217 for datatypes with no dependencies in" :$$: DependenciesTypeInstance nodeTy depsTy) :: Constraint) => GHasDependencies (Proxy nodeTy) (Proxy depsTy) node Void Source # | |
Defined in Graphula.Internal | |
(TypeError ('Text "A datatype with no constructors can't use the dependencies in" :$$: DependenciesTypeInstance nodeTy depsTy) :: Constraint) => GHasDependencies (Proxy nodeTy) (Proxy depsTy) Void (Either deps rest) Source # | |
Defined in Graphula.Internal | |
GHasDependencies (Proxy nodeTy) (Proxy depsTy) Void (Either () Void) Source # | |
Defined in Graphula.Internal | |
(TypeError ('Text "Cannot automatically find dependencies for sum type or use a sum type as a dependency in" :$$: DependenciesTypeInstance nodeTy depsTy) :: Constraint) => GHasDependencies (Proxy nodeTy) (Proxy depsTy) (Either left1 (Either right1 rest1)) (Either left2 (Either right2 rest2)) Source # | |
(TypeError ('Text "Cannot automatically use a sum type as dependencies in" :$$: DependenciesTypeInstance nodeTy depsTy) :: Constraint) => GHasDependencies (Proxy nodeTy) (Proxy depsTy) (Either node Void) (Either left (Either right rest)) Source # | |
(TypeError ('Text "Cannot automatically find dependencies for sum type in" :$$: DependenciesTypeInstance nodeTy depsTy) :: Constraint) => GHasDependencies (Proxy nodeTy) (Proxy depsTy) (Either left (Either right rest)) (Either deps Void) Source # | |
(FindMatches nodeTy depsTy node deps ~ fields, GHasDependenciesRecursive (Proxy fields) node deps) => GHasDependencies (Proxy nodeTy) (Proxy depsTy) (Either node Void) (Either deps Void) Source # | |
data KeySourceType Source #
SourceDefault | Generate keys using the database's |
SourceArbitrary | |
SourceExternal | Always explicitly pass an external key |
class GenerateKeyInternal (s :: KeySourceType) a where Source #
Handle key generation for
and SourceDefault
SourceArbitrary
Ths could be a single-parameter class, but carrying the a
around
lets us give a better error message when
is called instead
of node
.nodeKeyed
type KeyConstraint s a :: Constraint Source #
generateKey :: KeyConstraint s a => Gen (Maybe (Key a)) Source #
Instances
GenerateKeyInternal 'SourceDefault a Source # | |
Defined in Graphula.Internal type KeyConstraint 'SourceDefault a Source # | |
GenerateKeyInternal 'SourceArbitrary a Source # | |
Defined in Graphula.Internal type KeyConstraint 'SourceArbitrary a Source # | |
(TypeError ((((((((((('Text "Cannot generate a value of type " :<>: Quote ('ShowType a)) :<>: 'Text " using ") :<>: Quote ('Text "node")) :<>: 'Text " since") :$$: 'Text "") :$$: (('Text " instance HasDependencies " :<>: 'ShowType a) :<>: 'Text " where")) :$$: (((('Text " " :<>: 'Text "type KeySource ") :<>: 'ShowType a) :<>: 'Text " = ") :<>: 'ShowType 'SourceExternal)) :$$: 'Text "") :$$: 'Text "Possible fixes include:") :$$: ((('Text "\8226 Use " :<>: Quote ('Text "nodeKeyed")) :<>: 'Text " instead of ") :<>: Quote ('Text "node"))) :$$: ((((('Text "\8226 Change " :<>: Quote ('Text "KeySource " :<>: 'ShowType a)) :<>: 'Text " to ") :<>: 'Text "'SourceDefault") :<>: 'Text " or ") :<>: 'Text "'SourceArbitrary")) :: Constraint) => GenerateKeyInternal 'SourceExternal a Source # | Explicit instance for Rendered: Cannot generate a value of type ‘X’ using ‘node’ since instance HasDependencies X where type KeySource X = 'SourceExternal Possible fixes include: • Use ‘nodeKeyed’ instead of ‘node’ • Change ‘KeySource X’ to 'SourceDefault or 'SourceArbitrary |
Defined in Graphula.Internal type KeyConstraint 'SourceExternal a Source # |
class NoConstraint a Source #
Graphula accepts constraints for various uses. Frontends do not always
utilize these constraints. NoConstraint
is a universal class that all
types inhabit. It has no behavior and no additional constraints.
Instances
NoConstraint a Source # | |
Defined in Graphula.Internal |