versioning-0.3.1.0: Type-safe data versioning.

Safe HaskellNone
LanguageHaskell2010

Versioning.Upgrade

Contents

Synopsis

Documentation

class Adapt (v :: V) (w :: V) (a :: V -> Type) where Source #

Adapt from a version to another

Methods

adapt :: a v -> a w Source #

Upgrading

type Upgrade v w a = Upgrade' (v == w) v w a Source #

This constraint specifies that a value of type a can be upgraded from version v to version w.

upgrade :: forall v w a. Upgrade v w a => a v -> a w Source #

Upgrade from a lower to a higher version by calling adapt on all the intermediary steps.

Downgrading

type Downgrade v w a = Downgrade' (v == w) v w a Source #

This constraint specifies that a value of type a can be downgraded from version v to version w.

downgrade :: forall v w a. Downgrade v w a => a v -> a w Source #

Downgrade from a higher to a lower version by calling adapt on all the intermediary steps.