monoids-0.1.32: Monoids, specialized containers and a general map/reduce frameworkSource codeContentsIndex
Data.Monoid.Lexical.Words
Portabilitynon-portable (MPTCs, OverloadedStrings)
Stabilityexperimental
Maintainerekmett@gmail.com
Contents
Words
Lines
Description
A simple demonstration of tokenizing a Generator into distinct words and/or lines using a word-parsing Monoid that accumulates partial information about words and then builds up a token stream.
Synopsis
module Data.Monoid.Reducer.Char
data Words m
runWords :: Words m -> [m]
data Unspaced m
wordsFrom :: (Generator c, Elem c ~ Char, Reducer Char m, Reducer Char n, Reducer Char o) => m -> c -> [(m, n, o)]
data Lines m
runLines :: Lines m -> [m]
data Unlined m
linesFrom :: (Generator c, Elem c ~ Char, Reducer Char m, Reducer Char n, Reducer Char o) => m -> c -> [(m, n, o)]
Documentation
module Data.Monoid.Reducer.Char
Words
data Words m Source
A CharReducer transformer that breaks a Char Generator into distinct words, feeding a Char Reducer each line in turn
show/hide Instances
runWords :: Words m -> [m]Source
Extract the matched words from the Words Monoid
data Unspaced m Source
A CharReducer transformer that strips out any character matched by isSpace
show/hide Instances
wordsFrom :: (Generator c, Elem c ~ Char, Reducer Char m, Reducer Char n, Reducer Char o) => m -> c -> [(m, n, o)]Source
Utility function to extract words using accumulator, inside-word, and until-next-word monoids
Lines
data Lines m Source
A CharReducer transformer that breaks a Char Generator into distinct lines, feeding a Char Reducer each line in turn.
show/hide Instances
runLines :: Lines m -> [m]Source
Extract the matched lines from the Lines Monoid
data Unlined m Source
A CharReducer transformer that strips out newlines
show/hide Instances
linesFrom :: (Generator c, Elem c ~ Char, Reducer Char m, Reducer Char n, Reducer Char o) => m -> c -> [(m, n, o)]Source
Utility function to extract lines using accumulator, inside-line, and until-next-line monoids
Produced by Haddock version 2.4.2