monoid-subclasses-1.2.6: Subclasses of Monoid

Safe Haskell | Safe-Inferred
Language | Haskell2010

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 `StableFactorial`. 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.

Line number is zero-based, column one-based:

    > let p = pure "abcd\nefgh\nijkl\nmnop\n" :: LinePositioned String
    > p
    "abcd\nefgh\nijkl\nmnop\n"
    > Data.Monoid.Factorial.drop 13 p
    Line 2, column 4: "l\nmnop\n"

Synopsis

- data OffsetPositioned m
- data LinePositioned m
- extract :: Positioned p => p a -> a
- position :: Positioned p => p a -> Int
- line :: LinePositioned m -> Int
- column :: LinePositioned m -> Int

# Documentation

data OffsetPositioned m Source #

#### Instances

Instances details

Applicative OffsetPositioned Source # |

Instance details

Defined in Data.Monoid.Instances.Positioned

Methods

pure :: a -> OffsetPositioned a Source #

(<*>) :: OffsetPositioned (a -> b) -> OffsetPositioned a -> OffsetPositioned b Source #

liftA2 :: (a -> b -> c) -> OffsetPositioned a -> OffsetPositioned b -> OffsetPositioned c Source #

(*>) :: OffsetPositioned a -> OffsetPositioned b -> OffsetPositioned b Source #

(<*) :: OffsetPositioned a -> OffsetPositioned b -> OffsetPositioned a Source #

Functor OffsetPositioned Source # |
Instance details Defined in Data.Monoid.Instances.Positioned Methods fmap :: (a -> b) -> OffsetPositioned a -> OffsetPositioned b Source # (<$) :: a -> OffsetPositioned b -> OffsetPositioned a Source #
(FactorialMonoid m, StableFactorial m) => Monoid (OffsetPositioned m) Source # |
Instance details Defined in Data.Monoid.Instances.Positioned Methods mempty :: OffsetPositioned m Source # mappend :: OffsetPositioned m -> OffsetPositioned m -> OffsetPositioned m Source # mconcat :: [OffsetPositioned m] -> OffsetPositioned m Source #
StableFactorial m => Semigroup (OffsetPositioned m) Source # |
Instance details Defined in Data.Monoid.Instances.Positioned Methods (<>) :: OffsetPositioned m -> OffsetPositioned m -> OffsetPositioned m Source # sconcat :: NonEmpty (OffsetPositioned m) -> OffsetPositioned m Source # stimes :: Integral b => b -> OffsetPositioned m -> OffsetPositioned m Source #
Data m => Data (OffsetPositioned m) Source # |

Instance details

Defined in Data.Monoid.Instances.Positioned

Methods

gfoldl :: (forall d b. Data d => c (d -> b) -> d -> c b) -> (forall g. g -> c g) -> OffsetPositioned m -> c (OffsetPositioned m) Source #

gunfold :: (forall b r. Data b => c (b -> r) -> c r) -> (forall r. r -> c r) -> Constr -> c (OffsetPositioned m) Source #

toConstr :: OffsetPositioned m -> Constr Source #

dataTypeOf :: OffsetPositioned m -> DataType Source #

dataCast1 :: Typeable t => (forall d. Data d => c (t d)) -> Maybe (c (OffsetPositioned m)) Source #

dataCast2 :: Typeable t => (forall d e. (Data d, Data e) => c (t d e)) -> Maybe (c (OffsetPositioned m)) Source #

gmapT :: (forall b. Data b => b -> b) -> OffsetPositioned m -> OffsetPositioned m Source #

gmapQl :: (r -> r' -> r) -> r -> (forall d. Data d => d -> r') -> OffsetPositioned m -> r Source #

gmapQr :: forall r r'. (r' -> r -> r) -> r -> (forall d. Data d => d -> r') -> OffsetPositioned m -> r Source #

gmapQ :: (forall d. Data d => d -> u) -> OffsetPositioned m -> [u] Source #

gmapQi :: Int -> (forall d. Data d => d -> u) -> OffsetPositioned m -> u Source #

gmapM :: Monad m0 => (forall d. Data d => d -> m0 d) -> OffsetPositioned m -> m0 (OffsetPositioned m) Source #

gmapMp :: MonadPlus m0 => (forall d. Data d => d -> m0 d) -> OffsetPositioned m -> m0 (OffsetPositioned m) Source #

gmapMo :: MonadPlus m0 => (forall d. Data d => d -> m0 d) -> OffsetPositioned m -> m0 (OffsetPositioned m) Source #

IsString m => IsString (OffsetPositioned m) Source # |
Instance details Defined in Data.Monoid.Instances.Positioned Methods fromString :: String -> OffsetPositioned m Source #
Show m => Show (OffsetPositioned m) Source # |
Instance details Defined in Data.Monoid.Instances.Positioned Methods showsPrec :: Int -> OffsetPositioned m -> ShowS Source # show :: OffsetPositioned m -> String Source # showList :: [OffsetPositioned m] -> ShowS Source #
Eq m => Eq (OffsetPositioned m) Source # |
Instance details Defined in Data.Monoid.Instances.Positioned Methods (==) :: OffsetPositioned m -> OffsetPositioned m -> Bool Source # (/=) :: OffsetPositioned m -> OffsetPositioned m -> Bool Source #
Ord m => Ord (OffsetPositioned m) Source # |

Instance details

Defined in Data.Monoid.Instances.Positioned

Methods

compare :: OffsetPositioned m -> OffsetPositioned m -> Ordering Source #

(<) :: OffsetPositioned m -> OffsetPositioned m -> Bool Source #

(<=) :: OffsetPositioned m -> OffsetPositioned m -> Bool Source #

(>) :: OffsetPositioned m -> OffsetPositioned m -> Bool Source #

(>=) :: OffsetPositioned m -> OffsetPositioned m -> Bool Source #

max :: OffsetPositioned m -> OffsetPositioned m -> OffsetPositioned m Source #

min :: OffsetPositioned m -> OffsetPositioned m -> OffsetPositioned m Source #

(StableFactorial m, FactorialMonoid m) => FactorialMonoid (OffsetPositioned m) Source # |

Instance details

Defined in Data.Monoid.Instances.Positioned

Methods

splitPrimePrefix :: OffsetPositioned m -> Maybe (OffsetPositioned m, OffsetPositioned m) Source #

splitPrimeSuffix :: OffsetPositioned m -> Maybe (OffsetPositioned m, OffsetPositioned m) Source #

inits :: OffsetPositioned m -> [OffsetPositioned m] Source #

tails :: OffsetPositioned m -> [OffsetPositioned m] Source #

span :: (OffsetPositioned m -> Bool) -> OffsetPositioned m -> (OffsetPositioned m, OffsetPositioned m) Source #

break :: (OffsetPositioned m -> Bool) -> OffsetPositioned m -> (OffsetPositioned m, OffsetPositioned m) Source #

split :: (OffsetPositioned m -> Bool) -> OffsetPositioned m -> [OffsetPositioned m] Source #

takeWhile :: (OffsetPositioned m -> Bool) -> OffsetPositioned m -> OffsetPositioned m Source #

dropWhile :: (OffsetPositioned m -> Bool) -> OffsetPositioned m -> OffsetPositioned m Source #

spanMaybe :: s -> (s -> OffsetPositioned m -> Maybe s) -> OffsetPositioned m -> (OffsetPositioned m, OffsetPositioned m, s) Source #

spanMaybe' :: s -> (s -> OffsetPositioned m -> Maybe s) -> OffsetPositioned m -> (OffsetPositioned m, OffsetPositioned m, s) Source #

splitAt :: Int -> OffsetPositioned m -> (OffsetPositioned m, OffsetPositioned m) Source #

drop :: Int -> OffsetPositioned m -> OffsetPositioned m Source #

take :: Int -> OffsetPositioned m -> OffsetPositioned m Source #

(StableFactorial m, FactorialMonoid m, LeftGCDMonoid m) => LeftGCDMonoid (OffsetPositioned m) Source # |
Instance details Defined in Data.Monoid.Instances.Positioned Methods commonPrefix :: OffsetPositioned m -> OffsetPositioned m -> OffsetPositioned m Source # stripCommonPrefix :: OffsetPositioned m -> OffsetPositioned m -> (OffsetPositioned m, OffsetPositioned m, OffsetPositioned m) Source #
(StableFactorial m, FactorialMonoid m, RightGCDMonoid m) => RightGCDMonoid (OffsetPositioned m) Source # |
Instance details Defined in Data.Monoid.Instances.Positioned Methods commonSuffix :: OffsetPositioned m -> OffsetPositioned m -> OffsetPositioned m Source # stripCommonSuffix :: OffsetPositioned m -> OffsetPositioned m -> (OffsetPositioned m, OffsetPositioned m, OffsetPositioned m) Source #
(StableFactorial m, FactorialMonoid m) => MonoidNull (OffsetPositioned m) Source # |
Instance details Defined in Data.Monoid.Instances.Positioned Methods null :: OffsetPositioned m -> Bool Source #
(StableFactorial m, FactorialMonoid m) => PositiveMonoid (OffsetPositioned m) Source # |
Instance details Defined in Data.Monoid.Instances.Positioned
(StableFactorial m, TextualMonoid m) => TextualMonoid (OffsetPositioned m) Source # |

Instance details

Defined in Data.Monoid.Instances.Positioned

Methods

fromText :: Text -> OffsetPositioned m Source #

singleton :: Char -> OffsetPositioned m Source #

splitCharacterPrefix :: OffsetPositioned m -> Maybe (Char, OffsetPositioned m) Source #

characterPrefix :: OffsetPositioned m -> Maybe Char Source #

map :: (Char -> Char) -> OffsetPositioned m -> OffsetPositioned m Source #

concatMap :: (Char -> OffsetPositioned m) -> OffsetPositioned m -> OffsetPositioned m Source #

toString :: (OffsetPositioned m -> String) -> OffsetPositioned m -> String Source #

toText :: (OffsetPositioned m -> Text) -> OffsetPositioned m -> Text Source #

any :: (Char -> Bool) -> OffsetPositioned m -> Bool Source #

all :: (Char -> Bool) -> OffsetPositioned m -> Bool Source #

foldl :: (a -> OffsetPositioned m -> a) -> (a -> Char -> a) -> a -> OffsetPositioned m -> a Source #

foldl' :: (a -> OffsetPositioned m -> a) -> (a -> Char -> a) -> a -> OffsetPositioned m -> a Source #

foldr :: (OffsetPositioned m -> a -> a) -> (Char -> a -> a) -> a -> OffsetPositioned m -> a Source #

scanl :: (Char -> Char -> Char) -> Char -> OffsetPositioned m -> OffsetPositioned m Source #

scanl1 :: (Char -> Char -> Char) -> OffsetPositioned m -> OffsetPositioned m Source #

scanr :: (Char -> Char -> Char) -> Char -> OffsetPositioned m -> OffsetPositioned m Source #

scanr1 :: (Char -> Char -> Char) -> OffsetPositioned m -> OffsetPositioned m Source #

mapAccumL :: (a -> Char -> (a, Char)) -> a -> OffsetPositioned m -> (a, OffsetPositioned m) Source #

mapAccumR :: (a -> Char -> (a, Char)) -> a -> OffsetPositioned m -> (a, OffsetPositioned m) Source #

takeWhile :: (OffsetPositioned m -> Bool) -> (Char -> Bool) -> OffsetPositioned m -> OffsetPositioned m Source #

dropWhile :: (OffsetPositioned m -> Bool) -> (Char -> Bool) -> OffsetPositioned m -> OffsetPositioned m Source #

break :: (OffsetPositioned m -> Bool) -> (Char -> Bool) -> OffsetPositioned m -> (OffsetPositioned m, OffsetPositioned m) Source #

span :: (OffsetPositioned m -> Bool) -> (Char -> Bool) -> OffsetPositioned m -> (OffsetPositioned m, OffsetPositioned m) Source #

spanMaybe :: s -> (s -> OffsetPositioned m -> Maybe s) -> (s -> Char -> Maybe s) -> OffsetPositioned m -> (OffsetPositioned m, OffsetPositioned m, s) Source #

spanMaybe' :: s -> (s -> OffsetPositioned m -> Maybe s) -> (s -> Char -> Maybe s) -> OffsetPositioned m -> (OffsetPositioned m, OffsetPositioned m, s) Source #

split :: (Char -> Bool) -> OffsetPositioned m -> [OffsetPositioned m] Source #

find :: (Char -> Bool) -> OffsetPositioned m -> Maybe Char Source #

elem :: Char -> OffsetPositioned m -> Bool Source #

foldl_ :: (a -> Char -> a) -> a -> OffsetPositioned m -> a Source #

foldl_' :: (a -> Char -> a) -> a -> OffsetPositioned m -> a Source #

foldr_ :: (Char -> a -> a) -> a -> OffsetPositioned m -> a Source #

takeWhile_ :: Bool -> (Char -> Bool) -> OffsetPositioned m -> OffsetPositioned m Source #

dropWhile_ :: Bool -> (Char -> Bool) -> OffsetPositioned m -> OffsetPositioned m Source #

break_ :: Bool -> (Char -> Bool) -> OffsetPositioned m -> (OffsetPositioned m, OffsetPositioned m) Source #

span_ :: Bool -> (Char -> Bool) -> OffsetPositioned m -> (OffsetPositioned m, OffsetPositioned m) Source #

spanMaybe_ :: s -> (s -> Char -> Maybe s) -> OffsetPositioned m -> (OffsetPositioned m, OffsetPositioned m, s) Source #

spanMaybe_' :: s -> (s -> Char -> Maybe s) -> OffsetPositioned m -> (OffsetPositioned m, OffsetPositioned m, s) Source #

(StableFactorial m, LeftReductive m) => LeftReductive (OffsetPositioned m) Source # |
Instance details Defined in Data.Monoid.Instances.Positioned Methods isPrefixOf :: OffsetPositioned m -> OffsetPositioned m -> Bool Source # stripPrefix :: OffsetPositioned m -> OffsetPositioned m -> Maybe (OffsetPositioned m) Source #
(StableFactorial m, FactorialMonoid m, RightReductive m) => RightReductive (OffsetPositioned m) Source # |
Instance details Defined in Data.Monoid.Instances.Positioned Methods isSuffixOf :: OffsetPositioned m -> OffsetPositioned m -> Bool Source # stripSuffix :: OffsetPositioned m -> OffsetPositioned m -> Maybe (OffsetPositioned m) Source #
StableFactorial m => Factorial (OffsetPositioned m) Source # |

Instance details

Defined in Data.Monoid.Instances.Positioned

Methods

factors :: OffsetPositioned m -> [OffsetPositioned m] Source #

primePrefix :: OffsetPositioned m -> OffsetPositioned m Source #

primeSuffix :: OffsetPositioned m -> OffsetPositioned m Source #

foldl :: (a -> OffsetPositioned m -> a) -> a -> OffsetPositioned m -> a Source #

foldl' :: (a -> OffsetPositioned m -> a) -> a -> OffsetPositioned m -> a Source #

foldr :: (OffsetPositioned m -> a -> a) -> a -> OffsetPositioned m -> a Source #

length :: OffsetPositioned m -> Int Source #

foldMap :: Monoid n => (OffsetPositioned m -> n) -> OffsetPositioned m -> n Source #

reverse :: OffsetPositioned m -> OffsetPositioned m Source #

StableFactorial m => StableFactorial (OffsetPositioned m) Source # |
Instance details Defined in Data.Monoid.Instances.Positioned

data LinePositioned m Source #

#### Instances

Instances details

Applicative LinePositioned Source # |

Instance details

Defined in Data.Monoid.Instances.Positioned

Methods

pure :: a -> LinePositioned a Source #

(<*>) :: LinePositioned (a -> b) -> LinePositioned a -> LinePositioned b Source #

liftA2 :: (a -> b -> c) -> LinePositioned a -> LinePositioned b -> LinePositioned c Source #

(*>) :: LinePositioned a -> LinePositioned b -> LinePositioned b Source #

(<*) :: LinePositioned a -> LinePositioned b -> LinePositioned a Source #

Functor LinePositioned Source # |
Instance details Defined in Data.Monoid.Instances.Positioned Methods fmap :: (a -> b) -> LinePositioned a -> LinePositioned b Source # (<$) :: a -> LinePositioned b -> LinePositioned a Source #
(StableFactorial m, TextualMonoid m) => Monoid (LinePositioned m) Source # |
Instance details Defined in Data.Monoid.Instances.Positioned Methods mempty :: LinePositioned m Source # mappend :: LinePositioned m -> LinePositioned m -> LinePositioned m Source # mconcat :: [LinePositioned m] -> LinePositioned m Source #
(StableFactorial m, TextualMonoid m) => Semigroup (LinePositioned m) Source # |
Instance details Defined in Data.Monoid.Instances.Positioned Methods (<>) :: LinePositioned m -> LinePositioned m -> LinePositioned m Source # sconcat :: NonEmpty (LinePositioned m) -> LinePositioned m Source # stimes :: Integral b => b -> LinePositioned m -> LinePositioned m Source #
Data m => Data (LinePositioned m) Source # |

Instance details

Defined in Data.Monoid.Instances.Positioned

Methods

gfoldl :: (forall d b. Data d => c (d -> b) -> d -> c b) -> (forall g. g -> c g) -> LinePositioned m -> c (LinePositioned m) Source #

gunfold :: (forall b r. Data b => c (b -> r) -> c r) -> (forall r. r -> c r) -> Constr -> c (LinePositioned m) Source #

toConstr :: LinePositioned m -> Constr Source #

dataTypeOf :: LinePositioned m -> DataType Source #

dataCast1 :: Typeable t => (forall d. Data d => c (t d)) -> Maybe (c (LinePositioned m)) Source #

dataCast2 :: Typeable t => (forall d e. (Data d, Data e) => c (t d e)) -> Maybe (c (LinePositioned m)) Source #

gmapT :: (forall b. Data b => b -> b) -> LinePositioned m -> LinePositioned m Source #

gmapQl :: (r -> r' -> r) -> r -> (forall d. Data d => d -> r') -> LinePositioned m -> r Source #

gmapQr :: forall r r'. (r' -> r -> r) -> r -> (forall d. Data d => d -> r') -> LinePositioned m -> r Source #

gmapQ :: (forall d. Data d => d -> u) -> LinePositioned m -> [u] Source #

gmapQi :: Int -> (forall d. Data d => d -> u) -> LinePositioned m -> u Source #

gmapM :: Monad m0 => (forall d. Data d => d -> m0 d) -> LinePositioned m -> m0 (LinePositioned m) Source #

gmapMp :: MonadPlus m0 => (forall d. Data d => d -> m0 d) -> LinePositioned m -> m0 (LinePositioned m) Source #

gmapMo :: MonadPlus m0 => (forall d. Data d => d -> m0 d) -> LinePositioned m -> m0 (LinePositioned m) Source #

IsString m => IsString (LinePositioned m) Source # |
Instance details Defined in Data.Monoid.Instances.Positioned Methods fromString :: String -> LinePositioned m Source #
Show m => Show (LinePositioned m) Source # |
Instance details Defined in Data.Monoid.Instances.Positioned Methods showsPrec :: Int -> LinePositioned m -> ShowS Source # show :: LinePositioned m -> String Source # showList :: [LinePositioned m] -> ShowS Source #
Eq m => Eq (LinePositioned m) Source # |
Instance details Defined in Data.Monoid.Instances.Positioned Methods (==) :: LinePositioned m -> LinePositioned m -> Bool Source # (/=) :: LinePositioned m -> LinePositioned m -> Bool Source #
Ord m => Ord (LinePositioned m) Source # |

Instance details

Defined in Data.Monoid.Instances.Positioned

Methods

compare :: LinePositioned m -> LinePositioned m -> Ordering Source #

(<) :: LinePositioned m -> LinePositioned m -> Bool Source #

(<=) :: LinePositioned m -> LinePositioned m -> Bool Source #

(>) :: LinePositioned m -> LinePositioned m -> Bool Source #

(>=) :: LinePositioned m -> LinePositioned m -> Bool Source #

max :: LinePositioned m -> LinePositioned m -> LinePositioned m Source #

min :: LinePositioned m -> LinePositioned m -> LinePositioned m Source #

(StableFactorial m, TextualMonoid m) => FactorialMonoid (LinePositioned m) Source # |

Instance details

Defined in Data.Monoid.Instances.Positioned

Methods

splitPrimePrefix :: LinePositioned m -> Maybe (LinePositioned m, LinePositioned m) Source #

splitPrimeSuffix :: LinePositioned m -> Maybe (LinePositioned m, LinePositioned m) Source #

inits :: LinePositioned m -> [LinePositioned m] Source #

tails :: LinePositioned m -> [LinePositioned m] Source #

span :: (LinePositioned m -> Bool) -> LinePositioned m -> (LinePositioned m, LinePositioned m) Source #

break :: (LinePositioned m -> Bool) -> LinePositioned m -> (LinePositioned m, LinePositioned m) Source #

split :: (LinePositioned m -> Bool) -> LinePositioned m -> [LinePositioned m] Source #

takeWhile :: (LinePositioned m -> Bool) -> LinePositioned m -> LinePositioned m Source #

dropWhile :: (LinePositioned m -> Bool) -> LinePositioned m -> LinePositioned m Source #

spanMaybe :: s -> (s -> LinePositioned m -> Maybe s) -> LinePositioned m -> (LinePositioned m, LinePositioned m, s) Source #

spanMaybe' :: s -> (s -> LinePositioned m -> Maybe s) -> LinePositioned m -> (LinePositioned m, LinePositioned m, s) Source #

splitAt :: Int -> LinePositioned m -> (LinePositioned m, LinePositioned m) Source #

drop :: Int -> LinePositioned m -> LinePositioned m Source #

take :: Int -> LinePositioned m -> LinePositioned m Source #

(StableFactorial m, TextualMonoid m, LeftGCDMonoid m) => LeftGCDMonoid (LinePositioned m) Source # |
Instance details Defined in Data.Monoid.Instances.Positioned Methods commonPrefix :: LinePositioned m -> LinePositioned m -> LinePositioned m Source # stripCommonPrefix :: LinePositioned m -> LinePositioned m -> (LinePositioned m, LinePositioned m, LinePositioned m) Source #
(StableFactorial m, TextualMonoid m, RightGCDMonoid m) => RightGCDMonoid (LinePositioned m) Source # |
Instance details Defined in Data.Monoid.Instances.Positioned Methods commonSuffix :: LinePositioned m -> LinePositioned m -> LinePositioned m Source # stripCommonSuffix :: LinePositioned m -> LinePositioned m -> (LinePositioned m, LinePositioned m, LinePositioned m) Source #
(StableFactorial m, TextualMonoid m, MonoidNull m) => MonoidNull (LinePositioned m) Source # |
Instance details Defined in Data.Monoid.Instances.Positioned Methods null :: LinePositioned m -> Bool Source #
(StableFactorial m, TextualMonoid m) => PositiveMonoid (LinePositioned m) Source # |
Instance details Defined in Data.Monoid.Instances.Positioned
(StableFactorial m, TextualMonoid m) => TextualMonoid (LinePositioned m) Source # |

Instance details

Defined in Data.Monoid.Instances.Positioned

Methods

fromText :: Text -> LinePositioned m Source #

singleton :: Char -> LinePositioned m Source #

splitCharacterPrefix :: LinePositioned m -> Maybe (Char, LinePositioned m) Source #

characterPrefix :: LinePositioned m -> Maybe Char Source #

map :: (Char -> Char) -> LinePositioned m -> LinePositioned m Source #

concatMap :: (Char -> LinePositioned m) -> LinePositioned m -> LinePositioned m Source #

toString :: (LinePositioned m -> String) -> LinePositioned m -> String Source #

toText :: (LinePositioned m -> Text) -> LinePositioned m -> Text Source #

any :: (Char -> Bool) -> LinePositioned m -> Bool Source #

all :: (Char -> Bool) -> LinePositioned m -> Bool Source #

foldl :: (a -> LinePositioned m -> a) -> (a -> Char -> a) -> a -> LinePositioned m -> a Source #

foldl' :: (a -> LinePositioned m -> a) -> (a -> Char -> a) -> a -> LinePositioned m -> a Source #

foldr :: (LinePositioned m -> a -> a) -> (Char -> a -> a) -> a -> LinePositioned m -> a Source #

scanl :: (Char -> Char -> Char) -> Char -> LinePositioned m -> LinePositioned m Source #

scanl1 :: (Char -> Char -> Char) -> LinePositioned m -> LinePositioned m Source #

scanr :: (Char -> Char -> Char) -> Char -> LinePositioned m -> LinePositioned m Source #

scanr1 :: (Char -> Char -> Char) -> LinePositioned m -> LinePositioned m Source #

mapAccumL :: (a -> Char -> (a, Char)) -> a -> LinePositioned m -> (a, LinePositioned m) Source #

mapAccumR :: (a -> Char -> (a, Char)) -> a -> LinePositioned m -> (a, LinePositioned m) Source #

takeWhile :: (LinePositioned m -> Bool) -> (Char -> Bool) -> LinePositioned m -> LinePositioned m Source #

dropWhile :: (LinePositioned m -> Bool) -> (Char -> Bool) -> LinePositioned m -> LinePositioned m Source #

break :: (LinePositioned m -> Bool) -> (Char -> Bool) -> LinePositioned m -> (LinePositioned m, LinePositioned m) Source #

span :: (LinePositioned m -> Bool) -> (Char -> Bool) -> LinePositioned m -> (LinePositioned m, LinePositioned m) Source #

spanMaybe :: s -> (s -> LinePositioned m -> Maybe s) -> (s -> Char -> Maybe s) -> LinePositioned m -> (LinePositioned m, LinePositioned m, s) Source #

spanMaybe' :: s -> (s -> LinePositioned m -> Maybe s) -> (s -> Char -> Maybe s) -> LinePositioned m -> (LinePositioned m, LinePositioned m, s) Source #

split :: (Char -> Bool) -> LinePositioned m -> [LinePositioned m] Source #

find :: (Char -> Bool) -> LinePositioned m -> Maybe Char Source #

elem :: Char -> LinePositioned m -> Bool Source #

foldl_ :: (a -> Char -> a) -> a -> LinePositioned m -> a Source #

foldl_' :: (a -> Char -> a) -> a -> LinePositioned m -> a Source #

foldr_ :: (Char -> a -> a) -> a -> LinePositioned m -> a Source #

takeWhile_ :: Bool -> (Char -> Bool) -> LinePositioned m -> LinePositioned m Source #

dropWhile_ :: Bool -> (Char -> Bool) -> LinePositioned m -> LinePositioned m Source #

break_ :: Bool -> (Char -> Bool) -> LinePositioned m -> (LinePositioned m, LinePositioned m) Source #

span_ :: Bool -> (Char -> Bool) -> LinePositioned m -> (LinePositioned m, LinePositioned m) Source #

spanMaybe_ :: s -> (s -> Char -> Maybe s) -> LinePositioned m -> (LinePositioned m, LinePositioned m, s) Source #

spanMaybe_' :: s -> (s -> Char -> Maybe s) -> LinePositioned m -> (LinePositioned m, LinePositioned m, s) Source #

(StableFactorial m, TextualMonoid m) => LeftReductive (LinePositioned m) Source # |
Instance details Defined in Data.Monoid.Instances.Positioned Methods isPrefixOf :: LinePositioned m -> LinePositioned m -> Bool Source # stripPrefix :: LinePositioned m -> LinePositioned m -> Maybe (LinePositioned m) Source #
(StableFactorial m, TextualMonoid m, RightReductive m) => RightReductive (LinePositioned m) Source # |
Instance details Defined in Data.Monoid.Instances.Positioned Methods isSuffixOf :: LinePositioned m -> LinePositioned m -> Bool Source # stripSuffix :: LinePositioned m -> LinePositioned m -> Maybe (LinePositioned m) Source #
(StableFactorial m, TextualMonoid m) => Factorial (LinePositioned m) Source # |

Instance details

Defined in Data.Monoid.Instances.Positioned

Methods

factors :: LinePositioned m -> [LinePositioned m] Source #

primePrefix :: LinePositioned m -> LinePositioned m Source #

primeSuffix :: LinePositioned m -> LinePositioned m Source #

foldl :: (a -> LinePositioned m -> a) -> a -> LinePositioned m -> a Source #

foldl' :: (a -> LinePositioned m -> a) -> a -> LinePositioned m -> a Source #

foldr :: (LinePositioned m -> a -> a) -> a -> LinePositioned m -> a Source #

length :: LinePositioned m -> Int Source #

foldMap :: Monoid n => (LinePositioned m -> n) -> LinePositioned m -> n Source #

reverse :: LinePositioned m -> LinePositioned m Source #

(StableFactorial m, TextualMonoid m) => StableFactorial (LinePositioned m) Source # |
Instance details Defined in Data.Monoid.Instances.Positioned

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