acts: Semigroup actions and torsors.

[ algebra, bsd3, library, math ] [ Propose Tags ]

Acts and torsors model types which can be transformed under the action of another type.

A prototypical example is affine space, which has an action by translation: given any two points in affine space, there is a unique translation that brings one to the other.

This can be useful in a library keeping track of time: on top of needing to keep track of units, one also needs to distinguish between absolute time (time stamps) and relative time (time differences). The operations one expects in this situation are:

  • Addition and subtraction of time differences: time differences form a (commutative) group.

  • Translation of an absolute time by a time difference: there is an action of relative time on absolute time.

  • Given two absolute times, one can obtain the time difference between them: absolute time is a torsor under relative time.

This library provides a convenient framework which helps to avoid mixing up these two different notions.

A fleshed out example is available at Acts.Examples.MusicalIntervals, which showcases the use of actions and torsors in the context of musical intervals and harmony. It also demonstrates common usage patterns of this library, such as how to automatically derive instances.

See also the project readme, which includes a simple example with 2D affine space.


[Last Documentation]

  • Data
    • Data.Act


Manual Flags


Use the finitary library to define actions on finite enumerations.

Disable to remove dependencies on `finite-typelits` and finitary.


Use -f <flag> to enable a flag, or -f -<flag> to disable that flag. More info


Note: This package has metadata revisions in the cabal description newer than included in the tarball. To unpack the package including the revisions, use 'cabal get'.

Maintainer's Corner

Package maintainers

For package maintainers and hackage trustees


Versions [RSS],,,,
Change log
Dependencies acts, base (>=4.12 && <4.21), deepseq (>= && <1.6), finitary (>= && <2.2), finite-typelits (>= && <0.2), groups (>= && <0.6) [details]
License BSD-3-Clause
Author Sam Derbyshire
Maintainer Sam Derbyshire
Revised Revision 2 made by sheaf at 2024-02-17T11:45:11Z
Category Algebra, Math
Home page
Bug tracker
Source repo head: git clone git://
Uploaded by sheaf at 2022-12-03T15:12:13Z
Downloads 1309 total (17 in the last 30 days)
Rating (no votes yet) [estimated by Bayesian average]
Your Rating
  • λ
  • λ
  • λ
Status Docs not available [build log]
All reported builds failed as of 2022-12-03 [all 2 reports]