avers-0.0.17.1: empty

Safe HaskellNone
LanguageHaskell2010

Avers.Types

Synopsis

Documentation

class Pk a where Source #

Pk - Types which can be converted to a database primary key.

Minimal complete definition

toPk

Methods

toPk :: a -> Text Source #

newtype Path Source #

Path

Constructors

Path 

Fields

Instances

Eq Path Source # 

Methods

(==) :: Path -> Path -> Bool #

(/=) :: Path -> Path -> Bool #

Ord Path Source # 

Methods

compare :: Path -> Path -> Ordering #

(<) :: Path -> Path -> Bool #

(<=) :: Path -> Path -> Bool #

(>) :: Path -> Path -> Bool #

(>=) :: Path -> Path -> Bool #

max :: Path -> Path -> Path #

min :: Path -> Path -> Path #

Show Path Source # 

Methods

showsPrec :: Int -> Path -> ShowS #

show :: Path -> String #

showList :: [Path] -> ShowS #

IsString Path Source # 

Methods

fromString :: String -> Path #

Generic Path Source # 

Associated Types

type Rep Path :: * -> * #

Methods

from :: Path -> Rep Path x #

to :: Rep Path x -> Path #

ToJSON Path Source # 
FromJSON Path Source # 
ToDatum Path Source # 

Methods

toDatum :: Path -> Datum #

FromDatum Path Source # 
type Rep Path Source # 
type Rep Path = D1 (MetaData "Path" "Avers.Types" "avers-0.0.17.1-5bAZHu7ABPDLnacsfr9X8" True) (C1 (MetaCons "Path" PrefixI True) (S1 (MetaSel (Just Symbol "unPath") NoSourceUnpackedness NoSourceStrictness DecidedLazy) (Rec0 Text)))

rootPath :: Path Source #

This path refers to the root of an object. It is only used in Set operations.

newtype ObjId Source #

ObjId

Constructors

ObjId 

Fields

Instances

Eq ObjId Source # 

Methods

(==) :: ObjId -> ObjId -> Bool #

(/=) :: ObjId -> ObjId -> Bool #

Ord ObjId Source # 

Methods

compare :: ObjId -> ObjId -> Ordering #

(<) :: ObjId -> ObjId -> Bool #

(<=) :: ObjId -> ObjId -> Bool #

(>) :: ObjId -> ObjId -> Bool #

(>=) :: ObjId -> ObjId -> Bool #

max :: ObjId -> ObjId -> ObjId #

min :: ObjId -> ObjId -> ObjId #

Show ObjId Source # 

Methods

showsPrec :: Int -> ObjId -> ShowS #

show :: ObjId -> String #

showList :: [ObjId] -> ShowS #

Generic ObjId Source # 

Associated Types

type Rep ObjId :: * -> * #

Methods

from :: ObjId -> Rep ObjId x #

to :: Rep ObjId x -> ObjId #

ToJSON ObjId Source # 
FromJSON ObjId Source # 
ToDatum ObjId Source # 

Methods

toDatum :: ObjId -> Datum #

FromDatum ObjId Source # 
Pk ObjId Source # 

Methods

toPk :: ObjId -> Text Source #

type Rep ObjId Source # 
type Rep ObjId = D1 (MetaData "ObjId" "Avers.Types" "avers-0.0.17.1-5bAZHu7ABPDLnacsfr9X8" True) (C1 (MetaCons "ObjId" PrefixI True) (S1 (MetaSel (Just Symbol "unObjId") NoSourceUnpackedness NoSourceStrictness DecidedLazy) (Rec0 Text)))

rootObjId :: ObjId Source #

The root object id is used for object created internally or when there is no applicable creator.

newtype RevId Source #

RevId

Constructors

RevId 

Fields

Instances

Enum RevId Source # 
Eq RevId Source # 

Methods

(==) :: RevId -> RevId -> Bool #

(/=) :: RevId -> RevId -> Bool #

Ord RevId Source # 

Methods

compare :: RevId -> RevId -> Ordering #

(<) :: RevId -> RevId -> Bool #

(<=) :: RevId -> RevId -> Bool #

(>) :: RevId -> RevId -> Bool #

(>=) :: RevId -> RevId -> Bool #

max :: RevId -> RevId -> RevId #

min :: RevId -> RevId -> RevId #

Show RevId Source # 

Methods

showsPrec :: Int -> RevId -> ShowS #

show :: RevId -> String #

showList :: [RevId] -> ShowS #

Generic RevId Source # 

Associated Types

type Rep RevId :: * -> * #

Methods

from :: RevId -> Rep RevId x #

to :: Rep RevId x -> RevId #

ToJSON RevId Source # 
FromJSON RevId Source # 
ToDatum RevId Source # 

Methods

toDatum :: RevId -> Datum #

FromDatum RevId Source # 
Pk RevId Source # 

Methods

toPk :: RevId -> Text Source #

type Rep RevId Source # 
type Rep RevId = D1 (MetaData "RevId" "Avers.Types" "avers-0.0.17.1-5bAZHu7ABPDLnacsfr9X8" True) (C1 (MetaCons "RevId" PrefixI True) (S1 (MetaSel (Just Symbol "unRevId") NoSourceUnpackedness NoSourceStrictness DecidedLazy) (Rec0 Int)))

zeroRevId :: RevId Source #

The RevId which is used for the initial snapshot.

data ObjectId Source #

ObjectId

Constructors

BaseObjectId !ObjId

The base object whose snapshots contain the actual content.

ReleaseObjectId !ObjId !RevId

An object describing a particualar release of the base object.

AuthorizationObjectId !ObjId

Object which contains authorization rules.

Instances

Eq ObjectId Source # 
Ord ObjectId Source # 
Show ObjectId Source # 
Generic ObjectId Source # 

Associated Types

type Rep ObjectId :: * -> * #

Methods

from :: ObjectId -> Rep ObjectId x #

to :: Rep ObjectId x -> ObjectId #

ToJSON ObjectId Source # 
FromJSON ObjectId Source # 
ToDatum ObjectId Source # 

Methods

toDatum :: ObjectId -> Datum #

FromDatum ObjectId Source # 
Pk ObjectId Source # 

Methods

toPk :: ObjectId -> Text Source #

type Rep ObjectId Source # 

data Operation Source #

The operations that can be applied to JSON values.

Constructors

Set

Set is applied to Objects. It is used for adding, updating and deleting properties from the object.

Fields

Splice

Splice is used to manipulate Arrays. It can remove and insert multiple elements in a single operation.

Fields

Instances

Eq Operation Source # 
Show Operation Source # 
Generic Operation Source # 

Associated Types

type Rep Operation :: * -> * #

ToJSON Operation Source # 
FromJSON Operation Source # 
ToDatum Operation Source # 

Methods

toDatum :: Operation -> Datum #

FromDatum Operation Source # 
type Rep Operation Source # 

data PatchError Source #

Constructors

UnknownPatchError !Text 

Instances

Show PatchError Source # 
Generic PatchError Source # 

Associated Types

type Rep PatchError :: * -> * #

type Rep PatchError Source # 
type Rep PatchError = D1 (MetaData "PatchError" "Avers.Types" "avers-0.0.17.1-5bAZHu7ABPDLnacsfr9X8" False) (C1 (MetaCons "UnknownPatchError" PrefixI False) (S1 (MetaSel (Nothing Symbol) NoSourceUnpackedness SourceStrict DecidedStrict) (Rec0 Text)))

data Object Source #

data Patch Source #

Patch

initialSnapshot :: ObjectId -> Snapshot Source #

The initial snapshot on top of which all future patches are applied.

(deriveJSONOptions "release") ''Release)

newtype SecretId Source #

SecretId

Constructors

SecretId 

Fields

data Secret Source #

Secret

A Secret is a password (encrypted with scrypt) that is attached to a SecretId (for example the ObjId of an account).

It is up to you to ensure that SecretIds are unique. If you use ObjIds then they by definition are.

Constructors

Secret 

newtype BlobId Source #

BlobId

Constructors

BlobId 

Fields

Instances

Show BlobId Source # 
Generic BlobId Source # 

Associated Types

type Rep BlobId :: * -> * #

Methods

from :: BlobId -> Rep BlobId x #

to :: Rep BlobId x -> BlobId #

ToJSON BlobId Source # 
FromJSON BlobId Source # 
ToDatum BlobId Source # 

Methods

toDatum :: BlobId -> Datum #

FromDatum BlobId Source # 
Pk BlobId Source # 

Methods

toPk :: BlobId -> Text Source #

type Rep BlobId Source # 
type Rep BlobId = D1 (MetaData "BlobId" "Avers.Types" "avers-0.0.17.1-5bAZHu7ABPDLnacsfr9X8" True) (C1 (MetaCons "BlobId" PrefixI True) (S1 (MetaSel (Just Symbol "unBlobId") NoSourceUnpackedness NoSourceStrictness DecidedLazy) (Rec0 Text)))

data Blob Source #

Blob

Constructors

Blob 

Instances

data Session Source #

The session record that is stored in the database.

A session is a unique identifier attached to a particular object. It contains the creation date and when it was last accessed. If you need to store additional data for a session, we recommend to use cookies.

data AversError Source #

Instances

Show AversError Source # 
Generic AversError Source # 

Associated Types

type Rep AversError :: * -> * #

MonadError AversError Avers Source # 

Methods

throwError :: AversError -> Avers a #

catchError :: Avers a -> (AversError -> Avers a) -> Avers a #

type Rep AversError Source # 

data ObjectType a Source #

An ObjectType describes a particular type of object that is managed by Avers.

Constructors

ObjectType 

Fields

data Config Source #

Configuration of the Avers monad.

Constructors

Config 

Fields

data Change Source #

A change in the system, for example a new object, patch, release, blob etc.

Constructors

CPatch !Patch

A new patch was created.

Instances

Show Change Source # 
Generic Change Source # 

Associated Types

type Rep Change :: * -> * #

Methods

from :: Change -> Rep Change x #

to :: Rep Change x -> Change #

ToJSON Change Source # 
type Rep Change Source # 
type Rep Change = D1 (MetaData "Change" "Avers.Types" "avers-0.0.17.1-5bAZHu7ABPDLnacsfr9X8" False) (C1 (MetaCons "CPatch" PrefixI False) (S1 (MetaSel (Nothing Symbol) NoSourceUnpackedness SourceStrict DecidedStrict) (Rec0 Patch)))

data Handle Source #

Constructors

Handle 

Fields

Instances

MonadState Handle Avers Source # 

Methods

get :: Avers Handle #

put :: Handle -> Avers () #

state :: (Handle -> (a, Handle)) -> Avers a #

newtype Avers a Source #

Constructors

Avers 

Instances

Monad Avers Source # 

Methods

(>>=) :: Avers a -> (a -> Avers b) -> Avers b #

(>>) :: Avers a -> Avers b -> Avers b #

return :: a -> Avers a #

fail :: String -> Avers a #

Functor Avers Source # 

Methods

fmap :: (a -> b) -> Avers a -> Avers b #

(<$) :: a -> Avers b -> Avers a #

Applicative Avers Source # 

Methods

pure :: a -> Avers a #

(<*>) :: Avers (a -> b) -> Avers a -> Avers b #

(*>) :: Avers a -> Avers b -> Avers b #

(<*) :: Avers a -> Avers b -> Avers a #

MonadIO Avers Source # 

Methods

liftIO :: IO a -> Avers a #

MonadAvers Avers Source # 

Methods

liftAvers :: Avers a -> Avers a Source #

MonadError AversError Avers Source # 

Methods

throwError :: AversError -> Avers a #

catchError :: Avers a -> (AversError -> Avers a) -> Avers a #

MonadState Handle Avers Source # 

Methods

get :: Avers Handle #

put :: Handle -> Avers () #

state :: (Handle -> (a, Handle)) -> Avers a #

class Monad m => MonadAvers m where Source #

Minimal complete definition

liftAvers

Methods

liftAvers :: Avers a -> m a Source #

Instances

data View obj a Source #

Constructors

View 

Fields

data SomeView obj where Source #

Constructors

SomeView :: (ToDatum a, FromDatum a, FromJSON obj, ToJSON a) => View obj a -> SomeView obj