monoid-subclasses-0.3.6: Subclasses of Monoid

Safe HaskellNone
LanguageHaskell2010

Data.Monoid.Instances.Positioned

Description

This module defines two monoid transformer data types, OffsetPositioned and LinePositioned. Both data types add a notion of the current position to their base monoid. In case of OffsetPositioned, the current position is a simple integer offset from the beginning of the monoid, and it can be applied to any StableFactorialMonoid. The base monoid of LinePositioned must be a TextualMonoid, but for the price it will keep track of the current line and column numbers as well.

Synopsis

Documentation

extract :: Positioned p => p a -> a Source

position :: Positioned p => p a -> Int Source

line :: LinePositioned m -> Int Source

the current line

column :: LinePositioned m -> Int Source

the current column