graphula-2.1.0.0: A simple interface for generating persistent data and linking its dependencies
Safe HaskellSafe-Inferred
LanguageHaskell2010

Graphula.Key

Description

Convenience functions for working with Key dependencies

Synopsis

Documentation

onlyKey :: Entity a -> Only (Key a) Source #

Equivalent to Only . entityKey

keys :: EntityKeys a => a -> Keys a Source #

type family Keys a Source #

Type-class for turning a tuple of Entity into a tuple of Key

For example, given:

instance HasDependencies Course where
  type Dependencies Course = (SchoolId, TeacherId)

You would have to do,

course <- node @Course (entityKey school, entityKey teacher) mempty

This type-class allows you to do:

course <- node @Course (keys (school, teacher)) mempty

The type class instances currently scale up 4-tuple Dependencies.

Instances

Instances details
type Keys (Only (Entity a)) Source # 
Instance details

Defined in Graphula.Key

type Keys (Only (Entity a)) = Only (Key a)
type Keys (Entity a) Source # 
Instance details

Defined in Graphula.Key

type Keys (Entity a) = Key a
type Keys (Entity a, Entity b) Source # 
Instance details

Defined in Graphula.Key

type Keys (Entity a, Entity b) = (Key a, Key b)
type Keys (Entity a, Entity b, Entity c) Source # 
Instance details

Defined in Graphula.Key

type Keys (Entity a, Entity b, Entity c) = (Key a, Key b, Key c)
type Keys (Entity a, Entity b, Entity c, Entity d) Source # 
Instance details

Defined in Graphula.Key

type Keys (Entity a, Entity b, Entity c, Entity d) = (Key a, Key b, Key c, Key d)