HORIZON HASKELLDocslts/ghc-10.0.x2b276322026-10-31Search packagesCtrl K
Theme: |

GHC 10.0.0.20260917 · lts/ghc-10.0.x · 2b27632 · 2026-10-31

Modulealgebraic-graphs-0.8Haskell2010

Algebra.Graph.Relation.Reflexive

An abstract implementation of reflexive binary relations. Use Algebra.Graph.Class for polymorphic construction and manipulation.

Contents
  1. Data structure
Synopsis

Data structure

newtypenewtype ReflexiveRelation a

The ReflexiveRelation data type represents a reflexive binary relation over a set of elements. Reflexive relations satisfy all laws of the Reflexive type class and, in particular, the self-loop axiom:

vertex x == vertex x * vertex x

The Show instance produces reflexively closed expressions:

show (1     :: ReflexiveRelation Int) == "edge 1 1"
show (1 * 2 :: ReflexiveRelation Int) == "edges [(1,1),(1,2),(2,2)]"
Instances9Eq, Num, Ord, Show, IsString, NFData, …