eventstore-0.14.0.2: EventStore TCP Client

Copyright(C) 2014 Yorick Laupa
License(see the file LICENSE)
MaintainerYorick Laupa <yo.eight@gmail.com>
Stabilityprovisional
Portabilitynon-portable
Safe HaskellNone
LanguageHaskell2010

Database.EventStore

Contents

Description

 

Synopsis

Connection

data Connection Source #

Represents a connection to a single EventStore node.

data ConnectionType Source #

Gathers every connection type handled by the client.

Constructors

Static String Int

HostName and Port.

Cluster ClusterSettings 
Dns ByteString (Maybe DnsServer) Int

Domain name, optional DNS server and port.

data ConnectionException Source #

Type of connection issue that can arise during the communication with the server.

Constructors

MaxAttemptConnectionReached

The max reconnection attempt threshold has been reached.

ClosedConnection

Use of a close Connection.

WrongPackageFraming

TCP package sent by the server had a wrong framing.

PackageParsingError String

Server sent a malformed TCP package.

data Credentials Source #

Holds login and password information.

data Retry Source #

Represents reconnection strategy.

atMost :: Int -> Retry Source #

Indicates how many times we should try to reconnect to the server. A value less than or equal to 0 means no retry.

keepRetrying :: Retry Source #

Indicates we should try to reconnect to the server until the end of the Universe.

credentials Source #

Arguments

:: ByteString

Login

-> ByteString

Password

-> Credentials 

Creates a Credentials given a login and a password.

defaultSettings :: Settings Source #

Default global settings. s_heartbeatInterval = 750 ms s_heartbeatTimeout = 1500 ms s_requireMaster = True s_credentials = Nothing s_retry = atMost 3 s_reconnect_delay_secs = 3 s_logger = Nothing

defaultSSLSettings :: TLSSettings -> Settings Source #

Default SSL settings based on defaultSettings.

connect :: Settings -> ConnectionType -> IO Connection Source #

Creates a new Connection to a single node. It maintains a full duplex connection to the EventStore. An EventStore Connection operates quite differently than say a SQL connection. Normally when you use an EventStore connection you want to keep the connection open for a much longer of time than when you use a SQL connection.

Another difference is that with the EventStore Connection all operations are handled in a full async manner (even if you call the synchronous behaviors). Many threads can use an EvenStore Connection at the same time or a single thread can make many asynchronous requests. To get the most performance out of the connection it is generally recommended to use it in this way.

shutdown :: Connection -> IO () Source #

Asynchronously closes the Connection.

waitTillClosed :: Connection -> IO () Source #

Waits the Connection to be closed.

connectionSettings :: Connection -> Settings Source #

Returns a Connection's Settings.

Cluster Connection

data ClusterSettings Source #

Contains settings related to a connection to a cluster.

Constructors

ClusterSettings 

Fields

data DnsServer Source #

Tells how the DNS server should be contacted.

data GossipSeed Source #

Represents a source of cluster gossip.

gossipSeedWithHeader :: String -> Int -> String -> GossipSeed Source #

Creates a GossipSeed with a specific HTTP header.

gossipSeedHost :: GossipSeed -> String Source #

Returns GossipSeed host IP address.

gossipSeedHeader :: GossipSeed -> String Source #

The host header to be sent when requesting gossip.

gossipSeedClusterSettings :: NonEmpty GossipSeed -> ClusterSettings Source #

Configures a ClusterSettings for connecting to a cluster using gossip seeds. clusterDns = "" clusterMaxDiscoverAttempts = 10 clusterExternalGossipPort = 0 clusterGossipTimeout = 1s

dnsClusterSettings :: ByteString -> ClusterSettings Source #

Configures a ClusterSettings for connecting to a cluster using DNS discovery. clusterMaxDiscoverAttempts = 10 clusterExternalGossipPort = 0 clusterGossipSeeds = Nothing clusterGossipTimeout = 1s

Event

data Event Source #

Contains event information like its type and data. Only used for write queries.

Instances

Eq Event Source # 

Methods

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

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

Show Event Source # 

Methods

showsPrec :: Int -> Event -> ShowS #

show :: Event -> String #

showList :: [Event] -> ShowS #

data EventType Source #

Constants for System event types.

Constructors

StreamDeletedType

Event type for stream deleted.

StatsCollectionType

Event type for statistics.

LinkToType

Event type for linkTo.

StreamMetadataType

Event type for stream metadata.

SettingsType

Event type for the system settings.

UserDefined Text

Event defined by the user.

createEvent Source #

Arguments

:: EventType

Event type

-> Maybe UUID

Event ID, generated if Nothing

-> EventData

Event data

-> Event 

Create an Event meant to be persisted.

withJson :: ToJSON a => a -> EventData Source #

Creates an event using JSON format

withJsonAndMetadata :: (ToJSON a, ToJSON b) => a -> b -> EventData Source #

Creates an event with metadata using JSON format.

withBinary :: ByteString -> EventData Source #

Creates an event using a binary format.

withBinaryAndMetadata :: ByteString -> ByteString -> EventData Source #

Creates an event with metadata using binary format.

Read Operations

data StreamMetadataResult Source #

Represents stream metadata as a series of properties for system data and a StreamMetadata object for user metadata.

Constructors

StreamMetadataResult 

Fields

NotFoundStreamMetadataResult

When the stream is either not found or 'no stream'.

Fields

DeletedStreamMetadataResult

When the stream is soft-deleted.

Fields

readEvent Source #

Arguments

:: Connection 
-> Text

Stream name

-> Int32

Event number

-> Bool

Resolve Link Tos

-> IO (Async (ReadResult RegularStream ReadEvent)) 

Reads a single event from given stream.

readAllEventsBackward Source #

Arguments

:: Connection 
-> Position 
-> Int32

Batch size

-> Bool

Resolve Link Tos

-> IO (Async AllSlice) 

Reads events from the $all stream backward

readAllEventsForward Source #

Arguments

:: Connection 
-> Position 
-> Int32

Batch size

-> Bool

Resolve Link Tos

-> IO (Async AllSlice) 

Reads events from the $all stream forward.

readStreamEventsBackward Source #

Arguments

:: Connection 
-> Text

Stream name

-> Int32

From event number

-> Int32

Batch size

-> Bool

Resolve Link Tos

-> IO (Async (ReadResult RegularStream StreamSlice)) 

Reads events from a given stream backward.

readStreamEventsForward Source #

Arguments

:: Connection 
-> Text

Stream name

-> Int32

From event number

-> Int32

Batch size

-> Bool

Resolve Link Tos

-> IO (Async (ReadResult RegularStream StreamSlice)) 

Reads events from a given stream forward.

getStreamMetadata :: Connection -> Text -> IO (Async StreamMetadataResult) Source #

Asynchronously gets the metadata of a stream.

Write Operations

data StreamACL Source #

Represents an access control list for a stream.

Constructors

StreamACL 

Fields

data StreamMetadata Source #

Represents stream metadata with strongly typed properties for system values and a dictionary-like interface for custom values.

Constructors

StreamMetadata 

Fields

getCustomPropertyValue :: StreamMetadata -> Text -> Maybe Value Source #

Gets a custom property value from metadata.

getCustomProperty :: FromJSON a => StreamMetadata -> Text -> Maybe a Source #

Get a custom property value from metadata.

emptyStreamACL :: StreamACL Source #

StreamACL with no role or users whatsoever.

deleteStream Source #

Arguments

:: Connection 
-> Text

Stream name

-> ExpectedVersion 
-> Maybe Bool

Hard delete

-> IO (Async DeleteResult) 

Deletes given stream.

sendEvent Source #

Arguments

:: Connection 
-> Text

Stream name

-> ExpectedVersion 
-> Event 
-> IO (Async WriteResult) 

Sends a single Event to given stream.

sendEvents Source #

Arguments

:: Connection 
-> Text

Stream name

-> ExpectedVersion 
-> [Event] 
-> IO (Async WriteResult) 

Sends a list of Event to given stream.

setStreamMetadata :: Connection -> Text -> ExpectedVersion -> StreamMetadata -> IO (Async WriteResult) Source #

Asynchronously sets the metadata for a stream.

Builder

type Builder a = Endo a Source #

Allows to build a structure using Monoid functions.

Stream ACL Builder

setReadRoles :: [Text] -> StreamACLBuilder Source #

Sets role names with read permission for the stream.

setReadRole :: Text -> StreamACLBuilder Source #

Sets a single role name with read permission for the stream.

setWriteRoles :: [Text] -> StreamACLBuilder Source #

Sets role names with write permission for the stream.

setWriteRole :: Text -> StreamACLBuilder Source #

Sets a single role name with write permission for the stream.

setDeleteRoles :: [Text] -> StreamACLBuilder Source #

Sets role names with delete permission for the stream.

setDeleteRole :: Text -> StreamACLBuilder Source #

Sets a single role name with delete permission for the stream.

setMetaReadRoles :: [Text] -> StreamACLBuilder Source #

Sets role names with metadata read permission for the stream.

setMetaReadRole :: Text -> StreamACLBuilder Source #

Sets a single role name with metadata read permission for the stream.

setMetaWriteRoles :: [Text] -> StreamACLBuilder Source #

Sets role names with metadata write permission for the stream.

setMetaWriteRole :: Text -> StreamACLBuilder Source #

Sets a single role name with metadata write permission for the stream.

Stream Metadata Builder

setMaxCount :: Int32 -> StreamMetadataBuilder Source #

Sets the maximum number of events allowed in the stream.

setMaxAge :: TimeSpan -> StreamMetadataBuilder Source #

Sets the maximum age of events allowed in the stream.

setTruncateBefore :: Int32 -> StreamMetadataBuilder Source #

Sets the event number from which previous events can be scavenged.

setCacheControl :: TimeSpan -> StreamMetadataBuilder Source #

Sets the amount of time for which the stream head is cachable.

setACL :: StreamACL -> StreamMetadataBuilder Source #

Overwrites any previous StreamACL by the given one in a StreamMetadataBuilder.

setCustomProperty :: ToJSON a => Text -> a -> StreamMetadataBuilder Source #

Sets a custom metadata property.

Transaction

data Transaction Source #

Represents a multi-request transaction with the EventStore.

startTransaction Source #

Arguments

:: Connection 
-> Text

Stream name

-> ExpectedVersion 
-> IO (Async Transaction) 

Starts a transaction on given stream.

transactionCommit :: Transaction -> IO (Async WriteResult) Source #

Asynchronously commits this transaction.

transactionRollback :: Transaction -> IO () Source #

There isn't such of thing in EventStore parlance. Basically, if you want to rollback, you just have to not transactionCommit a Transaction.

transactionWrite :: Transaction -> [Event] -> IO (Async ()) Source #

Asynchronously writes to a transaction in the EventStore.

Subscription

data Subscription t Source #

It's possible to subscribe to a stream and be notified when new events are written to that stream. There are three types of subscription which are available, all of which can be useful in different situations.

data SubDropReason Source #

Indicates why a subscription has been dropped.

Constructors

SubUnsubscribed

Subscription connection has been closed by the user.

SubAccessDenied

The current user is not allowed to operate on the supplied stream.

SubNotFound

Given stream name doesn't exist.

SubPersistDeleted

Given stream is deleted.

SubAborted

Occurs when the user shutdown the connection from the server or if the connection to the server is no longer possible.

SubNotAuthenticated (Maybe Text) 
SubServerError (Maybe Text)

Unexpected error from the server.

SubNotHandled !NotHandledReason !(Maybe MasterInfo) 
SubClientError !Text 
SubSubscriberMaxCountReached 

waitConfirmation :: Subscription a -> IO () Source #

Waits until the Subscription has been confirmed.

waitUnsubscribeConfirmed :: Subscription a -> IO () Source #

Wait until unsubscription has been confirmed by the server.

Volatile Subscription

data Regular Source #

Also referred as volatile subscription. For example, if a stream has 100 events in it when a subscriber connects, the subscriber can expect to see event number 101 onwards until the time the subscription is closed or dropped.

subscribe Source #

Arguments

:: Connection 
-> Text

Stream name

-> Bool

Resolve Link Tos

-> IO (Subscription Regular) 

Subcribes to given stream.

subscribeToAll Source #

Arguments

:: Connection 
-> Bool

Resolve Link Tos

-> IO (Subscription Regular) 

Subcribes to $all stream.

getSubId :: Subscription a -> IO SubscriptionId Source #

Gets the ID of the subscription.

getSubStream :: Subscription a -> Text Source #

Gets the subscription stream name.

isSubscribedToAll :: Subscription a -> Bool Source #

If the subscription is on the $all stream.

unsubscribe :: Subscription a -> IO () Source #

Asynchronously unsubscribe from the the stream.

nextEvent :: Subscription a -> IO ResolvedEvent Source #

Awaits for the next event.

getSubResolveLinkTos :: Subscription Regular -> Bool Source #

Determines whether or not any link events encontered in the stream will be resolved.

getSubLastCommitPos :: Subscription a -> IO Int64 Source #

The last commit position seen on the subscription (if this a subscription to $all stream).

getSubLastEventNumber :: Subscription a -> IO (Maybe Int32) Source #

The last event number seen on the subscription (if this is a subscription to a single stream).

Catch-up Subscription

data Catchup Source #

This kind of subscription specifies a starting point, in the form of an event number or transaction file position. The given function will be called for events from the starting point until the end of the stream, and then for subsequently written events.

For example, if a starting point of 50 is specified when a stream has 100 events in it, the subscriber can expect to see events 51 through 100, and then any events subsequently written until such time as the subscription is dropped or closed.

subscribeFrom Source #

Arguments

:: Connection 
-> Text

Stream name

-> Bool

Resolve Link Tos

-> Maybe Int32

Last checkpoint

-> Maybe Int32

Batch size

-> IO (Subscription Catchup) 

Subscribes to given stream. If last checkpoint is defined, this will readStreamEventsForward from that event number, otherwise from the beginning. Once last stream event reached up, a subscription request will be sent using subscribe.

subscribeToAllFrom Source #

Arguments

:: Connection 
-> Bool

Resolve Link Tos

-> Maybe Position

Last checkpoint

-> Maybe Int32

Batch size

-> IO (Subscription Catchup) 

Same as subscribeFrom but applied to $all stream.

waitTillCatchup :: Subscription Catchup -> IO () Source #

Waits until CatchupSubscription subscription catch-up its stream.

Persistent Subscription

data Persistent Source #

The server remembers the state of the subscription. This allows for many different modes of operations compared to a regular or catchup subscription where the client holds the subscription state. (Need EventStore >= v3.1.0).

data PersistentSubscriptionSettings Source #

Gathers every persistent subscription property.

Constructors

PersistentSubscriptionSettings 

Fields

data SystemConsumerStrategy Source #

System supported consumer strategies for use with persistent subscriptions.

Constructors

DispatchToSingle

Distributes events to a single client until it is full. Then round robin to the next client.

RoundRobin

Distributes events to each client in a round robin fashion.

data PersistActionException Source #

Enumerates all persistent action exceptions.

Constructors

PersistActionFail

The action failed.

PersistActionAlreadyExist

Happens when creating a persistent subscription on a stream with a group name already taken.

PersistActionDoesNotExist

An operation tried to do something on a persistent subscription or a stream that don't exist.

PersistActionAccessDenied

The current user is not allowed to operate on the supplied stream or persistent subscription.

PersistActionAborted

That action has been aborted because the user shutdown the connection to the server or the connection to the server is no longer possible.

acknowledge :: Subscription Persistent -> ResolvedEvent -> IO () Source #

Acknowledges that ResolvedEvent has been successfully processed.

acknowledgeEvents :: Subscription Persistent -> [ResolvedEvent] -> IO () Source #

Acknowledges those ResolvedEvents have been successfully processed.

failed :: Subscription Persistent -> ResolvedEvent -> NakAction -> Maybe Text -> IO () Source #

Mark a message that has failed processing. The server will take action based upon the action parameter.

eventsFailed :: Subscription Persistent -> [ResolvedEvent] -> NakAction -> Maybe Text -> IO () Source #

Mark messages that have failed processing. The server will take action based upon the action parameter.

notifyEventsProcessed :: Subscription Persistent -> [UUID] -> IO () Source #

Acknowledges those event ids have been successfully processed.

notifyEventsFailed :: Subscription Persistent -> NakAction -> Maybe Text -> [UUID] -> IO () Source #

Acknowledges those event ids have failed to be processed successfully.

defaultPersistentSubscriptionSettings :: PersistentSubscriptionSettings Source #

System default persistent subscription settings.

createPersistentSubscription :: Connection -> Text -> Text -> PersistentSubscriptionSettings -> IO (Async (Maybe PersistActionException)) Source #

Asynchronously create a persistent subscription group on a stream.

updatePersistentSubscription :: Connection -> Text -> Text -> PersistentSubscriptionSettings -> IO (Async (Maybe PersistActionException)) Source #

Asynchronously update a persistent subscription group on a stream.

deletePersistentSubscription :: Connection -> Text -> Text -> IO (Async (Maybe PersistActionException)) Source #

Asynchronously delete a persistent subscription group on a stream.

connectToPersistentSubscription :: Connection -> Text -> Text -> Int32 -> IO (Subscription Persistent) Source #

Asynchronously connect to a persistent subscription given a group on a stream.

Results

class Slice a where Source #

Gathers common slice operations.

Minimal complete definition

sliceEvents, sliceDirection, sliceEOS, sliceFrom, sliceNext

Associated Types

type Loc a Source #

Methods

sliceEvents :: a -> [ResolvedEvent] Source #

Gets slice's ResolvedEvents.

sliceDirection :: a -> ReadDirection Source #

Gets slice's reading direction.

sliceEOS :: a -> Bool Source #

If the slice reaches the end of the stream.

sliceFrom :: a -> Loc a Source #

Gets the starting location of this slice.

sliceNext :: a -> Loc a Source #

Gets the next location of this slice.

newtype DeleteResult Source #

Returned after deleting a stream. Position of the write.

Constructors

DeleteResult Position 

data WriteResult Source #

Returned after writing to a stream.

Constructors

WriteResult 

Fields

data ReadResult :: StreamType -> * -> * where Source #

Enumeration detailing the possible outcomes of reading a stream.

Instances

Functor (ReadResult t) Source # 

Methods

fmap :: (a -> b) -> ReadResult t a -> ReadResult t b #

(<$) :: a -> ReadResult t b -> ReadResult t a #

Foldable (ReadResult t) Source # 

Methods

fold :: Monoid m => ReadResult t m -> m #

foldMap :: Monoid m => (a -> m) -> ReadResult t a -> m #

foldr :: (a -> b -> b) -> b -> ReadResult t a -> b #

foldr' :: (a -> b -> b) -> b -> ReadResult t a -> b #

foldl :: (b -> a -> b) -> b -> ReadResult t a -> b #

foldl' :: (b -> a -> b) -> b -> ReadResult t a -> b #

foldr1 :: (a -> a -> a) -> ReadResult t a -> a #

foldl1 :: (a -> a -> a) -> ReadResult t a -> a #

toList :: ReadResult t a -> [a] #

null :: ReadResult t a -> Bool #

length :: ReadResult t a -> Int #

elem :: Eq a => a -> ReadResult t a -> Bool #

maximum :: Ord a => ReadResult t a -> a #

minimum :: Ord a => ReadResult t a -> a #

sum :: Num a => ReadResult t a -> a #

product :: Num a => ReadResult t a -> a #

Traversable (ReadResult t) Source # 

Methods

traverse :: Applicative f => (a -> f b) -> ReadResult t a -> f (ReadResult t b) #

sequenceA :: Applicative f => ReadResult t (f a) -> f (ReadResult t a) #

mapM :: Monad m => (a -> m b) -> ReadResult t a -> m (ReadResult t b) #

sequence :: Monad m => ReadResult t (m a) -> m (ReadResult t a) #

Eq a => Eq (ReadResult t a) Source # 

Methods

(==) :: ReadResult t a -> ReadResult t a -> Bool #

(/=) :: ReadResult t a -> ReadResult t a -> Bool #

Show a => Show (ReadResult t a) Source # 

Methods

showsPrec :: Int -> ReadResult t a -> ShowS #

show :: ReadResult t a -> String #

showList :: [ReadResult t a] -> ShowS #

data RecordedEvent Source #

Represents a previously written event.

Constructors

RecordedEvent 

Fields

data ReadEvent Source #

Represents the result of looking up a specific event number from a stream.

data Position Source #

A structure referring to a potential logical record position in the EventStore transaction file.

Constructors

Position 

Fields

data ReadDirection Source #

Represents the direction of read operation (both from $all an usual streams).

Constructors

Forward

From beginning to end

Backward

From end to beginning

data ResolvedEvent Source #

A structure representing a single event or an resolved link event.

Constructors

ResolvedEvent 

Fields

data OperationError Source #

Operation exception that can occurs on an operation response.

Constructors

WrongExpectedVersion Text ExpectedVersion

Stream and Expected Version

StreamDeleted Text

Stream

InvalidTransaction 
AccessDenied StreamName

Stream

InvalidServerResponse Command Command

Expected, Found

ProtobufDecodingError String 
ServerError (Maybe Text)

Reason

InvalidOperation Text 
NotAuthenticatedOp

Invalid operation state. If happens, it's a driver bug.

Aborted

Occurs when the user asked to close the connection or if the connection can't reconnect anymore.

data StreamName Source #

Represents a regular stream name or $all stream.

Constructors

StreamName Text 
AllStream 

isEventResolvedLink :: ResolvedEvent -> Bool Source #

Indicates whether this ResolvedEvent is a resolved link event.

resolvedEventOriginal :: ResolvedEvent -> RecordedEvent Source #

Returns the event that was read or which triggered the subscription.

If this ResolvedEvent represents a link event, the link will be the original event, otherwise it will be the event.

resolvedEventDataAsJson :: FromJSON a => ResolvedEvent -> Maybe a Source #

Tries to desarialize resolvedEventOriginal data as JSON.

resolvedEventOriginalStreamId :: ResolvedEvent -> Text Source #

The stream name of the original event.

resolvedEventOriginalId :: ResolvedEvent -> UUID Source #

The ID of the original event.

recordedEventDataAsJson :: FromJSON a => RecordedEvent -> Maybe a Source #

Tries to parse JSON object from the given RecordedEvent.

positionStart :: Position Source #

Representing the start of the transaction file.

positionEnd :: Position Source #

Representing the end of the transaction file.

Misc

data ExpectedVersion Source #

Constants used for expected version control.

The use of expected version can be a bit tricky especially when discussing idempotency assurances given by the EventStore.

The EventStore will assure idempotency for all operations using any value in ExpectedVersion except for anyStream. When using anyStream the EventStore will do its best to assure idempotency but will not guarantee idempotency.

anyVersion :: ExpectedVersion Source #

This write should not conflict with anything and should always succeed.

noStreamVersion :: ExpectedVersion Source #

The stream being written to should not yet exist. If it does exist treat that as a concurrency problem.

emptyStreamVersion :: ExpectedVersion Source #

The stream should exist and should be empty. If it does not exist or is not empty, treat that as a concurrency problem.

exactEventVersion :: Int32 -> ExpectedVersion Source #

States that the last event written to the stream should have a sequence number matching your expected value.

streamExists :: ExpectedVersion Source #

The stream should exist. If it or a metadata stream does not exist treat that as a concurrency problem.

Re-export

waitAsync :: MonadIO m => Async a -> m a #

waitSTM for any MonadIO

Since: 1.0.0

(<>) :: Semigroup a => a -> a -> a #

An associative operation.

(a <> b) <> c = a <> (b <> c)

If a is also a Monoid we further require

(<>) = mappend

data NonEmpty a :: * -> * #

Non-empty (and non-strict) list type.

Since: 4.9.0.0

Constructors

a :| [a] infixr 5 

Instances

Monad NonEmpty 

Methods

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

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

return :: a -> NonEmpty a #

fail :: String -> NonEmpty a #

Functor NonEmpty 

Methods

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

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

MonadFix NonEmpty 

Methods

mfix :: (a -> NonEmpty a) -> NonEmpty a #

Applicative NonEmpty 

Methods

pure :: a -> NonEmpty a #

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

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

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

Foldable NonEmpty 

Methods

fold :: Monoid m => NonEmpty m -> m #

foldMap :: Monoid m => (a -> m) -> NonEmpty a -> m #

foldr :: (a -> b -> b) -> b -> NonEmpty a -> b #

foldr' :: (a -> b -> b) -> b -> NonEmpty a -> b #

foldl :: (b -> a -> b) -> b -> NonEmpty a -> b #

foldl' :: (b -> a -> b) -> b -> NonEmpty a -> b #

foldr1 :: (a -> a -> a) -> NonEmpty a -> a #

foldl1 :: (a -> a -> a) -> NonEmpty a -> a #

toList :: NonEmpty a -> [a] #

null :: NonEmpty a -> Bool #

length :: NonEmpty a -> Int #

elem :: Eq a => a -> NonEmpty a -> Bool #

maximum :: Ord a => NonEmpty a -> a #

minimum :: Ord a => NonEmpty a -> a #

sum :: Num a => NonEmpty a -> a #

product :: Num a => NonEmpty a -> a #

Traversable NonEmpty 

Methods

traverse :: Applicative f => (a -> f b) -> NonEmpty a -> f (NonEmpty b) #

sequenceA :: Applicative f => NonEmpty (f a) -> f (NonEmpty a) #

mapM :: Monad m => (a -> m b) -> NonEmpty a -> m (NonEmpty b) #

sequence :: Monad m => NonEmpty (m a) -> m (NonEmpty a) #

Generic1 NonEmpty 

Associated Types

type Rep1 (NonEmpty :: * -> *) :: * -> * #

Methods

from1 :: NonEmpty a -> Rep1 NonEmpty a #

to1 :: Rep1 NonEmpty a -> NonEmpty a #

ToJSON1 NonEmpty 

Methods

liftToJSON :: (a -> Value) -> ([a] -> Value) -> NonEmpty a -> Value #

liftToJSONList :: (a -> Value) -> ([a] -> Value) -> [NonEmpty a] -> Value #

liftToEncoding :: (a -> Encoding) -> ([a] -> Encoding) -> NonEmpty a -> Encoding #

liftToEncodingList :: (a -> Encoding) -> ([a] -> Encoding) -> [NonEmpty a] -> Encoding #

FromJSON1 NonEmpty 

Methods

liftParseJSON :: (Value -> Parser a) -> (Value -> Parser [a]) -> Value -> Parser (NonEmpty a) #

liftParseJSONList :: (Value -> Parser a) -> (Value -> Parser [a]) -> Value -> Parser [NonEmpty a] #

MonadZip NonEmpty 

Methods

mzip :: NonEmpty a -> NonEmpty b -> NonEmpty (a, b) #

mzipWith :: (a -> b -> c) -> NonEmpty a -> NonEmpty b -> NonEmpty c #

munzip :: NonEmpty (a, b) -> (NonEmpty a, NonEmpty b) #

Zip NonEmpty 

Methods

zipWith :: (a -> b -> c) -> NonEmpty a -> NonEmpty b -> NonEmpty c #

zip :: NonEmpty a -> NonEmpty b -> NonEmpty (a, b) #

zap :: NonEmpty (a -> b) -> NonEmpty a -> NonEmpty b #

unzip :: NonEmpty (a, b) -> (NonEmpty a, NonEmpty b) #

Comonad NonEmpty 

Methods

extract :: NonEmpty a -> a #

duplicate :: NonEmpty a -> NonEmpty (NonEmpty a) #

extend :: (NonEmpty a -> b) -> NonEmpty a -> NonEmpty b #

ComonadApply NonEmpty 

Methods

(<@>) :: NonEmpty (a -> b) -> NonEmpty a -> NonEmpty b #

(@>) :: NonEmpty a -> NonEmpty b -> NonEmpty b #

(<@) :: NonEmpty a -> NonEmpty b -> NonEmpty a #

Keyed NonEmpty 

Methods

mapWithKey :: (Key NonEmpty -> a -> b) -> NonEmpty a -> NonEmpty b #

Zip NonEmpty 

Methods

zipWith :: (a -> b -> c) -> NonEmpty a -> NonEmpty b -> NonEmpty c #

zip :: NonEmpty a -> NonEmpty b -> NonEmpty (a, b) #

zap :: NonEmpty (a -> b) -> NonEmpty a -> NonEmpty b #

ZipWithKey NonEmpty 

Methods

zipWithKey :: (Key NonEmpty -> a -> b -> c) -> NonEmpty a -> NonEmpty b -> NonEmpty c #

zapWithKey :: NonEmpty (Key NonEmpty -> a -> b) -> NonEmpty a -> NonEmpty b #

Indexable NonEmpty 

Methods

index :: NonEmpty a -> Key NonEmpty -> a #

Lookup NonEmpty 

Methods

lookup :: Key NonEmpty -> NonEmpty a -> Maybe a #

Adjustable NonEmpty 

Methods

adjust :: (a -> a) -> Key NonEmpty -> NonEmpty a -> NonEmpty a #

replace :: Key NonEmpty -> a -> NonEmpty a -> NonEmpty a #

FoldableWithKey NonEmpty 

Methods

toKeyedList :: NonEmpty a -> [(Key NonEmpty, a)] #

foldMapWithKey :: Monoid m => (Key NonEmpty -> a -> m) -> NonEmpty a -> m #

foldrWithKey :: (Key NonEmpty -> a -> b -> b) -> b -> NonEmpty a -> b #

foldlWithKey :: (b -> Key NonEmpty -> a -> b) -> b -> NonEmpty a -> b #

FoldableWithKey1 NonEmpty 

Methods

foldMapWithKey1 :: Semigroup m => (Key NonEmpty -> a -> m) -> NonEmpty a -> m #

TraversableWithKey NonEmpty 

Methods

traverseWithKey :: Applicative f => (Key NonEmpty -> a -> f b) -> NonEmpty a -> f (NonEmpty b) #

mapWithKeyM :: Monad m => (Key NonEmpty -> a -> m b) -> NonEmpty a -> m (NonEmpty b) #

TraversableWithKey1 NonEmpty 

Methods

traverseWithKey1 :: Apply f => (Key NonEmpty -> a -> f b) -> NonEmpty a -> f (NonEmpty b) #

Apply NonEmpty 

Methods

(<.>) :: NonEmpty (a -> b) -> NonEmpty a -> NonEmpty b #

(.>) :: NonEmpty a -> NonEmpty b -> NonEmpty b #

(<.) :: NonEmpty a -> NonEmpty b -> NonEmpty a #

Bind NonEmpty 

Methods

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

join :: NonEmpty (NonEmpty a) -> NonEmpty a #

IsList (NonEmpty a) 

Associated Types

type Item (NonEmpty a) :: * #

Methods

fromList :: [Item (NonEmpty a)] -> NonEmpty a #

fromListN :: Int -> [Item (NonEmpty a)] -> NonEmpty a #

toList :: NonEmpty a -> [Item (NonEmpty a)] #

Eq a => Eq (NonEmpty a) 

Methods

(==) :: NonEmpty a -> NonEmpty a -> Bool #

(/=) :: NonEmpty a -> NonEmpty a -> Bool #

Data a => Data (NonEmpty a) 

Methods

gfoldl :: (forall d b. Data d => c (d -> b) -> d -> c b) -> (forall g. g -> c g) -> NonEmpty a -> c (NonEmpty a) #

gunfold :: (forall b r. Data b => c (b -> r) -> c r) -> (forall r. r -> c r) -> Constr -> c (NonEmpty a) #

toConstr :: NonEmpty a -> Constr #

dataTypeOf :: NonEmpty a -> DataType #

dataCast1 :: Typeable (* -> *) t => (forall d. Data d => c (t d)) -> Maybe (c (NonEmpty a)) #

dataCast2 :: Typeable (* -> * -> *) t => (forall d e. (Data d, Data e) => c (t d e)) -> Maybe (c (NonEmpty a)) #

gmapT :: (forall b. Data b => b -> b) -> NonEmpty a -> NonEmpty a #

gmapQl :: (r -> r' -> r) -> r -> (forall d. Data d => d -> r') -> NonEmpty a -> r #

gmapQr :: (r' -> r -> r) -> r -> (forall d. Data d => d -> r') -> NonEmpty a -> r #

gmapQ :: (forall d. Data d => d -> u) -> NonEmpty a -> [u] #

gmapQi :: Int -> (forall d. Data d => d -> u) -> NonEmpty a -> u #

gmapM :: Monad m => (forall d. Data d => d -> m d) -> NonEmpty a -> m (NonEmpty a) #

gmapMp :: MonadPlus m => (forall d. Data d => d -> m d) -> NonEmpty a -> m (NonEmpty a) #

gmapMo :: MonadPlus m => (forall d. Data d => d -> m d) -> NonEmpty a -> m (NonEmpty a) #

Ord a => Ord (NonEmpty a) 

Methods

compare :: NonEmpty a -> NonEmpty a -> Ordering #

(<) :: NonEmpty a -> NonEmpty a -> Bool #

(<=) :: NonEmpty a -> NonEmpty a -> Bool #

(>) :: NonEmpty a -> NonEmpty a -> Bool #

(>=) :: NonEmpty a -> NonEmpty a -> Bool #

max :: NonEmpty a -> NonEmpty a -> NonEmpty a #

min :: NonEmpty a -> NonEmpty a -> NonEmpty a #

Read a => Read (NonEmpty a) 
Show a => Show (NonEmpty a) 

Methods

showsPrec :: Int -> NonEmpty a -> ShowS #

show :: NonEmpty a -> String #

showList :: [NonEmpty a] -> ShowS #

Generic (NonEmpty a) 

Associated Types

type Rep (NonEmpty a) :: * -> * #

Methods

from :: NonEmpty a -> Rep (NonEmpty a) x #

to :: Rep (NonEmpty a) x -> NonEmpty a #

Semigroup (NonEmpty a) 

Methods

(<>) :: NonEmpty a -> NonEmpty a -> NonEmpty a #

sconcat :: NonEmpty (NonEmpty a) -> NonEmpty a #

stimes :: Integral b => b -> NonEmpty a -> NonEmpty a #

Hashable a => Hashable (NonEmpty a) 

Methods

hashWithSalt :: Int -> NonEmpty a -> Int #

hash :: NonEmpty a -> Int #

ToJSON a => ToJSON (NonEmpty a) 
FromJSON a => FromJSON (NonEmpty a) 
GrowingAppend (NonEmpty a) 
MonoPointed (NonEmpty a) 

Methods

opoint :: Element (NonEmpty a) -> NonEmpty a #

MonoTraversable (NonEmpty a) 

Methods

otraverse :: Applicative f => (Element (NonEmpty a) -> f (Element (NonEmpty a))) -> NonEmpty a -> f (NonEmpty a) #

omapM :: Applicative m => (Element (NonEmpty a) -> m (Element (NonEmpty a))) -> NonEmpty a -> m (NonEmpty a) #

MonoFoldable (NonEmpty a) 

Methods

ofoldMap :: Monoid m => (Element (NonEmpty a) -> m) -> NonEmpty a -> m #

ofoldr :: (Element (NonEmpty a) -> b -> b) -> b -> NonEmpty a -> b #

ofoldl' :: (a -> Element (NonEmpty a) -> a) -> a -> NonEmpty a -> a #

otoList :: NonEmpty a -> [Element (NonEmpty a)] #

oall :: (Element (NonEmpty a) -> Bool) -> NonEmpty a -> Bool #

oany :: (Element (NonEmpty a) -> Bool) -> NonEmpty a -> Bool #

onull :: NonEmpty a -> Bool #

olength :: NonEmpty a -> Int #

olength64 :: NonEmpty a -> Int64 #

ocompareLength :: Integral i => NonEmpty a -> i -> Ordering #

otraverse_ :: Applicative f => (Element (NonEmpty a) -> f b) -> NonEmpty a -> f () #

ofor_ :: Applicative f => NonEmpty a -> (Element (NonEmpty a) -> f b) -> f () #

omapM_ :: Applicative m => (Element (NonEmpty a) -> m ()) -> NonEmpty a -> m () #

oforM_ :: Applicative m => NonEmpty a -> (Element (NonEmpty a) -> m ()) -> m () #

ofoldlM :: Monad m => (a -> Element (NonEmpty a) -> m a) -> a -> NonEmpty a -> m a #

ofoldMap1Ex :: Semigroup m => (Element (NonEmpty a) -> m) -> NonEmpty a -> m #

ofoldr1Ex :: (Element (NonEmpty a) -> Element (NonEmpty a) -> Element (NonEmpty a)) -> NonEmpty a -> Element (NonEmpty a) #

ofoldl1Ex' :: (Element (NonEmpty a) -> Element (NonEmpty a) -> Element (NonEmpty a)) -> NonEmpty a -> Element (NonEmpty a) #

headEx :: NonEmpty a -> Element (NonEmpty a) #

lastEx :: NonEmpty a -> Element (NonEmpty a) #

unsafeHead :: NonEmpty a -> Element (NonEmpty a) #

unsafeLast :: NonEmpty a -> Element (NonEmpty a) #

maximumByEx :: (Element (NonEmpty a) -> Element (NonEmpty a) -> Ordering) -> NonEmpty a -> Element (NonEmpty a) #

minimumByEx :: (Element (NonEmpty a) -> Element (NonEmpty a) -> Ordering) -> NonEmpty a -> Element (NonEmpty a) #

MonoFunctor (NonEmpty a) 

Methods

omap :: (Element (NonEmpty a) -> Element (NonEmpty a)) -> NonEmpty a -> NonEmpty a #

SemiSequence (NonEmpty a) 

Associated Types

type Index (NonEmpty a) :: * #

type Rep1 NonEmpty 
type Key NonEmpty 
type Rep (NonEmpty a) 
type Item (NonEmpty a) 
type Item (NonEmpty a) = a
type Element (NonEmpty a) 
type Element (NonEmpty a) = a
type Index (NonEmpty a) 
type Index (NonEmpty a) = Int

nonEmpty :: [a] -> Maybe (NonEmpty a) #

nonEmpty efficiently turns a normal list into a NonEmpty stream, producing Nothing if the input is empty.

data TLSSettings :: * #

TLS Settings that can be either expressed as simple settings, or as full blown TLS.Params settings.

Unless you need access to parameters that are not accessible through the simple settings, you should use TLSSettingsSimple.