[documentation change to reflect new project name ekmett@gmail.com**20090325070736] { adddir ./dist/doc/html/monoids adddir ./dist/doc/html/monoids/src hunk ./dist/doc/html/lexical-monoids/Data-Monoid-Generator.html 1 - - -Data.Monoid.Generator
 lexical-monoids-0.1.1: Lexical monoidsSource codeContentsIndex
Data.Monoid.Generator
Documentation
class Generator c whereSource
Associated Types
type Elem c :: *Source
Methods
mapreduce :: Reducer e m => (Elem c -> e) -> c -> mSource
mapreducer :: Reducer e m => (Elem c -> e) -> m -> c -> mSource
mapreducel :: Reducer e m => (Elem c -> e) -> c -> m -> mSource
show/hide Instances
mapreduce :: (Generator c, Reducer e m) => (Elem c -> e) -> c -> mSource
mapreducer :: (Generator c, Reducer e m) => (Elem c -> e) -> m -> c -> mSource
mapreducel :: (Generator c, Reducer e m) => (Elem c -> e) -> c -> m -> mSource
Produced by Haddock version 2.3.0
rmfile ./dist/doc/html/lexical-monoids/Data-Monoid-Generator.html hunk ./dist/doc/html/lexical-monoids/Data-Monoid-Lexical-SourcePosition.html 1 - - -Data.Monoid.Lexical.SourcePosition
 lexical-monoids-0.1.1: Lexical monoidsSource codeContentsIndex
Data.Monoid.Lexical.SourcePosition
Documentation
module Data.Monoid.Reducer.Char
data SourcePosition file Source
show/hide Instances
type SourceLine = IntSource
type SourceColumn = IntSource
sourceLine :: SourcePosition f -> Maybe SourceLineSource
sourceColumn :: SourcePosition f -> Maybe SourceColumnSource
startOfFile :: f -> SourcePosition fSource
showSourcePosition :: SourcePosition String -> StringSource
Produced by Haddock version 2.3.0
rmfile ./dist/doc/html/lexical-monoids/Data-Monoid-Lexical-SourcePosition.html hunk ./dist/doc/html/lexical-monoids/Data-Monoid-Lexical-UTF8-Decoder.html 1 - - -Data.Monoid.Lexical.UTF8.Decoder
 lexical-monoids-0.1.1: Lexical monoidsSource codeContentsIndex
Data.Monoid.Lexical.UTF8.Decoder
Documentation
module Data.Monoid.Reducer.Char
data UTF8 m Source
show/hide Instances
runUTF8 :: CharReducer m => UTF8 m -> mSource
Produced by Haddock version 2.3.0
rmfile ./dist/doc/html/lexical-monoids/Data-Monoid-Lexical-UTF8-Decoder.html hunk ./dist/doc/html/lexical-monoids/Data-Monoid-Lexical-Words.html 1 - - -Data.Monoid.Lexical.Words
 lexical-monoids-0.1.1: Lexical monoidsSource codeContentsIndex
Data.Monoid.Lexical.Words
Documentation
module Data.Monoid.Reducer.Char
data Words m Source
show/hide Instances
runWords :: Words m -> [m]Source
data Lines m Source
show/hide Instances
runLines :: Lines m -> [m]Source
data Unspaced m Source
show/hide Instances
data Unlined m Source
show/hide Instances
wordsFrom :: (Generator c, Elem c ~ Char, Reducer Char m, Reducer Char n, Reducer Char o) => m -> c -> [(m, n, o)]Source
linesFrom :: (Generator c, Elem c ~ Char, Reducer Char m, Reducer Char n, Reducer Char o) => m -> c -> [(m, n, o)]Source
Produced by Haddock version 2.3.0
rmfile ./dist/doc/html/lexical-monoids/Data-Monoid-Lexical-Words.html hunk ./dist/doc/html/lexical-monoids/Data-Monoid-Ord.html 1 - - -Data.Monoid.Ord
 lexical-monoids-0.1.1: Lexical monoidsSource codeContentsIndex
Data.Monoid.Ord
Contents
Max -
Min -
MaxPriority: Max semigroup w/ added bottom -
MinPriority: Min semigroup w/ added top -
Synopsis
newtype Max a = Max {
getMax :: a
}
newtype Min a = Min {
getMin :: a
}
newtype MaxPriority a = MaxPriority {
getMaxPriority :: Maybe a
}
newtype MinPriority a = MinPriority {
getMinPriority :: Maybe a
}
Max -
newtype Max a Source
The Monoid (max,minBound) -
Constructors
Max
getMax :: a
show/hide Instances
Bounded a => Bounded (Max a)
Eq a => Eq (Max a)
Ord a => Ord (Max a)
Read a => Read (Max a)
Show a => Show (Max a)
(Ord a, Bounded a) => Monoid (Max a)
Min -
newtype Min a Source
The Monoid given by (min,maxBound) -
Constructors
Min
getMin :: a
show/hide Instances
Bounded a => Bounded (Min a)
Eq a => Eq (Min a)
Ord a => Ord (Min a)
Read a => Read (Min a)
Show a => Show (Min a)
(Ord a, Bounded a) => Monoid (Min a)
MaxPriority: Max semigroup w/ added bottom -
newtype MaxPriority a Source
The Monoid (max,Nothing) over Maybe a where Nothing is the bottom element -
Constructors
MaxPriority
getMaxPriority :: Maybe a
show/hide Instances
MinPriority: Min semigroup w/ added top -
newtype MinPriority a Source
The Monoid (min,Nothing) over Maybe a where Nothing is the top element -
Constructors
MinPriority
getMinPriority :: Maybe a
show/hide Instances
Produced by Haddock version 2.3.0
rmfile ./dist/doc/html/lexical-monoids/Data-Monoid-Ord.html hunk ./dist/doc/html/lexical-monoids/Data-Monoid-Reducer-Char.html 1 - - -Data.Monoid.Reducer.Char
 lexical-monoids-0.1.1: Lexical monoidsSource codeContentsIndex
Data.Monoid.Reducer.Char
Documentation
module Data.Monoid.Reducer
class Reducer Char m => CharReducer m whereSource
Methods
reduceChar :: Char -> mSource
invalidChar :: [Word8] -> mSource
show/hide Instances
invalidChar :: CharReducer m => [Word8] -> mSource
reduceChar :: CharReducer m => Char -> mSource
Produced by Haddock version 2.3.0
rmfile ./dist/doc/html/lexical-monoids/Data-Monoid-Reducer-Char.html hunk ./dist/doc/html/lexical-monoids/Data-Monoid-Reducer-With.html 1 - - -Data.Monoid.Reducer.With
 lexical-monoids-0.1.1: Lexical monoidsSource codeContentsIndex
Data.Monoid.Reducer.With
Documentation
module Data.Monoid.Reducer
data WithReducer c m Source
show/hide Instances
Reducer c m => Measured m (WithReducer c m)
Reducer c m => Reducer (WithReducer c m) m
withReducer :: Reducer c m => c -> c `WithReducer` mSource
withoutReducer :: (c `WithReducer` m) -> cSource
Produced by Haddock version 2.3.0
rmfile ./dist/doc/html/lexical-monoids/Data-Monoid-Reducer-With.html hunk ./dist/doc/html/lexical-monoids/Data-Monoid-Reducer.html 1 - - -Data.Monoid.Reducer
 lexical-monoids-0.1.1: Lexical monoidsSource codeContentsIndex
Data.Monoid.Reducer
Documentation
class Monoid m => Reducer c m whereSource
Methods
reduce :: c -> mSource
reducer :: m -> c -> mSource
reducel :: c -> m -> mSource
show/hide Instances
Reducer c ()
Reducer Char (SourcePosition file)
Reducer Char (SourcePosition file)
Reducer Char m => Reducer Char (Unlined m)
Reducer Char m => Reducer Char (Unlined m)
Reducer Char m => Reducer Char (Unspaced m)
Reducer Char m => Reducer Char (Unspaced m)
Reducer Char m => Reducer Char (Lines m)
Reducer Char m => Reducer Char (Lines m)
Reducer Char m => Reducer Char (Words m)
Reducer Char m => Reducer Char (Words m)
CharReducer m => Reducer Word8 (UTF8 m)
CharReducer m => Reducer Word8 (UTF8 m)
Reducer c ([] c)
(Reducer c m, Reducer c m') => Reducer c ((,) m m')
(Reducer c m, Reducer c m', Reducer c m'') => Reducer c ((,,) m m' m'')
(Reducer c m, Reducer c m', Reducer c m'', Reducer c m''') => Reducer c ((,,,) m m' m'' m''')
Reducer c m => Reducer (WithReducer c m) m
reduce :: Reducer c m => c -> mSource
reducer :: Reducer c m => m -> c -> mSource
reducel :: Reducer c m => c -> m -> mSource
Produced by Haddock version 2.3.0
rmfile ./dist/doc/html/lexical-monoids/Data-Monoid-Reducer.html hunk ./dist/doc/html/lexical-monoids/doc-index.html 1 - - -lexical-monoids-0.1.1: Lexical monoids (Index)
 lexical-monoids-0.1.1: Lexical monoidsContentsIndex
Search:
All
1 (Data Constructor)
2 (Type/Class)
Any
1 (Data Constructor)
2 (Type/Class)
appEndo
CharReducer
Dual
1 (Data Constructor)
2 (Type/Class)
Elem
Endo
1 (Data Constructor)
2 (Type/Class)
First
1 (Data Constructor)
2 (Type/Class)
Generator
getAll
getAny
getDual
getFirst
getLast
getMax
getMaxPriority
getMin
getMinPriority
getProduct
getSum
invalidChar
Last
1 (Data Constructor)
2 (Type/Class)
Lines
linesFrom
mappend
mapreduce
mapreducel
mapreducer
Max
1 (Type/Class)
2 (Data Constructor)
MaxPriority
1 (Type/Class)
2 (Data Constructor)
mconcat
mempty
Min
1 (Type/Class)
2 (Data Constructor)
MinPriority
1 (Type/Class)
2 (Data Constructor)
Monoid
Product
1 (Data Constructor)
2 (Type/Class)
reduce
reduceChar
reducel
Reducer
reducer
runLines
runUnlined
runUnspaced
runUTF8
runWithReducer
runWords
showSourcePosition
SourceColumn
sourceColumn
SourceLine
sourceLine
SourcePosition
startOfFile
Sum
1 (Data Constructor)
2 (Type/Class)
Unlined
Unspaced
UTF8
withoutReducer
WithReducer
withReducer
Words
wordsFrom
rmfile ./dist/doc/html/lexical-monoids/doc-index.html hunk ./dist/doc/html/lexical-monoids/haddock-util.js 1 -// Haddock JavaScript utilities -function toggle(button,id) -{ - var n = document.getElementById(id).style; - if (n.display == "none") - { - button.src = "minus.gif"; - n.display = "block"; - } - else - { - button.src = "plus.gif"; - n.display = "none"; - } -} - - -var max_results = 75; // 50 is not enough to search for map in the base libraries -var shown_range = null; -var last_search = null; - -function quick_search() -{ - perform_search(false); -} - -function full_search() -{ - perform_search(true); -} - - -function perform_search(full) -{ - var text = document.getElementById("searchbox").value.toLowerCase(); - if (text == last_search && !full) return; - last_search = text; - - var table = document.getElementById("indexlist"); - var status = document.getElementById("searchmsg"); - var children = table.firstChild.childNodes; - - // first figure out the first node with the prefix - var first = bisect(-1); - var last = (first == -1 ? -1 : bisect(1)); - - if (first == -1) - { - table.className = ""; - status.innerHTML = "No results found, displaying all"; - } - else if (first == 0 && last == children.length - 1) - { - table.className = ""; - status.innerHTML = ""; - } - else if (last - first >= max_results && !full) - { - table.className = ""; - status.innerHTML = "More than " + max_results + ", press Search to display"; - } - else - { - // decide what you need to clear/show - if (shown_range) - setclass(shown_range[0], shown_range[1], "indexrow"); - setclass(first, last, "indexshow"); - shown_range = [first, last]; - table.className = "indexsearch"; - status.innerHTML = ""; - } - - - function setclass(first, last, status) - { - for (var i = first; i <= last; i++) - { - children[i].className = status; - } - } - - - // do a binary search, treating 0 as ... - // return either -1 (no 0's found) or location of most far match - function bisect(dir) - { - var first = 0, finish = children.length - 1; - var mid, success = false; - - while (finish - first > 3) - { - mid = Math.floor((finish + first) / 2); - - var i = checkitem(mid); - if (i == 0) i = dir; - if (i == -1) - finish = mid; - else - first = mid; - } - var a = (dir == 1 ? first : finish); - var b = (dir == 1 ? finish : first); - for (var i = b; i != a - dir; i -= dir) - { - if (checkitem(i) == 0) return i; - } - return -1; - } - - - // from an index, decide what the result is - // 0 = match, -1 is lower, 1 is higher - function checkitem(i) - { - var s = getitem(i).toLowerCase().substr(0, text.length); - if (s == text) return 0; - else return (s > text ? -1 : 1); - } - - - // from an index, get its string - // this abstracts over alternates - function getitem(i) - { - for ( ; i >= 0; i--) - { - var s = children[i].firstChild.firstChild.data; - if (s.indexOf(' ') == -1) - return s; - } - return ""; // should never be reached - } -} rmfile ./dist/doc/html/lexical-monoids/haddock-util.js hunk ./dist/doc/html/lexical-monoids/haddock.css 1 -/* -------- Global things --------- */ - -BODY { - background-color: #ffffff; - color: #000000; - font-family: sans-serif; - } - -A:link { color: #0000e0; text-decoration: none } -A:visited { color: #0000a0; text-decoration: none } -A:hover { background-color: #e0e0ff; text-decoration: none } - -TABLE.vanilla { - width: 100%; - border-width: 0px; - /* I can't seem to specify cellspacing or cellpadding properly using CSS... */ -} - -TABLE.vanilla2 { - border-width: 0px; -} - -/* font is a little too small in MSIE */ -TT { font-size: 100%; } -PRE { font-size: 100%; } - -LI P { margin: 0pt } - -TD { - border-width: 0px; -} - -TABLE.narrow { - border-width: 0px; -} - -TD.s8 { height: 8px; } -TD.s15 { height: 15px; } - -SPAN.keyword { text-decoration: underline; } - -/* Resize the buttom image to match the text size */ -IMG.coll { width : 0.75em; height: 0.75em; margin-bottom: 0; margin-right: 0.5em } - -/* --------- Contents page ---------- */ - -DIV.node { - padding-left: 3em; -} - -DIV.cnode { - padding-left: 1.75em; -} - -SPAN.pkg { - position: absolute; - left: 50em; -} - -/* --------- Documentation elements ---------- */ - -TD.children { - padding-left: 25px; - } - -TD.synopsis { - padding: 2px; - background-color: #f0f0f0; - font-family: monospace - } - -TD.decl { - padding: 2px; - background-color: #f0f0f0; - font-family: monospace; - vertical-align: top; - } - -TD.topdecl { - padding: 2px; - background-color: #f0f0f0; - font-family: monospace; - vertical-align: top; -} - -TABLE.declbar { - border-spacing: 0px; - } - -TD.declname { - width: 100%; - } - -TD.declbut { - padding-left: 5px; - padding-right: 5px; - border-left-width: 1px; - border-left-color: #000099; - border-left-style: solid; - white-space: nowrap; - font-size: small; - } - -/* - arg is just like decl, except that wrapping is not allowed. It is - used for function and constructor arguments which have a text box - to the right, where if wrapping is allowed the text box squashes up - the declaration by wrapping it. -*/ -TD.arg { - padding: 2px; - background-color: #f0f0f0; - font-family: monospace; - vertical-align: top; - white-space: nowrap; - } - -TD.recfield { padding-left: 20px } - -TD.doc { - padding-top: 2px; - padding-left: 10px; - } - -TD.ndoc { - padding: 2px; - } - -TD.rdoc { - padding: 2px; - padding-left: 10px; - width: 100%; - } - -TD.body { - padding-left: 10px - } - -TD.pkg { - width: 100%; - padding-left: 10px -} - -TABLE.indexsearch TR.indexrow { - display: none; -} -TABLE.indexsearch TR.indexshow { - display: table-row; -} - -TD.indexentry { - vertical-align: top; - padding-right: 10px - } - -TD.indexannot { - vertical-align: top; - padding-left: 20px; - white-space: nowrap - } - -TD.indexlinks { - width: 100% - } - -/* ------- Section Headings ------- */ - -TD.section1 { - padding-top: 15px; - font-weight: bold; - font-size: 150% - } - -TD.section2 { - padding-top: 10px; - font-weight: bold; - font-size: 130% - } - -TD.section3 { - padding-top: 5px; - font-weight: bold; - font-size: 110% - } - -TD.section4 { - font-weight: bold; - font-size: 100% - } - -/* -------------- The title bar at the top of the page */ - -TD.infohead { - color: #ffffff; - font-weight: bold; - padding-right: 10px; - text-align: left; -} - -TD.infoval { - color: #ffffff; - padding-right: 10px; - text-align: left; -} - -TD.topbar { - background-color: #000099; - padding: 5px; -} - -TD.title { - color: #ffffff; - padding-left: 10px; - width: 100% - } - -TD.topbut { - padding-left: 5px; - padding-right: 5px; - border-left-width: 1px; - border-left-color: #ffffff; - border-left-style: solid; - white-space: nowrap; - } - -TD.topbut A:link { - color: #ffffff - } - -TD.topbut A:visited { - color: #ffff00 - } - -TD.topbut A:hover { - background-color: #6060ff; - } - -TD.topbut:hover { - background-color: #6060ff - } - -TD.modulebar { - background-color: #0077dd; - padding: 5px; - border-top-width: 1px; - border-top-color: #ffffff; - border-top-style: solid; - } - -/* --------- The page footer --------- */ - -TD.botbar { - background-color: #000099; - color: #ffffff; - padding: 5px - } -TD.botbar A:link { - color: #ffffff; - text-decoration: underline - } -TD.botbar A:visited { - color: #ffff00 - } -TD.botbar A:hover { - background-color: #6060ff - } - rmfile ./dist/doc/html/lexical-monoids/haddock.css binary ./dist/doc/html/lexical-monoids/haskell_icon.gif oldhex *47494638376110001000f70f00000000800000008000808000000080800080008080c0c0c08080 *80ff000000ff00ffff000000ffff00ff00ffffffffff0000000000000000000000000000000000 *000000000000000000000000000000000000000000000000000000000000000000000000000000 *000000000000000000000000000000000000000000000000000000000000000000000000000000 *000000000000000000000000000000000000000000000000000000000000000000000000000000 *000000000000000000000000000000000000000000000000000000000000000000000000000000 *000000000000000000000000000000000000000000000000000000000000000000000000000000 *000000000000000000000000000000000000000000000000000000000000000000000000000000 *000000000000000000000000000000000000000000000000000000000000000000000000000000 *000000000000000000000000000000000000000000000000000000000000000000000000000000 *000000000000000000000000000000000000000000000000000000000000000000000000000000 *000000000000000000000000000000000000000000000000000000000000000000000000000000 *000000000000000000000000000000000000000000000000000000000000000000000000000000 *000000000000000000000000000000000000000000000000000000000000000000000000000000 *000000000000000000000000000000000000000000000000000000000000000000000000000000 *000000000000000000000000000000000000000000000000000000000000000000000000000000 *000000000000000000000000000000000000000000000000000000000000000000000000000000 *000000000000000000000000000000000000000000000000000000000000000000000000000000 *000000000000000000000000000000000000000000000000000000000000000000000000000000 *000000000000000000000000000000000000000000000000000000000000000000000000000000 *0021f90401000000002c000000001000100007086c0001007840b0a0418202073e38b0b021c387 *07143e2440c0a143040e091cd0787021c686151f84347800e343901d4b12646870e44a930d0952 *3ca832a6cc990555b2bc2992e4c79d3847ea2c88b3a7c89a2c8b8aa43874e941a60810003840b5 *aa55aa511346ddca75abc080003b newhex * rmfile ./dist/doc/html/lexical-monoids/haskell_icon.gif hunk ./dist/doc/html/lexical-monoids/index.html 1 - - -lexical-monoids-0.1.1: Lexical monoids
 lexical-monoids-0.1.1: Lexical monoidsContentsIndex
lexical-monoids-0.1.1: Lexical monoids
Facilities for lexing using monoids -
Modules
show/hideData
show/hideMonoid
Data.Monoid.Generator
show/hideLexical
Data.Monoid.Lexical.SourcePosition
show/hideUTF8
Data.Monoid.Lexical.UTF8.Decoder
Data.Monoid.Lexical.Words
Data.Monoid.Ord
show/hideData.Monoid.Reducer
Data.Monoid.Reducer.Char
Data.Monoid.Reducer.With
Produced by Haddock version 2.3.0
rmfile ./dist/doc/html/lexical-monoids/index.html binary ./dist/doc/html/lexical-monoids/lexical-monoids.haddock oldhex *0d0cface000400000000000016990000000000000ea82f00000000000000000000000000000000 *000000000000000100000000000000010000000000000000000000000000000100000000000000 *020000000000000000000000000000000100000000000000030000000000000000000000000000 *000100000000000000040000000000000000000000000000000100000000000000050000000000 *000000000000000000000100000000000000060000000000000000000000000000000100000000 *000000070000000000000000000000000000000100000000000000080000000000000000000000 *0000000001000000000000000900000000000000000000000000000001000000000000000a0000 *0000000000000000000000000001000000000000000b0000000000000000000000000000000100 *0000000000000c00000000000000000000000000000002000000000000000d0000000000000000 *0000000000000002000000000000000e0000000000000000000000000000000200000000000000 *0f0000000000000000000000000000000200000000000000100000000000000000000000000000 *000300000000000000110000000000000000000000000000000300000000000000120000000000 *000000000000000000000300000000000000130000000000000000000000000000000400000000 *000000140000000000000000000000000000000400000000000000150000000000000000000000 *000000000400000000000000160000000000000000000000000000000400000000000000170000 *000000000000000000000000000400000000000000180000000000000000000000000000000400 *0000000000001900000000000000000000000000000004000000000000001a0000000000000000 *0000000000000005000000000000001b0000000000000000000000000000000500000000000000 *1c00000000000000000000000000000006000000000000001d0000000000000000000000000000 *0006000000000000001e00000000000000000000000000000006000000000000001f0000000000 *000000000000000000000600000000000000200000000000000000000000000000000700000000 *000000210000000000000000000000000000000700000000000000220000000000000000000000 *000000000700000000000000230000000000000000000000000000000700000000000000240000 *000000000000000000000000000700000000000000250000000000000000000000000000000800 *000000000000260000000000000000000000000000000800000000000000270000000000000000 *000000000000000800000000000000280000000000000000000000000000000800000000000000 *2900000000000000000000000000000008000000000000002a0000000000000000000000000000 *0008000000000000002b00000000000000000000000000000008000000000000002c0000000000 *0000000000000000000008000000000000002d0000000000000000000000000000000800000000 *0000002e0000000000000000000000000000000808000000000000000000000000000000010000 *000004000000000000000003010204000000540000006800000065000000200104010000000000 *0000002f0000000000000009000000000000000a01020100000020010701020100000028010401 *0000000000000000300000000000000009000000000000000b0102010000002c01040100000000 *00000000310000000000000009000000000000000c020100000029010206000000200000006f00 *000076000000650000007200000020010701040100000000000000003200000000000000090000 *00000000000c020200000020000000610102070000002000000077000000680000006500000072 *00000065000000200104010000000000000000310000000000000009000000000000000c021400 *00002000000069000000730000002000000074000000680000006500000020000000740000006f *0000007000000020000000650000006c000000650000006d000000650000006e00000074000000 *0a0000000000000003030102040000005400000068000000650000002001040100000000000000 *002f0000000000000009000000000000000a010201000000200107010201000000280104010000 *000000000000330000000000000009000000000000000b0102010000002c010401000000000000 *0000310000000000000009000000000000000c020100000029010206000000200000006f000000 *760000006500000072000000200107010401000000000000000032000000000000000900000000 *0000000c0202000000200000006101020700000020000000770000006800000065000000720000 *0065000000200104010000000000000000310000000000000009000000000000000c0217000000 *2000000069000000730000002000000074000000680000006500000020000000620000006f0000 *0074000000740000006f0000006d00000020000000650000006c000000650000006d0000006500 *00006e000000740000000a00000000000000060301020400000054000000680000006500000020 *01040100000000000000002f0000000000000009000000000000000a01020a0000002000000067 *0000006900000076000000650000006e0000002000000062000000790000002001070102010000 *00280104010000000000000000300000000000000009000000000000000b0102010000002c0104 *010000000000000000340000000000000009000000000000000d02010000002902010000000a00 *00000000000009030102040000005400000068000000650000002001040100000000000000002f *0000000000000009000000000000000a0102010000002001070102010000002801040100000000 *00000000330000000000000009000000000000000b0102010000002c0104010000000000000000 *350000000000000009000000000000000d02010000002902010000000a0f000000000000003600 *00000000000037000000000000002f000000000000000000000000000000010000000000000002 *000000000000000300000000000000040000000000000005000000000000000600000000000000 *0700000000000000080000000000000009000000000000000a000000000000000b0c0000000000 *000009000000000000000a000000000000000b0000000000000006000000000000000700000000 *000000080000000000000003000000000000000400000000000000050000000000000000000000 *000000000100000000000000020000000000000000000000000000000200000000000700000000 *000000360000000000000037000000000000002f000000000000000c000000000000000d000000 *000000000e000000000000000f04000000000000000c000000000000000d000000000000000e00 *0000000000000f0000000000000000000000000000000300000000000a00000000000000360000 *000000000037000000000000002f000000000000000c000000000000000d000000000000000e00 *0000000000000f0000000000000010000000000000001100000000000000120300000000000000 *100000000000000012000000000000001100000000000000000000000000000004000000000011 *00000000000000360000000000000037000000000000002f000000000000000c00000000000000 *0d000000000000000e000000000000000f00000000000000100000000000000011000000000000 *001200000000000000130000000000000014000000000000001500000000000000160000000000 *000017000000000000001800000000000000190700000000000000130000000000000015000000 *000000001400000000000000180000000000000017000000000000001600000000000000190000 *000000000000000000000000000500000000000c00000000000000360000000000000037000000 *000000002f000000000000000c000000000000000d000000000000000e000000000000000f0000 *00000000001000000000000000110000000000000012000000000000001a000000000000001b02 *000000000000001a000000000000001b0000000000000000000000000000000600000000000b00 *000000000000360000000000000037000000000000002f000000000000000c000000000000000d *000000000000000e000000000000000f000000000000001c000000000000001d00000000000000 *1e000000000000001f04000000000000001c000000000000001d000000000000001e0000000000 *00001f000000000000000000000000000000070000000000210000000000000036000000000000 *00380000000000000037000000000000002f0000000000000039000000000000003a0000000000 *00003b000000000000003c000000000000003d000000000000003e000000000000003f00000000 *000000400000000000000041000000000000004200000000000000430000000000000044000000 *000000004500000000000000460000000000000047000000000000004800000000000000490000 *00000000004a000000000000004b000000000000004c000000000000004d000000000000004e00 *0000000000004f0000000000000050000000000000002000000000000000210000000000000022 *000000000000002300000000000000240500000000000000200000000000000021000000000000 *002200000000000000230000000000000024000000000000000000000000000000080000000000 *1400000000000000360000000000000037000000000000002f000000000000000c000000000000 *000d000000000000000e000000000000000f000000000000001000000000000000110000000000 *000012000000000000002500000000000000260000000000000027000000000000002800000000 *00000029000000000000002a000000000000002b000000000000002c000000000000002d000000 *000000002e0a000000000000002a000000000000002b0000000000000029000000000000002c00 *00000000000027000000000000002800000000000000250000000000000026000000000000002d *000000000000002e00000000000000510000000000000000000000000000000103000000000000 *000e0000000000000000000000000000000101000000000000000e000000000000000000000000 *0000000100000000000000000f0000000000000000000000000000000103000000000000001000 *000000000000000000000000000001010000000000000010000000000000000000000000000000 *010000000000000000110000000000000000000000000000000103000000000000001200000000 *000000000000000000000001010000000000000012000000000000000000000000000000010000 *000000000000130000000000000000000000000000000103000000000000001400000000000000 *000000000000000001010000000000000014000000000000000000000000000000010000000000 *000000150000000000000000000000000000000203000000000000001600000000000000000000 *000000000002000000000000000017000000000000000000000000000000020000000000000000 *180000000000000000000000000000000200000000000000001900000000000000000000000000 *00000303000000000000001a0000000000000000000000000000000300000000000000001b0000 *000000000000000000000000000300000000000000001c00000000000000000000000000000004 *03000000000000001d0000000000000000000000000000000403000000000000001e0000000000 *000000000000000000000403000000000000001f00000000000000000000000000000004000000 *000000000020000000000000000000000000000000040000000000000000210000000000000000 *000000000000000400000000000000002200000000000000000000000000000004000000000000 *000023000000000000000000000000000000050300000000000000240000000000000000000000 *000000000500000000000000002500000000000000000000000000000006030000000000000026 *000000000000000000000000000000060000000000000000270000000000000000000000000000 *000600000000000000002800000000000000000000000000000006000000000000000029000000 *0000000000000000000000000703000000000000002a0000000000000000000000000000000703 *000000000000002b0000000000000000000000000000000700000000000000002c000000000000 *0000000000000000000700000000000000002d0000000000000000000000000000000700000000 *000000002e0000000000000000000000000000000803000000000000002f000000000000000000 *000000000000080000000000000000300000000000000000000000000000000803000000000000 *003100000000000000000000000000000008000000000000000032000000000000000000000000 *000000080300000000000000330000000000000000000000000000000803000000000000003400 *000000000000000000000000000008000000000000000035000000000000000000000000000000 *080000000000000000360000000000000000000000000000000800000000000000003700000000 *0000000000000000000000080000000000000000380000000000000009000000000000000a0300 *000000000000390000000000000009000000000000003a00000000000000003b00000000000000 *09000000000000000c01000000000000003c0000000000000009000000000000000c0300000000 *0000003d0000000000000009000000000000003a00000000000000003e00000000000000090000 *00000000003f0000000000000000400000000000000009000000000000003f0000000000000000 *410000000000000009000000000000000a00000000000000004200000000000000090000000000 *00000a0000000000000000430000000000000009000000000000000a0000000000000000440000 *000000000009000000000000000a0000000000000000450000000000000009000000000000000a *0100000000000000460000000000000009000000000000000a0300000000000000460000000000 *000009000000000000000a0000000000000000470000000000000009000000000000000a010000 *0000000000480000000000000009000000000000000a0300000000000000480000000000000009 *000000000000000a0000000000000000490000000000000009000000000000000a010000000000 *00004a0000000000000009000000000000000a03000000000000004a0000000000000009000000 *000000000a00000000000000004b0000000000000009000000000000000a01000000000000004c *0000000000000009000000000000000a03000000000000004c0000000000000009000000000000 *000a00000000000000004d0000000000000009000000000000000a01000000000000004e000000 *0000000009000000000000000a03000000000000004e0000000000000009000000000000000a00 *000000000000004f0000000000000009000000000000000a010000000000000050000000000000 *0009000000000000000a0300000000000000500000000000000009000000000000000a00000000 *00000000510000000000000009000000000000000a010000000000000052000000000000000900 *0000000000000a0300000000000000520000000000000009000000000000000a00000000000000 *00530000000000000009000000000000000a010000000000000054000000000000000900000000 *0000000a030000000000000054000000000000005500000000000000156c65786963616c2d6d6f *6e6f6964732d302e312e31000000000000000f446174612e4d6f6e6f69642e4f72640000000000 *000013446174612e4d6f6e6f69642e526564756365720000000000000018446174612e4d6f6e6f *69642e526564756365722e436861720000000000000022446174612e4d6f6e6f69642e4c657869 *63616c2e536f75726365506f736974696f6e0000000000000020446174612e4d6f6e6f69642e4c *65786963616c2e555446382e4465636f6465720000000000000018446174612e4d6f6e6f69642e *526564756365722e576974680000000000000015446174612e4d6f6e6f69642e47656e65726174 *6f720000000000000019446174612e4d6f6e6f69642e4c65786963616c2e576f72647300000000 *0000000462617365000000000000000b446174612e4d6f6e6f6964000000000000000844617461 *2e4f7264000000000000000a446174612e4d6179626500000000000000075072656c7564650000 *00000000000b4d696e5072696f72697479000000000000000e6765744d696e5072696f72697479 *000000000000000b4d61785072696f72697479000000000000000e6765744d61785072696f7269 *747900000000000000034d696e00000000000000066765744d696e00000000000000034d617800 *000000000000066765744d61780000000000000007526564756365720000000000000006726564 *75636500000000000000077265647563657200000000000000077265647563656c000000000000 *000b4368617252656475636572000000000000000a72656475636543686172000000000000000b *696e76616c696443686172000000000000000e536f75726365506f736974696f6e000000000000 *000c536f75726365436f6c756d6e000000000000000a536f757263654c696e6500000000000000 *0b73746172744f6646696c65000000000000000c736f75726365436f6c756d6e00000000000000 *0a736f757263654c696e65000000000000001273686f77536f75726365506f736974696f6e0000 *00000000000455544638000000000000000772756e55544638000000000000000b576974685265 *6475636572000000000000000e72756e5769746852656475636572000000000000000b77697468 *52656475636572000000000000000e776974686f75745265647563657200000000000000094765 *6e657261746f720000000000000004456c656d00000000000000096d6170726564756365000000 *000000000a6d617072656475636572000000000000000a6d61707265647563656c000000000000 *0007556e6c696e6564000000000000000a72756e556e6c696e65640000000000000008556e7370 *61636564000000000000000b72756e556e73706163656400000000000000054c696e6573000000 *0000000005576f726473000000000000000872756e576f726473000000000000000872756e4c69 *6e65730000000000000009776f72647346726f6d00000000000000096c696e657346726f6d0000 *0000000000064d6f6e6f6964000000000000000b4748432e436c61737365730000000000000003 *6d696e00000000000000074e6f7468696e6700000000000000054d617962650000000000000003 *6d617800000000000000084748432e456e756d00000000000000086d6178426f756e6400000000 *000000086d696e426f756e6400000000000000076d617070656e6400000000000000066d656d70 *747900000000000000076d636f6e63617400000000000000076765744475616c00000000000000 *044475616c0000000000000007617070456e646f0000000000000004456e646f00000000000000 *06676574416c6c0000000000000003416c6c0000000000000006676574416e7900000000000000 *03416e79000000000000000667657453756d000000000000000353756d000000000000000a6765 *7450726f64756374000000000000000750726f6475637400000000000000086765744669727374 *0000000000000005466972737400000000000000076765744c61737400000000000000044c6173 *74 newhex * rmfile ./dist/doc/html/lexical-monoids/lexical-monoids.haddock binary ./dist/doc/html/lexical-monoids/minus.gif oldhex *47494638396109000900910000fefefe8282820202020000002c00000000090009000002118c8f *a00bc6eb5e0b40583b6596f1a11f14003b newhex * rmfile ./dist/doc/html/lexical-monoids/minus.gif binary ./dist/doc/html/lexical-monoids/plus.gif oldhex *47494638396109000900910000fefefe8282820202020000002c00000000090009000002148c8f *a00bb6b29c82ca897b5b7871cfce74085200003b newhex * rmfile ./dist/doc/html/lexical-monoids/plus.gif hunk ./dist/doc/html/lexical-monoids/src/Data-Monoid-Generator.html 1 - - - - -Data/Monoid/Generator.hs - - - -
{-# LANGUAGE UndecidableInstances, TypeOperators, FlexibleContexts, MultiParamTypeClasses, FlexibleInstances, TypeFamilies #-}
-module Data.Monoid.Generator
-    ( module Data.Monoid
-    , Generator
-    , Elem
-    , mapreduce
-    , mapreducer
-    , mapreducel
-    ) where
-
-import Prelude hiding (lex)
-import Data.Word (Word8)
-import Data.Text (Text)
-import Data.Foldable (fold,foldMap)
-import qualified Data.Text as Text
-import qualified Data.ByteString as Strict
-import qualified Data.ByteString.Lazy as Lazy
-import Control.Parallel.Strategies
-import Data.Monoid
-import Data.Monoid.Reducer
-
--- minimal definition mapreduce or affixMapReduce
-class Generator c where
-    type Elem c :: * 
-    mapreduce   :: (e `Reducer` m) => (Elem c -> e) -> c -> m
-    mapreducer  :: (e `Reducer` m) => (Elem c -> e) -> m -> c -> m 
-    mapreducel  :: (e `Reducer` m) => (Elem c -> e) -> c -> m -> m
-
-    mapreduce  f = mapreducer f mempty
-    mapreducer f m = mappend m . mapreduce f
-    mapreducel f = mappend . mapreduce f
-
-instance Generator Strict.ByteString where
-    type Elem Strict.ByteString = Word8
-    mapreducer f = Strict.foldl' (\a -> reducer a . f)
-
-instance Generator Lazy.ByteString where
-    type Elem Lazy.ByteString = Elem Strict.ByteString
-    mapreduce f = fold . parMap rwhnf (mapreduce f) . Lazy.toChunks
-
-instance Generator Text where
-    type Elem Text = Char
-    mapreducer f = Text.foldl' (\a -> reducer a . f)
-
-instance Generator [c] where
-    type Elem [c] = c
-    mapreduce f = foldMap (reduce . f)
-
- rmfile ./dist/doc/html/lexical-monoids/src/Data-Monoid-Generator.html hunk ./dist/doc/html/lexical-monoids/src/Data-Monoid-Lexical-SourcePosition.html 1 - - - - -Data/Monoid/Lexical/SourcePosition.hs - - - -
{-# LANGUAGE FlexibleInstances, MultiParamTypeClasses #-}
-module Data.Monoid.Lexical.SourcePosition
-    ( module Data.Monoid.Reducer.Char
-    , SourcePosition
-    , SourceLine
-    , SourceColumn
-    , sourceLine
-    , sourceColumn
-    , startOfFile
-    , showSourcePosition
-    ) where
-
-import Prelude hiding (lex)
-import Control.Functor.Extras
-import Control.Functor.Pointed
-import Data.Monoid.Reducer.Char
-
-type SourceLine = Int
-type SourceColumn = Int
-
-data SourcePosition file = Pos file {-# UNPACK #-} !SourceLine !SourceColumn
-         | Lines {-# UNPACK #-} !SourceLine !SourceColumn
-         | Columns {-# UNPACK #-} !SourceColumn
-         | Tab {-# UNPACK #-} !SourceColumn !SourceColumn -- cols before and after an unresolved tab
-    deriving (Read,Show,Eq)
-
-nextTab :: Int -> Int
-nextTab x = x + (8 - (x-1) `mod` 8)
-
-instance Functor SourcePosition where
-    fmap g (Pos f l c) = Pos (g f) l c
-    fmap _ (Lines l c) = Lines l c
-    fmap _ (Columns c) = Columns c
-    fmap _ (Tab x y) = Tab x y
-
-instance Pointed SourcePosition where
-    point f = Pos f 1 1
-
-instance FunctorZero SourcePosition where
-    fzero = mempty
-
-instance FunctorPlus SourcePosition where
-    fplus = mappend
-
-instance Monoid (SourcePosition file) where
-    mempty = Columns 0
-
-    Pos f l _ `mappend` Lines m d = Pos f (l + m) d
-    Pos f l c `mappend` Columns d = Pos f l (c + d)
-    Pos f l c `mappend` Tab x y   = Pos f l (nextTab (c + x) + y)
-    Lines l _ `mappend` Lines m d = Lines (l + m) d
-    Lines l c `mappend` Columns d = Lines l (c + d)
-    Lines l c `mappend` Tab x y   = Lines l (nextTab (c + x) + y)
-    Columns c `mappend` Columns d  = Columns (c + d)
-    Columns c `mappend` Tab x y    = Tab (c + x) y
-    Tab _ _   `mappend` Lines m d  = Lines m d
-    Tab x y   `mappend` Columns d  = Tab x (y + d)
-    Tab x y   `mappend` Tab x' y'  = Tab x (nextTab (y + x') + y')
-    _         `mappend` pos        = pos
-
-instance Reducer Char (SourcePosition file) where
-    reduce '\n' = Lines 1 1
-    reduce '\t' = Tab 0 0 
-    reduce _    = Columns 1
-
-instance CharReducer (SourcePosition file)
-    
-startOfFile :: f -> SourcePosition f
-startOfFile = point
-
-sourceColumn :: SourcePosition f -> Maybe SourceColumn
-sourceColumn (Pos _ _ c) = Just c
-sourceColumn (Lines _ c) = Just c
-sourceColumn _ = Nothing
-
-sourceLine :: SourcePosition f -> Maybe SourceLine
-sourceLine (Pos _ l _) = Just l
-sourceLine _ = Nothing
-
-showSourcePosition :: SourcePosition String -> String
-showSourcePosition pos = showSourcePosition' (point "-" `mappend` pos) where
-    showSourcePosition' (Pos f l c) = f ++ ":" ++ show l ++ ":" ++ show c
-    showSourcePosition' _ = undefined
-
- rmfile ./dist/doc/html/lexical-monoids/src/Data-Monoid-Lexical-SourcePosition.html hunk ./dist/doc/html/lexical-monoids/src/Data-Monoid-Lexical-UTF8-Decoder.html 1 - - - - -Data/Monoid/Lexical/UTF8/Decoder.hs - - - -
{-# LANGUAGE FlexibleInstances, MultiParamTypeClasses #-}
-module Data.Monoid.Lexical.UTF8.Decoder 
-    ( module Data.Monoid.Reducer.Char
-    , UTF8
-    , runUTF8
-    ) where
-    
-import Data.Bits (shiftL,(.&.),(.|.))
-import Data.Word (Word8)
-
-import Control.Functor.Pointed
-
-import Data.Monoid.Reducer.Char
-
--- Incrementally reduce canonical RFC3629 UTF-8 Characters
-
--- utf8 characters are at most 4 characters long, so we need only retain state for 3 of them
--- moreover their length is able to be determined a priori, so lets store that intrinsically in the constructor
-data H = H0
-       | H2_1 {-# UNPACK #-} !Word8 
-       | H3_1 {-# UNPACK #-} !Word8
-       | H3_2 {-# UNPACK #-} !Word8 !Word8
-       | H4_1 {-# UNPACK #-} !Word8
-       | H4_2 {-# UNPACK #-} !Word8 !Word8
-       | H4_3 {-# UNPACK #-} !Word8 !Word8 !Word8
-
--- words expressing the tail of a character, each between 0x80 and 0xbf
--- this is arbitrary length to simplify making the parser truly monoidal
--- this probably means we have O(n^2) worst case performance in the face of very long runs of chars that look like 10xxxxxx
-type T = [Word8]
-
--- S is a segment that contains a possible tail of a character, the result of reduceing some full characters, and the start of another character
--- T contains a list of bytes each between 0x80 and 0xbf
-data UTF8 m = S T m !H
-            | T T
-
--- flush any extra characters in a head, when the next character isn't between 0x80 and 0xbf
-flushH :: CharReducer m => H -> m
-flushH (H0) = mempty
-flushH (H2_1 x) = invalidChar [x]
-flushH (H3_1 x) = invalidChar [x]
-flushH (H3_2 x y) = invalidChar [x,y]
-flushH (H4_1 x) = invalidChar [x]
-flushH (H4_2 x y) = invalidChar [x,y]
-flushH (H4_3 x y z) = invalidChar [x,y,z]
-
--- flush a character tail 
-flushT :: CharReducer m => [Word8] -> m
-flushT = invalidChar
-
-reducerH :: CharReducer m => H -> Word8 -> (m -> H -> UTF8 m) -> m -> UTF8 m
-reducerH H0 c k m 
-    | c < 0x80 = k (m `mappend` b1 c) H0
-    | c < 0xc0 = k (m `mappend` invalidChar [c]) H0
-    | c < 0xe0 = k m (H2_1 c)
-    | c < 0xf0 = k m (H3_1 c)
-    | c < 0xf5 = k m (H4_1 c)
-    | otherwise = k (m `mappend` invalidChar [c]) H0
-reducerH (H2_1 c) d k m
-    | d >= 0x80 && d < 0xc0 = k (m `mappend` b2 c d) H0
-    | otherwise = k (m `mappend` invalidChar [c]) H0
-reducerH (H3_1 c) d k m 
-    | d >= 0x80 && d < 0xc0 = k m (H3_2 c d)
-    | otherwise = k (m `mappend` invalidChar [c]) H0
-reducerH (H3_2 c d) e k m 
-    | d >= 0x80 && d < 0xc0 = k (m `mappend` b3 c d e) H0
-    | otherwise = k (m `mappend` invalidChar [c,d]) H0
-reducerH (H4_1 c) d k m 
-    | d >= 0x80 && d < 0xc0 = k m (H4_2 c d)
-    | otherwise = k (m `mappend` invalidChar [c,d]) H0
-reducerH (H4_2 c d) e k m 
-    | d >= 0x80 && d < 0xc0 = k m (H4_3 c d e)
-    | otherwise = k (m `mappend` invalidChar [c,d,e]) H0
-reducerH (H4_3 c d e) f k m 
-    | d >= 0x80 && d < 0xc0 = k (m `mappend` b4 c d e f) H0
-    | otherwise = k (m `mappend` invalidChar [c,d,e,f]) H0
-
-mask :: Word8 -> Word8 -> Int
-mask c m = fromEnum (c .&. m) 
-
-combine :: Int -> Word8 -> Int
-combine a r = shiftL a 6 .|. fromEnum (r .&. 0x3f)
-
-b1 :: CharReducer m => Word8 -> m
-b1 c | c < 0x80 = reduceChar . toEnum $ fromEnum c
-     | otherwise = invalidChar [c]
-
-b2 :: CharReducer m => Word8 -> Word8 -> m
-b2 c d | valid_b2 c d = reduceChar (toEnum (combine (mask c 0x1f) d))
-       | otherwise = invalidChar [c,d]
-
-b3 :: CharReducer m => Word8 -> Word8 -> Word8 -> m
-b3 c d e | valid_b3 c d e = reduceChar (toEnum (combine (combine (mask c 0x0f) d) e))
-         | otherwise = invalidChar [c,d,e]
-
-
-b4 :: CharReducer m => Word8 -> Word8 -> Word8 -> Word8 -> m
-b4 c d e f | valid_b4 c d e f = reduceChar (toEnum (combine (combine (combine (mask c 0x07) d) e) f))
-           | otherwise = invalidChar [c,d,e,f]
-
-valid_b2 :: Word8 -> Word8 -> Bool
-valid_b2 c d = (c >= 0xc2 && c <= 0xdf && d >= 0x80 && d <= 0xbf)
-
-valid_b3 :: Word8 -> Word8 -> Word8 -> Bool
-valid_b3 c d e = (c == 0xe0 && d >= 0xa0 && d <= 0xbf && e >= 0x80 && e <= 0xbf) || 
-                 (c >= 0xe1 && c <= 0xef && d >= 0x80 && d <= 0xbf && e >= 0x80 && e <= 0xbf)
-
-valid_b4 :: Word8 -> Word8 -> Word8 -> Word8 -> Bool
-valid_b4 c d e f = (c == 0xf0 && d >= 0x90 && d <= 0xbf && e >= 0x80 && e <= 0xbf && f >= 0x80 && f <= 0xbf) ||
-      (c >= 0xf1 && c <= 0xf3 && d >= 0x80 && d <= 0xbf && e >= 0x80 && e <= 0xbf && f >= 0x80 && f <= 0xbf) ||
-                   (c == 0xf4 && d >= 0x80 && d <= 0x8f && e >= 0x80 && e <= 0xbf && f >= 0x80 && f <= 0xbf)
-
-reducelT :: CharReducer m => Word8 -> T -> (H -> UTF8 m) -> (m -> UTF8 m) -> (T -> UTF8 m) -> UTF8 m
-reducelT c cs h m t
-             | c < 0x80 = m $ b1 c `mappend` invalidChars cs
-             | c < 0xc0 = t (c:cs)
-             | c < 0xe0 = case cs of
-                        [] -> h $ H2_1 c
-                        (d:ds) -> m $ b2 c d `mappend` invalidChars ds
-             | c < 0xf0 = case cs of
-                        [] -> h $ H3_1 c
-                        [d] -> h $ H3_2 c d
-                        (d:e:es) -> m $ b3 c d e `mappend` invalidChars es
-             | c < 0xf5 = case cs of
-                        [] -> h $ H4_1 c
-                        [d] -> h $ H4_2 c d 
-                        [d,e] -> h $ H4_3 c d e 
-                        (d:e:f:fs) -> m $ b4 c d e f `mappend` invalidChars fs
-             | otherwise = mempty
-
-invalidChars :: CharReducer m => [Word8] -> m
-invalidChars = foldr (mappend . invalidChar . return) mempty
-
-merge :: CharReducer m => H -> T -> (m -> a) -> (H -> a) -> a
-merge H0 cs k _               = k $ invalidChars cs
-merge (H2_1 c) [] _ p         = p $ H2_1 c
-merge (H2_1 c) (d:ds) k _     = k $ b2 c d `mappend` invalidChars ds
-merge (H3_1 c) [] _ p         = p $ H3_1 c
-merge (H3_1 c) [d] _ p        = p $ H3_2 c d
-merge (H3_1 c) (d:e:es) k _   = k $ b3 c d e `mappend` invalidChars es
-merge (H3_2 c d) [] _ p       = p $ H3_2 c d
-merge (H3_2 c d) (e:es) k _   = k $ b3 c d e `mappend` invalidChars es
-merge (H4_1 c) [] _ p         = p $ H4_1 c
-merge (H4_1 c) [d] _ p        = p $ H4_2 c d
-merge (H4_1 c) [d,e] _ p      = p $ H4_3 c d e
-merge (H4_1 c) (d:e:f:fs) k _ = k $ b4 c d e f `mappend` invalidChars fs
-merge (H4_2 c d) [] _ p       = p $ H4_2 c d 
-merge (H4_2 c d) [e] _ p      = p $ H4_3 c d e
-merge (H4_2 c d) (e:f:fs) k _ = k $ b4 c d e f `mappend` invalidChars fs
-merge (H4_3 c d e) [] _ p     = p $ H4_3 c d e
-merge (H4_3 c d e) (f:fs) k _ = k $ b4 c d e f `mappend` invalidChars fs
-
-instance CharReducer m => Monoid (UTF8 m) where
-    mempty = T []
-    T c `mappend` T d = T (c ++ d)
-    T c `mappend` S l m r = S (c ++ l) m r
-    S l m c `mappend` S c' m' r = S l (m `mappend` merge c c' id flushH `mappend` m') r
-    s@(S _ _ _) `mappend` T [] = s
-    S l m c `mappend` T c' = merge c c' k (S l m) where
-        k m' = S l (m `mappend` m') H0
-
-instance CharReducer m => Reducer Word8 (UTF8 m) where
-    S t m h `reducer` c        = reducerH h c (S t) m
-    T t     `reducer` c        | c >= 0x80 && c < 0xc0 = T (t ++ [c])
-                               | otherwise = reducerH H0 c (S t) mempty
-
-    c       `reducel` T cs     = reducelT c cs (S [] mempty) (flip (S []) H0) T
-    c       `reducel` S cs m h = reducelT c cs k1 k2 k3 where
-        k1 h' = S [] (flushH h' `mappend` m) h
-        k2 m' = S [] (m' `mappend` m) h
-        k3 t' = S t' m h
-    
-instance Functor UTF8 where
-    fmap f (S t x h) = S t (f x) h
-    fmap _ (T t) = T t
-
-instance Pointed UTF8 where
-    point f = S [] f H0
-
-runUTF8 :: CharReducer m => UTF8 m -> m 
-runUTF8 (T t) = flushT t
-runUTF8 (S t m h) = flushT t `mappend` m `mappend` flushH h
-
- rmfile ./dist/doc/html/lexical-monoids/src/Data-Monoid-Lexical-UTF8-Decoder.html hunk ./dist/doc/html/lexical-monoids/src/Data-Monoid-Lexical-Words.html 1 - - - - -Data/Monoid/Lexical/Words.hs - - - -
{-# LANGUAGE FlexibleInstances, MultiParamTypeClasses, FlexibleContexts, GeneralizedNewtypeDeriving, ParallelListComp, TypeFamilies #-}
-module Data.Monoid.Lexical.Words 
-    ( module Data.Monoid.Reducer.Char
-    , Words
-    , runWords
-    , Lines
-    , runLines
-    , Unspaced(runUnspaced)
-    , Unlined(runUnlined)
-    , wordsFrom
-    , linesFrom
-    ) where
-
-import Data.Char (isSpace)
-import Data.Maybe (maybeToList)
-import Data.Monoid.Reducer.Char
-import Data.Monoid.Generator
-import Control.Functor.Pointed
-
-data Words m = Chunk (Maybe m)
-             | Segment (Maybe m) [m] (Maybe m)
-    deriving (Show,Read)
-
-runWords :: Words m -> [m]
-runWords (Chunk m) = maybeToList m
-runWords (Segment l m r) = maybeToList l ++ m ++ maybeToList r
-
-instance Monoid m => Monoid (Words m) where
-    mempty = Chunk mempty
-    Chunk l `mappend` Chunk r = Chunk (l `mappend` r)
-    Chunk l `mappend` Segment l' m r = Segment (l `mappend` l') m r
-    Segment l m r `mappend` Chunk r' = Segment l m (r `mappend` r')
-    Segment l m r `mappend` Segment l' m' r' = Segment l (m ++ maybeToList (r `mappend` l') ++ m') r'
-
-instance Reducer Char m => Reducer Char (Words m) where
-    reduce c | isSpace c = Segment (Just (reduce c)) [] mempty
-          | otherwise = Chunk (Just (reduce c))
-
-instance Functor Words where
-    fmap f (Chunk m) = Chunk (fmap f m)
-    fmap f (Segment m ms m') = Segment (fmap f m) (fmap f ms) (fmap f m')
-
--- abuse the same machinery to handle lines as well
-
-newtype Lines m = Lines (Words m) deriving (Show,Read,Monoid,Functor)
-
-instance Reducer Char m => Reducer Char (Lines m) where
-    reduce '\n' = Lines $ Segment (Just (reduce '\n')) [] mempty
-    reduce c = Lines $ Chunk (Just (reduce c))
-
-runLines :: Lines m -> [m]
-runLines (Lines x) = runWords x
-
-newtype Unspaced m = Unspaced { runUnspaced :: m }  deriving (Eq,Ord,Show,Read,Monoid)
-
-instance Reducer Char m => Reducer Char (Unspaced m) where
-    reduce c | isSpace c = mempty
-          | otherwise = Unspaced (reduce c)
-
-instance CharReducer m => CharReducer (Unspaced m) where
-    invalidChar = Unspaced . invalidChar
-
-instance Functor Unspaced where
-    fmap f (Unspaced x) = Unspaced (f x)
-
-instance Pointed Unspaced where
-    point = Unspaced
-
-instance Copointed Unspaced where
-    extract = runUnspaced
-
-newtype Unlined m = Unlined { runUnlined :: m }  deriving (Eq,Ord,Show,Read,Monoid)
-
-instance Reducer Char m => Reducer Char (Unlined m) where
-    reduce '\n' = mempty
-    reduce c = Unlined (reduce c)
-
-instance CharReducer m => CharReducer (Unlined m) where
-    invalidChar = Unlined . invalidChar
-
-instance Functor Unlined where
-    fmap f (Unlined x) = Unlined (f x)
-
-instance Pointed Unlined where
-    point = Unlined
-
-instance Copointed Unlined where
-    extract = runUnlined
-
--- accumulator, inside-word, and until-next-word monoids
-wordsFrom :: (Generator c, Elem c ~ Char, Char `Reducer` m, Char `Reducer` n, Char `Reducer` o) => m -> c -> [(m,n,o)]
-wordsFrom s c = [(x,runUnlined y,z) | x <- scanl mappend s ls | (y,z) <- rs ] where
-    (ls,rs) = unzip (runWords (mapreduce id c))
-
--- accumulator, inside-line, and until-next-line monoids
-linesFrom :: (Generator c, Elem c ~ Char, Char `Reducer` m, Char `Reducer` n, Char `Reducer` o) => m -> c -> [(m,n,o)]
-linesFrom s c = [(x,runUnlined y,z) | x <- scanl mappend s ls | (y,z) <- rs ] where
-    (ls,rs) = unzip (runLines (mapreduce id c))
-
- rmfile ./dist/doc/html/lexical-monoids/src/Data-Monoid-Lexical-Words.html hunk ./dist/doc/html/lexical-monoids/src/Data-Monoid-Ord.html 1 - - - - -Data/Monoid/Ord.hs - - - -
-----------------------------------------------------------------------------
----- |
----- Module      :  Data.Monoid.Ord
----- Copyright   :  (c) Edward Kmett 2009
----- License     :  BSD-style
----- Maintainer  :  libraries@haskell.org
----- Stability   :  provisional
----- Portability :  portable
-----
----- Some 'Monoid' instances that should probably be in "Data.Monoid".
-----
--------------------------------------------------------------------------------
-
-module Data.Monoid.Ord 
-    ( module Data.Monoid
-    -- * Max
-    , Max(Max,getMax)
-    -- * Min
-    , Min(Min,getMin)
-    -- * MaxPriority: Max semigroup w/ added bottom
-    , MaxPriority(MaxPriority,getMaxPriority)
-    -- * MinPriority: Min semigroup w/ added top
-    , MinPriority(MinPriority,getMinPriority)
-    ) where
-
-import Data.Monoid (Monoid, mappend, mempty)
-
-
--- | The 'Monoid' @('max','minBound')@
-newtype Max a = Max { getMax :: a } deriving (Eq,Ord,Show,Read,Bounded)
-
-instance (Ord a, Bounded a) => Monoid (Max a) where
-    mempty = Max minBound
-    mappend = max
-
--- | The 'Monoid' given by @('min','maxBound')@
-newtype Min a = Min { getMin :: a } deriving (Eq,Ord,Show,Read,Bounded)
-
-instance (Ord a, Bounded a) => Monoid (Min a) where
-    mempty = Min maxBound
-    mappend = min
-
--- | The 'Monoid' @('max','Nothing')@ over @'Maybe' a@ where 'Nothing' is the bottom element
-newtype MaxPriority a = MaxPriority { getMaxPriority :: Maybe a } deriving (Eq,Ord,Show,Read)
-
-instance Ord a => Monoid (MaxPriority a) where
-    mempty = MaxPriority Nothing
-    mappend = max
-
--- | The 'Monoid' @('min','Nothing')@ over @'Maybe' a@ where 'Nothing' is the top element
-newtype MinPriority a = MinPriority { getMinPriority :: Maybe a } deriving (Eq,Show,Read)
-
-instance Ord a => Ord (MinPriority a) where
-    MinPriority Nothing  `compare` MinPriority Nothing  = EQ
-    MinPriority Nothing  `compare` _                    = GT
-    _                    `compare` MinPriority Nothing  = LT
-    MinPriority (Just a) `compare` MinPriority (Just b) = a `compare` b
-
-instance Ord a => Monoid (MinPriority a) where
-    mempty = MinPriority Nothing
-    mappend = min
-
- rmfile ./dist/doc/html/lexical-monoids/src/Data-Monoid-Ord.html hunk ./dist/doc/html/lexical-monoids/src/Data-Monoid-Reducer-Char.html 1 - - - - -Data/Monoid/Reducer/Char.hs - - - -
{-# LANGUAGE UndecidableInstances, FlexibleContexts, MultiParamTypeClasses, FlexibleInstances #-}
-module Data.Monoid.Reducer.Char
-    ( module Data.Monoid.Reducer
-    , CharReducer
-    , invalidChar
-    , reduceChar
-    ) where
-
-import Data.Monoid.Reducer
-import Data.Word (Word8)
-
-class Reducer Char m => CharReducer m where
-    reduceChar :: Char -> m 
-    reduceChar = reduce
-
-    invalidChar :: [Word8] -> m
-    invalidChar = const mempty
-
-instance (CharReducer m, CharReducer m') =>  CharReducer (m,m') where
-    invalidChar bs = (invalidChar bs, invalidChar bs)
-
-instance (CharReducer m, CharReducer m', CharReducer m'') =>  CharReducer (m,m',m'') where
-    invalidChar bs = (invalidChar bs, invalidChar bs, invalidChar bs)
-
-instance (CharReducer m, CharReducer m', CharReducer m'', CharReducer m''') =>  CharReducer (m,m',m'',m''') where
-    invalidChar bs = (invalidChar bs, invalidChar bs, invalidChar bs, invalidChar bs)
-
-instance CharReducer [Char]
-
-instance CharReducer ()
-
- rmfile ./dist/doc/html/lexical-monoids/src/Data-Monoid-Reducer-Char.html hunk ./dist/doc/html/lexical-monoids/src/Data-Monoid-Reducer-With.html 1 - - - - -Data/Monoid/Reducer/With.hs - - - -
{-# LANGUAGE UndecidableInstances, TypeOperators, FlexibleContexts, MultiParamTypeClasses, FlexibleInstances #-}
-module Data.Monoid.Reducer.With
-    ( module Data.Monoid.Reducer
-    , WithReducer(runWithReducer)
-    , withReducer
-    , withoutReducer
-    ) where
-
-import Data.Monoid.Reducer
-import Data.FingerTree
-
-newtype WithReducer c m = WithReducer { runWithReducer :: (m,c) } 
-
-withReducer :: (c `Reducer` m) => c -> c `WithReducer` m
-withReducer x = d `seq` WithReducer (d, x) where d = reduce x
-
-withoutReducer :: c `WithReducer` m -> c
-withoutReducer = snd . runWithReducer
-
-instance (c `Reducer` m) => Reducer (c `WithReducer` m) m where
-    reduce = fst . runWithReducer 
-
-instance (c `Reducer` m) => Measured m (c `WithReducer` m) where
-    measure = fst . runWithReducer
-
- rmfile ./dist/doc/html/lexical-monoids/src/Data-Monoid-Reducer-With.html hunk ./dist/doc/html/lexical-monoids/src/Data-Monoid-Reducer.html 1 - - - - -Data/Monoid/Reducer.hs - - - -
{-# LANGUAGE UndecidableInstances, FlexibleContexts, MultiParamTypeClasses, FlexibleInstances #-}
-module Data.Monoid.Reducer
-    ( module Data.Monoid
-    , Reducer
-    , reduce, reducer, reducel
-    ) where
-
-import Data.Monoid (Monoid, mempty, mappend)
-
--- minimal definition reduce or reducer
-class Monoid m => Reducer c m where
-    reduce :: c -> m 
-    reducer :: m -> c -> m
-    reducel :: c -> m -> m 
-
-    reduce = reducer mempty 
-    reducer m = mappend m . reduce
-    reducel = mappend . reduce
-
-instance (Reducer c m, Reducer c m') => Reducer c (m,m') where
-    reduce x = (reduce x,reduce x)
-    reducer (m,m') x = (reducer m x, reducer m' x)
-    reducel x (m,m') = (reducel x m, reducel x m')
-
-instance (Reducer c m, Reducer c m', Reducer c m'') => Reducer c (m,m',m'') where
-    reduce x = (reduce x,reduce x, reduce x)
-    reducer (m,m',m'') x = (reducer m x, reducer m' x, reducer m'' x)
-    reducel x (m,m',m'') = (reducel x m, reducel x m', reducel x m'')
-
-instance (Reducer c m, Reducer c m', Reducer c m'', Reducer c m''') => Reducer c (m,m',m'',m''') where
-    reduce x = (reduce x,reduce x, reduce x, reduce x)
-    reducer (m,m',m'',m''') x = (reducer m x, reducer m' x, reducer m'' x, reducer m''' x)
-    reducel x (m,m',m'',m''') = (reducel x m, reducel x m', reducel x m'', reducel x m''')
-
-instance Reducer c [c] where
-    reduce = return
-    reducel = (:)
-    reducer xs x = xs ++ [x]
-
-instance Reducer c () where
-    reduce _ = ()
-    reducer _ _ = ()
-    reducel _ _ = ()
-
- rmfile ./dist/doc/html/lexical-monoids/src/Data-Monoid-Reducer.html hunk ./dist/doc/html/lexical-monoids/src/hscolour.css 1 -.hs-keyglyph, .hs-layout {color: red;} -.hs-keyword {color: blue;} -.hs-comment, .hs-comment a {color: green;} -.hs-str, .hs-chr {color: teal;} -.hs-keyword, .hs-conid, .hs-varid, .hs-conop, .hs-varop, .hs-num, .hs-cpp, .hs-sel, .hs-definition {} rmfile ./dist/doc/html/lexical-monoids/src/hscolour.css rmdir ./dist/doc/html/lexical-monoids/src rmdir ./dist/doc/html/lexical-monoids addfile ./dist/doc/html/monoids/Data-Monoid-Applicative.html hunk ./dist/doc/html/monoids/Data-Monoid-Applicative.html 1 + + +Data.Monoid.Applicative
 monoids-0.1.1: Lots of MonoidsSource codeContentsIndex
Data.Monoid.Applicative
Documentation
module Data.Monoid.Reducer
newtype Traversal f Source
Constructors
Traversal
getTraversal :: f ()
show/hide Instances
newtype Alternate f a Source
Constructors
Alternate
getAlternate :: f a
show/hide Instances
Produced by Haddock version 2.3.0
addfile ./dist/doc/html/monoids/Data-Monoid-FingerTree.html hunk ./dist/doc/html/monoids/Data-Monoid-FingerTree.html 1 + + +Data.Monoid.FingerTree
 monoids-0.1.1: Lots of MonoidsSource codeContentsIndex
Data.Monoid.FingerTree
Documentation
module Data.Monoid.Reducer
Produced by Haddock version 2.3.0
addfile ./dist/doc/html/monoids/Data-Monoid-Generator.html hunk ./dist/doc/html/monoids/Data-Monoid-Generator.html 1 + + +Data.Monoid.Generator
 monoids-0.1.1: Lots of MonoidsSource codeContentsIndex
Data.Monoid.Generator
Documentation
class Generator c whereSource
Associated Types
type Elem c :: *Source
Methods
mapReduce :: Reducer e m => (Elem c -> e) -> c -> mSource
mapTo :: Reducer e m => (Elem c -> e) -> m -> c -> mSource
mapFrom :: Reducer e m => (Elem c -> e) -> c -> m -> mSource
show/hide Instances
mapReduce :: (Generator c, Reducer e m) => (Elem c -> e) -> c -> mSource
mapTo :: (Generator c, Reducer e m) => (Elem c -> e) -> m -> c -> mSource
mapFrom :: (Generator c, Reducer e m) => (Elem c -> e) -> c -> m -> mSource
Produced by Haddock version 2.3.0
addfile ./dist/doc/html/monoids/Data-Monoid-IntMap.html hunk ./dist/doc/html/monoids/Data-Monoid-IntMap.html 1 + + +Data.Monoid.IntMap
 monoids-0.1.1: Lots of MonoidsSource codeContentsIndex
Data.Monoid.IntMap
Documentation
module Data.Monoid.Reducer
data Union a Source
show/hide Instances
data UnionWith m Source
show/hide Instances
Produced by Haddock version 2.3.0
addfile ./dist/doc/html/monoids/Data-Monoid-Lexical-SourcePosition.html hunk ./dist/doc/html/monoids/Data-Monoid-Lexical-SourcePosition.html 1 + + +Data.Monoid.Lexical.SourcePosition
 monoids-0.1.1: Lots of MonoidsSource codeContentsIndex
Data.Monoid.Lexical.SourcePosition
Documentation
module Data.Monoid.Reducer.Char
data SourcePosition file Source
show/hide Instances
type SourceLine = IntSource
type SourceColumn = IntSource
sourceLine :: SourcePosition f -> Maybe SourceLineSource
sourceColumn :: SourcePosition f -> Maybe SourceColumnSource
startOfFile :: f -> SourcePosition fSource
showSourcePosition :: SourcePosition String -> StringSource
Produced by Haddock version 2.3.0
addfile ./dist/doc/html/monoids/Data-Monoid-Lexical-UTF8-Decoder.html hunk ./dist/doc/html/monoids/Data-Monoid-Lexical-UTF8-Decoder.html 1 + + +Data.Monoid.Lexical.UTF8.Decoder
 monoids-0.1.1: Lots of MonoidsSource codeContentsIndex
Data.Monoid.Lexical.UTF8.Decoder
Documentation
module Data.Monoid.Reducer.Char
data UTF8 m Source
show/hide Instances
runUTF8 :: CharReducer m => UTF8 m -> mSource
Produced by Haddock version 2.3.0
addfile ./dist/doc/html/monoids/Data-Monoid-Lexical-Words.html hunk ./dist/doc/html/monoids/Data-Monoid-Lexical-Words.html 1 + + +Data.Monoid.Lexical.Words
 monoids-0.1.1: Lots of MonoidsSource codeContentsIndex
Data.Monoid.Lexical.Words
Documentation
module Data.Monoid.Reducer.Char
data Words m Source
show/hide Instances
runWords :: Words m -> [m]Source
data Lines m Source
show/hide Instances
runLines :: Lines m -> [m]Source
data Unspaced m Source
show/hide Instances
data Unlined m Source
show/hide Instances
wordsFrom :: (Generator c, Elem c ~ Char, Reducer Char m, Reducer Char n, Reducer Char o) => m -> c -> [(m, n, o)]Source
linesFrom :: (Generator c, Elem c ~ Char, Reducer Char m, Reducer Char n, Reducer Char o) => m -> c -> [(m, n, o)]Source
Produced by Haddock version 2.3.0
addfile ./dist/doc/html/monoids/Data-Monoid-Map.html hunk ./dist/doc/html/monoids/Data-Monoid-Map.html 1 + + +Data.Monoid.Map
 monoids-0.1.1: Lots of MonoidsSource codeContentsIndex
Data.Monoid.Map
Documentation
module Data.Monoid.Reducer
data Union k a Source
show/hide Instances
Ord k => Monoid (Union k a)
Ord k => Reducer (Map k a) (Union k a)
data UnionWith k m Source
show/hide Instances
(Ord k, Monoid m) => Monoid (UnionWith k m)
(Ord k, Monoid m) => Reducer (Map k m) (UnionWith k m)
Produced by Haddock version 2.3.0
addfile ./dist/doc/html/monoids/Data-Monoid-Monad.html hunk ./dist/doc/html/monoids/Data-Monoid-Monad.html 1 + + +Data.Monoid.Monad
 monoids-0.1.1: Lots of MonoidsSource codeContentsIndex
Data.Monoid.Monad
Documentation
module Data.Monoid.Reducer
newtype Action m Source
Constructors
Action
getAction :: m ()
show/hide Instances
Monad m => Monoid (Action m)
Monad m => Reducer (m a) (Action m)
newtype MonadSum m a Source
Constructors
MonadSum
getMonadSum :: m a
show/hide Instances
Monad m => Monad (MonadSum m)
Functor m => Functor (MonadSum m)
MonadPlus m => MonadPlus (MonadSum m)
MonadPlus m => Reducer (m a) (MonadSum m a)
Eq (m a) => Eq (MonadSum m a)
Ord (m a) => Ord (MonadSum m a)
Read (m a) => Read (MonadSum m a)
Show (m a) => Show (MonadSum m a)
MonadPlus m => Monoid (MonadSum m a)
Produced by Haddock version 2.3.0
addfile ./dist/doc/html/monoids/Data-Monoid-Ord.html hunk ./dist/doc/html/monoids/Data-Monoid-Ord.html 1 + + +Data.Monoid.Ord
 monoids-0.1.1: Lots of MonoidsSource codeContentsIndex
Data.Monoid.Ord
Contents
Max +
Min +
MaxPriority: Max semigroup w/ added bottom +
MinPriority: Min semigroup w/ added top +
Synopsis
newtype Max a = Max {
getMax :: a
}
newtype Min a = Min {
getMin :: a
}
newtype MaxPriority a = MaxPriority {
getMaxPriority :: Maybe a
}
newtype MinPriority a = MinPriority {
getMinPriority :: Maybe a
}
Max +
newtype Max a Source
The Monoid (max,minBound) +
Constructors
Max
getMax :: a
show/hide Instances
Bounded a => Bounded (Max a)
Eq a => Eq (Max a)
Ord a => Ord (Max a)
Read a => Read (Max a)
Show a => Show (Max a)
(Ord a, Bounded a) => Monoid (Max a)
Min +
newtype Min a Source
The Monoid given by (min,maxBound) +
Constructors
Min
getMin :: a
show/hide Instances
Bounded a => Bounded (Min a)
Eq a => Eq (Min a)
Ord a => Ord (Min a)
Read a => Read (Min a)
Show a => Show (Min a)
(Ord a, Bounded a) => Monoid (Min a)
MaxPriority: Max semigroup w/ added bottom +
newtype MaxPriority a Source
The Monoid (max,Nothing) over Maybe a where Nothing is the bottom element +
Constructors
MaxPriority
getMaxPriority :: Maybe a
show/hide Instances
MinPriority: Min semigroup w/ added top +
newtype MinPriority a Source
The Monoid (min,Nothing) over Maybe a where Nothing is the top element +
Constructors
MinPriority
getMinPriority :: Maybe a
show/hide Instances
Produced by Haddock version 2.3.0
addfile ./dist/doc/html/monoids/Data-Monoid-Reducer-Char.html hunk ./dist/doc/html/monoids/Data-Monoid-Reducer-Char.html 1 + + +Data.Monoid.Reducer.Char
 monoids-0.1.1: Lots of MonoidsSource codeContentsIndex
Data.Monoid.Reducer.Char
Documentation
module Data.Monoid.Reducer
class Reducer Char m => CharReducer m whereSource
Methods
fromChar :: Char -> mSource
invalidChar :: [Word8] -> mSource
show/hide Instances
invalidChar :: CharReducer m => [Word8] -> mSource
fromChar :: CharReducer m => Char -> mSource
Produced by Haddock version 2.3.0
addfile ./dist/doc/html/monoids/Data-Monoid-Reducer-With.html hunk ./dist/doc/html/monoids/Data-Monoid-Reducer-With.html 1 + + +Data.Monoid.Reducer.With
 monoids-0.1.1: Lots of MonoidsSource codeContentsIndex
Data.Monoid.Reducer.With
Documentation
module Data.Monoid.Reducer
newtype WithReducer c m Source
Constructors
WithReducer
runWithReducer :: (m, c)
show/hide Instances
Reducer c m => Measured m (WithReducer c m)
Reducer c m => Reducer (WithReducer c m) m
withoutReducer :: (c `WithReducer` m) -> cSource
Produced by Haddock version 2.3.0
addfile ./dist/doc/html/monoids/Data-Monoid-Reducer.html hunk ./dist/doc/html/monoids/Data-Monoid-Reducer.html 1 + + +Data.Monoid.Reducer
 monoids-0.1.1: Lots of MonoidsSource codeContentsIndex
Data.Monoid.Reducer
Documentation
class Monoid m => Reducer c m whereSource
Methods
unit :: c -> mSource
snoc :: m -> c -> mSource
cons :: c -> m -> mSource
show/hide Instances
Reducer c ()
Reducer Char (SourcePosition file)
Reducer Char (SourcePosition file)
Reducer Char m => Reducer Char (Unlined m)
Reducer Char m => Reducer Char (Unlined m)
Reducer Char m => Reducer Char (Unspaced m)
Reducer Char m => Reducer Char (Unspaced m)
Reducer Char m => Reducer Char (Lines m)
Reducer Char m => Reducer Char (Lines m)
Reducer Char m => Reducer Char (Words m)
Reducer Char m => Reducer Char (Words m)
CharReducer m => Reducer Word8 (UTF8 m)
CharReducer m => Reducer Word8 (UTF8 m)
Reducer c ([] c)
(Reducer c m, Reducer c n) => Reducer c ((,) m n)
Measured v a => Reducer a (FingerTree v a)
(Reducer c m, Reducer c n, Reducer c o) => Reducer c ((,,) m n o)
(Reducer c m, Reducer c n, Reducer c o, Reducer c p) => Reducer c ((,,,) m n o p)
Reducer ([] c) ([] c)
Monad m => Reducer (m a) (Action m)
Applicative f => Reducer (f a) (Traversal f)
Monoid m => Reducer (IntMap m) (UnionWith m)
Monoid m => Reducer (IntMap m) (UnionWith m)
Reducer (IntMap a) (Union a)
Reducer (IntMap a) (Union a)
MonadPlus m => Reducer (m a) (MonadSum m a)
Alternative f => Reducer (f a) (Alternate f a)
Reducer c m => Reducer (WithReducer c m) m
(Ord k, Monoid m) => Reducer (Map k m) (UnionWith k m)
(Ord k, Monoid m) => Reducer (Map k m) (UnionWith k m)
Ord k => Reducer (Map k a) (Union k a)
Ord k => Reducer (Map k a) (Union k a)
unit :: Reducer c m => c -> mSource
snoc :: Reducer c m => m -> c -> mSource
cons :: Reducer c m => c -> m -> mSource
Produced by Haddock version 2.3.0
addfile ./dist/doc/html/monoids/doc-index.html hunk ./dist/doc/html/monoids/doc-index.html 1 + + +monoids-0.1.1: Lots of Monoids (Index)
 monoids-0.1.1: Lots of MonoidsContentsIndex
Search:
*>
:<
:>
<|
<|>
><
Action
1 (Type/Class)
2 (Data Constructor)
All
1 (Data Constructor)
2 (Type/Class)
Alternate
1 (Type/Class)
2 (Data Constructor)
Alternative
Any
1 (Data Constructor)
2 (Type/Class)
appEndo
Applicative
CharReducer
cons
dropUntil
Dual
1 (Data Constructor)
2 (Type/Class)
Elem
empty
1 (Function)
2 (Function)
EmptyL
EmptyR
Endo
1 (Data Constructor)
2 (Type/Class)
FingerTree
First
1 (Data Constructor)
2 (Type/Class)
fmap'
fromChar
fromList
Generator
getAction
getAll
getAlternate
getAny
getDual
getFirst
getLast
getMax
getMaxPriority
getMin
getMinPriority
getMonadSum
getProduct
getSum
getTraversal
getUnion
1 (Function)
2 (Function)
getUnionWith
1 (Function)
2 (Function)
invalidChar
Last
1 (Data Constructor)
2 (Type/Class)
Lines
linesFrom
mapFrom
mappend
mapReduce
mapTo
Max
1 (Type/Class)
2 (Data Constructor)
MaxPriority
1 (Type/Class)
2 (Data Constructor)
mconcat
measure
Measured
mempty
Min
1 (Type/Class)
2 (Data Constructor)
MinPriority
1 (Type/Class)
2 (Data Constructor)
MonadPlus
MonadSum
1 (Type/Class)
2 (Data Constructor)
Monoid
mplus
mzero
null
Product
1 (Data Constructor)
2 (Type/Class)
pure
Reducer
reverse
runLines
runUnlined
runUnspaced
runUTF8
runWithReducer
runWords
showSourcePosition
singleton
snoc
SourceColumn
sourceColumn
SourceLine
sourceLine
SourcePosition
split
startOfFile
Sum
1 (Data Constructor)
2 (Type/Class)
takeUntil
Traversal
1 (Type/Class)
2 (Data Constructor)
traverse'
Union
1 (Type/Class)
2 (Type/Class)
UnionWith
1 (Type/Class)
2 (Type/Class)
unit
Unlined
Unspaced
UTF8
ViewL
viewl
ViewR
viewr
withoutReducer
WithReducer
1 (Type/Class)
2 (Data Constructor)
Words
wordsFrom
|>
addfile ./dist/doc/html/monoids/haddock-util.js hunk ./dist/doc/html/monoids/haddock-util.js 1 +// Haddock JavaScript utilities +function toggle(button,id) +{ + var n = document.getElementById(id).style; + if (n.display == "none") + { + button.src = "minus.gif"; + n.display = "block"; + } + else + { + button.src = "plus.gif"; + n.display = "none"; + } +} + + +var max_results = 75; // 50 is not enough to search for map in the base libraries +var shown_range = null; +var last_search = null; + +function quick_search() +{ + perform_search(false); +} + +function full_search() +{ + perform_search(true); +} + + +function perform_search(full) +{ + var text = document.getElementById("searchbox").value.toLowerCase(); + if (text == last_search && !full) return; + last_search = text; + + var table = document.getElementById("indexlist"); + var status = document.getElementById("searchmsg"); + var children = table.firstChild.childNodes; + + // first figure out the first node with the prefix + var first = bisect(-1); + var last = (first == -1 ? -1 : bisect(1)); + + if (first == -1) + { + table.className = ""; + status.innerHTML = "No results found, displaying all"; + } + else if (first == 0 && last == children.length - 1) + { + table.className = ""; + status.innerHTML = ""; + } + else if (last - first >= max_results && !full) + { + table.className = ""; + status.innerHTML = "More than " + max_results + ", press Search to display"; + } + else + { + // decide what you need to clear/show + if (shown_range) + setclass(shown_range[0], shown_range[1], "indexrow"); + setclass(first, last, "indexshow"); + shown_range = [first, last]; + table.className = "indexsearch"; + status.innerHTML = ""; + } + + + function setclass(first, last, status) + { + for (var i = first; i <= last; i++) + { + children[i].className = status; + } + } + + + // do a binary search, treating 0 as ... + // return either -1 (no 0's found) or location of most far match + function bisect(dir) + { + var first = 0, finish = children.length - 1; + var mid, success = false; + + while (finish - first > 3) + { + mid = Math.floor((finish + first) / 2); + + var i = checkitem(mid); + if (i == 0) i = dir; + if (i == -1) + finish = mid; + else + first = mid; + } + var a = (dir == 1 ? first : finish); + var b = (dir == 1 ? finish : first); + for (var i = b; i != a - dir; i -= dir) + { + if (checkitem(i) == 0) return i; + } + return -1; + } + + + // from an index, decide what the result is + // 0 = match, -1 is lower, 1 is higher + function checkitem(i) + { + var s = getitem(i).toLowerCase().substr(0, text.length); + if (s == text) return 0; + else return (s > text ? -1 : 1); + } + + + // from an index, get its string + // this abstracts over alternates + function getitem(i) + { + for ( ; i >= 0; i--) + { + var s = children[i].firstChild.firstChild.data; + if (s.indexOf(' ') == -1) + return s; + } + return ""; // should never be reached + } +} addfile ./dist/doc/html/monoids/haddock.css hunk ./dist/doc/html/monoids/haddock.css 1 +/* -------- Global things --------- */ + +BODY { + background-color: #ffffff; + color: #000000; + font-family: sans-serif; + } + +A:link { color: #0000e0; text-decoration: none } +A:visited { color: #0000a0; text-decoration: none } +A:hover { background-color: #e0e0ff; text-decoration: none } + +TABLE.vanilla { + width: 100%; + border-width: 0px; + /* I can't seem to specify cellspacing or cellpadding properly using CSS... */ +} + +TABLE.vanilla2 { + border-width: 0px; +} + +/* font is a little too small in MSIE */ +TT { font-size: 100%; } +PRE { font-size: 100%; } + +LI P { margin: 0pt } + +TD { + border-width: 0px; +} + +TABLE.narrow { + border-width: 0px; +} + +TD.s8 { height: 8px; } +TD.s15 { height: 15px; } + +SPAN.keyword { text-decoration: underline; } + +/* Resize the buttom image to match the text size */ +IMG.coll { width : 0.75em; height: 0.75em; margin-bottom: 0; margin-right: 0.5em } + +/* --------- Contents page ---------- */ + +DIV.node { + padding-left: 3em; +} + +DIV.cnode { + padding-left: 1.75em; +} + +SPAN.pkg { + position: absolute; + left: 50em; +} + +/* --------- Documentation elements ---------- */ + +TD.children { + padding-left: 25px; + } + +TD.synopsis { + padding: 2px; + background-color: #f0f0f0; + font-family: monospace + } + +TD.decl { + padding: 2px; + background-color: #f0f0f0; + font-family: monospace; + vertical-align: top; + } + +TD.topdecl { + padding: 2px; + background-color: #f0f0f0; + font-family: monospace; + vertical-align: top; +} + +TABLE.declbar { + border-spacing: 0px; + } + +TD.declname { + width: 100%; + } + +TD.declbut { + padding-left: 5px; + padding-right: 5px; + border-left-width: 1px; + border-left-color: #000099; + border-left-style: solid; + white-space: nowrap; + font-size: small; + } + +/* + arg is just like decl, except that wrapping is not allowed. It is + used for function and constructor arguments which have a text box + to the right, where if wrapping is allowed the text box squashes up + the declaration by wrapping it. +*/ +TD.arg { + padding: 2px; + background-color: #f0f0f0; + font-family: monospace; + vertical-align: top; + white-space: nowrap; + } + +TD.recfield { padding-left: 20px } + +TD.doc { + padding-top: 2px; + padding-left: 10px; + } + +TD.ndoc { + padding: 2px; + } + +TD.rdoc { + padding: 2px; + padding-left: 10px; + width: 100%; + } + +TD.body { + padding-left: 10px + } + +TD.pkg { + width: 100%; + padding-left: 10px +} + +TABLE.indexsearch TR.indexrow { + display: none; +} +TABLE.indexsearch TR.indexshow { + display: table-row; +} + +TD.indexentry { + vertical-align: top; + padding-right: 10px + } + +TD.indexannot { + vertical-align: top; + padding-left: 20px; + white-space: nowrap + } + +TD.indexlinks { + width: 100% + } + +/* ------- Section Headings ------- */ + +TD.section1 { + padding-top: 15px; + font-weight: bold; + font-size: 150% + } + +TD.section2 { + padding-top: 10px; + font-weight: bold; + font-size: 130% + } + +TD.section3 { + padding-top: 5px; + font-weight: bold; + font-size: 110% + } + +TD.section4 { + font-weight: bold; + font-size: 100% + } + +/* -------------- The title bar at the top of the page */ + +TD.infohead { + color: #ffffff; + font-weight: bold; + padding-right: 10px; + text-align: left; +} + +TD.infoval { + color: #ffffff; + padding-right: 10px; + text-align: left; +} + +TD.topbar { + background-color: #000099; + padding: 5px; +} + +TD.title { + color: #ffffff; + padding-left: 10px; + width: 100% + } + +TD.topbut { + padding-left: 5px; + padding-right: 5px; + border-left-width: 1px; + border-left-color: #ffffff; + border-left-style: solid; + white-space: nowrap; + } + +TD.topbut A:link { + color: #ffffff + } + +TD.topbut A:visited { + color: #ffff00 + } + +TD.topbut A:hover { + background-color: #6060ff; + } + +TD.topbut:hover { + background-color: #6060ff + } + +TD.modulebar { + background-color: #0077dd; + padding: 5px; + border-top-width: 1px; + border-top-color: #ffffff; + border-top-style: solid; + } + +/* --------- The page footer --------- */ + +TD.botbar { + background-color: #000099; + color: #ffffff; + padding: 5px + } +TD.botbar A:link { + color: #ffffff; + text-decoration: underline + } +TD.botbar A:visited { + color: #ffff00 + } +TD.botbar A:hover { + background-color: #6060ff + } + addfile ./dist/doc/html/monoids/haskell_icon.gif binary ./dist/doc/html/monoids/haskell_icon.gif oldhex * newhex *47494638376110001000f70f00000000800000008000808000000080800080008080c0c0c08080 *80ff000000ff00ffff000000ffff00ff00ffffffffff0000000000000000000000000000000000 *000000000000000000000000000000000000000000000000000000000000000000000000000000 *000000000000000000000000000000000000000000000000000000000000000000000000000000 *000000000000000000000000000000000000000000000000000000000000000000000000000000 *000000000000000000000000000000000000000000000000000000000000000000000000000000 *000000000000000000000000000000000000000000000000000000000000000000000000000000 *000000000000000000000000000000000000000000000000000000000000000000000000000000 *000000000000000000000000000000000000000000000000000000000000000000000000000000 *000000000000000000000000000000000000000000000000000000000000000000000000000000 *000000000000000000000000000000000000000000000000000000000000000000000000000000 *000000000000000000000000000000000000000000000000000000000000000000000000000000 *000000000000000000000000000000000000000000000000000000000000000000000000000000 *000000000000000000000000000000000000000000000000000000000000000000000000000000 *000000000000000000000000000000000000000000000000000000000000000000000000000000 *000000000000000000000000000000000000000000000000000000000000000000000000000000 *000000000000000000000000000000000000000000000000000000000000000000000000000000 *000000000000000000000000000000000000000000000000000000000000000000000000000000 *000000000000000000000000000000000000000000000000000000000000000000000000000000 *000000000000000000000000000000000000000000000000000000000000000000000000000000 *0021f90401000000002c000000001000100007086c0001007840b0a0418202073e38b0b021c387 *07143e2440c0a143040e091cd0787021c686151f84347800e343901d4b12646870e44a930d0952 *3ca832a6cc990555b2bc2992e4c79d3847ea2c88b3a7c89a2c8b8aa43874e941a60810003840b5 *aa55aa511346ddca75abc080003b addfile ./dist/doc/html/monoids/index.html hunk ./dist/doc/html/monoids/index.html 1 + + +monoids-0.1.1: Lots of Monoids
 monoids-0.1.1: Lots of MonoidsContentsIndex
monoids-0.1.1: Lots of Monoids
Lots of Monoids +
Modules
show/hideData
show/hideMonoid
Data.Monoid.Applicative
Data.Monoid.FingerTree
Data.Monoid.Generator
Data.Monoid.IntMap
show/hideLexical
Data.Monoid.Lexical.SourcePosition
show/hideUTF8
Data.Monoid.Lexical.UTF8.Decoder
Data.Monoid.Lexical.Words
Data.Monoid.Map
Data.Monoid.Monad
Data.Monoid.Ord
show/hideData.Monoid.Reducer
Data.Monoid.Reducer.Char
Data.Monoid.Reducer.With
Produced by Haddock version 2.3.0
addfile ./dist/doc/html/monoids/minus.gif binary ./dist/doc/html/monoids/minus.gif oldhex * newhex *47494638396109000900910000fefefe8282820202020000002c00000000090009000002118c8f *a00bc6eb5e0b40583b6596f1a11f14003b addfile ./dist/doc/html/monoids/monoids.haddock binary ./dist/doc/html/monoids/monoids.haddock oldhex * newhex *0d0cface00040000000000002179000000000000145b4300000000000000000000000000000000 *000000000000000100000000000000010000000000000000000000000000000100000000000000 *020000000000000000000000000000000100000000000000030000000000000000000000000000 *000100000000000000040000000000000000000000000000000100000000000000050000000000 *000000000000000000000100000000000000060000000000000000000000000000000100000000 *000000070000000000000000000000000000000100000000000000080000000000000000000000 *0000000001000000000000000900000000000000000000000000000001000000000000000a0000 *0000000000000000000000000001000000000000000b0000000000000000000000000000000100 *0000000000000c00000000000000000000000000000002000000000000000d0000000000000000 *0000000000000002000000000000000e0000000000000000000000000000000200000000000000 *0f0000000000000000000000000000000200000000000000100000000000000000000000000000 *000300000000000000110000000000000000000000000000000300000000000000120000000000 *000000000000000000000300000000000000130000000000000000000000000000000400000000 *000000140000000000000000000000000000000400000000000000150000000000000000000000 *000000000400000000000000160000000000000000000000000000000400000000000000170000 *000000000000000000000000000400000000000000180000000000000000000000000000000400 *0000000000001900000000000000000000000000000004000000000000001a0000000000000000 *0000000000000005000000000000001b0000000000000000000000000000000500000000000000 *1c00000000000000000000000000000006000000000000001d0000000000000000000000000000 *0006000000000000001e00000000000000000000000000000006000000000000001f0000000000 *000000000000000000000600000000000000200000000000000000000000000000000700000000 *000000210000000000000000000000000000000700000000000000220000000000000000000000 *000000000700000000000000230000000000000000000000000000000700000000000000240000 *000000000000000000000000000700000000000000250000000000000000000000000000000700 *000000000000260000000000000000000000000000000800000000000000270000000000000000 *000000000000000800000000000000280000000000000000000000000000000800000000000000 *2900000000000000000000000000000008000000000000002a0000000000000000000000000000 *0008000000000000002b00000000000000000000000000000008000000000000002c0000000000 *0000000000000000000009000000000000002d0000000000000000000000000000000900000000 *0000002e00000000000000000000000000000009000000000000002f0000000000000000000000 *000000000900000000000000300000000000000000000000000000000a00000000000000310000 *000000000000000000000000000a00000000000000320000000000000000000000000000000a00 *000000000000330000000000000000000000000000000a00000000000000340000000000000000 *000000000000000b00000000000000350000000000000000000000000000000b00000000000000 *360000000000000000000000000000000b00000000000000370000000000000000000000000000 *000b00000000000000380000000000000000000000000000000b00000000000000390000000000 *000000000000000000000c000000000000003a0000000000000000000000000000000c00000000 *0000003b0000000000000000000000000000000c000000000000003c0000000000000000000000 *000000000c000000000000003d0000000000000000000000000000000c000000000000003e0000 *000000000000000000000000000c000000000000003f0000000000000000000000000000000c00 *000000000000400000000000000000000000000000000c00000000000000410000000000000000 *000000000000000c00000000000000420000000000000000000000000000000c0d000000000000 *000000000000000000010000000004000000000000000003010204000000540000006800000065 *00000020010401000000000000000043000000000000000d000000000000000e01020100000020 *010701020100000028010401000000000000000044000000000000000d000000000000000f0102 *010000002c010401000000000000000045000000000000000d0000000000000010020100000029 *010206000000200000006f00000076000000650000007200000020010701040100000000000000 *0046000000000000000d0000000000000010020200000020000000610102070000002000000077 *000000680000006500000072000000650000002001040100000000000000004500000000000000 *0d0000000000000010021400000020000000690000007300000020000000740000006800000065 *00000020000000740000006f0000007000000020000000650000006c000000650000006d000000 *650000006e000000740000000a0000000000000003030102040000005400000068000000650000 *0020010401000000000000000043000000000000000d000000000000000e010201000000200107 *01020100000028010401000000000000000047000000000000000d000000000000000f01020100 *00002c010401000000000000000045000000000000000d00000000000000100201000000290102 *06000000200000006f000000760000006500000072000000200107010401000000000000000046 *000000000000000d00000000000000100202000000200000006101020700000020000000770000 *006800000065000000720000006500000020010401000000000000000045000000000000000d00 *000000000000100217000000200000006900000073000000200000007400000068000000650000 *0020000000620000006f00000074000000740000006f0000006d00000020000000650000006c00 *0000650000006d000000650000006e000000740000000a00000000000000060301020400000054 *000000680000006500000020010401000000000000000043000000000000000d00000000000000 *0e01020a00000020000000670000006900000076000000650000006e0000002000000062000000 *7900000020010701020100000028010401000000000000000044000000000000000d0000000000 *00000f0102010000002c010401000000000000000048000000000000000d000000000000001102 *010000002902010000000a00000000000000090301020400000054000000680000006500000020 *010401000000000000000043000000000000000d000000000000000e0102010000002001070102 *0100000028010401000000000000000047000000000000000d000000000000000f010201000000 *2c010401000000000000000049000000000000000d000000000000001102010000002902010000 *000a0f000000000000004a000000000000004b0000000000000043000000000000000000000000 *000000010000000000000002000000000000000300000000000000040000000000000005000000 *0000000006000000000000000700000000000000080000000000000009000000000000000a0000 *00000000000b0c0000000000000009000000000000000a000000000000000b0000000000000006 *000000000000000700000000000000080000000000000003000000000000000400000000000000 *050000000000000000000000000000000100000000000000020000000000000000000000000000 *0002000000000007000000000000004a000000000000004b000000000000004300000000000000 *0c000000000000000d000000000000000e000000000000000f04000000000000000c0000000000 *00000d000000000000000e000000000000000f0000000000000000000000000000000300000000 *000a000000000000004a000000000000004b0000000000000043000000000000000c0000000000 *00000d000000000000000e000000000000000f0000000000000010000000000000001100000000 *000000120300000000000000100000000000000012000000000000001100000000000000000000 *000000000004000000000011000000000000004a000000000000004b0000000000000043000000 *000000000c000000000000000d000000000000000e000000000000000f00000000000000100000 *000000000011000000000000001200000000000000130000000000000014000000000000001500 *000000000000160000000000000017000000000000001800000000000000190700000000000000 *130000000000000015000000000000001400000000000000180000000000000017000000000000 *001600000000000000190000000000000000000000000000000500000000000c00000000000000 *4a000000000000004b0000000000000043000000000000000c000000000000000d000000000000 *000e000000000000000f0000000000000010000000000000001100000000000000120000000000 *00001a000000000000001b02000000000000001a000000000000001b0000000000000000000000 *000000000600000000000b000000000000004a000000000000004b000000000000004300000000 *0000000c000000000000000d000000000000000e000000000000000f000000000000001c000000 *000000001d000000000000001e000000000000001f04000000000000001c000000000000001d00 *0000000000001e000000000000001f000000000000000000000000000000070000000000100000 *00000000004c000000000000004a000000000000004b0000000000000043000000000000004d00 *0000000000004e000000000000000c000000000000000d000000000000000e000000000000000f *000000000000002000000000000000210000000000000022000000000000002300000000000000 *240000000000000025060000000000000023000000000000002400000000000000250000000000 *000020000000000000002100000000000000220000000000000000000000000000000800000000 *0013000000000000004a000000000000004f000000000000005000000000000000510000000000 *00005200000000000000530000000000000054000000000000004b000000000000004300000000 *0000000c000000000000000d000000000000000e000000000000000f0000000000000026000000 *000000002700000000000000280000000000000029000000000000002a000000000000002b0600 *00000000000029000000000000002a000000000000002b00000000000000260000000000000027 *00000000000000280000000000000000000000000000001200000000001f000000000000004a00 *0000000000004b0000000000000043000000000000000c000000000000000d000000000000000e *000000000000000f00000000000000550000000000000056000000000000005700000000000000 *580000000000000059000000000000005a000000000000005b000000000000005c000000000000 *005d000000000000005e000000000000005f000000000000006000000000000000610000000000 *000062000000000000006300000000000000640000000000000065000000000000006600000000 *0000006700000000000000680000000000000069000000000000006a000000000000006b000000 *000000006c000000000000000000000000000000000900000000000b000000000000004a000000 *000000004b0000000000000043000000000000000c000000000000000d000000000000000e0000 *00000000000f000000000000002c000000000000002d000000000000002e000000000000002f04 *000000000000002e000000000000002f000000000000002c000000000000002d00000000000000 *00000000000000000a00000000000b000000000000004a000000000000004b0000000000000043 *000000000000000c000000000000000d000000000000000e000000000000000f00000000000000 *300000000000000031000000000000003200000000000000330400000000000000320000000000 *000033000000000000003000000000000000310000000000000000000000000000000b00000000 *0021000000000000004a000000000000006d000000000000004b00000000000000430000000000 *00006e000000000000006f00000000000000700000000000000071000000000000007200000000 *000000730000000000000074000000000000007500000000000000760000000000000077000000 *00000000780000000000000079000000000000007a000000000000007b000000000000007c0000 *00000000007d000000000000007e000000000000007f0000000000000080000000000000008100 *000000000000820000000000000083000000000000008400000000000000850000000000000034 *000000000000003500000000000000360000000000000037000000000000003805000000000000 *003400000000000000350000000000000036000000000000003700000000000000380000000000 *000000000000000000000c000000000014000000000000004a000000000000004b000000000000 *0043000000000000000c000000000000000d000000000000000e000000000000000f0000000000 *000010000000000000001100000000000000120000000000000039000000000000003a00000000 *0000003b000000000000003c000000000000003d000000000000003e000000000000003f000000 *0000000040000000000000004100000000000000420a000000000000003e000000000000003f00 *0000000000003d0000000000000040000000000000003b000000000000003c0000000000000039 *000000000000003a00000000000000410000000000000042000000000000008600000000000000 *000000000000000001030000000000000013000000000000000000000000000000010100000000 *000000130000000000000000000000000000000100000000000000001400000000000000000000 *000000000001030000000000000015000000000000000000000000000000010100000000000000 *150000000000000000000000000000000100000000000000001600000000000000000000000000 *000001030000000000000017000000000000000000000000000000010100000000000000170000 *000000000000000000000000000100000000000000001800000000000000000000000000000001 *030000000000000019000000000000000000000000000000010100000000000000190000000000 *000000000000000000000100000000000000001a00000000000000000000000000000002030000 *00000000001b0000000000000000000000000000000200000000000000001c0000000000000000 *000000000000000200000000000000001d00000000000000000000000000000002000000000000 *00001e0000000000000000000000000000000303000000000000001f0000000000000000000000 *000000000300000000000000002000000000000000000000000000000003000000000000000021 *000000000000000000000000000000040300000000000000220000000000000000000000000000 *000403000000000000002300000000000000000000000000000004030000000000000024000000 *000000000000000000000000040000000000000000250000000000000000000000000000000400 *000000000000002600000000000000000000000000000004000000000000000027000000000000 *000000000000000000040000000000000000280000000000000000000000000000000503000000 *00000000290000000000000000000000000000000500000000000000002a000000000000000000 *0000000000000603000000000000002b0000000000000000000000000000000601000000000000 *002b0000000000000000000000000000000600000000000000002c000000000000000000000000 *0000000600000000000000002d0000000000000000000000000000000703000000000000002e00 *00000000000000000000000000000701000000000000002e000000000000000000000000000000 *0700000000000000002f0000000000000000000000000000000703000000000000003000000000 *000000000000000000000007010000000000000030000000000000000000000000000000070000 *000000000000310000000000000000000000000000000803000000000000003200000000000000 *000000000000000008010000000000000032000000000000000000000000000000080000000000 *000000330000000000000000000000000000000803000000000000003400000000000000000000 *000000000008010000000000000034000000000000000000000000000000080000000000000000 *350000000000000000000000000000000903000000000000003600000000000000000000000000 *000009000000000000000037000000000000000000000000000000090300000000000000380000 *00000000000000000000000000090000000000000000390000000000000000000000000000000a *0300000000000000360000000000000000000000000000000a0000000000000000370000000000 *000000000000000000000a0300000000000000380000000000000000000000000000000a000000 *0000000000390000000000000000000000000000000b03000000000000003a0000000000000000 *000000000000000b03000000000000003b0000000000000000000000000000000b000000000000 *00003c0000000000000000000000000000000b00000000000000003d0000000000000000000000 *000000000b00000000000000003e0000000000000000000000000000000c03000000000000003f *0000000000000000000000000000000c0000000000000000400000000000000000000000000000 *000c0300000000000000410000000000000000000000000000000c000000000000000042000000 *0000000000000000000000000c0300000000000000430000000000000000000000000000000c03 *00000000000000440000000000000000000000000000000c000000000000000045000000000000 *0000000000000000000c0000000000000000460000000000000000000000000000000c00000000 *00000000470000000000000000000000000000000c000000000000000048000000000000000d00 *0000000000000e030000000000000049000000000000000d000000000000004a00000000000000 *004b000000000000000d000000000000001001000000000000004c000000000000000d00000000 *0000001003000000000000004d000000000000000d000000000000004a00000000000000004e00 *0000000000000d000000000000004f000000000000000050000000000000000d00000000000000 *4f000000000000000051000000000000000d000000000000000e00000000000000005200000000 *0000000d000000000000000e000000000000000053000000000000000d00000000000000540300 *00000000000055000000000000000d000000000000005400000000000000005600000000000000 *0d0000000000000054000000000000000057000000000000000d00000000000000580000000000 *00000059000000000000000d000000000000005800000000000000005a000000000000000d0000 *00000000005803000000000000005b000000000000000d00000000000000580000000000000000 *5c000000000000000d000000000000005800000000000000005d000000000000000d0000000000 *00005803000000000000005e000000000000005f00000000000000600000000000000000610000 *00000000005f0000000000000060000000000000000062000000000000005f0000000000000060 *010000000000000063000000000000005f00000000000000600100000000000000640000000000 *00005f0000000000000060010000000000000065000000000000005f0000000000000060010000 *000000000066000000000000005f0000000000000060030000000000000067000000000000005f *0000000000000060030000000000000068000000000000005f0000000000000060030000000000 *000069000000000000005f000000000000006003000000000000006a000000000000005f000000 *000000006000000000000000006b000000000000005f000000000000006000000000000000006c *000000000000005f000000000000006000000000000000006d000000000000005f000000000000 *006000000000000000005d000000000000005f000000000000006000000000000000006e000000 *000000005f000000000000006000000000000000006f000000000000005f000000000000006000 *0000000000000070000000000000005f0000000000000060000000000000000071000000000000 *005f0000000000000060000000000000000072000000000000005f000000000000006000000000 *0000000073000000000000005f0000000000000060000000000000000074000000000000005f00 *00000000000060000000000000000075000000000000005f000000000000006000000000000000 *0076000000000000005f0000000000000060000000000000000077000000000000000d00000000 *0000000e000000000000000078000000000000000d000000000000000e00000000000000007900 *0000000000000d000000000000000e01000000000000007a000000000000000d00000000000000 *0e03000000000000007a000000000000000d000000000000000e00000000000000007b00000000 *0000000d000000000000000e01000000000000007c000000000000000d000000000000000e0300 *0000000000007c000000000000000d000000000000000e00000000000000007d00000000000000 *0d000000000000000e01000000000000007e000000000000000d000000000000000e0300000000 *0000007e000000000000000d000000000000000e00000000000000007f000000000000000d0000 *00000000000e010000000000000080000000000000000d000000000000000e0300000000000000 *80000000000000000d000000000000000e000000000000000081000000000000000d0000000000 *00000e010000000000000082000000000000000d000000000000000e0300000000000000820000 *00000000000d000000000000000e000000000000000083000000000000000d000000000000000e *010000000000000084000000000000000d000000000000000e0300000000000000840000000000 *00000d000000000000000e000000000000000085000000000000000d000000000000000e010000 *000000000086000000000000000d000000000000000e030000000000000086000000000000000d *000000000000000e000000000000000087000000000000000d000000000000000e010000000000 *000088000000000000000d000000000000000e0300000000000000880000000000000089000000 *000000000d6d6f6e6f6964732d302e312e31000000000000000f446174612e4d6f6e6f69642e4f *72640000000000000013446174612e4d6f6e6f69642e5265647563657200000000000000184461 *74612e4d6f6e6f69642e526564756365722e436861720000000000000022446174612e4d6f6e6f *69642e4c65786963616c2e536f75726365506f736974696f6e0000000000000020446174612e4d *6f6e6f69642e4c65786963616c2e555446382e4465636f6465720000000000000018446174612e *4d6f6e6f69642e526564756365722e576974680000000000000011446174612e4d6f6e6f69642e *4d6f6e61640000000000000017446174612e4d6f6e6f69642e4170706c69636174697665000000 *000000000f446174612e4d6f6e6f69642e4d61700000000000000012446174612e4d6f6e6f6964 *2e496e744d61700000000000000015446174612e4d6f6e6f69642e47656e657261746f72000000 *0000000019446174612e4d6f6e6f69642e4c65786963616c2e576f726473000000000000000462 *617365000000000000000b446174612e4d6f6e6f69640000000000000008446174612e4f726400 *0000000000000a446174612e4d6179626500000000000000075072656c75646500000000000000 *16446174612e4d6f6e6f69642e46696e67657254726565000000000000000b4d696e5072696f72 *697479000000000000000e6765744d696e5072696f72697479000000000000000b4d6178507269 *6f72697479000000000000000e6765744d61785072696f7269747900000000000000034d696e00 *000000000000066765744d696e00000000000000034d617800000000000000066765744d617800 *00000000000007526564756365720000000000000004756e69740000000000000004736e6f6300 *00000000000004636f6e73000000000000000b4368617252656475636572000000000000000866 *726f6d43686172000000000000000b696e76616c696443686172000000000000000e536f757263 *65506f736974696f6e000000000000000c536f75726365436f6c756d6e000000000000000a536f *757263654c696e65000000000000000b73746172744f6646696c65000000000000000c736f7572 *6365436f6c756d6e000000000000000a736f757263654c696e65000000000000001273686f7753 *6f75726365506f736974696f6e000000000000000455544638000000000000000772756e555446 *38000000000000000b5769746852656475636572000000000000000e72756e5769746852656475 *636572000000000000000e776974686f75745265647563657200000000000000084d6f6e616453 *756d000000000000000b6765744d6f6e616453756d0000000000000006416374696f6e00000000 *00000009676574416374696f6e0000000000000009416c7465726e617465000000000000000c67 *6574416c7465726e617465000000000000000954726176657273616c000000000000000c676574 *54726176657273616c0000000000000009556e696f6e57697468000000000000000c676574556e *696f6e576974680000000000000005556e696f6e0000000000000008676574556e696f6e000000 *000000000947656e657261746f720000000000000004456c656d00000000000000096d61705265 *6475636500000000000000056d6170546f00000000000000076d617046726f6d00000000000000 *07556e6c696e6564000000000000000a72756e556e6c696e65640000000000000008556e737061 *636564000000000000000b72756e556e73706163656400000000000000054c696e657300000000 *00000005576f726473000000000000000872756e576f726473000000000000000872756e4c696e *65730000000000000009776f72647346726f6d00000000000000096c696e657346726f6d000000 *00000000064d6f6e6f6964000000000000000b4748432e436c617373657300000000000000036d *696e00000000000000074e6f7468696e6700000000000000054d6179626500000000000000036d *617800000000000000084748432e456e756d00000000000000086d6178426f756e640000000000 *0000086d696e426f756e6400000000000000076d617070656e6400000000000000066d656d7074 *79000000000000000d436f6e74726f6c2e4d6f6e616400000000000000094d6f6e6164506c7573 *00000000000000056d706c757300000000000000056d7a65726f0000000000000013436f6e7472 *6f6c2e4170706c6963617469766500000000000000022a3e000000000000000470757265000000 *000000000b4170706c6963617469766500000000000000033c7c3e0000000000000005656d7074 *79000000000000000b416c7465726e6174697665000000000000000e66696e676572747265652d *302e30000000000000000f446174612e46696e6765725472656500000000000000023c7c000000 *000000000573706c697400000000000000023a3e0000000000000006456d707479520000000000 *0000023a3c0000000000000006456d7074794c0000000000000005566965774c00000000000000 *055669657752000000000000000a46696e6765725472656500000000000000084d656173757265 *6400000000000000023e3c00000000000000076d656173757265000000000000000964726f7055 *6e74696c0000000000000005666d617027000000000000000866726f6d4c697374000000000000 *00046e756c6c000000000000000772657665727365000000000000000973696e676c65746f6e00 *0000000000000974616b65556e74696c0000000000000009747261766572736527000000000000 *0005766965776c0000000000000005766965777200000000000000027c3e00000000000000076d *636f6e63617400000000000000076765744475616c00000000000000044475616c000000000000 *0007617070456e646f0000000000000004456e646f0000000000000006676574416c6c00000000 *00000003416c6c0000000000000006676574416e790000000000000003416e7900000000000000 *0667657453756d000000000000000353756d000000000000000a67657450726f64756374000000 *000000000750726f64756374000000000000000867657446697273740000000000000005466972 *737400000000000000076765744c61737400000000000000044c617374 addfile ./dist/doc/html/monoids/plus.gif binary ./dist/doc/html/monoids/plus.gif oldhex * newhex *47494638396109000900910000fefefe8282820202020000002c00000000090009000002148c8f *a00bb6b29c82ca897b5b7871cfce74085200003b addfile ./dist/doc/html/monoids/src/Data-Monoid-Applicative.html hunk ./dist/doc/html/monoids/src/Data-Monoid-Applicative.html 1 + + + + +Data/Monoid/Applicative.hs + + + +
{-# LANGUAGE FlexibleInstances, MultiParamTypeClasses, GeneralizedNewtypeDeriving, FlexibleContexts #-}
+module Data.Monoid.Applicative 
+    ( module Control.Applicative
+    , module Data.Monoid.Reducer
+    , Traversal(Traversal,getTraversal)
+    , Alternate(Alternate,getAlternate)
+    ) where
+
+import Control.Applicative (Applicative, (*>), pure, Alternative, empty, (<|>))
+import Data.Monoid.Reducer
+
+newtype Traversal f = Traversal { getTraversal :: f () } 
+
+instance Applicative f => Monoid (Traversal f) where
+    mempty = Traversal (pure ())
+    Traversal a `mappend` Traversal b = Traversal (a *> b)
+
+instance Applicative f => Reducer (f a) (Traversal f) where
+    unit a = Traversal (a *> pure ())
+    a `cons` Traversal b = Traversal (a *> b)
+    Traversal a `snoc` b = Traversal (a *> b *> pure ())
+
+{-# RULES "unitTraversal" unit = Traversal #-}
+{-# RULES "snocTraversal" snoc = snocTraversal #-}
+snocTraversal :: Reducer (f ()) (Traversal f) => Traversal f -> f () -> Traversal f
+snocTraversal a = mappend a . Traversal
+
+newtype Alternate f a = Alternate { getAlternate :: f a } 
+    deriving (Eq,Ord,Show,Read,Functor,Applicative,Alternative)
+
+instance Alternative f => Monoid (Alternate f a) where
+    mempty = empty 
+    Alternate a `mappend` Alternate b = Alternate (a <|> b) 
+
+instance Alternative f => Reducer (f a) (Alternate f a) where
+    unit = Alternate
+    a `cons` Alternate b = Alternate (a <|> b) 
+    Alternate a `snoc` b = Alternate (a <|> b)
+
+ addfile ./dist/doc/html/monoids/src/Data-Monoid-FingerTree.html hunk ./dist/doc/html/monoids/src/Data-Monoid-FingerTree.html 1 + + + + +Data/Monoid/FingerTree.hs + + + +
{-# LANGUAGE FlexibleInstances, MultiParamTypeClasses #-}
+module Data.Monoid.FingerTree
+    ( module Data.Monoid.Reducer
+    , module Data.FingerTree
+    ) where
+
+import Data.Monoid.Reducer (Reducer, unit, cons, snoc, Monoid, mempty, mappend)
+import Data.FingerTree
+
+instance Measured v a => Monoid (FingerTree v a) where
+    mempty = empty
+    mappend = (><)
+
+instance Measured v a => Reducer a (FingerTree v a) where
+    unit = singleton
+    cons = (<|)
+    snoc = (|>) 
+
+{-
+instance Measured v a => Reducer (FingerTree v a) (FingerTree v a) where
+    unit = id
+    cons = mappend
+    snoc = mappend
+-}
+
+ addfile ./dist/doc/html/monoids/src/Data-Monoid-Generator.html hunk ./dist/doc/html/monoids/src/Data-Monoid-Generator.html 1 + + + + +Data/Monoid/Generator.hs + + + +
{-# LANGUAGE UndecidableInstances, TypeOperators, FlexibleContexts, MultiParamTypeClasses, FlexibleInstances, TypeFamilies #-}
+module Data.Monoid.Generator
+    ( module Data.Monoid
+    , Generator
+    , Elem
+    , mapReduce
+    , mapTo
+    , mapFrom
+    ) where
+
+import Data.Word (Word8)
+import Data.Text (Text)
+import Data.Foldable (fold,foldMap)
+import qualified Data.Text as Text
+import qualified Data.ByteString as Strict
+import qualified Data.ByteString.Lazy as Lazy
+import Control.Parallel.Strategies
+import Data.Monoid
+import Data.Monoid.Reducer
+import Data.Monoid.Applicative
+import Data.Monoid.Monad
+
+-- minimal definition mapReduce or affixMapReduce
+class Generator c where
+    type Elem c :: * 
+    mapReduce :: (e `Reducer` m) => (Elem c -> e) -> c -> m
+    mapTo     :: (e `Reducer` m) => (Elem c -> e) -> m -> c -> m 
+    mapFrom   :: (e `Reducer` m) => (Elem c -> e) -> c -> m -> m
+
+    mapReduce f = mapTo f mempty
+    mapTo f m = mappend m . mapReduce f
+    mapFrom f = mappend . mapReduce f
+
+instance Generator Strict.ByteString where
+    type Elem Strict.ByteString = Word8
+    mapTo f = Strict.foldl' (\a -> snoc a . f)
+
+instance Generator Lazy.ByteString where
+    type Elem Lazy.ByteString = Elem Strict.ByteString
+    mapReduce f = fold . parMap rwhnf (mapReduce f) . Lazy.toChunks
+
+instance Generator Text where
+    type Elem Text = Char
+    mapTo f = Text.foldl' (\a -> snoc a . f)
+
+instance Generator [c] where
+    type Elem [c] = c
+    mapReduce f = foldMap (unit . f)
+
+{-# SPECIALIZE reduce :: (Word8 `Reducer` m) => Strict.ByteString -> m #-}
+{-# SPECIALIZE reduce :: (Word8 `Reducer` m) => Lazy.ByteString -> m #-}
+{-# SPECIALIZE reduce :: (Char `Reducer` m) => Text -> m #-}
+-- These aren't happy, but should work
+{-- RULES "reduce/fold" reduce = fold --}
+{-- RULES "mapReduce/foldMap" mapReduce = foldMap --}
+reduce :: (Generator c, Elem c `Reducer` m) => c -> m
+reduce = mapReduce id
+
+mtraverse_ :: (Generator c, Applicative f) => (Elem c -> f b) -> c -> f ()
+mtraverse_ f = getTraversal . mapReduce f
+    
+mfor_ :: (Generator c, Applicative f) => c -> (Elem c -> f b) -> f ()
+mfor_ = flip mtraverse_
+
+mmapM_ :: (Generator c, Monad m) => (Elem c -> m b) -> c -> m ()
+mmapM_ f = getAction . mapReduce f
+
+mforM_ :: (Generator c, Monad m) => c -> (Elem c -> m b) -> m ()
+mforM_ = flip mmapM_
+
+mconcatMap :: Generator c => (Elem c -> [b]) -> c -> [b]
+mconcatMap = mapReduce
+
+
+
+ addfile ./dist/doc/html/monoids/src/Data-Monoid-IntMap.html hunk ./dist/doc/html/monoids/src/Data-Monoid-IntMap.html 1 + + + + +Data/Monoid/IntMap.hs + + + +
{-# LANGUAGE MultiParamTypeClasses #-}
+module Data.Monoid.IntMap 
+    ( module Data.Monoid.Reducer
+    , Union(getUnion)
+    , UnionWith(getUnionWith)
+    ) where
+
+import Data.Monoid.Reducer (Reducer, unit, cons, snoc, Monoid, mappend, mempty)
+import Data.IntMap
+
+newtype Union a = Union { getUnion :: IntMap a } 
+
+instance Monoid (Union a) where
+    mempty = Union empty
+    Union a `mappend` Union b = Union (a `union` b)
+
+instance Reducer (IntMap a) (Union a) where
+    unit = Union
+
+-- only needs m to be a semigroup, but Haskell doesn't have a semigroup class
+
+newtype UnionWith m = UnionWith { getUnionWith :: IntMap m } 
+
+instance Monoid m => Monoid (UnionWith m) where
+    mempty = UnionWith empty
+    UnionWith a `mappend` UnionWith b = UnionWith (unionWith mappend a b)
+
+instance Monoid m => Reducer (IntMap m) (UnionWith m) where
+    unit = UnionWith
+
+ addfile ./dist/doc/html/monoids/src/Data-Monoid-Lexical-SourcePosition.html hunk ./dist/doc/html/monoids/src/Data-Monoid-Lexical-SourcePosition.html 1 + + + + +Data/Monoid/Lexical/SourcePosition.hs + + + +
{-# LANGUAGE FlexibleInstances, MultiParamTypeClasses #-}
+module Data.Monoid.Lexical.SourcePosition
+    ( module Data.Monoid.Reducer.Char
+    , SourcePosition
+    , SourceLine
+    , SourceColumn
+    , sourceLine
+    , sourceColumn
+    , startOfFile
+    , showSourcePosition
+    ) where
+
+import Prelude hiding (lex)
+import Control.Functor.Extras
+import Control.Functor.Pointed
+import Data.Monoid.Reducer.Char
+
+type SourceLine = Int
+type SourceColumn = Int
+
+data SourcePosition file = Pos file {-# UNPACK #-} !SourceLine !SourceColumn
+         | Lines {-# UNPACK #-} !SourceLine !SourceColumn
+         | Columns {-# UNPACK #-} !SourceColumn
+         | Tab {-# UNPACK #-} !SourceColumn !SourceColumn -- cols before and after an unresolved tab
+    deriving (Read,Show,Eq)
+
+nextTab :: Int -> Int
+nextTab x = x + (8 - (x-1) `mod` 8)
+
+instance Functor SourcePosition where
+    fmap g (Pos f l c) = Pos (g f) l c
+    fmap _ (Lines l c) = Lines l c
+    fmap _ (Columns c) = Columns c
+    fmap _ (Tab x y) = Tab x y
+
+instance Pointed SourcePosition where
+    point f = Pos f 1 1
+
+instance FunctorZero SourcePosition where
+    fzero = mempty
+
+instance FunctorPlus SourcePosition where
+    fplus = mappend
+
+instance Monoid (SourcePosition file) where
+    mempty = Columns 0
+
+    Pos f l _ `mappend` Lines m d = Pos f (l + m) d
+    Pos f l c `mappend` Columns d = Pos f l (c + d)
+    Pos f l c `mappend` Tab x y   = Pos f l (nextTab (c + x) + y)
+    Lines l _ `mappend` Lines m d = Lines (l + m) d
+    Lines l c `mappend` Columns d = Lines l (c + d)
+    Lines l c `mappend` Tab x y   = Lines l (nextTab (c + x) + y)
+    Columns c `mappend` Columns d  = Columns (c + d)
+    Columns c `mappend` Tab x y    = Tab (c + x) y
+    Tab _ _   `mappend` Lines m d  = Lines m d
+    Tab x y   `mappend` Columns d  = Tab x (y + d)
+    Tab x y   `mappend` Tab x' y'  = Tab x (nextTab (y + x') + y')
+    _         `mappend` pos        = pos
+
+instance Reducer Char (SourcePosition file) where
+    unit '\n' = Lines 1 1
+    unit '\t' = Tab 0 0 
+    unit _    = Columns 1
+
+instance CharReducer (SourcePosition file)
+    
+startOfFile :: f -> SourcePosition f
+startOfFile = point
+
+sourceColumn :: SourcePosition f -> Maybe SourceColumn
+sourceColumn (Pos _ _ c) = Just c
+sourceColumn (Lines _ c) = Just c
+sourceColumn _ = Nothing
+
+sourceLine :: SourcePosition f -> Maybe SourceLine
+sourceLine (Pos _ l _) = Just l
+sourceLine _ = Nothing
+
+showSourcePosition :: SourcePosition String -> String
+showSourcePosition pos = showSourcePosition' (point "-" `mappend` pos) where
+    showSourcePosition' (Pos f l c) = f ++ ":" ++ show l ++ ":" ++ show c
+    showSourcePosition' _ = undefined
+
+ addfile ./dist/doc/html/monoids/src/Data-Monoid-Lexical-UTF8-Decoder.html hunk ./dist/doc/html/monoids/src/Data-Monoid-Lexical-UTF8-Decoder.html 1 + + + + +Data/Monoid/Lexical/UTF8/Decoder.hs + + + +
{-# LANGUAGE FlexibleInstances, MultiParamTypeClasses #-}
+module Data.Monoid.Lexical.UTF8.Decoder 
+    ( module Data.Monoid.Reducer.Char
+    , UTF8
+    , runUTF8
+    ) where
+    
+import Data.Bits (shiftL,(.&.),(.|.))
+import Data.Word (Word8)
+
+import Control.Functor.Pointed
+
+import Data.Monoid.Reducer.Char
+
+-- Incrementally reduce canonical RFC3629 UTF-8 Characters
+
+-- utf8 characters are at most 4 characters long, so we need only retain state for 3 of them
+-- moreover their length is able to be determined a priori, so lets store that intrinsically in the constructor
+data H = H0
+       | H2_1 {-# UNPACK #-} !Word8 
+       | H3_1 {-# UNPACK #-} !Word8
+       | H3_2 {-# UNPACK #-} !Word8 !Word8
+       | H4_1 {-# UNPACK #-} !Word8
+       | H4_2 {-# UNPACK #-} !Word8 !Word8
+       | H4_3 {-# UNPACK #-} !Word8 !Word8 !Word8
+
+-- words expressing the tail of a character, each between 0x80 and 0xbf
+-- this is arbitrary length to simplify making the parser truly monoidal
+-- this probably means we have O(n^2) worst case performance in the face of very long runs of chars that look like 10xxxxxx
+type T = [Word8]
+
+-- S is a segment that contains a possible tail of a character, the result of reducing some full characters, and the start of another character
+-- T contains a list of bytes each between 0x80 and 0xbf
+data UTF8 m = S T m !H
+            | T T
+
+-- flush any extra characters in a head, when the next character isn't between 0x80 and 0xbf
+flushH :: CharReducer m => H -> m
+flushH (H0) = mempty
+flushH (H2_1 x) = invalidChar [x]
+flushH (H3_1 x) = invalidChar [x]
+flushH (H3_2 x y) = invalidChar [x,y]
+flushH (H4_1 x) = invalidChar [x]
+flushH (H4_2 x y) = invalidChar [x,y]
+flushH (H4_3 x y z) = invalidChar [x,y,z]
+
+-- flush a character tail 
+flushT :: CharReducer m => [Word8] -> m
+flushT = invalidChar
+
+snocH :: CharReducer m => H -> Word8 -> (m -> H -> UTF8 m) -> m -> UTF8 m
+snocH H0 c k m 
+    | c < 0x80 = k (m `mappend` b1 c) H0
+    | c < 0xc0 = k (m `mappend` invalidChar [c]) H0
+    | c < 0xe0 = k m (H2_1 c)
+    | c < 0xf0 = k m (H3_1 c)
+    | c < 0xf5 = k m (H4_1 c)
+    | otherwise = k (m `mappend` invalidChar [c]) H0
+snocH (H2_1 c) d k m
+    | d >= 0x80 && d < 0xc0 = k (m `mappend` b2 c d) H0
+    | otherwise = k (m `mappend` invalidChar [c]) H0
+snocH (H3_1 c) d k m 
+    | d >= 0x80 && d < 0xc0 = k m (H3_2 c d)
+    | otherwise = k (m `mappend` invalidChar [c]) H0
+snocH (H3_2 c d) e k m 
+    | d >= 0x80 && d < 0xc0 = k (m `mappend` b3 c d e) H0
+    | otherwise = k (m `mappend` invalidChar [c,d]) H0
+snocH (H4_1 c) d k m 
+    | d >= 0x80 && d < 0xc0 = k m (H4_2 c d)
+    | otherwise = k (m `mappend` invalidChar [c,d]) H0
+snocH (H4_2 c d) e k m 
+    | d >= 0x80 && d < 0xc0 = k m (H4_3 c d e)
+    | otherwise = k (m `mappend` invalidChar [c,d,e]) H0
+snocH (H4_3 c d e) f k m 
+    | d >= 0x80 && d < 0xc0 = k (m `mappend` b4 c d e f) H0
+    | otherwise = k (m `mappend` invalidChar [c,d,e,f]) H0
+
+mask :: Word8 -> Word8 -> Int
+mask c m = fromEnum (c .&. m) 
+
+combine :: Int -> Word8 -> Int
+combine a r = shiftL a 6 .|. fromEnum (r .&. 0x3f)
+
+b1 :: CharReducer m => Word8 -> m
+b1 c | c < 0x80 = fromChar . toEnum $ fromEnum c
+     | otherwise = invalidChar [c]
+
+b2 :: CharReducer m => Word8 -> Word8 -> m
+b2 c d | valid_b2 c d = fromChar (toEnum (combine (mask c 0x1f) d))
+       | otherwise = invalidChar [c,d]
+
+b3 :: CharReducer m => Word8 -> Word8 -> Word8 -> m
+b3 c d e | valid_b3 c d e = fromChar (toEnum (combine (combine (mask c 0x0f) d) e))
+         | otherwise = invalidChar [c,d,e]
+
+
+b4 :: CharReducer m => Word8 -> Word8 -> Word8 -> Word8 -> m
+b4 c d e f | valid_b4 c d e f = fromChar (toEnum (combine (combine (combine (mask c 0x07) d) e) f))
+           | otherwise = invalidChar [c,d,e,f]
+
+valid_b2 :: Word8 -> Word8 -> Bool
+valid_b2 c d = (c >= 0xc2 && c <= 0xdf && d >= 0x80 && d <= 0xbf)
+
+valid_b3 :: Word8 -> Word8 -> Word8 -> Bool
+valid_b3 c d e = (c == 0xe0 && d >= 0xa0 && d <= 0xbf && e >= 0x80 && e <= 0xbf) || 
+                 (c >= 0xe1 && c <= 0xef && d >= 0x80 && d <= 0xbf && e >= 0x80 && e <= 0xbf)
+
+valid_b4 :: Word8 -> Word8 -> Word8 -> Word8 -> Bool
+valid_b4 c d e f = (c == 0xf0 && d >= 0x90 && d <= 0xbf && e >= 0x80 && e <= 0xbf && f >= 0x80 && f <= 0xbf) ||
+      (c >= 0xf1 && c <= 0xf3 && d >= 0x80 && d <= 0xbf && e >= 0x80 && e <= 0xbf && f >= 0x80 && f <= 0xbf) ||
+                   (c == 0xf4 && d >= 0x80 && d <= 0x8f && e >= 0x80 && e <= 0xbf && f >= 0x80 && f <= 0xbf)
+
+consT :: CharReducer m => Word8 -> T -> (H -> UTF8 m) -> (m -> UTF8 m) -> (T -> UTF8 m) -> UTF8 m
+consT c cs h m t
+             | c < 0x80 = m $ b1 c `mappend` invalidChars cs
+             | c < 0xc0 = t (c:cs)
+             | c < 0xe0 = case cs of
+                        [] -> h $ H2_1 c
+                        (d:ds) -> m $ b2 c d `mappend` invalidChars ds
+             | c < 0xf0 = case cs of
+                        [] -> h $ H3_1 c
+                        [d] -> h $ H3_2 c d
+                        (d:e:es) -> m $ b3 c d e `mappend` invalidChars es
+             | c < 0xf5 = case cs of
+                        [] -> h $ H4_1 c
+                        [d] -> h $ H4_2 c d 
+                        [d,e] -> h $ H4_3 c d e 
+                        (d:e:f:fs) -> m $ b4 c d e f `mappend` invalidChars fs
+             | otherwise = mempty
+
+invalidChars :: CharReducer m => [Word8] -> m
+invalidChars = foldr (mappend . invalidChar . return) mempty
+
+merge :: CharReducer m => H -> T -> (m -> a) -> (H -> a) -> a
+merge H0 cs k _               = k $ invalidChars cs
+merge (H2_1 c) [] _ p         = p $ H2_1 c
+merge (H2_1 c) (d:ds) k _     = k $ b2 c d `mappend` invalidChars ds
+merge (H3_1 c) [] _ p         = p $ H3_1 c
+merge (H3_1 c) [d] _ p        = p $ H3_2 c d
+merge (H3_1 c) (d:e:es) k _   = k $ b3 c d e `mappend` invalidChars es
+merge (H3_2 c d) [] _ p       = p $ H3_2 c d
+merge (H3_2 c d) (e:es) k _   = k $ b3 c d e `mappend` invalidChars es
+merge (H4_1 c) [] _ p         = p $ H4_1 c
+merge (H4_1 c) [d] _ p        = p $ H4_2 c d
+merge (H4_1 c) [d,e] _ p      = p $ H4_3 c d e
+merge (H4_1 c) (d:e:f:fs) k _ = k $ b4 c d e f `mappend` invalidChars fs
+merge (H4_2 c d) [] _ p       = p $ H4_2 c d 
+merge (H4_2 c d) [e] _ p      = p $ H4_3 c d e
+merge (H4_2 c d) (e:f:fs) k _ = k $ b4 c d e f `mappend` invalidChars fs
+merge (H4_3 c d e) [] _ p     = p $ H4_3 c d e
+merge (H4_3 c d e) (f:fs) k _ = k $ b4 c d e f `mappend` invalidChars fs
+
+instance CharReducer m => Monoid (UTF8 m) where
+    mempty = T []
+    T c `mappend` T d = T (c ++ d)
+    T c `mappend` S l m r = S (c ++ l) m r
+    S l m c `mappend` S c' m' r = S l (m `mappend` merge c c' id flushH `mappend` m') r
+    s@(S _ _ _) `mappend` T [] = s
+    S l m c `mappend` T c' = merge c c' k (S l m) where
+        k m' = S l (m `mappend` m') H0
+
+instance CharReducer m => Reducer Word8 (UTF8 m) where
+    unit c | c >= 0x80 && c < 0xc0 = T [c]
+           | otherwise = snocH H0 c (S []) mempty
+    S t m h `snoc` c        = snocH h c (S t) m
+    T t     `snoc` c        | c >= 0x80 && c < 0xc0 = T (t ++ [c])
+                            | otherwise = snocH H0 c (S t) mempty
+
+    c       `cons` T cs     = consT c cs (S [] mempty) (flip (S []) H0) T
+    c       `cons` S cs m h = consT c cs k1 k2 k3 where
+        k1 h' = S [] (flushH h' `mappend` m) h
+        k2 m' = S [] (m' `mappend` m) h
+        k3 t' = S t' m h
+    
+instance Functor UTF8 where
+    fmap f (S t x h) = S t (f x) h
+    fmap _ (T t) = T t
+
+instance Pointed UTF8 where
+    point f = S [] f H0
+
+runUTF8 :: CharReducer m => UTF8 m -> m 
+runUTF8 (T t) = flushT t
+runUTF8 (S t m h) = flushT t `mappend` m `mappend` flushH h
+
+ addfile ./dist/doc/html/monoids/src/Data-Monoid-Lexical-Words.html hunk ./dist/doc/html/monoids/src/Data-Monoid-Lexical-Words.html 1 + + + + +Data/Monoid/Lexical/Words.hs + + + +
{-# LANGUAGE FlexibleInstances, MultiParamTypeClasses, FlexibleContexts, GeneralizedNewtypeDeriving, ParallelListComp, TypeFamilies #-}
+module Data.Monoid.Lexical.Words 
+    ( module Data.Monoid.Reducer.Char
+    , Words
+    , runWords
+    , Lines
+    , runLines
+    , Unspaced(runUnspaced)
+    , Unlined(runUnlined)
+    , wordsFrom
+    , linesFrom
+    ) where
+
+import Data.Char (isSpace)
+import Data.Maybe (maybeToList)
+import Data.Monoid.Reducer.Char
+import Data.Monoid.Generator
+import Control.Functor.Pointed
+
+data Words m = Chunk (Maybe m)
+             | Segment (Maybe m) [m] (Maybe m)
+    deriving (Show,Read)
+
+runWords :: Words m -> [m]
+runWords (Chunk m) = maybeToList m
+runWords (Segment l m r) = maybeToList l ++ m ++ maybeToList r
+
+instance Monoid m => Monoid (Words m) where
+    mempty = Chunk mempty
+    Chunk l `mappend` Chunk r = Chunk (l `mappend` r)
+    Chunk l `mappend` Segment l' m r = Segment (l `mappend` l') m r
+    Segment l m r `mappend` Chunk r' = Segment l m (r `mappend` r')
+    Segment l m r `mappend` Segment l' m' r' = Segment l (m ++ maybeToList (r `mappend` l') ++ m') r'
+
+instance Reducer Char m => Reducer Char (Words m) where
+    unit c | isSpace c = Segment (Just (unit c)) [] mempty
+           | otherwise = Chunk (Just (unit c))
+
+instance Functor Words where
+    fmap f (Chunk m) = Chunk (fmap f m)
+    fmap f (Segment m ms m') = Segment (fmap f m) (fmap f ms) (fmap f m')
+
+-- abuse the same machinery to handle lines as well
+
+newtype Lines m = Lines (Words m) deriving (Show,Read,Monoid,Functor)
+
+instance Reducer Char m => Reducer Char (Lines m) where
+    unit '\n' = Lines $ Segment (Just (unit '\n')) [] mempty
+    unit c = Lines $ Chunk (Just (unit c))
+
+runLines :: Lines m -> [m]
+runLines (Lines x) = runWords x
+
+newtype Unspaced m = Unspaced { runUnspaced :: m }  deriving (Eq,Ord,Show,Read,Monoid)
+
+instance Reducer Char m => Reducer Char (Unspaced m) where
+    unit c | isSpace c = mempty
+           | otherwise = Unspaced (unit c)
+
+instance CharReducer m => CharReducer (Unspaced m) where
+    invalidChar = Unspaced . invalidChar
+
+instance Functor Unspaced where
+    fmap f (Unspaced x) = Unspaced (f x)
+
+instance Pointed Unspaced where
+    point = Unspaced
+
+instance Copointed Unspaced where
+    extract = runUnspaced
+
+newtype Unlined m = Unlined { runUnlined :: m }  deriving (Eq,Ord,Show,Read,Monoid)
+
+instance Reducer Char m => Reducer Char (Unlined m) where
+    unit '\n' = mempty
+    unit c = Unlined (unit c)
+
+instance CharReducer m => CharReducer (Unlined m) where
+    invalidChar = Unlined . invalidChar
+
+instance Functor Unlined where
+    fmap f (Unlined x) = Unlined (f x)
+
+instance Pointed Unlined where
+    point = Unlined
+
+instance Copointed Unlined where
+    extract = runUnlined
+
+-- accumulator, inside-word, and until-next-word monoids
+wordsFrom :: (Generator c, Elem c ~ Char, Char `Reducer` m, Char `Reducer` n, Char `Reducer` o) => m -> c -> [(m,n,o)]
+wordsFrom s c = [(x,runUnlined y,z) | x <- scanl mappend s ls | (y,z) <- rs ] where
+    (ls,rs) = unzip (runWords (mapReduce id c))
+
+-- accumulator, inside-line, and until-next-line monoids
+linesFrom :: (Generator c, Elem c ~ Char, Char `Reducer` m, Char `Reducer` n, Char `Reducer` o) => m -> c -> [(m,n,o)]
+linesFrom s c = [(x,runUnlined y,z) | x <- scanl mappend s ls | (y,z) <- rs ] where
+    (ls,rs) = unzip (runLines (mapReduce id c))
+
+ addfile ./dist/doc/html/monoids/src/Data-Monoid-Map.html hunk ./dist/doc/html/monoids/src/Data-Monoid-Map.html 1 + + + + +Data/Monoid/Map.hs + + + +
{-# LANGUAGE MultiParamTypeClasses #-}
+module Data.Monoid.Map 
+    ( module Data.Monoid.Reducer
+    , Union(getUnion)
+    , UnionWith(getUnionWith)
+    ) where
+
+import Prelude (Ord)
+import Data.Monoid.Reducer (Reducer, unit, cons, snoc, Monoid, mempty, mappend)
+import Data.Map
+
+newtype Union k a = Union { getUnion :: Map k a } 
+
+instance Ord k => Monoid (Union k a) where
+    mempty = Union empty
+    Union a `mappend` Union b = Union (a `union` b)
+
+instance Ord k => Reducer (Map k a) (Union k a) where
+    unit = Union
+
+-- only needs m to be a semigroup, but Haskell doesn't have a semigroup class
+
+newtype UnionWith k m = UnionWith { getUnionWith :: Map k m } 
+
+instance (Ord k, Monoid m) => Monoid (UnionWith k m) where
+    mempty = UnionWith empty
+    UnionWith a `mappend` UnionWith b = UnionWith (unionWith mappend a b)
+
+instance (Ord k, Monoid m) => Reducer (Map k m) (UnionWith k m) where
+    unit = UnionWith
+
+ addfile ./dist/doc/html/monoids/src/Data-Monoid-Monad.html hunk ./dist/doc/html/monoids/src/Data-Monoid-Monad.html 1 + + + + +Data/Monoid/Monad.hs + + + +
{-# LANGUAGE FlexibleInstances, MultiParamTypeClasses, GeneralizedNewtypeDeriving, FlexibleContexts #-}
+module Data.Monoid.Monad 
+    ( module Control.Monad
+    , module Data.Monoid.Reducer
+    , Action(Action,getAction)
+    , MonadSum(MonadSum,getMonadSum)
+    ) where
+
+import Data.Monoid.Reducer
+import Control.Monad (MonadPlus, mplus, mzero)
+
+newtype Action m = Action { getAction :: m () } 
+
+instance Monad m => Monoid (Action m) where
+    mempty = Action (return ())
+    Action a `mappend` Action b = Action (a >> b)
+
+instance Monad m => Reducer (m a) (Action m) where
+    unit a = Action (a >> return ())
+    a `cons` Action b = Action (a >> b)
+    Action a `snoc` b = Action (a >> b >> return ())
+
+{-# RULES "unitAction" unit = Action #-}
+{-# RULES "snocAction" snoc = snocAction #-} 
+snocAction :: Reducer (m ()) (Action m) => Action m -> m () -> Action m
+snocAction a = mappend a . Action
+
+newtype MonadSum m a = MonadSum { getMonadSum :: m a } 
+    deriving (Eq,Ord,Show,Read,Functor,Monad,MonadPlus)
+
+instance MonadPlus m => Monoid (MonadSum m a) where
+    mempty = MonadSum mzero
+    MonadSum a `mappend` MonadSum b = MonadSum (a `mplus` b)
+
+instance MonadPlus m => Reducer (m a) (MonadSum m a) where
+    unit = MonadSum
+    a `cons` MonadSum b = MonadSum (a `mplus` b)
+    MonadSum a `snoc` b = MonadSum (a `mplus` b)
+
+
+ addfile ./dist/doc/html/monoids/src/Data-Monoid-Ord.html hunk ./dist/doc/html/monoids/src/Data-Monoid-Ord.html 1 + + + + +Data/Monoid/Ord.hs + + + +
-----------------------------------------------------------------------------
+---- |
+---- Module      :  Data.Monoid.Ord
+---- Copyright   :  (c) Edward Kmett 2009
+---- License     :  BSD-style
+---- Maintainer  :  libraries@haskell.org
+---- Stability   :  provisional
+---- Portability :  portable
+----
+---- Some 'Monoid' instances that should probably be in "Data.Monoid".
+----
+-------------------------------------------------------------------------------
+
+module Data.Monoid.Ord 
+    ( module Data.Monoid
+    -- * Max
+    , Max(Max,getMax)
+    -- * Min
+    , Min(Min,getMin)
+    -- * MaxPriority: Max semigroup w/ added bottom
+    , MaxPriority(MaxPriority,getMaxPriority)
+    -- * MinPriority: Min semigroup w/ added top
+    , MinPriority(MinPriority,getMinPriority)
+    ) where
+
+import Data.Monoid (Monoid, mappend, mempty)
+
+
+-- | The 'Monoid' @('max','minBound')@
+newtype Max a = Max { getMax :: a } deriving (Eq,Ord,Show,Read,Bounded)
+
+instance (Ord a, Bounded a) => Monoid (Max a) where
+    mempty = Max minBound
+    mappend = max
+
+-- | The 'Monoid' given by @('min','maxBound')@
+newtype Min a = Min { getMin :: a } deriving (Eq,Ord,Show,Read,Bounded)
+
+instance (Ord a, Bounded a) => Monoid (Min a) where
+    mempty = Min maxBound
+    mappend = min
+
+-- | The 'Monoid' @('max','Nothing')@ over @'Maybe' a@ where 'Nothing' is the bottom element
+newtype MaxPriority a = MaxPriority { getMaxPriority :: Maybe a } deriving (Eq,Ord,Show,Read)
+
+instance Ord a => Monoid (MaxPriority a) where
+    mempty = MaxPriority Nothing
+    mappend = max
+
+-- | The 'Monoid' @('min','Nothing')@ over @'Maybe' a@ where 'Nothing' is the top element
+newtype MinPriority a = MinPriority { getMinPriority :: Maybe a } deriving (Eq,Show,Read)
+
+instance Ord a => Ord (MinPriority a) where
+    MinPriority Nothing  `compare` MinPriority Nothing  = EQ
+    MinPriority Nothing  `compare` _                    = GT
+    _                    `compare` MinPriority Nothing  = LT
+    MinPriority (Just a) `compare` MinPriority (Just b) = a `compare` b
+
+instance Ord a => Monoid (MinPriority a) where
+    mempty = MinPriority Nothing
+    mappend = min
+
+ addfile ./dist/doc/html/monoids/src/Data-Monoid-Reducer-Char.html hunk ./dist/doc/html/monoids/src/Data-Monoid-Reducer-Char.html 1 + + + + +Data/Monoid/Reducer/Char.hs + + + +
{-# LANGUAGE UndecidableInstances, FlexibleContexts, MultiParamTypeClasses, FlexibleInstances #-}
+module Data.Monoid.Reducer.Char
+    ( module Data.Monoid.Reducer
+    , CharReducer
+    , invalidChar
+    , fromChar
+    ) where
+
+import Data.Monoid.Reducer
+import Data.Word (Word8)
+
+class Reducer Char m => CharReducer m where
+    fromChar :: Char -> m 
+    fromChar = unit
+
+    invalidChar :: [Word8] -> m
+    invalidChar = const mempty
+
+instance (CharReducer m, CharReducer m') =>  CharReducer (m,m') where
+    invalidChar bs = (invalidChar bs, invalidChar bs)
+
+instance (CharReducer m, CharReducer m', CharReducer m'') =>  CharReducer (m,m',m'') where
+    invalidChar bs = (invalidChar bs, invalidChar bs, invalidChar bs)
+
+instance (CharReducer m, CharReducer m', CharReducer m'', CharReducer m''') =>  CharReducer (m,m',m'',m''') where
+    invalidChar bs = (invalidChar bs, invalidChar bs, invalidChar bs, invalidChar bs)
+
+instance CharReducer [Char]
+
+instance CharReducer ()
+
+ addfile ./dist/doc/html/monoids/src/Data-Monoid-Reducer-With.html hunk ./dist/doc/html/monoids/src/Data-Monoid-Reducer-With.html 1 + + + + +Data/Monoid/Reducer/With.hs + + + +
{-# LANGUAGE UndecidableInstances, TypeOperators, FlexibleContexts, MultiParamTypeClasses, FlexibleInstances #-}
+module Data.Monoid.Reducer.With
+    ( module Data.Monoid.Reducer
+    , WithReducer(WithReducer,runWithReducer)
+    , withoutReducer
+    ) where
+
+import Data.Monoid.Reducer
+import Data.FingerTree
+
+newtype WithReducer c m = WithReducer { runWithReducer :: (m,c) } 
+
+withoutReducer :: c `WithReducer` m -> c
+withoutReducer = snd . runWithReducer
+
+instance (c `Reducer` m) => Reducer (c `WithReducer` m) m where
+    unit = fst . runWithReducer 
+
+instance (c `Reducer` m) => Measured m (c `WithReducer` m) where
+    measure = fst . runWithReducer
+
+ addfile ./dist/doc/html/monoids/src/Data-Monoid-Reducer.html hunk ./dist/doc/html/monoids/src/Data-Monoid-Reducer.html 1 + + + + +Data/Monoid/Reducer.hs + + + +
{-# LANGUAGE UndecidableInstances, FlexibleContexts, MultiParamTypeClasses, FlexibleInstances #-}
+module Data.Monoid.Reducer
+    ( module Data.Monoid
+    , Reducer
+    , unit, snoc, cons
+    ) where
+
+import Data.Monoid (Monoid, mempty, mappend)
+
+-- minimal definition unit or snoc
+class Monoid m => Reducer c m where
+    unit :: c -> m 
+    snoc :: m -> c -> m
+    cons :: c -> m -> m 
+
+    unit = snoc mempty 
+    snoc m = mappend m . unit
+    cons = mappend . unit
+
+instance (Reducer c m, Reducer c n) => Reducer c (m,n) where
+    unit x = (unit x,unit x)
+    (m,n) `snoc` x = (m `snoc` x, n `snoc` x)
+    x `cons` (m,n) = (x `cons` m, x `cons` n)
+
+instance (Reducer c m, Reducer c n, Reducer c o) => Reducer c (m,n,o) where
+    unit x = (unit x,unit x, unit x)
+    (m,n,o) `snoc` x = (m `snoc` x, n `snoc` x, o `snoc` x)
+    x `cons` (m,n,o) = (x `cons` m, x `cons` n, x `cons` o)
+
+instance (Reducer c m, Reducer c n, Reducer c o, Reducer c p) => Reducer c (m,n,o,p) where
+    unit x = (unit x,unit x, unit x, unit x)
+    (m,n,o,p) `snoc` x = (m `snoc` x, n `snoc` x, o `snoc` x, p `snoc` x)
+    x `cons` (m,n,o,p) = (x `cons` m, x `cons` n, x `cons` o, x `cons` p)
+
+instance Reducer c [c] where
+    unit = return
+    cons = (:)
+    xs `snoc` x = xs ++ [x]
+
+instance Reducer [c] [c] where
+    unit = id
+    snoc = mappend
+    cons = mappend
+
+instance Reducer c () where
+    unit _ = ()
+    _ `snoc` _ = ()
+    _ `cons` _ = ()
+
+ addfile ./dist/doc/html/monoids/src/hscolour.css hunk ./dist/doc/html/monoids/src/hscolour.css 1 +.hs-keyglyph, .hs-layout {color: red;} +.hs-keyword {color: blue;} +.hs-comment, .hs-comment a {color: green;} +.hs-str, .hs-chr {color: teal;} +.hs-keyword, .hs-conid, .hs-varid, .hs-conop, .hs-varop, .hs-num, .hs-cpp, .hs-sel, .hs-definition {} }