semigroups-actions: Semigroups actions

[ algebra, bsd3, data, data-structures, library, math ] [ Propose Tags ]

In mathematics, an action of a semigroup on a set is an operation that associates each element of the semigroup is with a transformation on the set.


[Skip to Readme]

Flags

Automatic Flags
NameDescriptionDefault
base2Disabled

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

Downloads

Maintainer's Corner

Package maintainers

For package maintainers and hackage trustees

Candidates

  • No Candidates
Versions [RSS] 0.1
Dependencies base (>=2 && <5), containers (>=0.3 && <0.6), semigroups (>=0.8 && <0.9) [details]
License BSD-3-Clause
Copyright Copyright (C) 2012 Petr Pudlák
Author Petr Pudlák
Maintainer Petr Pudlák <petr.mvd@gmail.com>
Category Algebra, Data, Data Structures, Math
Home page http://github.com/ppetr/semigroups-actions/
Bug tracker http://github.com/ppetr/semigroups-actions/issues
Source repo head: git clone git://github.com/ppetr/semigroups-actions.git
Uploaded by PetrPudlak at 2012-12-20T21:48:01Z
Distributions
Reverse Dependencies 1 direct, 0 indirect [details]
Downloads 1192 total (5 in the last 30 days)
Rating (no votes yet) [estimated by Bayesian average]
Your Rating
  • λ
  • λ
  • λ
Status Docs uploaded by user
Build status unknown [no reports yet]

Readme for semigroups-actions-0.1

[back to package description]

semigroups-actions

In mathematics, an action of a semigroup on a set is an operation that associates each element of the semigroup is with a transformation on the set. See Wikipedia articles on semigroup action and group action.

This package complements and depends on semigroups.

It requires MultiParamTypeClasses extension.

Examples

Similarly to semigroups, semigroup (or monoid) actions arise almost everywhere (if you look for them).

Natural numbers acting on monoids

The multiplication monoid of natural numbers acts on any other monoid:

n `act` x = x <> ... <> x -- x appears n-times

So 0 `act` x == mempty, 3 `act` x == x <> x <> x etc. TODO efficiency

This is expressed by newtype Repeat and instance

instance (Monoid w, Whole n) => SemigroupAct (Product n) (Repeat w) where

Many different concepts can be expressed using such an action, including

  • repeating a list n-times (replicate),

  • compose a function f n-times, commonly denoted as fⁿ in mathematics:

    (Repeat (Endo fⁿ)) = (Product n) `act` (Repeat (Endo f))
    

Self-application

Any semigroup (or monoid) can be viewed as acting on itself. In this case, act simply becomes <>. This is expressed by the SelfAct type:

newtype SelfAct a = SelfAct a
instance Semigroup g => Semigroup (SelfAct g) where
    (SelfAct x) <> (SelfAct y) = SelfAct $ x <> y

Matrices acting on vectors

Matrices with multiplication can be viewed as a group acting on vectors.

Copyright

Copyright 2012, Petr Pudlák

Contact: petr.pudlak.name or through github.

License: BSD3