Safe Haskell | Safe-Inferred |
---|
Documentation
A position in a term. Arguments are counted from 0.
A position describes a path in the tree representation of a term. The empty
position []
denotes the root of the term. A position [0,1]
denotes the
2nd child of the 1st child of the root (counting children from left to
right).
Comparing Positions
Note that positions are not totally ordered. Nevertheless there are some commonly useful comparisons between positions.
above :: Pos -> Pos -> BoolSource
p `above` q
checks whether p
is above q
(in the tree representation of
a term). A position p
is above a position q
, whenever p
is a prefix of
q
.
below :: Pos -> Pos -> BoolSource
p `below` q
checks whether p
is below q
, that is to say that q
is
above p
.
parallelTo :: Pos -> Pos -> BoolSource
p `parallelTo` q
checks whether p
is parallel to q
, that is to say
that p
and q
do not lie on the same path.