eventium-core: Core module for eventium

This is a package candidate release! Here you can preview how this package release will appear once published to the main package index (which can be accomplished via the 'maintain' link below). Please note that once a package has been published to the main package index it cannot be undone! Please consult the package uploading documentation for more information.

[maintain] [Publish]

Eventium-core provides the core abstractions and utilities for building event sourcing systems in Haskell. It includes event store interfaces, command handlers, projections, read models, process managers, and Template Haskell utilities for generating boilerplate code. This is the foundational package that all other Eventium modules build upon.


[Skip to Readme]

Properties

Versions 0.1.0, 0.1.0
Change log CHANGELOG.md
Dependencies aeson (>=1.5 && <2.3), base (>=4.9 && <5), containers (>=0.6 && <0.8), contravariant (>=1.5 && <1.6), http-api-data (>=0.4 && <0.7), path-pieces (>=0.2 && <0.3), template-haskell (>=2.16 && <2.22), text (>=1.2 && <2.2), transformers (>=0.5 && <0.7), uuid (>=1.3 && <1.4), x-sum-type-boilerplate (>=0.1 && <0.2) [details]
License MIT
Author
Maintainer Alexander Sidorenko
Category Database, Eventsourcing
Home page https://github.com/aleks-sidorenko/eventium#readme
Bug tracker https://github.com/aleks-sidorenko/eventium/issues
Source repo head: git clone https://github.com/aleks-sidorenko/eventium
Uploaded by aleks_sidorenko at 2025-12-12T21:56:25Z

Modules

[Index] [Quick Jump]

Downloads

Maintainer's Corner

Package maintainers

For package maintainers and hackage trustees


Readme for eventium-core-0.1.0

[back to package description]

Eventium Core

Core abstractions and utilities for building event sourcing systems in Haskell.

Overview

eventium-core is the foundational package of the Eventium event sourcing framework. It provides all the essential abstractions, interfaces, and utilities needed to build event-sourced applications with CQRS patterns.

Key Components

Event Store (Eventium.Store.Class)

Projection (Eventium.Projection)

Pure event fold for rebuilding state from events. Used for both domain aggregates (write model) and read models (query side).

data Projection state event = Projection
  { projectionSeed :: state
  , projectionEventHandler :: state -> event -> state
  }

Command Handler (Eventium.CommandHandler)

Implements the aggregate pattern from DDD/Event Sourcing. Processes commands, validates against current state, and emits events.

data CommandHandler state event command = CommandHandler
  { commandHandlerHandler :: state -> command -> [event]
  , commandHandlerProjection :: Projection state event
  }

Process Manager (Eventium.ProcessManager)

Coordinates long-running business processes across multiple aggregates. Implements the Saga pattern for complex workflows.

Read Model (Eventium.ReadModel.Class)

Builds denormalized views optimized for queries. Tracks processed events for eventual consistency with the write side.

Serializer (Eventium.Serializer)

Type-safe event serialization/deserialization with JSON support and Template Haskell utilities for automatic boilerplate generation.

Template Haskell Utilities (Eventium.TH)

Features

Usage

Add eventium-core to your package dependencies:

dependencies:
  - eventium-core

Then choose a storage backend:

Design Principles

  1. Type Safety - Phantom types prevent mixing concerns
  2. Functional Purity - Projections are pure folds
  3. Abstraction - Backend-agnostic core types
  4. CQRS - Clear command/query separation
  5. Standard Patterns - Aggregates, Sagas, Read Models

Documentation

License

MIT - see LICENSE.md