Safe Haskell | None |
---|---|
Language | Haskell2010 |
- type APIKey = Text
- type Collection = Text
- type Key = Text
- type Ref = Text
- type Timestamp = Integer
- type Location = Text
- type RestCall a = Options -> String -> IO (Response a)
- type Limit = Int
- type Offset = Int
- type IfMatch' = Maybe Ref
- data IfMatch
- = IfMatch Ref
- | IfNoneMatch Ref
- | NoMatch
- type Range a = (RangeEnd a, RangeEnd a)
- data RangeEnd a
- type KVList v = ResultList (ResultItem Path v)
- data TombstoneItem v
- = TombstoneItem { }
- | LiveItem { }
- _TombstoneItem :: Prism' (TombstoneItem v) (TombstoneItem v)
- _LiveItem :: Prism' (TombstoneItem v) (TombstoneItem v)
- livePath :: forall v. Traversal' (TombstoneItem v) Path
- liveTime :: forall v. Traversal' (TombstoneItem v) Timestamp
- liveValue :: forall v v. Traversal (TombstoneItem v) (TombstoneItem v) (Maybe v) (Maybe v)
- tombstonePath :: forall v. Traversal' (TombstoneItem v) Path
- tombstoneTime :: forall v. Traversal' (TombstoneItem v) Timestamp
- type EventList a b = ResultList (EventItem a b)
- type EventType = Text
- data EventPath = EventPath {
- _eventPath :: !Path
- _eventPathType :: !EventType
- _eventPathTime :: !Timestamp
- _eventPathOrd :: !Int
- eventPath :: Lens' EventPath Path
- eventPathType :: Lens' EventPath EventType
- eventPathTime :: Lens' EventPath Timestamp
- eventPathOrd :: Lens' EventPath Int
- data EventItem a b = EventItem {
- _eventItem :: !(ResultItem EventPath a)
- _eventTime :: !Timestamp
- _eventOrd :: !Int
- eventItem :: forall a b a b. Lens (EventItem a b) (EventItem a b) (ResultItem EventPath a) (ResultItem EventPath a)
- eventTime :: forall a b b. Lens (EventItem a b) (EventItem a b) Timestamp Timestamp
- eventOrd :: forall a b b. Lens (EventItem a b) (EventItem a b) Int Int
- type RelKind = Text
- type RelList a b = ResultList (ResultItem Path b)
- type QueryText = Text
- data SearchList v = SearchList {
- _searchResults :: !(ResultList (SearchItem v))
- _searchTotal :: !Int
- searchResults :: forall v v. Lens (SearchList v) (SearchList v) (ResultList (SearchItem v)) (ResultList (SearchItem v))
- searchTotal :: forall v. Lens' (SearchList v) Int
- data SearchItem v = SearchItem {
- _searchItem :: !(ResultItem Path v)
- _searchScore :: !Double
- searchItem :: forall v v. Lens (SearchItem v) (SearchItem v) (ResultItem Path v) (ResultItem Path v)
- searchScore :: forall v. Lens' (SearchItem v) Double
- data Session = Session {
- _sessionURL :: !Text
- _sessionKey :: !APIKey
- _sessionVersion :: !Int
- _sessionOptions :: !Options
- sessionURL :: Lens' Session Text
- sessionKey :: Lens' Session APIKey
- sessionVersion :: Lens' Session Int
- sessionOptions :: Lens' Session Options
- class (ToJSON a, FromJSON a) => OrchestrateData a where
- tableName :: a -> Collection
- dataKey :: a -> Key
- newtype OrchestrateT m a = OrchestrateT {
- runOrchestrate :: ExceptT SomeException (ReaderT Session m) a
- type OrchestrateIO = OrchestrateT IO
- type Orchestrate = OrchestrateT Identity
- data ResultList i = ResultList {
- _resultCount :: !Int
- _resultList :: ![i]
- _resultPrev :: !(Maybe Location)
- _resultNext :: !(Maybe Location)
- resultCount :: forall i. Lens' (ResultList i) Int
- resultList :: forall i i. Lens (ResultList i) (ResultList i) [i] [i]
- resultPrev :: forall i. Lens' (ResultList i) (Maybe Location)
- resultNext :: forall i. Lens' (ResultList i) (Maybe Location)
- data ResultItem p v = ResultItem {
- _itemPath :: !p
- _itemValue :: !v
- itemPath :: forall p v p. Lens (ResultItem p v) (ResultItem p v) p p
- itemValue :: forall p v v. Lens (ResultItem p v) (ResultItem p v) v v
- data Path = Path {
- _itemCollection :: !Collection
- _itemKey :: !Key
- _itemRef :: !Ref
- itemCollection :: Lens' Path Collection
- itemKey :: Lens' Path Key
- itemRef :: Lens' Path Ref
- ask :: MonadReader r m => m r
- asks :: MonadReader r m => (r -> a) -> m a
- throwError :: MonadError e m => forall a. e -> m a
- catchError :: MonadError e m => forall a. m a -> (e -> m a) -> m a
General Types
Aliases
type Collection = Text Source
Result Limits
Conditional API Calls
A richer type than IfMatch
for specifying conditional calls.
IfMatch Ref | Only perform the action if the ref does exist. |
IfNoneMatch Ref | Only perform the action if the ref does not exist. |
NoMatch | Always perform the action. |
Ranges
type Range a = (RangeEnd a, RangeEnd a) Source
This is a range tuple. Each end can be specified separately.
This represents the end of a range.
Key/Value Types
type KVList v = ResultList (ResultItem Path v) Source
A list of data returned by listV
.
v
- The type of the data contained in the list.
Ref Types
data TombstoneItem v Source
TombstoneItem
data represents the data values in the database.
TombstoneItem |
|
| |
LiveItem |
|
Show v => Show (TombstoneItem v) Source | |
FromJSON v => FromJSON (TombstoneItem v) Source |
Type Lenses and Prisms
_TombstoneItem :: Prism' (TombstoneItem v) (TombstoneItem v) Source
A Prism'
into data created with the TombstoneItem
constructor.
_LiveItem :: Prism' (TombstoneItem v) (TombstoneItem v) Source
livePath :: forall v. Traversal' (TombstoneItem v) Path Source
liveTime :: forall v. Traversal' (TombstoneItem v) Timestamp Source
liveValue :: forall v v. Traversal (TombstoneItem v) (TombstoneItem v) (Maybe v) (Maybe v) Source
tombstonePath :: forall v. Traversal' (TombstoneItem v) Path Source
tombstoneTime :: forall v. Traversal' (TombstoneItem v) Timestamp Source
Event Types
Type Aliases
type EventList a b = ResultList (EventItem a b) Source
A list of events returned by listEvents
.
This data type uses two parameters:
a
- The type of data being stored for the event.
b
- A phantom type for the type of data associated with the event. This data must also be stored in Orchestrate using the Database.Orchestrate.KeyValue API.
Event Location
The data necessary to access an event.
EventPath | |
|
Event Data
One item in an EventList
.
This data type uses two parameters:
a
- The type of data being stored for the event.
b
- A phantom type for the type of data associated with the event. This data must also be stored in Orchestrate using the Database.Orchestrate.KeyValue API.
EventItem | |
|
eventItem :: forall a b a b. Lens (EventItem a b) (EventItem a b) (ResultItem EventPath a) (ResultItem EventPath a) Source
Graph Types
type RelList a b = ResultList (ResultItem Path b) Source
A list of edges returned by getRel
.
This datatype uses two parameters:
a
- The data type for the edge's origin node.
b
- The data type for the edge's target node.
Search Types
List of Search Results
data SearchList v Source
The collection of search results.
SearchList | |
|
Show v => Show (SearchList v) Source | |
FromJSON v => FromJSON (SearchList v) Source |
searchResults :: forall v v. Lens (SearchList v) (SearchList v) (ResultList (SearchItem v)) (ResultList (SearchItem v)) Source
searchTotal :: forall v. Lens' (SearchList v) Int Source
Single Search Result
data SearchItem v Source
A single search item.
SearchItem | |
|
Show v => Show (SearchItem v) Source | |
FromJSON v => FromJSON (SearchItem v) Source |
searchItem :: forall v v. Lens (SearchItem v) (SearchItem v) (ResultItem Path v) (ResultItem Path v) Source
searchScore :: forall v. Lens' (SearchItem v) Double Source
Session
The data for a session with the Orchestrate database.
Session | |
|
Orchestrate Types
Data
class (ToJSON a, FromJSON a) => OrchestrateData a where Source
This is a class for data that can be stored in an Orchestrate Key/Value store. See Database.Orchestrate.KeyValue for where this is used.
Monad Types
newtype OrchestrateT m a Source
The type for the Orchestrate monad. All interactions with the
Orchestrate API are run in this monad. It combines a reader over
Session
data with error handling using EitherT
SomeException
.
MonadTrans OrchestrateT Source | |
Monad m => MonadReader Session (OrchestrateT m) Source | |
Monad m => MonadError SomeException (OrchestrateT m) Source | |
Monad m => Monad (OrchestrateT m) Source | |
Functor m => Functor (OrchestrateT m) Source | |
Monad m => Applicative (OrchestrateT m) Source | |
MonadIO m => MonadIO (OrchestrateT m) Source |
type OrchestrateIO = OrchestrateT IO Source
OrchestrateT
over IO
, the way God intended.
type Orchestrate = OrchestrateT Identity Source
OrchestrateT
over Identity
. Only the most useless monad ever.
Result Types
Lists of Results
data ResultList i Source
A parameterized list of results returned by an API call.
i
- the type of the data contained.
ResultList | |
|
Show i => Show (ResultList i) Source | |
FromJSON r => FromJSON (ResultList r) Source |
resultCount :: forall i. Lens' (ResultList i) Int Source
resultList :: forall i i. Lens (ResultList i) (ResultList i) [i] [i] Source
resultPrev :: forall i. Lens' (ResultList i) (Maybe Location) Source
resultNext :: forall i. Lens' (ResultList i) (Maybe Location) Source
Individual Results
data ResultItem p v Source
A parameterized single item returned in a collection by an API call.
p
- the type of the path data to this data.
v
- the type of the value for this data.
ResultItem | |
|
(Show p, Show v) => Show (ResultItem p v) Source | |
(ToJSON p, ToJSON v) => ToJSON (ResultItem p v) Source | |
(FromJSON p, FromJSON v) => FromJSON (ResultItem p v) Source |
itemPath :: forall p v p. Lens (ResultItem p v) (ResultItem p v) p p Source
itemValue :: forall p v v. Lens (ResultItem p v) (ResultItem p v) v v Source
Rich Item Locations (Paths)
This represents the unique access information for a value in the store.
Path | |
|
Re-exports
Accessing Data
ask :: MonadReader r m => m r
Retrieves the monad environment.
:: forall (m :: * -> *). MonadReader r m | |
=> (r -> a) | The selector function to apply to the environment. |
-> m a |
Retrieves a function of the current environment.
Throwing and Handling Errors
throwError :: MonadError e m => forall a. e -> m a
Is used within a monadic computation to begin exception processing.
catchError :: MonadError e m => forall a. m a -> (e -> m a) -> m a
A handler function to handle previous errors and return to normal execution. A common idiom is:
do { action1; action2; action3 } `catchError` handler
where the action
functions can call throwError
.
Note that handler
and the do-block must have the same return type.