diff --git a/AUTHORS.md b/AUTHORS.md
new file mode 100644
--- /dev/null
+++ b/AUTHORS.md
@@ -0,0 +1,2 @@
+* [Christiaan Baaij](mailto:christiaan.baaij@gmail.com) [@christiaanb](https://github.com/christiaanb)
+* John Ericson [@Ericson2314](https://github.com/Ericson2314)
diff --git a/CHANGELOG.md b/CHANGELOG.md
--- a/CHANGELOG.md
+++ b/CHANGELOG.md
@@ -1,5 +1,9 @@
 # Changelog for [`clash-prelude` package](http://hackage.haskell.org/package/clash-prelude)
 
+## 0.7.5 **May 7th 2015**
+* New features:
+  * Moore machine combinators
+
 ## 0.7.4 **May 5th 2015*
 * New features:
   * Add `TopEntity` annotations
diff --git a/clash-prelude.cabal b/clash-prelude.cabal
--- a/clash-prelude.cabal
+++ b/clash-prelude.cabal
@@ -1,5 +1,5 @@
 Name:                 clash-prelude
-Version:              0.7.4
+Version:              0.7.5
 Synopsis:             CAES Language for Synchronous Hardware - Prelude library
 Description:
   CλaSH (pronounced ‘clash’) is a functional hardware description language that
@@ -34,6 +34,7 @@
 
 Extra-source-files:   README.md
                       CHANGELOG.md
+                      AUTHORS.md
 
 extra-doc-files:      doc/*.svg
 
@@ -68,6 +69,7 @@
                       CLaSH.Prelude.DataFlow
                       CLaSH.Prelude.Explicit
                       CLaSH.Prelude.Mealy
+                      CLaSH.Prelude.Moore
                       CLaSH.Prelude.Testbench
 
                       CLaSH.Promoted.Nat
@@ -120,7 +122,7 @@
                       data-default              >= 0.5.3,
                       integer-gmp               >= 0.5.1.0,
                       ghc-prim                  >= 0.3.1.0,
-                      ghc-typelits-natnormalise >= 0.2,
+                      ghc-typelits-natnormalise >= 0.2.1,
                       singletons                >= 1.0,
                       template-haskell          >= 2.9.0.0,
                       th-lift                   >= 0.5.6
diff --git a/doc/foldl.svg b/doc/foldl.svg
new file mode 100644
--- /dev/null
+++ b/doc/foldl.svg
@@ -0,0 +1,3 @@
+<?xml version="1.0" encoding="utf-8" standalone="no"?>
+<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd">
+<svg xmlns="http://www.w3.org/2000/svg" xmlns:xl="http://www.w3.org/1999/xlink" version="1.1" viewBox="121 143 243 93" width="243pt" height="93pt" xmlns:dc="http://purl.org/dc/elements/1.1/"><metadata> Produced by OmniGraffle 6.1.3 <dc:date>2015-05-07 12:44:21 +0000</dc:date></metadata><defs><font-face font-family="Courier" font-size="9" units-per-em="1000" underline-position="-178.22266" underline-thickness="57.617188" slope="0" x-height="462.40234" cap-height="594.72656" ascent="753.90625" descent="-246.09375" font-weight="500"><font-face-src><font-face-name name="Courier"/></font-face-src></font-face><marker orient="auto" overflow="visible" markerUnits="strokeWidth" id="FilledArrow_Marker" viewBox="-9 -4 10 8" markerWidth="10" markerHeight="8" color="black"><g><path d="M -8 0 L 0 3 L 0 -3 Z" fill="currentColor" stroke="currentColor" stroke-width="1"/></g></marker><marker orient="auto" overflow="visible" markerUnits="strokeWidth" id="FilledArrow_Marker_2" viewBox="-1 -4 8 8" markerWidth="8" markerHeight="8" color="black"><g><path d="M 5.5999994 0 L 0 -2.0999998 L 0 2.0999998 Z" fill="currentColor" stroke="currentColor" stroke-width="1"/></g></marker></defs><g stroke="none" stroke-opacity="1" stroke-dasharray="none" fill="none" fill-opacity="1"><title>Canvas 1</title><g><title>Layer 1</title><path d="M 159.69867 190.41867 L 191.8421 190.41867 C 194.60353 190.41867 196.8421 192.65725 196.8421 195.41867 L 196.8421 227.5621 C 196.8421 230.32353 194.60353 232.5621 191.8421 232.5621 L 159.69867 232.5621 C 156.93725 232.5621 154.69867 230.32353 154.69867 227.5621 L 154.69867 195.41867 C 154.69867 192.65725 156.93725 190.41867 159.69867 190.41867 Z" stroke="black" stroke-linecap="round" stroke-linejoin="round" stroke-width="1"/><text transform="translate(169.98828 144)" fill="black"><tspan font-family="Courier" font-size="9" font-weight="500" x=".099121094" y="9" textLength="10.801758">x0</tspan></text><path d="M 132.860075 211.49039 L 132.68 211.49039 L 154.25446 211.49039" marker-start="url(#FilledArrow_Marker)" stroke="black" stroke-linecap="round" stroke-linejoin="round" stroke-width="1"/><text transform="translate(172.48828 205.0621)" fill="black"><tspan font-family="Courier" font-size="9" font-weight="500" x=".29956055" y="9" textLength="5.400879">f</tspan></text><line x1="196.8421" y1="211.56208" x2="200.91656" y2="211.56208" marker-end="url(#FilledArrow_Marker_2)" stroke="black" stroke-linecap="round" stroke-linejoin="round" stroke-width="1"/><path d="M 250.56 194.5621 L 250.56 228.5621 C 250.56 231.32353 248.32142 233.5621 245.56 233.5621 L 213.41656 233.5621 C 210.65514 233.5621 208.41656 231.32353 208.41656 228.5621 L 208.41656 194.5621 C 208.41656 191.80068 210.65514 189.5621 213.41656 189.5621 L 245.56 189.5621 C 248.32142 189.5621 250.56 191.80068 250.56 194.5621 Z" stroke="black" stroke-linecap="round" stroke-linejoin="round" stroke-width="1"/><text transform="translate(223.98828 144)" fill="black"><tspan font-family="Courier" font-size="9" font-weight="500" x=".099121094" y="9" textLength="10.801758">x1</tspan></text><path d="M 229.50976 158.580075 L 229.50976 158.4 L 229.48864 189.0621" marker-start="url(#FilledArrow_Marker)" stroke="black" stroke-linecap="round" stroke-linejoin="round" stroke-width="1"/><text transform="translate(226.48828 206.0621)" fill="black"><tspan font-family="Courier" font-size="9" font-weight="500" x=".29956055" y="9" textLength="5.400879">f</tspan></text><path d="M 340.56 194.0621 L 340.56 228.0621 C 340.56 230.82353 338.32142 233.0621 335.56 233.0621 L 303.41656 233.0621 C 300.65514 233.0621 298.41656 230.82353 298.41656 228.0621 L 298.41656 194.0621 C 298.41656 191.30068 300.65514 189.0621 303.41656 189.0621 L 335.56 189.0621 C 338.32142 189.0621 340.56 191.30068 340.56 194.0621 Z" stroke="black" stroke-linecap="round" stroke-linejoin="round" stroke-width="1"/><text transform="translate(313.98828 143.5)" fill="black"><tspan font-family="Courier" font-size="9" font-weight="500" x=".099121094" y="9" textLength="10.801758">xn</tspan></text><path d="M 319.48828 158.080075 L 319.48828 157.9 L 319.4883 189.0621" marker-start="url(#FilledArrow_Marker)" stroke="black" stroke-linecap="round" stroke-linejoin="round" stroke-width="1"/><text transform="translate(316.48828 205.5621)" fill="black"><tspan font-family="Courier" font-size="9" font-weight="500" x=".29956055" y="9" textLength="5.400879">f</tspan></text><text transform="translate(260.98828 203.0621)" fill="black"><tspan font-family="Courier" font-size="9" font-weight="500" x=".19824219" y="9" textLength="21.603516"> ...</tspan></text><path d="M 175.48828 158.580075 L 175.48828 158.4 L 175.4883 189.0621" marker-start="url(#FilledArrow_Marker)" stroke="black" stroke-linecap="round" stroke-linejoin="round" stroke-width="1"/><line x1="250.22" y1="211.68" x2="254.2946" y2="211.70524" marker-end="url(#FilledArrow_Marker_2)" stroke="black" stroke-linecap="round" stroke-linejoin="round" stroke-width="1"/><line x1="287.3421" y1="211.68" x2="291.41671" y2="211.70524" marker-end="url(#FilledArrow_Marker_2)" stroke="black" stroke-linecap="round" stroke-linejoin="round" stroke-width="1"/><line x1="340.3421" y1="211.68" x2="354.4166" y2="211.72677" marker-end="url(#FilledArrow_Marker_2)" stroke="black" stroke-linecap="round" stroke-linejoin="round" stroke-width="1"/><text transform="translate(121.64 205.0621)" fill="black"><tspan font-family="Courier" font-size="9" font-weight="500" x=".29956055" y="9" textLength="5.400879">z</tspan></text></g></g></svg>
diff --git a/doc/foldl1.svg b/doc/foldl1.svg
new file mode 100644
--- /dev/null
+++ b/doc/foldl1.svg
@@ -0,0 +1,3 @@
+<?xml version="1.0" encoding="utf-8" standalone="no"?>
+<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd">
+<svg xmlns="http://www.w3.org/2000/svg" xmlns:xl="http://www.w3.org/1999/xlink" version="1.1" viewBox="119 143 253 93" width="253pt" height="93pt" xmlns:dc="http://purl.org/dc/elements/1.1/"><metadata> Produced by OmniGraffle 6.1.3 <dc:date>2015-05-07 12:55:45 +0000</dc:date></metadata><defs><font-face font-family="Courier" font-size="9" units-per-em="1000" underline-position="-178.22266" underline-thickness="57.617188" slope="0" x-height="462.40234" cap-height="594.72656" ascent="753.90625" descent="-246.09375" font-weight="500"><font-face-src><font-face-name name="Courier"/></font-face-src></font-face><marker orient="auto" overflow="visible" markerUnits="strokeWidth" id="FilledArrow_Marker" viewBox="-9 -4 10 8" markerWidth="10" markerHeight="8" color="black"><g><path d="M -8 0 L 0 3 L 0 -3 Z" fill="currentColor" stroke="currentColor" stroke-width="1"/></g></marker><marker orient="auto" overflow="visible" markerUnits="strokeWidth" id="FilledArrow_Marker_2" viewBox="-1 -4 8 8" markerWidth="8" markerHeight="8" color="black"><g><path d="M 5.5999994 0 L 0 -2.0999998 L 0 2.0999998 Z" fill="currentColor" stroke="currentColor" stroke-width="1"/></g></marker></defs><g stroke="none" stroke-opacity="1" stroke-dasharray="none" fill="none" fill-opacity="1"><title>Canvas 1</title><g><title>Layer 1</title><path d="M 159.69867 190.41867 L 191.8421 190.41867 C 194.60353 190.41867 196.8421 192.65725 196.8421 195.41867 L 196.8421 227.5621 C 196.8421 230.32353 194.60353 232.5621 191.8421 232.5621 L 159.69867 232.5621 C 156.93725 232.5621 154.69867 230.32353 154.69867 227.5621 L 154.69867 195.41867 C 154.69867 192.65725 156.93725 190.41867 159.69867 190.41867 Z" stroke="black" stroke-linecap="round" stroke-linejoin="round" stroke-width="1"/><text transform="translate(169.98828 144)" fill="black"><tspan font-family="Courier" font-size="9" font-weight="500" x=".099121094" y="9" textLength="10.801758">x1</tspan></text><path d="M 132.860075 211.49039 L 132.68 211.49039 L 154.25446 211.49039" marker-start="url(#FilledArrow_Marker)" stroke="black" stroke-linecap="round" stroke-linejoin="round" stroke-width="1"/><text transform="translate(172.48828 205.0621)" fill="black"><tspan font-family="Courier" font-size="9" font-weight="500" x=".29956055" y="9" textLength="5.400879">f</tspan></text><line x1="196.8421" y1="211.56208" x2="200.91656" y2="211.56208" marker-end="url(#FilledArrow_Marker_2)" stroke="black" stroke-linecap="round" stroke-linejoin="round" stroke-width="1"/><path d="M 250.56 194.5621 L 250.56 228.5621 C 250.56 231.32353 248.32142 233.5621 245.56 233.5621 L 213.41656 233.5621 C 210.65514 233.5621 208.41656 231.32353 208.41656 228.5621 L 208.41656 194.5621 C 208.41656 191.80068 210.65514 189.5621 213.41656 189.5621 L 245.56 189.5621 C 248.32142 189.5621 250.56 191.80068 250.56 194.5621 Z" stroke="black" stroke-linecap="round" stroke-linejoin="round" stroke-width="1"/><text transform="translate(223.98828 144)" fill="black"><tspan font-family="Courier" font-size="9" font-weight="500" x=".099121094" y="9" textLength="10.801758">x2</tspan></text><path d="M 229.50976 158.580075 L 229.50976 158.4 L 229.48864 189.0621" marker-start="url(#FilledArrow_Marker)" stroke="black" stroke-linecap="round" stroke-linejoin="round" stroke-width="1"/><text transform="translate(226.48828 206.0621)" fill="black"><tspan font-family="Courier" font-size="9" font-weight="500" x=".29956055" y="9" textLength="5.400879">f</tspan></text><path d="M 340.56 194.0621 L 340.56 228.0621 C 340.56 230.82353 338.32142 233.0621 335.56 233.0621 L 303.41656 233.0621 C 300.65514 233.0621 298.41656 230.82353 298.41656 228.0621 L 298.41656 194.0621 C 298.41656 191.30068 300.65514 189.0621 303.41656 189.0621 L 335.56 189.0621 C 338.32142 189.0621 340.56 191.30068 340.56 194.0621 Z" stroke="black" stroke-linecap="round" stroke-linejoin="round" stroke-width="1"/><text transform="translate(313.98828 143.5)" fill="black"><tspan font-family="Courier" font-size="9" font-weight="500" x=".099121094" y="9" textLength="10.801758">xn</tspan></text><path d="M 319.48828 158.080075 L 319.48828 157.9 L 319.4883 189.0621" marker-start="url(#FilledArrow_Marker)" stroke="black" stroke-linecap="round" stroke-linejoin="round" stroke-width="1"/><text transform="translate(316.48828 205.5621)" fill="black"><tspan font-family="Courier" font-size="9" font-weight="500" x=".29956055" y="9" textLength="5.400879">f</tspan></text><text transform="translate(260.98828 203.0621)" fill="black"><tspan font-family="Courier" font-size="9" font-weight="500" x=".19824219" y="9" textLength="21.603516"> ...</tspan></text><path d="M 175.48828 158.580075 L 175.48828 158.4 L 175.4883 189.0621" marker-start="url(#FilledArrow_Marker)" stroke="black" stroke-linecap="round" stroke-linejoin="round" stroke-width="1"/><line x1="250.22" y1="211.68" x2="254.2946" y2="211.70524" marker-end="url(#FilledArrow_Marker_2)" stroke="black" stroke-linecap="round" stroke-linejoin="round" stroke-width="1"/><line x1="287.3421" y1="211.68" x2="291.41671" y2="211.70524" marker-end="url(#FilledArrow_Marker_2)" stroke="black" stroke-linecap="round" stroke-linejoin="round" stroke-width="1"/><line x1="340.3421" y1="211.68" x2="354.4166" y2="211.72677" marker-end="url(#FilledArrow_Marker_2)" stroke="black" stroke-linecap="round" stroke-linejoin="round" stroke-width="1"/><text transform="translate(119.14 205.0621)" fill="black"><tspan font-family="Courier" font-size="9" font-weight="500" x=".099121094" y="9" textLength="10.801758">x0</tspan></text></g></g></svg>
diff --git a/doc/foldr.svg b/doc/foldr.svg
new file mode 100644
--- /dev/null
+++ b/doc/foldr.svg
@@ -0,0 +1,3 @@
+<?xml version="1.0" encoding="utf-8" standalone="no"?>
+<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd">
+<svg xmlns="http://www.w3.org/2000/svg" xmlns:xl="http://www.w3.org/1999/xlink" version="1.1" viewBox="131 143 241 93" width="241pt" height="93pt" xmlns:dc="http://purl.org/dc/elements/1.1/"><metadata> Produced by OmniGraffle 6.1.3 <dc:date>2015-05-07 12:45:19 +0000</dc:date></metadata><defs><font-face font-family="Courier" font-size="9" units-per-em="1000" underline-position="-178.22266" underline-thickness="57.617188" slope="0" x-height="462.40234" cap-height="594.72656" ascent="753.90625" descent="-246.09375" font-weight="500"><font-face-src><font-face-name name="Courier"/></font-face-src></font-face><marker orient="auto" overflow="visible" markerUnits="strokeWidth" id="FilledArrow_Marker" viewBox="-9 -4 10 8" markerWidth="10" markerHeight="8" color="black"><g><path d="M -8 0 L 0 3 L 0 -3 Z" fill="currentColor" stroke="currentColor" stroke-width="1"/></g></marker><marker orient="auto" overflow="visible" markerUnits="strokeWidth" id="FilledArrow_Marker_2" viewBox="-1 -4 8 8" markerWidth="8" markerHeight="8" color="black"><g><path d="M 5.5999994 0 L 0 -2.0999998 L 0 2.0999998 Z" fill="currentColor" stroke="currentColor" stroke-width="1"/></g></marker></defs><g stroke="none" stroke-opacity="1" stroke-dasharray="none" fill="none" fill-opacity="1"><title>Canvas 1</title><g><title>Layer 1</title><path d="M 191.8421 190.41867 L 159.69867 190.41867 C 156.93725 190.41867 154.69867 192.65725 154.69867 195.41867 L 154.69867 227.5621 C 154.69867 230.32353 156.93725 232.5621 159.69867 232.5621 L 191.8421 232.5621 C 194.60353 232.5621 196.8421 230.32353 196.8421 227.5621 L 196.8421 195.41867 C 196.8421 192.65725 194.60353 190.41867 191.8421 190.41867 Z" stroke="black" stroke-linecap="round" stroke-linejoin="round" stroke-width="1"/><text transform="translate(169.98828 144)" fill="black"><tspan font-family="Courier" font-size="9" font-weight="500" x=".099121094" y="9" textLength="10.801758">x0</tspan></text><path d="M 361.88266 211.68 L 362.06274 211.68 L 340.48828 211.68" marker-start="url(#FilledArrow_Marker)" stroke="black" stroke-linecap="round" stroke-linejoin="round" stroke-width="1"/><text transform="translate(172.48828 205.0621)" fill="black"><tspan font-family="Courier" font-size="9" font-weight="500" x=".29956055" y="9" textLength="5.400879">f</tspan></text><line x1="208.41656" y1="211.56208" x2="204.33674" y2="211.71644" marker-end="url(#FilledArrow_Marker_2)" stroke="black" stroke-linecap="round" stroke-linejoin="round" stroke-width="1"/><path d="M 250.56 228.5621 L 250.56 194.5621 C 250.56 191.80068 248.32142 189.5621 245.56 189.5621 L 213.41656 189.5621 C 210.65514 189.5621 208.41656 191.80068 208.41656 194.5621 L 208.41656 228.5621 C 208.41656 231.32353 210.65514 233.5621 213.41656 233.5621 L 245.56 233.5621 C 248.32142 233.5621 250.56 231.32353 250.56 228.5621 Z" stroke="black" stroke-linecap="round" stroke-linejoin="round" stroke-width="1"/><text transform="translate(223.98828 144)" fill="black"><tspan font-family="Courier" font-size="9" font-weight="500" x=".099121094" y="9" textLength="10.801758">x1</tspan></text><path d="M 229.50976 158.580075 L 229.50976 158.4 L 229.50101 189.0621" marker-start="url(#FilledArrow_Marker)" stroke="black" stroke-linecap="round" stroke-linejoin="round" stroke-width="1"/><text transform="translate(226.48828 206.0621)" fill="black"><tspan font-family="Courier" font-size="9" font-weight="500" x=".29956055" y="9" textLength="5.400879">f</tspan></text><path d="M 340.56 228.0621 L 340.56 194.0621 C 340.56 191.30068 338.32142 189.0621 335.56 189.0621 L 303.41656 189.0621 C 300.65514 189.0621 298.41656 191.30068 298.41656 194.0621 L 298.41656 228.0621 C 298.41656 230.82353 300.65514 233.0621 303.41656 233.0621 L 335.56 233.0621 C 338.32142 233.0621 340.56 230.82353 340.56 228.0621 Z" stroke="black" stroke-linecap="round" stroke-linejoin="round" stroke-width="1"/><text transform="translate(313.98828 143.5)" fill="black"><tspan font-family="Courier" font-size="9" font-weight="500" x=".099121094" y="9" textLength="10.801758">xn</tspan></text><path d="M 319.48828 158.080075 L 319.48828 157.9 L 319.48829 188.5621" marker-start="url(#FilledArrow_Marker)" stroke="black" stroke-linecap="round" stroke-linejoin="round" stroke-width="1"/><text transform="translate(316.48828 205.5621)" fill="black"><tspan font-family="Courier" font-size="9" font-weight="500" x=".29956055" y="9" textLength="5.400879">f</tspan></text><text transform="translate(260.98828 203.5621)" fill="black"><tspan font-family="Courier" font-size="9" font-weight="500" x=".19824219" y="9" textLength="21.603516"> ...</tspan></text><path d="M 175.48828 158.580075 L 175.48828 158.4 L 175.4883 189.0621" marker-start="url(#FilledArrow_Marker)" stroke="black" stroke-linecap="round" stroke-linejoin="round" stroke-width="1"/><line x1="261.79446" y1="211.68" x2="257.71985" y2="211.70524" marker-end="url(#FilledArrow_Marker_2)" stroke="black" stroke-linecap="round" stroke-linejoin="round" stroke-width="1"/><line x1="298.91656" y1="211.68" x2="294.84196" y2="211.70524" marker-end="url(#FilledArrow_Marker_2)" stroke="black" stroke-linecap="round" stroke-linejoin="round" stroke-width="1"/><line x1="154.69867" y1="210.5621" x2="140.62417" y2="210.60888" marker-end="url(#FilledArrow_Marker_2)" stroke="black" stroke-linecap="round" stroke-linejoin="round" stroke-width="1"/><text transform="translate(365.48828 205.0621)" fill="black"><tspan font-family="Courier" font-size="9" font-weight="500" x=".29956055" y="9" textLength="5.400879">z</tspan></text></g></g></svg>
diff --git a/doc/foldr1.svg b/doc/foldr1.svg
new file mode 100644
--- /dev/null
+++ b/doc/foldr1.svg
@@ -0,0 +1,3 @@
+<?xml version="1.0" encoding="utf-8" standalone="no"?>
+<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd">
+<svg xmlns="http://www.w3.org/2000/svg" xmlns:xl="http://www.w3.org/1999/xlink" version="1.1" viewBox="131 143 244 93" width="244pt" height="93pt" xmlns:dc="http://purl.org/dc/elements/1.1/"><metadata> Produced by OmniGraffle 6.1.3 <dc:date>2015-05-07 12:53:45 +0000</dc:date></metadata><defs><font-face font-family="Courier" font-size="9" units-per-em="1000" underline-position="-178.22266" underline-thickness="57.617188" slope="0" x-height="462.40234" cap-height="594.72656" ascent="753.90625" descent="-246.09375" font-weight="500"><font-face-src><font-face-name name="Courier"/></font-face-src></font-face><marker orient="auto" overflow="visible" markerUnits="strokeWidth" id="FilledArrow_Marker" viewBox="-9 -4 10 8" markerWidth="10" markerHeight="8" color="black"><g><path d="M -8 0 L 0 3 L 0 -3 Z" fill="currentColor" stroke="currentColor" stroke-width="1"/></g></marker><marker orient="auto" overflow="visible" markerUnits="strokeWidth" id="FilledArrow_Marker_2" viewBox="-1 -4 8 8" markerWidth="8" markerHeight="8" color="black"><g><path d="M 5.5999994 0 L 0 -2.0999998 L 0 2.0999998 Z" fill="currentColor" stroke="currentColor" stroke-width="1"/></g></marker></defs><g stroke="none" stroke-opacity="1" stroke-dasharray="none" fill="none" fill-opacity="1"><title>Canvas 1</title><g><title>Layer 1</title><path d="M 191.8421 190.41867 L 159.69867 190.41867 C 156.93725 190.41867 154.69867 192.65725 154.69867 195.41867 L 154.69867 227.5621 C 154.69867 230.32353 156.93725 232.5621 159.69867 232.5621 L 191.8421 232.5621 C 194.60353 232.5621 196.8421 230.32353 196.8421 227.5621 L 196.8421 195.41867 C 196.8421 192.65725 194.60353 190.41867 191.8421 190.41867 Z" stroke="black" stroke-linecap="round" stroke-linejoin="round" stroke-width="1"/><text transform="translate(169.98828 144)" fill="black"><tspan font-family="Courier" font-size="9" font-weight="500" x=".099121094" y="9" textLength="10.801758">x0</tspan></text><path d="M 361.88266 211.68 L 362.06274 211.68 L 340.48828 211.68" marker-start="url(#FilledArrow_Marker)" stroke="black" stroke-linecap="round" stroke-linejoin="round" stroke-width="1"/><text transform="translate(172.48828 205.0621)" fill="black"><tspan font-family="Courier" font-size="9" font-weight="500" x=".29956055" y="9" textLength="5.400879">f</tspan></text><line x1="208.41656" y1="211.56208" x2="204.33674" y2="211.71644" marker-end="url(#FilledArrow_Marker_2)" stroke="black" stroke-linecap="round" stroke-linejoin="round" stroke-width="1"/><path d="M 250.56 228.5621 L 250.56 194.5621 C 250.56 191.80068 248.32142 189.5621 245.56 189.5621 L 213.41656 189.5621 C 210.65514 189.5621 208.41656 191.80068 208.41656 194.5621 L 208.41656 228.5621 C 208.41656 231.32353 210.65514 233.5621 213.41656 233.5621 L 245.56 233.5621 C 248.32142 233.5621 250.56 231.32353 250.56 228.5621 Z" stroke="black" stroke-linecap="round" stroke-linejoin="round" stroke-width="1"/><text transform="translate(223.98828 144)" fill="black"><tspan font-family="Courier" font-size="9" font-weight="500" x=".099121094" y="9" textLength="10.801758">x1</tspan></text><path d="M 229.50976 158.580075 L 229.50976 158.4 L 229.50101 189.0621" marker-start="url(#FilledArrow_Marker)" stroke="black" stroke-linecap="round" stroke-linejoin="round" stroke-width="1"/><text transform="translate(226.48828 206.0621)" fill="black"><tspan font-family="Courier" font-size="9" font-weight="500" x=".29956055" y="9" textLength="5.400879">f</tspan></text><path d="M 340.56 228.0621 L 340.56 194.0621 C 340.56 191.30068 338.32142 189.0621 335.56 189.0621 L 303.41656 189.0621 C 300.65514 189.0621 298.41656 191.30068 298.41656 194.0621 L 298.41656 228.0621 C 298.41656 230.82353 300.65514 233.0621 303.41656 233.0621 L 335.56 233.0621 C 338.32142 233.0621 340.56 230.82353 340.56 228.0621 Z" stroke="black" stroke-linecap="round" stroke-linejoin="round" stroke-width="1"/><text transform="translate(302.98828 143.5)" fill="black"><tspan font-family="Courier" font-size="9" font-weight="500" x=".29736328" y="9" textLength="32.405273">x&lt;n-1&gt;</tspan></text><path d="M 319.48828 158.080075 L 319.48828 157.9 L 319.48829 188.5621" marker-start="url(#FilledArrow_Marker)" stroke="black" stroke-linecap="round" stroke-linejoin="round" stroke-width="1"/><text transform="translate(316.48828 205.5621)" fill="black"><tspan font-family="Courier" font-size="9" font-weight="500" x=".29956055" y="9" textLength="5.400879">f</tspan></text><text transform="translate(260.98828 203.5621)" fill="black"><tspan font-family="Courier" font-size="9" font-weight="500" x=".19824219" y="9" textLength="21.603516"> ...</tspan></text><path d="M 175.48828 158.580075 L 175.48828 158.4 L 175.4883 189.0621" marker-start="url(#FilledArrow_Marker)" stroke="black" stroke-linecap="round" stroke-linejoin="round" stroke-width="1"/><line x1="261.79446" y1="211.68" x2="257.71985" y2="211.70524" marker-end="url(#FilledArrow_Marker_2)" stroke="black" stroke-linecap="round" stroke-linejoin="round" stroke-width="1"/><line x1="298.91656" y1="211.68" x2="294.84196" y2="211.70524" marker-end="url(#FilledArrow_Marker_2)" stroke="black" stroke-linecap="round" stroke-linejoin="round" stroke-width="1"/><line x1="154.69867" y1="210.5621" x2="140.62417" y2="210.60888" marker-end="url(#FilledArrow_Marker_2)" stroke="black" stroke-linecap="round" stroke-linejoin="round" stroke-width="1"/><text transform="translate(363.98828 205.0621)" fill="black"><tspan font-family="Courier" font-size="9" font-weight="500" x=".099121094" y="9" textLength="10.801758">xn</tspan></text></g></g></svg>
diff --git a/doc/generate.svg b/doc/generate.svg
new file mode 100644
--- /dev/null
+++ b/doc/generate.svg
@@ -0,0 +1,3 @@
+<?xml version="1.0" encoding="utf-8" standalone="no"?>
+<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd">
+<svg xmlns="http://www.w3.org/2000/svg" xmlns:xl="http://www.w3.org/1999/xlink" version="1.1" viewBox="121 187 222 73" width="222pt" height="73pt" xmlns:dc="http://purl.org/dc/elements/1.1/"><metadata> Produced by OmniGraffle 6.1.3 <dc:date>2015-05-07 13:22:29 +0000</dc:date></metadata><defs><marker orient="auto" overflow="visible" markerUnits="strokeWidth" id="FilledArrow_Marker" viewBox="-9 -4 10 8" markerWidth="10" markerHeight="8" color="black"><g><path d="M -8 0 L 0 3 L 0 -3 Z" fill="currentColor" stroke="currentColor" stroke-width="1"/></g></marker><font-face font-family="Courier" font-size="9" units-per-em="1000" underline-position="-178.22266" underline-thickness="57.617188" slope="0" x-height="462.40234" cap-height="594.72656" ascent="753.90625" descent="-246.09375" font-weight="500"><font-face-src><font-face-name name="Courier"/></font-face-src></font-face><marker orient="auto" overflow="visible" markerUnits="strokeWidth" id="FilledArrow_Marker_2" viewBox="-1 -4 8 8" markerWidth="8" markerHeight="8" color="black"><g><path d="M 5.5999994 0 L 0 -2.0999998 L 0 2.0999998 Z" fill="currentColor" stroke="currentColor" stroke-width="1"/></g></marker></defs><g stroke="none" stroke-opacity="1" stroke-dasharray="none" fill="none" fill-opacity="1"><title>Canvas 1</title><g><title>Layer 1</title><path d="M 159.69867 190.41867 L 191.8421 190.41867 C 194.60353 190.41867 196.8421 192.65725 196.8421 195.41867 L 196.8421 227.5621 C 196.8421 230.32353 194.60353 232.5621 191.8421 232.5621 L 159.69867 232.5621 C 156.93725 232.5621 154.69867 230.32353 154.69867 227.5621 L 154.69867 195.41867 C 154.69867 192.65725 156.93725 190.41867 159.69867 190.41867 Z" stroke="black" stroke-linecap="round" stroke-linejoin="round" stroke-width="1"/><path d="M 132.860075 211.49039 L 132.68 211.49039 L 154.25446 211.49039" marker-start="url(#FilledArrow_Marker)" stroke="black" stroke-linecap="round" stroke-linejoin="round" stroke-width="1"/><text transform="translate(172.48828 205.0621)" fill="black"><tspan font-family="Courier" font-size="9" font-weight="500" x=".29956055" y="9" textLength="5.400879">f</tspan></text><line x1="196.8421" y1="211.56208" x2="200.91656" y2="211.56208" marker-end="url(#FilledArrow_Marker_2)" stroke="black" stroke-linecap="round" stroke-linejoin="round" stroke-width="1"/><path d="M 250.56 194.5621 L 250.56 228.5621 C 250.56 231.32353 248.32142 233.5621 245.56 233.5621 L 213.41656 233.5621 C 210.65514 233.5621 208.41656 231.32353 208.41656 228.5621 L 208.41656 194.5621 C 208.41656 191.80068 210.65514 189.5621 213.41656 189.5621 L 245.56 189.5621 C 248.32142 189.5621 250.56 191.80068 250.56 194.5621 Z" stroke="black" stroke-linecap="round" stroke-linejoin="round" stroke-width="1"/><text transform="translate(226.48828 206.0621)" fill="black"><tspan font-family="Courier" font-size="9" font-weight="500" x=".29956055" y="9" textLength="5.400879">f</tspan></text><path d="M 340.56 194.0621 L 340.56 228.0621 C 340.56 230.82353 338.32142 233.0621 335.56 233.0621 L 303.41656 233.0621 C 300.65514 233.0621 298.41656 230.82353 298.41656 228.0621 L 298.41656 194.0621 C 298.41656 191.30068 300.65514 189.0621 303.41656 189.0621 L 335.56 189.0621 C 338.32142 189.0621 340.56 191.30068 340.56 194.0621 Z" stroke="black" stroke-linecap="round" stroke-linejoin="round" stroke-width="1"/><text transform="translate(316.48828 205.5621)" fill="black"><tspan font-family="Courier" font-size="9" font-weight="500" x=".29956055" y="9" textLength="5.400879">f</tspan></text><text transform="translate(260.98828 203.0621)" fill="black"><tspan font-family="Courier" font-size="9" font-weight="500" x=".19824219" y="9" textLength="21.603516"> ...</tspan></text><line x1="250.22" y1="211.68" x2="254.2946" y2="211.70524" marker-end="url(#FilledArrow_Marker_2)" stroke="black" stroke-linecap="round" stroke-linejoin="round" stroke-width="1"/><line x1="287.3421" y1="211.68" x2="291.41671" y2="211.70524" marker-end="url(#FilledArrow_Marker_2)" stroke="black" stroke-linecap="round" stroke-linejoin="round" stroke-width="1"/><line x1="175.05998" y1="232.0621" x2="175.01321" y2="246.1366" marker-end="url(#FilledArrow_Marker_2)" stroke="black" stroke-linecap="round" stroke-linejoin="round" stroke-width="1"/><text transform="translate(121.64 205.0621)" fill="black"><tspan font-family="Courier" font-size="9" font-weight="500" x=".29956055" y="9" textLength="5.400879">z</tspan></text></g><g><title>Layer 2</title><line x1="229.1317" y1="233.66" x2="229.08492" y2="247.7345" marker-end="url(#FilledArrow_Marker_2)" stroke="black" stroke-linecap="round" stroke-linejoin="round" stroke-width="1"/><line x1="319.05998" y1="233.66" x2="319.0132" y2="247.7345" marker-end="url(#FilledArrow_Marker_2)" stroke="black" stroke-linecap="round" stroke-linejoin="round" stroke-width="1"/></g></g></svg>
diff --git a/doc/iterate.svg b/doc/iterate.svg
new file mode 100644
--- /dev/null
+++ b/doc/iterate.svg
@@ -0,0 +1,3 @@
+<?xml version="1.0" encoding="utf-8" standalone="no"?>
+<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd">
+<svg xmlns="http://www.w3.org/2000/svg" xmlns:xl="http://www.w3.org/1999/xlink" version="1.1" viewBox="121 187 222 73" width="222pt" height="73pt" xmlns:dc="http://purl.org/dc/elements/1.1/"><metadata> Produced by OmniGraffle 6.1.3 <dc:date>2015-05-07 13:21:56 +0000</dc:date></metadata><defs><marker orient="auto" overflow="visible" markerUnits="strokeWidth" id="FilledArrow_Marker" viewBox="-9 -4 10 8" markerWidth="10" markerHeight="8" color="black"><g><path d="M -8 0 L 0 3 L 0 -3 Z" fill="currentColor" stroke="currentColor" stroke-width="1"/></g></marker><font-face font-family="Courier" font-size="9" units-per-em="1000" underline-position="-178.22266" underline-thickness="57.617188" slope="0" x-height="462.40234" cap-height="594.72656" ascent="753.90625" descent="-246.09375" font-weight="500"><font-face-src><font-face-name name="Courier"/></font-face-src></font-face><marker orient="auto" overflow="visible" markerUnits="strokeWidth" id="FilledArrow_Marker_2" viewBox="-1 -4 8 8" markerWidth="8" markerHeight="8" color="black"><g><path d="M 5.5999994 0 L 0 -2.0999998 L 0 2.0999998 Z" fill="currentColor" stroke="currentColor" stroke-width="1"/></g></marker><marker orient="auto" overflow="visible" markerUnits="strokeWidth" id="FilledArrow_Marker_3" viewBox="-1 -4 8 8" markerWidth="8" markerHeight="8" color="black"><g><path d="M 5.6 0 L 0 -2.1 L 0 2.1 Z" fill="currentColor" stroke="currentColor" stroke-width="1"/></g></marker></defs><g stroke="none" stroke-opacity="1" stroke-dasharray="none" fill="none" fill-opacity="1"><title>Canvas 1</title><g><title>Layer 1</title><path d="M 159.69867 190.41867 L 191.8421 190.41867 C 194.60353 190.41867 196.8421 192.65725 196.8421 195.41867 L 196.8421 227.5621 C 196.8421 230.32353 194.60353 232.5621 191.8421 232.5621 L 159.69867 232.5621 C 156.93725 232.5621 154.69867 230.32353 154.69867 227.5621 L 154.69867 195.41867 C 154.69867 192.65725 156.93725 190.41867 159.69867 190.41867 Z" stroke="black" stroke-linecap="round" stroke-linejoin="round" stroke-width="1"/><path d="M 132.860075 211.49039 L 132.68 211.49039 L 154.25446 211.49039" marker-start="url(#FilledArrow_Marker)" stroke="black" stroke-linecap="round" stroke-linejoin="round" stroke-width="1"/><text transform="translate(172.48828 205.0621)" fill="black"><tspan font-family="Courier" font-size="9" font-weight="500" x=".29956055" y="9" textLength="5.400879">f</tspan></text><line x1="196.8421" y1="211.56208" x2="200.91656" y2="211.56208" marker-end="url(#FilledArrow_Marker_2)" stroke="black" stroke-linecap="round" stroke-linejoin="round" stroke-width="1"/><path d="M 250.56 194.5621 L 250.56 228.5621 C 250.56 231.32353 248.32142 233.5621 245.56 233.5621 L 213.41656 233.5621 C 210.65514 233.5621 208.41656 231.32353 208.41656 228.5621 L 208.41656 194.5621 C 208.41656 191.80068 210.65514 189.5621 213.41656 189.5621 L 245.56 189.5621 C 248.32142 189.5621 250.56 191.80068 250.56 194.5621 Z" stroke="black" stroke-linecap="round" stroke-linejoin="round" stroke-width="1"/><text transform="translate(226.48828 206.0621)" fill="black"><tspan font-family="Courier" font-size="9" font-weight="500" x=".29956055" y="9" textLength="5.400879">f</tspan></text><path d="M 340.56 194.0621 L 340.56 228.0621 C 340.56 230.82353 338.32142 233.0621 335.56 233.0621 L 303.41656 233.0621 C 300.65514 233.0621 298.41656 230.82353 298.41656 228.0621 L 298.41656 194.0621 C 298.41656 191.30068 300.65514 189.0621 303.41656 189.0621 L 335.56 189.0621 C 338.32142 189.0621 340.56 191.30068 340.56 194.0621 Z" stroke="black" stroke-linecap="round" stroke-linejoin="round" stroke-width="1"/><text transform="translate(316.48828 205.5621)" fill="black"><tspan font-family="Courier" font-size="9" font-weight="500" x=".29956055" y="9" textLength="5.400879">f</tspan></text><text transform="translate(260.98828 203.0621)" fill="black"><tspan font-family="Courier" font-size="9" font-weight="500" x=".19824219" y="9" textLength="21.603516"> ...</tspan></text><line x1="250.22" y1="211.68" x2="254.2946" y2="211.70524" marker-end="url(#FilledArrow_Marker_2)" stroke="black" stroke-linecap="round" stroke-linejoin="round" stroke-width="1"/><line x1="287.3421" y1="211.68" x2="291.41671" y2="211.70524" marker-end="url(#FilledArrow_Marker_2)" stroke="black" stroke-linecap="round" stroke-linejoin="round" stroke-width="1"/><line x1="175.05998" y1="232.0621" x2="175.01321" y2="246.1366" marker-end="url(#FilledArrow_Marker_2)" stroke="black" stroke-linecap="round" stroke-linejoin="round" stroke-width="1"/><text transform="translate(121.64 205.0621)" fill="black"><tspan font-family="Courier" font-size="9" font-weight="500" x=".29956055" y="9" textLength="5.400879">z</tspan></text></g><g><title>Layer 2</title><line x1="229.1317" y1="233.66" x2="229.08492" y2="247.7345" marker-end="url(#FilledArrow_Marker_2)" stroke="black" stroke-linecap="round" stroke-linejoin="round" stroke-width="1"/><line x1="319.05998" y1="233.66" x2="319.0132" y2="247.7345" marker-end="url(#FilledArrow_Marker_2)" stroke="black" stroke-linecap="round" stroke-linejoin="round" stroke-width="1"/><path d="M 125.05249 219.06007 L 125.05249 218.88 L 125.05249 244.45446" marker-end="url(#FilledArrow_Marker_3)" marker-start="url(#FilledArrow_Marker)" stroke="black" stroke-linecap="round" stroke-linejoin="round" stroke-width="1"/></g></g></svg>
diff --git a/doc/map.svg b/doc/map.svg
new file mode 100644
--- /dev/null
+++ b/doc/map.svg
@@ -0,0 +1,3 @@
+<?xml version="1.0" encoding="utf-8" standalone="no"?>
+<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd">
+<svg xmlns="http://www.w3.org/2000/svg" xmlns:xl="http://www.w3.org/1999/xlink" version="1.1" viewBox="152 143 191 123" width="191pt" height="123pt" xmlns:dc="http://purl.org/dc/elements/1.1/"><metadata> Produced by OmniGraffle 6.1.3 <dc:date>2015-05-07 12:11:34 +0000</dc:date></metadata><defs><font-face font-family="Courier" font-size="9" units-per-em="1000" underline-position="-178.22266" underline-thickness="57.617188" slope="0" x-height="462.40234" cap-height="594.72656" ascent="753.90625" descent="-246.09375" font-weight="500"><font-face-src><font-face-name name="Courier"/></font-face-src></font-face><marker orient="auto" overflow="visible" markerUnits="strokeWidth" id="FilledArrow_Marker" viewBox="-9 -4 10 8" markerWidth="10" markerHeight="8" color="black"><g><path d="M -8 0 L 0 3 L 0 -3 Z" fill="currentColor" stroke="currentColor" stroke-width="1"/></g></marker><marker orient="auto" overflow="visible" markerUnits="strokeWidth" id="FilledArrow_Marker_2" viewBox="-1 -4 8 8" markerWidth="8" markerHeight="8" color="black"><g><path d="M 5.5999994 0 L 0 -2.0999998 L 0 2.0999998 Z" fill="currentColor" stroke="currentColor" stroke-width="1"/></g></marker></defs><g stroke="none" stroke-opacity="1" stroke-dasharray="none" fill="none" fill-opacity="1"><title>Canvas 1</title><g><title>Layer 1</title><path d="M 196.56 194.5621 L 196.56 228.5621 C 196.56 231.32353 194.32142 233.5621 191.56 233.5621 L 159.41656 233.5621 C 156.65514 233.5621 154.41656 231.32353 154.41656 228.5621 L 154.41656 194.5621 C 154.41656 191.80068 156.65514 189.5621 159.41656 189.5621 L 191.56 189.5621 C 194.32142 189.5621 196.56 191.80068 196.56 194.5621 Z" stroke="black" stroke-linecap="round" stroke-linejoin="round" stroke-width="1"/><text transform="translate(169.98828 144)" fill="black"><tspan font-family="Courier" font-size="9" font-weight="500" x=".099121094" y="9" textLength="10.801758">x0</tspan></text><path d="M 175.48828 158.580075 L 175.48828 158.4 L 175.4883 189.0621" marker-start="url(#FilledArrow_Marker)" stroke="black" stroke-linecap="round" stroke-linejoin="round" stroke-width="1"/><text transform="translate(172.48828 206.0621)" fill="black"><tspan font-family="Courier" font-size="9" font-weight="500" x=".29956055" y="9" textLength="5.400879">f</tspan></text><line x1="175.48829" y1="233.5621" x2="175.48829" y2="253.9957" marker-end="url(#FilledArrow_Marker_2)" stroke="black" stroke-linecap="round" stroke-linejoin="round" stroke-width="1"/><path d="M 250.56 194.5621 L 250.56 228.5621 C 250.56 231.32353 248.32142 233.5621 245.56 233.5621 L 213.41656 233.5621 C 210.65514 233.5621 208.41656 231.32353 208.41656 228.5621 L 208.41656 194.5621 C 208.41656 191.80068 210.65514 189.5621 213.41656 189.5621 L 245.56 189.5621 C 248.32142 189.5621 250.56 191.80068 250.56 194.5621 Z" stroke="black" stroke-linecap="round" stroke-linejoin="round" stroke-width="1"/><text transform="translate(223.98828 144)" fill="black"><tspan font-family="Courier" font-size="9" font-weight="500" x=".099121094" y="9" textLength="10.801758">x1</tspan></text><path d="M 229.48828 158.580075 L 229.48828 158.4 L 229.4883 189.0621" marker-start="url(#FilledArrow_Marker)" stroke="black" stroke-linecap="round" stroke-linejoin="round" stroke-width="1"/><text transform="translate(226.48828 206.0621)" fill="black"><tspan font-family="Courier" font-size="9" font-weight="500" x=".29956055" y="9" textLength="5.400879">f</tspan></text><line x1="229.48829" y1="233.5621" x2="229.48829" y2="253.9957" marker-end="url(#FilledArrow_Marker_2)" stroke="black" stroke-linecap="round" stroke-linejoin="round" stroke-width="1"/><path d="M 340.56 194.0621 L 340.56 228.0621 C 340.56 230.82353 338.32142 233.0621 335.56 233.0621 L 303.41656 233.0621 C 300.65514 233.0621 298.41656 230.82353 298.41656 228.0621 L 298.41656 194.0621 C 298.41656 191.30068 300.65514 189.0621 303.41656 189.0621 L 335.56 189.0621 C 338.32142 189.0621 340.56 191.30068 340.56 194.0621 Z" stroke="black" stroke-linecap="round" stroke-linejoin="round" stroke-width="1"/><text transform="translate(313.98828 143.5)" fill="black"><tspan font-family="Courier" font-size="9" font-weight="500" x=".099121094" y="9" textLength="10.801758">xn</tspan></text><path d="M 319.48828 158.080075 L 319.48828 157.9 L 319.4883 189.0621" marker-start="url(#FilledArrow_Marker)" stroke="black" stroke-linecap="round" stroke-linejoin="round" stroke-width="1"/><text transform="translate(316.48828 205.5621)" fill="black"><tspan font-family="Courier" font-size="9" font-weight="500" x=".29956055" y="9" textLength="5.400879">f</tspan></text><line x1="319.48829" y1="233.0621" x2="319.48829" y2="253.4957" marker-end="url(#FilledArrow_Marker_2)" stroke="black" stroke-linecap="round" stroke-linejoin="round" stroke-width="1"/><text transform="translate(256.98828 205.5621)" fill="black"><tspan font-family="Courier" font-size="9" font-weight="500" x=".29736328" y="9" textLength="32.405273"> . . .</tspan></text></g></g></svg>
diff --git a/doc/mapAccumL.svg b/doc/mapAccumL.svg
new file mode 100644
--- /dev/null
+++ b/doc/mapAccumL.svg
@@ -0,0 +1,3 @@
+<?xml version="1.0" encoding="utf-8" standalone="no"?>
+<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd">
+<svg xmlns="http://www.w3.org/2000/svg" xmlns:xl="http://www.w3.org/1999/xlink" version="1.1" viewBox="113 143 252 117" width="21pc" height="117pt" xmlns:dc="http://purl.org/dc/elements/1.1/"><metadata> Produced by OmniGraffle 6.1.3 <dc:date>2015-05-07 13:17:21 +0000</dc:date></metadata><defs><font-face font-family="Courier" font-size="9" units-per-em="1000" underline-position="-178.22266" underline-thickness="57.617188" slope="0" x-height="462.40234" cap-height="594.72656" ascent="753.90625" descent="-246.09375" font-weight="500"><font-face-src><font-face-name name="Courier"/></font-face-src></font-face><marker orient="auto" overflow="visible" markerUnits="strokeWidth" id="FilledArrow_Marker" viewBox="-9 -4 10 8" markerWidth="10" markerHeight="8" color="black"><g><path d="M -8 0 L 0 3 L 0 -3 Z" fill="currentColor" stroke="currentColor" stroke-width="1"/></g></marker><marker orient="auto" overflow="visible" markerUnits="strokeWidth" id="FilledArrow_Marker_2" viewBox="-1 -4 8 8" markerWidth="8" markerHeight="8" color="black"><g><path d="M 5.5999994 0 L 0 -2.0999998 L 0 2.0999998 Z" fill="currentColor" stroke="currentColor" stroke-width="1"/></g></marker></defs><g stroke="none" stroke-opacity="1" stroke-dasharray="none" fill="none" fill-opacity="1"><title>Canvas 1</title><g><title>Layer 1</title><path d="M 159.69867 190.41867 L 191.8421 190.41867 C 194.60353 190.41867 196.8421 192.65725 196.8421 195.41867 L 196.8421 227.5621 C 196.8421 230.32353 194.60353 232.5621 191.8421 232.5621 L 159.69867 232.5621 C 156.93725 232.5621 154.69867 230.32353 154.69867 227.5621 L 154.69867 195.41867 C 154.69867 192.65725 156.93725 190.41867 159.69867 190.41867 Z" stroke="black" stroke-linecap="round" stroke-linejoin="round" stroke-width="1"/><text transform="translate(169.98828 144)" fill="black"><tspan font-family="Courier" font-size="9" font-weight="500" x=".099121094" y="9" textLength="10.801758">x0</tspan></text><path d="M 132.860075 211.49039 L 132.68 211.49039 L 154.25446 211.49039" marker-start="url(#FilledArrow_Marker)" stroke="black" stroke-linecap="round" stroke-linejoin="round" stroke-width="1"/><text transform="translate(172.48828 205.0621)" fill="black"><tspan font-family="Courier" font-size="9" font-weight="500" x=".29956055" y="9" textLength="5.400879">f</tspan></text><line x1="196.8421" y1="211.56208" x2="200.91656" y2="211.56208" marker-end="url(#FilledArrow_Marker_2)" stroke="black" stroke-linecap="round" stroke-linejoin="round" stroke-width="1"/><path d="M 250.56 194.5621 L 250.56 228.5621 C 250.56 231.32353 248.32142 233.5621 245.56 233.5621 L 213.41656 233.5621 C 210.65514 233.5621 208.41656 231.32353 208.41656 228.5621 L 208.41656 194.5621 C 208.41656 191.80068 210.65514 189.5621 213.41656 189.5621 L 245.56 189.5621 C 248.32142 189.5621 250.56 191.80068 250.56 194.5621 Z" stroke="black" stroke-linecap="round" stroke-linejoin="round" stroke-width="1"/><text transform="translate(223.98828 144)" fill="black"><tspan font-family="Courier" font-size="9" font-weight="500" x=".099121094" y="9" textLength="10.801758">x1</tspan></text><path d="M 229.50976 158.580075 L 229.50976 158.4 L 229.48864 189.0621" marker-start="url(#FilledArrow_Marker)" stroke="black" stroke-linecap="round" stroke-linejoin="round" stroke-width="1"/><text transform="translate(226.48828 206.0621)" fill="black"><tspan font-family="Courier" font-size="9" font-weight="500" x=".29956055" y="9" textLength="5.400879">f</tspan></text><path d="M 340.56 194.0621 L 340.56 228.0621 C 340.56 230.82353 338.32142 233.0621 335.56 233.0621 L 303.41656 233.0621 C 300.65514 233.0621 298.41656 230.82353 298.41656 228.0621 L 298.41656 194.0621 C 298.41656 191.30068 300.65514 189.0621 303.41656 189.0621 L 335.56 189.0621 C 338.32142 189.0621 340.56 191.30068 340.56 194.0621 Z" stroke="black" stroke-linecap="round" stroke-linejoin="round" stroke-width="1"/><text transform="translate(313.98828 143.5)" fill="black"><tspan font-family="Courier" font-size="9" font-weight="500" x=".099121094" y="9" textLength="10.801758">xn</tspan></text><path d="M 319.48828 158.080075 L 319.48828 157.9 L 319.4883 189.0621" marker-start="url(#FilledArrow_Marker)" stroke="black" stroke-linecap="round" stroke-linejoin="round" stroke-width="1"/><text transform="translate(316.48828 205.5621)" fill="black"><tspan font-family="Courier" font-size="9" font-weight="500" x=".29956055" y="9" textLength="5.400879">f</tspan></text><text transform="translate(260.98828 203.0621)" fill="black"><tspan font-family="Courier" font-size="9" font-weight="500" x=".19824219" y="9" textLength="21.603516"> ...</tspan></text><path d="M 175.48828 158.580075 L 175.48828 158.4 L 175.4883 189.0621" marker-start="url(#FilledArrow_Marker)" stroke="black" stroke-linecap="round" stroke-linejoin="round" stroke-width="1"/><line x1="250.22" y1="211.68" x2="254.2946" y2="211.70524" marker-end="url(#FilledArrow_Marker_2)" stroke="black" stroke-linecap="round" stroke-linejoin="round" stroke-width="1"/><line x1="287.3421" y1="211.68" x2="291.41671" y2="211.70524" marker-end="url(#FilledArrow_Marker_2)" stroke="black" stroke-linecap="round" stroke-linejoin="round" stroke-width="1"/><line x1="175.05998" y1="232.0621" x2="175.01321" y2="246.1366" marker-end="url(#FilledArrow_Marker_2)" stroke="black" stroke-linecap="round" stroke-linejoin="round" stroke-width="1"/><text transform="translate(113.14 205.0621)" fill="black"><tspan font-family="Courier" font-size="9" font-weight="500" x=".39868164" y="9" textLength="16.202637">acc</tspan></text></g><g><title>Layer 2</title><line x1="229.1317" y1="233.66" x2="229.08492" y2="247.7345" marker-end="url(#FilledArrow_Marker_2)" stroke="black" stroke-linecap="round" stroke-linejoin="round" stroke-width="1"/><line x1="319.05998" y1="233.66" x2="319.0132" y2="247.7345" marker-end="url(#FilledArrow_Marker_2)" stroke="black" stroke-linecap="round" stroke-linejoin="round" stroke-width="1"/><line x1="340.56" y1="210.99039" x2="354.6345" y2="211.03716" marker-end="url(#FilledArrow_Marker_2)" stroke="black" stroke-linecap="round" stroke-linejoin="round" stroke-width="1"/></g></g></svg>
diff --git a/doc/mapAccumR.svg b/doc/mapAccumR.svg
new file mode 100644
--- /dev/null
+++ b/doc/mapAccumR.svg
@@ -0,0 +1,3 @@
+<?xml version="1.0" encoding="utf-8" standalone="no"?>
+<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd">
+<svg xmlns="http://www.w3.org/2000/svg" xmlns:xl="http://www.w3.org/1999/xlink" version="1.1" viewBox="130 143 253 117" width="253pt" height="117pt" xmlns:dc="http://purl.org/dc/elements/1.1/"><metadata> Produced by OmniGraffle 6.1.3 <dc:date>2015-05-07 13:16:26 +0000</dc:date></metadata><defs><font-face font-family="Courier" font-size="9" units-per-em="1000" underline-position="-178.22266" underline-thickness="57.617188" slope="0" x-height="462.40234" cap-height="594.72656" ascent="753.90625" descent="-246.09375" font-weight="500"><font-face-src><font-face-name name="Courier"/></font-face-src></font-face><marker orient="auto" overflow="visible" markerUnits="strokeWidth" id="FilledArrow_Marker" viewBox="-9 -4 10 8" markerWidth="10" markerHeight="8" color="black"><g><path d="M -8 0 L 0 3 L 0 -3 Z" fill="currentColor" stroke="currentColor" stroke-width="1"/></g></marker><marker orient="auto" overflow="visible" markerUnits="strokeWidth" id="FilledArrow_Marker_2" viewBox="-1 -4 8 8" markerWidth="8" markerHeight="8" color="black"><g><path d="M 5.5999994 0 L 0 -2.0999998 L 0 2.0999998 Z" fill="currentColor" stroke="currentColor" stroke-width="1"/></g></marker></defs><g stroke="none" stroke-opacity="1" stroke-dasharray="none" fill="none" fill-opacity="1"><title>Canvas 1</title><g><title>Layer 1</title><path d="M 191.8421 190.41867 L 159.69867 190.41867 C 156.93725 190.41867 154.69867 192.65725 154.69867 195.41867 L 154.69867 227.5621 C 154.69867 230.32353 156.93725 232.5621 159.69867 232.5621 L 191.8421 232.5621 C 194.60353 232.5621 196.8421 230.32353 196.8421 227.5621 L 196.8421 195.41867 C 196.8421 192.65725 194.60353 190.41867 191.8421 190.41867 Z" stroke="black" stroke-linecap="round" stroke-linejoin="round" stroke-width="1"/><text transform="translate(169.98828 144)" fill="black"><tspan font-family="Courier" font-size="9" font-weight="500" x=".099121094" y="9" textLength="10.801758">x0</tspan></text><path d="M 361.88266 211.68 L 362.06274 211.68 L 340.48828 211.68" marker-start="url(#FilledArrow_Marker)" stroke="black" stroke-linecap="round" stroke-linejoin="round" stroke-width="1"/><text transform="translate(172.48828 205.0621)" fill="black"><tspan font-family="Courier" font-size="9" font-weight="500" x=".29956055" y="9" textLength="5.400879">f</tspan></text><line x1="208.41656" y1="211.56208" x2="204.33674" y2="211.71644" marker-end="url(#FilledArrow_Marker_2)" stroke="black" stroke-linecap="round" stroke-linejoin="round" stroke-width="1"/><path d="M 250.56 228.5621 L 250.56 194.5621 C 250.56 191.80068 248.32142 189.5621 245.56 189.5621 L 213.41656 189.5621 C 210.65514 189.5621 208.41656 191.80068 208.41656 194.5621 L 208.41656 228.5621 C 208.41656 231.32353 210.65514 233.5621 213.41656 233.5621 L 245.56 233.5621 C 248.32142 233.5621 250.56 231.32353 250.56 228.5621 Z" stroke="black" stroke-linecap="round" stroke-linejoin="round" stroke-width="1"/><text transform="translate(223.98828 144)" fill="black"><tspan font-family="Courier" font-size="9" font-weight="500" x=".099121094" y="9" textLength="10.801758">x1</tspan></text><path d="M 229.50976 158.580075 L 229.50976 158.4 L 229.50101 189.0621" marker-start="url(#FilledArrow_Marker)" stroke="black" stroke-linecap="round" stroke-linejoin="round" stroke-width="1"/><text transform="translate(226.48828 206.0621)" fill="black"><tspan font-family="Courier" font-size="9" font-weight="500" x=".29956055" y="9" textLength="5.400879">f</tspan></text><path d="M 340.56 228.0621 L 340.56 194.0621 C 340.56 191.30068 338.32142 189.0621 335.56 189.0621 L 303.41656 189.0621 C 300.65514 189.0621 298.41656 191.30068 298.41656 194.0621 L 298.41656 228.0621 C 298.41656 230.82353 300.65514 233.0621 303.41656 233.0621 L 335.56 233.0621 C 338.32142 233.0621 340.56 230.82353 340.56 228.0621 Z" stroke="black" stroke-linecap="round" stroke-linejoin="round" stroke-width="1"/><text transform="translate(313.98828 143.5)" fill="black"><tspan font-family="Courier" font-size="9" font-weight="500" x=".099121094" y="9" textLength="10.801758">xn</tspan></text><path d="M 319.48828 158.080075 L 319.48828 157.9 L 319.48829 188.5621" marker-start="url(#FilledArrow_Marker)" stroke="black" stroke-linecap="round" stroke-linejoin="round" stroke-width="1"/><text transform="translate(316.48828 205.5621)" fill="black"><tspan font-family="Courier" font-size="9" font-weight="500" x=".29956055" y="9" textLength="5.400879">f</tspan></text><text transform="translate(260.98828 203.5621)" fill="black"><tspan font-family="Courier" font-size="9" font-weight="500" x=".19824219" y="9" textLength="21.603516"> ...</tspan></text><path d="M 175.48828 158.580075 L 175.48828 158.4 L 175.4883 189.0621" marker-start="url(#FilledArrow_Marker)" stroke="black" stroke-linecap="round" stroke-linejoin="round" stroke-width="1"/><line x1="261.79446" y1="211.68" x2="257.71985" y2="211.70524" marker-end="url(#FilledArrow_Marker_2)" stroke="black" stroke-linecap="round" stroke-linejoin="round" stroke-width="1"/><line x1="298.91656" y1="211.68" x2="294.84196" y2="211.70524" marker-end="url(#FilledArrow_Marker_2)" stroke="black" stroke-linecap="round" stroke-linejoin="round" stroke-width="1"/><text transform="translate(365.48828 205.0621)" fill="black"><tspan font-family="Courier" font-size="9" font-weight="500" x=".39868164" y="9" textLength="16.202637">acc</tspan></text><line x1="175.05998" y1="232.5621" x2="175.01321" y2="246.6366" marker-end="url(#FilledArrow_Marker_2)" stroke="black" stroke-linecap="round" stroke-linejoin="round" stroke-width="1"/><line x1="229.05998" y1="233.5621" x2="229.0132" y2="247.6366" marker-end="url(#FilledArrow_Marker_2)" stroke="black" stroke-linecap="round" stroke-linejoin="round" stroke-width="1"/><line x1="319.05998" y1="233.5621" x2="319.0132" y2="247.6366" marker-end="url(#FilledArrow_Marker_2)" stroke="black" stroke-linecap="round" stroke-linejoin="round" stroke-width="1"/><line x1="154.13446" y1="211.63379" x2="140.05995" y2="211.58701" marker-end="url(#FilledArrow_Marker_2)" stroke="black" stroke-linecap="round" stroke-linejoin="round" stroke-width="1"/></g></g></svg>
diff --git a/doc/scanl.svg b/doc/scanl.svg
new file mode 100644
--- /dev/null
+++ b/doc/scanl.svg
@@ -0,0 +1,3 @@
+<?xml version="1.0" encoding="utf-8" standalone="no"?>
+<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd">
+<svg xmlns="http://www.w3.org/2000/svg" xmlns:xl="http://www.w3.org/1999/xlink" version="1.1" viewBox="119 143 224 115" width="224pt" height="115pt" xmlns:dc="http://purl.org/dc/elements/1.1/"><metadata> Produced by OmniGraffle 6.1.3 <dc:date>2015-05-07 13:01:38 +0000</dc:date></metadata><defs><font-face font-family="Courier" font-size="9" units-per-em="1000" underline-position="-178.22266" underline-thickness="57.617188" slope="0" x-height="462.40234" cap-height="594.72656" ascent="753.90625" descent="-246.09375" font-weight="500"><font-face-src><font-face-name name="Courier"/></font-face-src></font-face><marker orient="auto" overflow="visible" markerUnits="strokeWidth" id="FilledArrow_Marker" viewBox="-9 -4 10 8" markerWidth="10" markerHeight="8" color="black"><g><path d="M -8 0 L 0 3 L 0 -3 Z" fill="currentColor" stroke="currentColor" stroke-width="1"/></g></marker><marker orient="auto" overflow="visible" markerUnits="strokeWidth" id="FilledArrow_Marker_2" viewBox="-1 -4 8 8" markerWidth="8" markerHeight="8" color="black"><g><path d="M 5.5999994 0 L 0 -2.0999998 L 0 2.0999998 Z" fill="currentColor" stroke="currentColor" stroke-width="1"/></g></marker><marker orient="auto" overflow="visible" markerUnits="strokeWidth" id="FilledArrow_Marker_3" viewBox="-1 -4 8 8" markerWidth="8" markerHeight="8" color="black"><g><path d="M 5.6 0 L 0 -2.1 L 0 2.1 Z" fill="currentColor" stroke="currentColor" stroke-width="1"/></g></marker></defs><g stroke="none" stroke-opacity="1" stroke-dasharray="none" fill="none" fill-opacity="1"><title>Canvas 1</title><g><title>Layer 1</title><path d="M 159.69867 190.41867 L 191.8421 190.41867 C 194.60353 190.41867 196.8421 192.65725 196.8421 195.41867 L 196.8421 227.5621 C 196.8421 230.32353 194.60353 232.5621 191.8421 232.5621 L 159.69867 232.5621 C 156.93725 232.5621 154.69867 230.32353 154.69867 227.5621 L 154.69867 195.41867 C 154.69867 192.65725 156.93725 190.41867 159.69867 190.41867 Z" stroke="black" stroke-linecap="round" stroke-linejoin="round" stroke-width="1"/><text transform="translate(169.98828 144)" fill="black"><tspan font-family="Courier" font-size="9" font-weight="500" x=".099121094" y="9" textLength="10.801758">x0</tspan></text><path d="M 132.860075 211.49039 L 132.68 211.49039 L 154.25446 211.49039" marker-start="url(#FilledArrow_Marker)" stroke="black" stroke-linecap="round" stroke-linejoin="round" stroke-width="1"/><text transform="translate(172.48828 205.0621)" fill="black"><tspan font-family="Courier" font-size="9" font-weight="500" x=".29956055" y="9" textLength="5.400879">f</tspan></text><line x1="196.8421" y1="211.56208" x2="200.91656" y2="211.56208" marker-end="url(#FilledArrow_Marker_2)" stroke="black" stroke-linecap="round" stroke-linejoin="round" stroke-width="1"/><path d="M 250.56 194.5621 L 250.56 228.5621 C 250.56 231.32353 248.32142 233.5621 245.56 233.5621 L 213.41656 233.5621 C 210.65514 233.5621 208.41656 231.32353 208.41656 228.5621 L 208.41656 194.5621 C 208.41656 191.80068 210.65514 189.5621 213.41656 189.5621 L 245.56 189.5621 C 248.32142 189.5621 250.56 191.80068 250.56 194.5621 Z" stroke="black" stroke-linecap="round" stroke-linejoin="round" stroke-width="1"/><text transform="translate(223.98828 144)" fill="black"><tspan font-family="Courier" font-size="9" font-weight="500" x=".099121094" y="9" textLength="10.801758">x1</tspan></text><path d="M 229.50976 158.580075 L 229.50976 158.4 L 229.48864 189.0621" marker-start="url(#FilledArrow_Marker)" stroke="black" stroke-linecap="round" stroke-linejoin="round" stroke-width="1"/><text transform="translate(226.48828 206.0621)" fill="black"><tspan font-family="Courier" font-size="9" font-weight="500" x=".29956055" y="9" textLength="5.400879">f</tspan></text><path d="M 340.56 194.0621 L 340.56 228.0621 C 340.56 230.82353 338.32142 233.0621 335.56 233.0621 L 303.41656 233.0621 C 300.65514 233.0621 298.41656 230.82353 298.41656 228.0621 L 298.41656 194.0621 C 298.41656 191.30068 300.65514 189.0621 303.41656 189.0621 L 335.56 189.0621 C 338.32142 189.0621 340.56 191.30068 340.56 194.0621 Z" stroke="black" stroke-linecap="round" stroke-linejoin="round" stroke-width="1"/><text transform="translate(313.98828 143.5)" fill="black"><tspan font-family="Courier" font-size="9" font-weight="500" x=".099121094" y="9" textLength="10.801758">xn</tspan></text><path d="M 319.48828 158.080075 L 319.48828 157.9 L 319.4883 189.0621" marker-start="url(#FilledArrow_Marker)" stroke="black" stroke-linecap="round" stroke-linejoin="round" stroke-width="1"/><text transform="translate(316.48828 205.5621)" fill="black"><tspan font-family="Courier" font-size="9" font-weight="500" x=".29956055" y="9" textLength="5.400879">f</tspan></text><text transform="translate(260.98828 203.0621)" fill="black"><tspan font-family="Courier" font-size="9" font-weight="500" x=".19824219" y="9" textLength="21.603516"> ...</tspan></text><path d="M 175.48828 158.580075 L 175.48828 158.4 L 175.4883 189.0621" marker-start="url(#FilledArrow_Marker)" stroke="black" stroke-linecap="round" stroke-linejoin="round" stroke-width="1"/><line x1="250.22" y1="211.68" x2="254.2946" y2="211.70524" marker-end="url(#FilledArrow_Marker_2)" stroke="black" stroke-linecap="round" stroke-linejoin="round" stroke-width="1"/><line x1="287.3421" y1="211.68" x2="291.41671" y2="211.70524" marker-end="url(#FilledArrow_Marker_2)" stroke="black" stroke-linecap="round" stroke-linejoin="round" stroke-width="1"/><line x1="175.05998" y1="232.0621" x2="175.01321" y2="246.1366" marker-end="url(#FilledArrow_Marker_2)" stroke="black" stroke-linecap="round" stroke-linejoin="round" stroke-width="1"/><text transform="translate(121.64 205.0621)" fill="black"><tspan font-family="Courier" font-size="9" font-weight="500" x=".29956055" y="9" textLength="5.400879">z</tspan></text></g><g><title>Layer 2</title><line x1="229.1317" y1="233.66" x2="229.08492" y2="247.7345" marker-end="url(#FilledArrow_Marker_2)" stroke="black" stroke-linecap="round" stroke-linejoin="round" stroke-width="1"/><line x1="319.05998" y1="233.66" x2="319.0132" y2="247.7345" marker-end="url(#FilledArrow_Marker_2)" stroke="black" stroke-linecap="round" stroke-linejoin="round" stroke-width="1"/><path d="M 125.05249 219.06007 L 125.05249 218.88 L 125.05249 244.45446" marker-end="url(#FilledArrow_Marker_3)" marker-start="url(#FilledArrow_Marker)" stroke="black" stroke-linecap="round" stroke-linejoin="round" stroke-width="1"/></g></g></svg>
diff --git a/doc/scanr.svg b/doc/scanr.svg
new file mode 100644
--- /dev/null
+++ b/doc/scanr.svg
@@ -0,0 +1,3 @@
+<?xml version="1.0" encoding="utf-8" standalone="no"?>
+<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd">
+<svg xmlns="http://www.w3.org/2000/svg" xmlns:xl="http://www.w3.org/1999/xlink" version="1.1" viewBox="152 143 222 115" width="222pt" height="115pt" xmlns:dc="http://purl.org/dc/elements/1.1/"><metadata> Produced by OmniGraffle 6.1.3 <dc:date>2015-05-07 13:03:08 +0000</dc:date></metadata><defs><font-face font-family="Courier" font-size="9" units-per-em="1000" underline-position="-178.22266" underline-thickness="57.617188" slope="0" x-height="462.40234" cap-height="594.72656" ascent="753.90625" descent="-246.09375" font-weight="500"><font-face-src><font-face-name name="Courier"/></font-face-src></font-face><marker orient="auto" overflow="visible" markerUnits="strokeWidth" id="FilledArrow_Marker" viewBox="-9 -4 10 8" markerWidth="10" markerHeight="8" color="black"><g><path d="M -8 0 L 0 3 L 0 -3 Z" fill="currentColor" stroke="currentColor" stroke-width="1"/></g></marker><marker orient="auto" overflow="visible" markerUnits="strokeWidth" id="FilledArrow_Marker_2" viewBox="-1 -4 8 8" markerWidth="8" markerHeight="8" color="black"><g><path d="M 5.5999994 0 L 0 -2.0999998 L 0 2.0999998 Z" fill="currentColor" stroke="currentColor" stroke-width="1"/></g></marker><marker orient="auto" overflow="visible" markerUnits="strokeWidth" id="FilledArrow_Marker_3" viewBox="-1 -4 8 8" markerWidth="8" markerHeight="8" color="black"><g><path d="M 5.6 0 L 0 -2.1 L 0 2.1 Z" fill="currentColor" stroke="currentColor" stroke-width="1"/></g></marker></defs><g stroke="none" stroke-opacity="1" stroke-dasharray="none" fill="none" fill-opacity="1"><title>Canvas 1</title><g><title>Layer 1</title><path d="M 191.8421 190.41867 L 159.69867 190.41867 C 156.93725 190.41867 154.69867 192.65725 154.69867 195.41867 L 154.69867 227.5621 C 154.69867 230.32353 156.93725 232.5621 159.69867 232.5621 L 191.8421 232.5621 C 194.60353 232.5621 196.8421 230.32353 196.8421 227.5621 L 196.8421 195.41867 C 196.8421 192.65725 194.60353 190.41867 191.8421 190.41867 Z" stroke="black" stroke-linecap="round" stroke-linejoin="round" stroke-width="1"/><text transform="translate(169.98828 144)" fill="black"><tspan font-family="Courier" font-size="9" font-weight="500" x=".099121094" y="9" textLength="10.801758">x0</tspan></text><path d="M 361.88266 211.68 L 362.06274 211.68 L 340.48828 211.68" marker-start="url(#FilledArrow_Marker)" stroke="black" stroke-linecap="round" stroke-linejoin="round" stroke-width="1"/><text transform="translate(172.48828 205.0621)" fill="black"><tspan font-family="Courier" font-size="9" font-weight="500" x=".29956055" y="9" textLength="5.400879">f</tspan></text><line x1="208.41656" y1="211.56208" x2="204.33674" y2="211.71644" marker-end="url(#FilledArrow_Marker_2)" stroke="black" stroke-linecap="round" stroke-linejoin="round" stroke-width="1"/><path d="M 250.56 228.5621 L 250.56 194.5621 C 250.56 191.80068 248.32142 189.5621 245.56 189.5621 L 213.41656 189.5621 C 210.65514 189.5621 208.41656 191.80068 208.41656 194.5621 L 208.41656 228.5621 C 208.41656 231.32353 210.65514 233.5621 213.41656 233.5621 L 245.56 233.5621 C 248.32142 233.5621 250.56 231.32353 250.56 228.5621 Z" stroke="black" stroke-linecap="round" stroke-linejoin="round" stroke-width="1"/><text transform="translate(223.98828 144)" fill="black"><tspan font-family="Courier" font-size="9" font-weight="500" x=".099121094" y="9" textLength="10.801758">x1</tspan></text><path d="M 229.50976 158.580075 L 229.50976 158.4 L 229.50101 189.0621" marker-start="url(#FilledArrow_Marker)" stroke="black" stroke-linecap="round" stroke-linejoin="round" stroke-width="1"/><text transform="translate(226.48828 206.0621)" fill="black"><tspan font-family="Courier" font-size="9" font-weight="500" x=".29956055" y="9" textLength="5.400879">f</tspan></text><path d="M 340.56 228.0621 L 340.56 194.0621 C 340.56 191.30068 338.32142 189.0621 335.56 189.0621 L 303.41656 189.0621 C 300.65514 189.0621 298.41656 191.30068 298.41656 194.0621 L 298.41656 228.0621 C 298.41656 230.82353 300.65514 233.0621 303.41656 233.0621 L 335.56 233.0621 C 338.32142 233.0621 340.56 230.82353 340.56 228.0621 Z" stroke="black" stroke-linecap="round" stroke-linejoin="round" stroke-width="1"/><text transform="translate(313.98828 143.5)" fill="black"><tspan font-family="Courier" font-size="9" font-weight="500" x=".099121094" y="9" textLength="10.801758">xn</tspan></text><path d="M 319.48828 158.080075 L 319.48828 157.9 L 319.48829 188.5621" marker-start="url(#FilledArrow_Marker)" stroke="black" stroke-linecap="round" stroke-linejoin="round" stroke-width="1"/><text transform="translate(316.48828 205.5621)" fill="black"><tspan font-family="Courier" font-size="9" font-weight="500" x=".29956055" y="9" textLength="5.400879">f</tspan></text><text transform="translate(260.98828 203.5621)" fill="black"><tspan font-family="Courier" font-size="9" font-weight="500" x=".19824219" y="9" textLength="21.603516"> ...</tspan></text><path d="M 175.48828 158.580075 L 175.48828 158.4 L 175.4883 189.0621" marker-start="url(#FilledArrow_Marker)" stroke="black" stroke-linecap="round" stroke-linejoin="round" stroke-width="1"/><line x1="261.79446" y1="211.68" x2="257.71985" y2="211.70524" marker-end="url(#FilledArrow_Marker_2)" stroke="black" stroke-linecap="round" stroke-linejoin="round" stroke-width="1"/><line x1="298.91656" y1="211.68" x2="294.84196" y2="211.70524" marker-end="url(#FilledArrow_Marker_2)" stroke="black" stroke-linecap="round" stroke-linejoin="round" stroke-width="1"/><text transform="translate(365.48828 205.0621)" fill="black"><tspan font-family="Courier" font-size="9" font-weight="500" x=".29956055" y="9" textLength="5.400879">z</tspan></text><path d="M 367.98828 221.22007 L 367.98828 221.04 L 367.98828 246.61446" marker-end="url(#FilledArrow_Marker_3)" marker-start="url(#FilledArrow_Marker)" stroke="black" stroke-linecap="round" stroke-linejoin="round" stroke-width="1"/><line x1="175.05998" y1="232.5621" x2="175.01321" y2="246.6366" marker-end="url(#FilledArrow_Marker_2)" stroke="black" stroke-linecap="round" stroke-linejoin="round" stroke-width="1"/><line x1="229.05998" y1="233.5621" x2="229.0132" y2="247.6366" marker-end="url(#FilledArrow_Marker_2)" stroke="black" stroke-linecap="round" stroke-linejoin="round" stroke-width="1"/><line x1="319.05998" y1="233.5621" x2="319.0132" y2="247.6366" marker-end="url(#FilledArrow_Marker_2)" stroke="black" stroke-linecap="round" stroke-linejoin="round" stroke-width="1"/></g></g></svg>
diff --git a/doc/sscanl.svg b/doc/sscanl.svg
new file mode 100644
--- /dev/null
+++ b/doc/sscanl.svg
@@ -0,0 +1,3 @@
+<?xml version="1.0" encoding="utf-8" standalone="no"?>
+<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd">
+<svg xmlns="http://www.w3.org/2000/svg" xmlns:xl="http://www.w3.org/1999/xlink" version="1.1" viewBox="121 143 222 117" width="222pt" height="117pt" xmlns:dc="http://purl.org/dc/elements/1.1/"><metadata> Produced by OmniGraffle 6.1.3 <dc:date>2015-05-07 13:06:21 +0000</dc:date></metadata><defs><font-face font-family="Courier" font-size="9" units-per-em="1000" underline-position="-178.22266" underline-thickness="57.617188" slope="0" x-height="462.40234" cap-height="594.72656" ascent="753.90625" descent="-246.09375" font-weight="500"><font-face-src><font-face-name name="Courier"/></font-face-src></font-face><marker orient="auto" overflow="visible" markerUnits="strokeWidth" id="FilledArrow_Marker" viewBox="-9 -4 10 8" markerWidth="10" markerHeight="8" color="black"><g><path d="M -8 0 L 0 3 L 0 -3 Z" fill="currentColor" stroke="currentColor" stroke-width="1"/></g></marker><marker orient="auto" overflow="visible" markerUnits="strokeWidth" id="FilledArrow_Marker_2" viewBox="-1 -4 8 8" markerWidth="8" markerHeight="8" color="black"><g><path d="M 5.5999994 0 L 0 -2.0999998 L 0 2.0999998 Z" fill="currentColor" stroke="currentColor" stroke-width="1"/></g></marker></defs><g stroke="none" stroke-opacity="1" stroke-dasharray="none" fill="none" fill-opacity="1"><title>Canvas 1</title><g><title>Layer 1</title><path d="M 159.69867 190.41867 L 191.8421 190.41867 C 194.60353 190.41867 196.8421 192.65725 196.8421 195.41867 L 196.8421 227.5621 C 196.8421 230.32353 194.60353 232.5621 191.8421 232.5621 L 159.69867 232.5621 C 156.93725 232.5621 154.69867 230.32353 154.69867 227.5621 L 154.69867 195.41867 C 154.69867 192.65725 156.93725 190.41867 159.69867 190.41867 Z" stroke="black" stroke-linecap="round" stroke-linejoin="round" stroke-width="1"/><text transform="translate(169.98828 144)" fill="black"><tspan font-family="Courier" font-size="9" font-weight="500" x=".099121094" y="9" textLength="10.801758">x0</tspan></text><path d="M 132.860075 211.49039 L 132.68 211.49039 L 154.25446 211.49039" marker-start="url(#FilledArrow_Marker)" stroke="black" stroke-linecap="round" stroke-linejoin="round" stroke-width="1"/><text transform="translate(172.48828 205.0621)" fill="black"><tspan font-family="Courier" font-size="9" font-weight="500" x=".29956055" y="9" textLength="5.400879">f</tspan></text><line x1="196.8421" y1="211.56208" x2="200.91656" y2="211.56208" marker-end="url(#FilledArrow_Marker_2)" stroke="black" stroke-linecap="round" stroke-linejoin="round" stroke-width="1"/><path d="M 250.56 194.5621 L 250.56 228.5621 C 250.56 231.32353 248.32142 233.5621 245.56 233.5621 L 213.41656 233.5621 C 210.65514 233.5621 208.41656 231.32353 208.41656 228.5621 L 208.41656 194.5621 C 208.41656 191.80068 210.65514 189.5621 213.41656 189.5621 L 245.56 189.5621 C 248.32142 189.5621 250.56 191.80068 250.56 194.5621 Z" stroke="black" stroke-linecap="round" stroke-linejoin="round" stroke-width="1"/><text transform="translate(223.98828 144)" fill="black"><tspan font-family="Courier" font-size="9" font-weight="500" x=".099121094" y="9" textLength="10.801758">x1</tspan></text><path d="M 229.50976 158.580075 L 229.50976 158.4 L 229.48864 189.0621" marker-start="url(#FilledArrow_Marker)" stroke="black" stroke-linecap="round" stroke-linejoin="round" stroke-width="1"/><text transform="translate(226.48828 206.0621)" fill="black"><tspan font-family="Courier" font-size="9" font-weight="500" x=".29956055" y="9" textLength="5.400879">f</tspan></text><path d="M 340.56 194.0621 L 340.56 228.0621 C 340.56 230.82353 338.32142 233.0621 335.56 233.0621 L 303.41656 233.0621 C 300.65514 233.0621 298.41656 230.82353 298.41656 228.0621 L 298.41656 194.0621 C 298.41656 191.30068 300.65514 189.0621 303.41656 189.0621 L 335.56 189.0621 C 338.32142 189.0621 340.56 191.30068 340.56 194.0621 Z" stroke="black" stroke-linecap="round" stroke-linejoin="round" stroke-width="1"/><text transform="translate(313.98828 143.5)" fill="black"><tspan font-family="Courier" font-size="9" font-weight="500" x=".099121094" y="9" textLength="10.801758">xn</tspan></text><path d="M 319.48828 158.080075 L 319.48828 157.9 L 319.4883 189.0621" marker-start="url(#FilledArrow_Marker)" stroke="black" stroke-linecap="round" stroke-linejoin="round" stroke-width="1"/><text transform="translate(316.48828 205.5621)" fill="black"><tspan font-family="Courier" font-size="9" font-weight="500" x=".29956055" y="9" textLength="5.400879">f</tspan></text><text transform="translate(260.98828 203.0621)" fill="black"><tspan font-family="Courier" font-size="9" font-weight="500" x=".19824219" y="9" textLength="21.603516"> ...</tspan></text><path d="M 175.48828 158.580075 L 175.48828 158.4 L 175.4883 189.0621" marker-start="url(#FilledArrow_Marker)" stroke="black" stroke-linecap="round" stroke-linejoin="round" stroke-width="1"/><line x1="250.22" y1="211.68" x2="254.2946" y2="211.70524" marker-end="url(#FilledArrow_Marker_2)" stroke="black" stroke-linecap="round" stroke-linejoin="round" stroke-width="1"/><line x1="287.3421" y1="211.68" x2="291.41671" y2="211.70524" marker-end="url(#FilledArrow_Marker_2)" stroke="black" stroke-linecap="round" stroke-linejoin="round" stroke-width="1"/><line x1="175.05998" y1="232.0621" x2="175.01321" y2="246.1366" marker-end="url(#FilledArrow_Marker_2)" stroke="black" stroke-linecap="round" stroke-linejoin="round" stroke-width="1"/><text transform="translate(121.64 205.0621)" fill="black"><tspan font-family="Courier" font-size="9" font-weight="500" x=".29956055" y="9" textLength="5.400879">z</tspan></text></g><g><title>Layer 2</title><line x1="229.1317" y1="233.66" x2="229.08492" y2="247.7345" marker-end="url(#FilledArrow_Marker_2)" stroke="black" stroke-linecap="round" stroke-linejoin="round" stroke-width="1"/><line x1="319.05998" y1="233.66" x2="319.0132" y2="247.7345" marker-end="url(#FilledArrow_Marker_2)" stroke="black" stroke-linecap="round" stroke-linejoin="round" stroke-width="1"/></g></g></svg>
diff --git a/doc/sscanr.svg b/doc/sscanr.svg
new file mode 100644
--- /dev/null
+++ b/doc/sscanr.svg
@@ -0,0 +1,3 @@
+<?xml version="1.0" encoding="utf-8" standalone="no"?>
+<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd">
+<svg xmlns="http://www.w3.org/2000/svg" xmlns:xl="http://www.w3.org/1999/xlink" version="1.1" viewBox="152 143 220 117" width="220pt" height="117pt" xmlns:dc="http://purl.org/dc/elements/1.1/"><metadata> Produced by OmniGraffle 6.1.3 <dc:date>2015-05-07 13:06:17 +0000</dc:date></metadata><defs><font-face font-family="Courier" font-size="9" units-per-em="1000" underline-position="-178.22266" underline-thickness="57.617188" slope="0" x-height="462.40234" cap-height="594.72656" ascent="753.90625" descent="-246.09375" font-weight="500"><font-face-src><font-face-name name="Courier"/></font-face-src></font-face><marker orient="auto" overflow="visible" markerUnits="strokeWidth" id="FilledArrow_Marker" viewBox="-9 -4 10 8" markerWidth="10" markerHeight="8" color="black"><g><path d="M -8 0 L 0 3 L 0 -3 Z" fill="currentColor" stroke="currentColor" stroke-width="1"/></g></marker><marker orient="auto" overflow="visible" markerUnits="strokeWidth" id="FilledArrow_Marker_2" viewBox="-1 -4 8 8" markerWidth="8" markerHeight="8" color="black"><g><path d="M 5.5999994 0 L 0 -2.0999998 L 0 2.0999998 Z" fill="currentColor" stroke="currentColor" stroke-width="1"/></g></marker></defs><g stroke="none" stroke-opacity="1" stroke-dasharray="none" fill="none" fill-opacity="1"><title>Canvas 1</title><g><title>Layer 1</title><path d="M 191.8421 190.41867 L 159.69867 190.41867 C 156.93725 190.41867 154.69867 192.65725 154.69867 195.41867 L 154.69867 227.5621 C 154.69867 230.32353 156.93725 232.5621 159.69867 232.5621 L 191.8421 232.5621 C 194.60353 232.5621 196.8421 230.32353 196.8421 227.5621 L 196.8421 195.41867 C 196.8421 192.65725 194.60353 190.41867 191.8421 190.41867 Z" stroke="black" stroke-linecap="round" stroke-linejoin="round" stroke-width="1"/><text transform="translate(169.98828 144)" fill="black"><tspan font-family="Courier" font-size="9" font-weight="500" x=".099121094" y="9" textLength="10.801758">x0</tspan></text><path d="M 361.88266 211.68 L 362.06274 211.68 L 340.48828 211.68" marker-start="url(#FilledArrow_Marker)" stroke="black" stroke-linecap="round" stroke-linejoin="round" stroke-width="1"/><text transform="translate(172.48828 205.0621)" fill="black"><tspan font-family="Courier" font-size="9" font-weight="500" x=".29956055" y="9" textLength="5.400879">f</tspan></text><line x1="208.41656" y1="211.56208" x2="204.33674" y2="211.71644" marker-end="url(#FilledArrow_Marker_2)" stroke="black" stroke-linecap="round" stroke-linejoin="round" stroke-width="1"/><path d="M 250.56 228.5621 L 250.56 194.5621 C 250.56 191.80068 248.32142 189.5621 245.56 189.5621 L 213.41656 189.5621 C 210.65514 189.5621 208.41656 191.80068 208.41656 194.5621 L 208.41656 228.5621 C 208.41656 231.32353 210.65514 233.5621 213.41656 233.5621 L 245.56 233.5621 C 248.32142 233.5621 250.56 231.32353 250.56 228.5621 Z" stroke="black" stroke-linecap="round" stroke-linejoin="round" stroke-width="1"/><text transform="translate(223.98828 144)" fill="black"><tspan font-family="Courier" font-size="9" font-weight="500" x=".099121094" y="9" textLength="10.801758">x1</tspan></text><path d="M 229.50976 158.580075 L 229.50976 158.4 L 229.50101 189.0621" marker-start="url(#FilledArrow_Marker)" stroke="black" stroke-linecap="round" stroke-linejoin="round" stroke-width="1"/><text transform="translate(226.48828 206.0621)" fill="black"><tspan font-family="Courier" font-size="9" font-weight="500" x=".29956055" y="9" textLength="5.400879">f</tspan></text><path d="M 340.56 228.0621 L 340.56 194.0621 C 340.56 191.30068 338.32142 189.0621 335.56 189.0621 L 303.41656 189.0621 C 300.65514 189.0621 298.41656 191.30068 298.41656 194.0621 L 298.41656 228.0621 C 298.41656 230.82353 300.65514 233.0621 303.41656 233.0621 L 335.56 233.0621 C 338.32142 233.0621 340.56 230.82353 340.56 228.0621 Z" stroke="black" stroke-linecap="round" stroke-linejoin="round" stroke-width="1"/><text transform="translate(313.98828 143.5)" fill="black"><tspan font-family="Courier" font-size="9" font-weight="500" x=".099121094" y="9" textLength="10.801758">xn</tspan></text><path d="M 319.48828 158.080075 L 319.48828 157.9 L 319.48829 188.5621" marker-start="url(#FilledArrow_Marker)" stroke="black" stroke-linecap="round" stroke-linejoin="round" stroke-width="1"/><text transform="translate(316.48828 205.5621)" fill="black"><tspan font-family="Courier" font-size="9" font-weight="500" x=".29956055" y="9" textLength="5.400879">f</tspan></text><text transform="translate(260.98828 203.5621)" fill="black"><tspan font-family="Courier" font-size="9" font-weight="500" x=".19824219" y="9" textLength="21.603516"> ...</tspan></text><path d="M 175.48828 158.580075 L 175.48828 158.4 L 175.4883 189.0621" marker-start="url(#FilledArrow_Marker)" stroke="black" stroke-linecap="round" stroke-linejoin="round" stroke-width="1"/><line x1="261.79446" y1="211.68" x2="257.71985" y2="211.70524" marker-end="url(#FilledArrow_Marker_2)" stroke="black" stroke-linecap="round" stroke-linejoin="round" stroke-width="1"/><line x1="298.91656" y1="211.68" x2="294.84196" y2="211.70524" marker-end="url(#FilledArrow_Marker_2)" stroke="black" stroke-linecap="round" stroke-linejoin="round" stroke-width="1"/><text transform="translate(365.48828 205.0621)" fill="black"><tspan font-family="Courier" font-size="9" font-weight="500" x=".29956055" y="9" textLength="5.400879">z</tspan></text><line x1="175.05998" y1="232.5621" x2="175.01321" y2="246.6366" marker-end="url(#FilledArrow_Marker_2)" stroke="black" stroke-linecap="round" stroke-linejoin="round" stroke-width="1"/><line x1="229.05998" y1="233.5621" x2="229.0132" y2="247.6366" marker-end="url(#FilledArrow_Marker_2)" stroke="black" stroke-linecap="round" stroke-linejoin="round" stroke-width="1"/><line x1="319.05998" y1="233.5621" x2="319.0132" y2="247.6366" marker-end="url(#FilledArrow_Marker_2)" stroke="black" stroke-linecap="round" stroke-linejoin="round" stroke-width="1"/></g></g></svg>
diff --git a/doc/zipWith.svg b/doc/zipWith.svg
new file mode 100644
--- /dev/null
+++ b/doc/zipWith.svg
@@ -0,0 +1,3 @@
+<?xml version="1.0" encoding="utf-8" standalone="no"?>
+<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd">
+<svg xmlns="http://www.w3.org/2000/svg" xmlns:xl="http://www.w3.org/1999/xlink" version="1.1" viewBox="152 143 191 123" width="191pt" height="123pt" xmlns:dc="http://purl.org/dc/elements/1.1/"><metadata> Produced by OmniGraffle 6.1.3 <dc:date>2015-05-07 12:16:36 +0000</dc:date></metadata><defs><font-face font-family="Courier" font-size="9" units-per-em="1000" underline-position="-178.22266" underline-thickness="57.617188" slope="0" x-height="462.40234" cap-height="594.72656" ascent="753.90625" descent="-246.09375" font-weight="500"><font-face-src><font-face-name name="Courier"/></font-face-src></font-face><marker orient="auto" overflow="visible" markerUnits="strokeWidth" id="FilledArrow_Marker" viewBox="-9 -4 10 8" markerWidth="10" markerHeight="8" color="black"><g><path d="M -8 0 L 0 3 L 0 -3 Z" fill="currentColor" stroke="currentColor" stroke-width="1"/></g></marker><marker orient="auto" overflow="visible" markerUnits="strokeWidth" id="FilledArrow_Marker_2" viewBox="-1 -4 8 8" markerWidth="8" markerHeight="8" color="black"><g><path d="M 5.5999994 0 L 0 -2.0999998 L 0 2.0999998 Z" fill="currentColor" stroke="currentColor" stroke-width="1"/></g></marker></defs><g stroke="none" stroke-opacity="1" stroke-dasharray="none" fill="none" fill-opacity="1"><title>Canvas 1</title><g><title>Layer 1</title><path d="M 196.56 194.5621 L 196.56 228.5621 C 196.56 231.32353 194.32142 233.5621 191.56 233.5621 L 159.41656 233.5621 C 156.65514 233.5621 154.41656 231.32353 154.41656 228.5621 L 154.41656 194.5621 C 154.41656 191.80068 156.65514 189.5621 159.41656 189.5621 L 191.56 189.5621 C 194.32142 189.5621 196.56 191.80068 196.56 194.5621 Z" stroke="black" stroke-linecap="round" stroke-linejoin="round" stroke-width="1"/><text transform="translate(159.12 143.78)" fill="black"><tspan font-family="Courier" font-size="9" font-weight="500" x=".099121094" y="9" textLength="10.801758">x0</tspan></text><path d="M 164.98828 158.580075 L 164.98828 158.4 L 164.95245 189.5621" marker-start="url(#FilledArrow_Marker)" stroke="black" stroke-linecap="round" stroke-linejoin="round" stroke-width="1"/><text transform="translate(172.48828 206.0621)" fill="black"><tspan font-family="Courier" font-size="9" font-weight="500" x=".29956055" y="9" textLength="5.400879">f</tspan></text><line x1="175.48829" y1="233.5621" x2="175.48829" y2="253.9957" marker-end="url(#FilledArrow_Marker_2)" stroke="black" stroke-linecap="round" stroke-linejoin="round" stroke-width="1"/><path d="M 250.56 194.5621 L 250.56 228.5621 C 250.56 231.32353 248.32142 233.5621 245.56 233.5621 L 213.41656 233.5621 C 210.65514 233.5621 208.41656 231.32353 208.41656 228.5621 L 208.41656 194.5621 C 208.41656 191.80068 210.65514 189.5621 213.41656 189.5621 L 245.56 189.5621 C 248.32142 189.5621 250.56 191.80068 250.56 194.5621 Z" stroke="black" stroke-linecap="round" stroke-linejoin="round" stroke-width="1"/><text transform="translate(213.12 143.78)" fill="black"><tspan font-family="Courier" font-size="9" font-weight="500" x=".099121094" y="9" textLength="10.801758">x1</tspan></text><path d="M 218.98828 158.580075 L 218.98828 158.4 L 218.95245 189.5621" marker-start="url(#FilledArrow_Marker)" stroke="black" stroke-linecap="round" stroke-linejoin="round" stroke-width="1"/><text transform="translate(226.48828 206.0621)" fill="black"><tspan font-family="Courier" font-size="9" font-weight="500" x=".29956055" y="9" textLength="5.400879">f</tspan></text><line x1="229.48829" y1="233.5621" x2="229.48829" y2="253.9957" marker-end="url(#FilledArrow_Marker_2)" stroke="black" stroke-linecap="round" stroke-linejoin="round" stroke-width="1"/><path d="M 340.56 194.0621 L 340.56 228.0621 C 340.56 230.82353 338.32142 233.0621 335.56 233.0621 L 303.41656 233.0621 C 300.65514 233.0621 298.41656 230.82353 298.41656 228.0621 L 298.41656 194.0621 C 298.41656 191.30068 300.65514 189.0621 303.41656 189.0621 L 335.56 189.0621 C 338.32142 189.0621 340.56 191.30068 340.56 194.0621 Z" stroke="black" stroke-linecap="round" stroke-linejoin="round" stroke-width="1"/><text transform="translate(303.12 143.28)" fill="black"><tspan font-family="Courier" font-size="9" font-weight="500" x=".099121094" y="9" textLength="10.801758">xn</tspan></text><path d="M 308.48828 158.080075 L 308.48828 157.9 L 308.95245 189.0621" marker-start="url(#FilledArrow_Marker)" stroke="black" stroke-linecap="round" stroke-linejoin="round" stroke-width="1"/><text transform="translate(316.48828 205.5621)" fill="black"><tspan font-family="Courier" font-size="9" font-weight="500" x=".29956055" y="9" textLength="5.400879">f</tspan></text><line x1="319.48829" y1="233.0621" x2="319.48829" y2="253.4957" marker-end="url(#FilledArrow_Marker_2)" stroke="black" stroke-linecap="round" stroke-linejoin="round" stroke-width="1"/><text transform="translate(256.98828 205.5621)" fill="black"><tspan font-family="Courier" font-size="9" font-weight="500" x=".29736328" y="9" textLength="32.405273"> . . .</tspan></text><text transform="translate(179.28 143.78)" fill="black"><tspan font-family="Courier" font-size="9" font-weight="500" x=".099121094" y="9" textLength="10.801758">y0</tspan></text><path d="M 185.14828 158.580075 L 185.14828 158.4 L 185.11245 189.5621" marker-start="url(#FilledArrow_Marker)" stroke="black" stroke-linecap="round" stroke-linejoin="round" stroke-width="1"/><text transform="translate(233.28 143.78)" fill="black"><tspan font-family="Courier" font-size="9" font-weight="500" x=".099121094" y="9" textLength="10.801758">y1</tspan></text><path d="M 239.14828 158.580075 L 239.14828 158.4 L 239.11245 189.5621" marker-start="url(#FilledArrow_Marker)" stroke="black" stroke-linecap="round" stroke-linejoin="round" stroke-width="1"/><text transform="translate(323.28 143.28)" fill="black"><tspan font-family="Courier" font-size="9" font-weight="500" x=".099121094" y="9" textLength="10.801758">yn</tspan></text><path d="M 328.64828 158.080075 L 328.64828 157.9 L 329.11245 189.0621" marker-start="url(#FilledArrow_Marker)" stroke="black" stroke-linecap="round" stroke-linejoin="round" stroke-width="1"/></g></g></svg>
diff --git a/doc/zipWith3.svg b/doc/zipWith3.svg
new file mode 100644
--- /dev/null
+++ b/doc/zipWith3.svg
@@ -0,0 +1,3 @@
+<?xml version="1.0" encoding="utf-8" standalone="no"?>
+<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd">
+<svg xmlns="http://www.w3.org/2000/svg" xmlns:xl="http://www.w3.org/1999/xlink" version="1.1" viewBox="152 143 193 123" width="193pt" height="123pt" xmlns:dc="http://purl.org/dc/elements/1.1/"><metadata> Produced by OmniGraffle 6.1.3 <dc:date>2015-05-07 12:18:39 +0000</dc:date></metadata><defs><font-face font-family="Courier" font-size="9" units-per-em="1000" underline-position="-178.22266" underline-thickness="57.617188" slope="0" x-height="462.40234" cap-height="594.72656" ascent="753.90625" descent="-246.09375" font-weight="500"><font-face-src><font-face-name name="Courier"/></font-face-src></font-face><marker orient="auto" overflow="visible" markerUnits="strokeWidth" id="FilledArrow_Marker" viewBox="-9 -4 10 8" markerWidth="10" markerHeight="8" color="black"><g><path d="M -8 0 L 0 3 L 0 -3 Z" fill="currentColor" stroke="currentColor" stroke-width="1"/></g></marker><marker orient="auto" overflow="visible" markerUnits="strokeWidth" id="FilledArrow_Marker_2" viewBox="-1 -4 8 8" markerWidth="8" markerHeight="8" color="black"><g><path d="M 5.5999994 0 L 0 -2.0999998 L 0 2.0999998 Z" fill="currentColor" stroke="currentColor" stroke-width="1"/></g></marker></defs><g stroke="none" stroke-opacity="1" stroke-dasharray="none" fill="none" fill-opacity="1"><title>Canvas 1</title><g><title>Layer 1</title><path d="M 196.56 194.5621 L 196.56 228.5621 C 196.56 231.32353 194.32142 233.5621 191.56 233.5621 L 159.41656 233.5621 C 156.65514 233.5621 154.41656 231.32353 154.41656 228.5621 L 154.41656 194.5621 C 154.41656 191.80068 156.65514 189.5621 159.41656 189.5621 L 191.56 189.5621 C 194.32142 189.5621 196.56 191.80068 196.56 194.5621 Z" stroke="black" stroke-linecap="round" stroke-linejoin="round" stroke-width="1"/><text transform="translate(159.12 143.78)" fill="black"><tspan font-family="Courier" font-size="9" font-weight="500" x=".099121094" y="9" textLength="10.801758">x0</tspan></text><path d="M 164.98828 158.580075 L 164.98828 158.4 L 164.95245 189.5621" marker-start="url(#FilledArrow_Marker)" stroke="black" stroke-linecap="round" stroke-linejoin="round" stroke-width="1"/><text transform="translate(172.48828 206.0621)" fill="black"><tspan font-family="Courier" font-size="9" font-weight="500" x=".29956055" y="9" textLength="5.400879">f</tspan></text><line x1="175.48829" y1="233.5621" x2="175.48829" y2="253.9957" marker-end="url(#FilledArrow_Marker_2)" stroke="black" stroke-linecap="round" stroke-linejoin="round" stroke-width="1"/><path d="M 250.56 194.5621 L 250.56 228.5621 C 250.56 231.32353 248.32142 233.5621 245.56 233.5621 L 213.41656 233.5621 C 210.65514 233.5621 208.41656 231.32353 208.41656 228.5621 L 208.41656 194.5621 C 208.41656 191.80068 210.65514 189.5621 213.41656 189.5621 L 245.56 189.5621 C 248.32142 189.5621 250.56 191.80068 250.56 194.5621 Z" stroke="black" stroke-linecap="round" stroke-linejoin="round" stroke-width="1"/><text transform="translate(213.12 143.78)" fill="black"><tspan font-family="Courier" font-size="9" font-weight="500" x=".099121094" y="9" textLength="10.801758">x1</tspan></text><path d="M 218.98828 158.580075 L 218.98828 158.4 L 218.95245 189.5621" marker-start="url(#FilledArrow_Marker)" stroke="black" stroke-linecap="round" stroke-linejoin="round" stroke-width="1"/><text transform="translate(226.48828 206.0621)" fill="black"><tspan font-family="Courier" font-size="9" font-weight="500" x=".29956055" y="9" textLength="5.400879">f</tspan></text><line x1="229.48829" y1="233.5621" x2="229.48829" y2="253.9957" marker-end="url(#FilledArrow_Marker_2)" stroke="black" stroke-linecap="round" stroke-linejoin="round" stroke-width="1"/><path d="M 340.56 194.0621 L 340.56 228.0621 C 340.56 230.82353 338.32142 233.0621 335.56 233.0621 L 303.41656 233.0621 C 300.65514 233.0621 298.41656 230.82353 298.41656 228.0621 L 298.41656 194.0621 C 298.41656 191.30068 300.65514 189.0621 303.41656 189.0621 L 335.56 189.0621 C 338.32142 189.0621 340.56 191.30068 340.56 194.0621 Z" stroke="black" stroke-linecap="round" stroke-linejoin="round" stroke-width="1"/><text transform="translate(303.12 143.28)" fill="black"><tspan font-family="Courier" font-size="9" font-weight="500" x=".099121094" y="9" textLength="10.801758">xn</tspan></text><path d="M 308.48828 158.080075 L 308.48828 157.9 L 308.95245 189.0621" marker-start="url(#FilledArrow_Marker)" stroke="black" stroke-linecap="round" stroke-linejoin="round" stroke-width="1"/><text transform="translate(316.48828 205.5621)" fill="black"><tspan font-family="Courier" font-size="9" font-weight="500" x=".29956055" y="9" textLength="5.400879">f</tspan></text><line x1="319.48829" y1="233.0621" x2="319.48829" y2="253.4957" marker-end="url(#FilledArrow_Marker_2)" stroke="black" stroke-linecap="round" stroke-linejoin="round" stroke-width="1"/><text transform="translate(256.98828 205.5621)" fill="black"><tspan font-family="Courier" font-size="9" font-weight="500" x=".29736328" y="9" textLength="32.405273"> . . .</tspan></text><text transform="translate(170.48828 143.78)" fill="black"><tspan font-family="Courier" font-size="9" font-weight="500" x=".099121094" y="9" textLength="10.801758">y0</tspan></text><path d="M 176.35656 158.580075 L 176.35656 158.4 L 176.32074 189.5621" marker-start="url(#FilledArrow_Marker)" stroke="black" stroke-linecap="round" stroke-linejoin="round" stroke-width="1"/><text transform="translate(224.48828 143.78)" fill="black"><tspan font-family="Courier" font-size="9" font-weight="500" x=".099121094" y="9" textLength="10.801758">y1</tspan></text><path d="M 230.35656 158.580075 L 230.35656 158.4 L 230.32074 189.5621" marker-start="url(#FilledArrow_Marker)" stroke="black" stroke-linecap="round" stroke-linejoin="round" stroke-width="1"/><text transform="translate(314.48828 143.28)" fill="black"><tspan font-family="Courier" font-size="9" font-weight="500" x=".099121094" y="9" textLength="10.801758">yn</tspan></text><path d="M 319.85656 158.080075 L 319.85656 157.9 L 320.32074 189.0621" marker-start="url(#FilledArrow_Marker)" stroke="black" stroke-linecap="round" stroke-linejoin="round" stroke-width="1"/><text transform="translate(182.78 143.78)" fill="black"><tspan font-family="Courier" font-size="9" font-weight="500" x=".099121094" y="9" textLength="10.801758">z0</tspan></text><path d="M 188.64828 158.580075 L 188.64828 158.4 L 188.61245 189.5621" marker-start="url(#FilledArrow_Marker)" stroke="black" stroke-linecap="round" stroke-linejoin="round" stroke-width="1"/><text transform="translate(236.78 143.78)" fill="black"><tspan font-family="Courier" font-size="9" font-weight="500" x=".099121094" y="9" textLength="10.801758">z1</tspan></text><path d="M 242.64828 158.580075 L 242.64828 158.4 L 242.61245 189.5621" marker-start="url(#FilledArrow_Marker)" stroke="black" stroke-linecap="round" stroke-linejoin="round" stroke-width="1"/><text transform="translate(326.78 143.28)" fill="black"><tspan font-family="Courier" font-size="9" font-weight="500" x=".099121094" y="9" textLength="10.801758">zn</tspan></text><path d="M 332.14828 158.080075 L 332.14828 157.9 L 332.61245 189.0621" marker-start="url(#FilledArrow_Marker)" stroke="black" stroke-linecap="round" stroke-linejoin="round" stroke-width="1"/></g></g></svg>
diff --git a/src/CLaSH/Annotations/TopEntity.hs b/src/CLaSH/Annotations/TopEntity.hs
--- a/src/CLaSH/Annotations/TopEntity.hs
+++ b/src/CLaSH/Annotations/TopEntity.hs
@@ -12,7 +12,7 @@
 
 We can exert some control how the top level function is created by the CλaSH
 compiler by annotating the @topEntity@ function with a 'TopEntity' annotation.
-You apply these annotation using the @ANN@ pragma like so:
+You apply these annotations using the @ANN@ pragma like so:
 
 @
 {\-\# ANN topEntity (TopEntity {t_name = ..., ...  }) \#-\}
diff --git a/src/CLaSH/Class/BitPack.hs b/src/CLaSH/Class/BitPack.hs
--- a/src/CLaSH/Class/BitPack.hs
+++ b/src/CLaSH/Class/BitPack.hs
@@ -75,7 +75,7 @@
   pack   v = v
   unpack v = v
 
-instance (KnownNat (BitSize a), KnownNat (BitSize b), BitPack a, BitPack b) =>
+instance (KnownNat (BitSize b), BitPack a, BitPack b) =>
     BitPack (a,b) where
   type BitSize (a,b) = BitSize a + BitSize b
   pack (a,b) = pack a ++# pack b
diff --git a/src/CLaSH/Prelude.hs b/src/CLaSH/Prelude.hs
--- a/src/CLaSH/Prelude.hs
+++ b/src/CLaSH/Prelude.hs
@@ -34,6 +34,8 @@
     mealy
   , mealyB
   , (<^>)
+  , moore
+  , mooreB
   , registerB
     -- * BlockRAM primitives
   , blockRam
@@ -114,6 +116,7 @@
 import CLaSH.Prelude.Explicit      (registerB', window', windowD', isRising',
                                     isFalling')
 import CLaSH.Prelude.Mealy         (mealy, mealyB, (<^>))
+import CLaSH.Prelude.Moore         (moore, mooreB)
 import CLaSH.Prelude.DataFlow
 import CLaSH.Prelude.Testbench     (assert, stimuliGenerator, outputVerifier)
 import CLaSH.Promoted.Nat
diff --git a/src/CLaSH/Prelude/BlockRam.hs b/src/CLaSH/Prelude/BlockRam.hs
--- a/src/CLaSH/Prelude/BlockRam.hs
+++ b/src/CLaSH/Prelude/BlockRam.hs
@@ -12,7 +12,7 @@
 import GHC.TypeLits           (KnownNat, type (^))
 import Prelude                hiding ((!!))
 
-import CLaSH.Prelude.Mealy    (mealy')
+import CLaSH.Prelude.Moore    (moore')
 import CLaSH.Signal           (Signal)
 import CLaSH.Signal.Explicit  (Signal', SClock, systemClock)
 import CLaSH.Signal.Bundle    (bundle')
@@ -99,9 +99,9 @@
           -- ^ Value of the @blockRAM@ at address @r@ from the previous clock
           -- cycle
 blockRam' clk binit wr rd en din =
-    mealy' clk bram' (binit,undefined) (bundle' clk (wr,rd,en,din))
+    moore' clk bram' snd (binit,undefined) (bundle' clk (wr,rd,en,din))
   where
-    bram' (ram,o) (w,r,e,d) = ((ram',o'),o)
+    bram' (ram,_) (w,r,e,d) = (ram',o')
       where
         ram' | e         = replace ram w d
              | otherwise = ram
diff --git a/src/CLaSH/Prelude/DataFlow.hs b/src/CLaSH/Prelude/DataFlow.hs
--- a/src/CLaSH/Prelude/DataFlow.hs
+++ b/src/CLaSH/Prelude/DataFlow.hs
@@ -20,6 +20,7 @@
     -- * Creating DataFlow circuits
   , liftDF
   , mealyDF
+  , mooreDF
     -- * Composition combinators
   , idDF
   , seqDF
@@ -129,6 +130,19 @@
                                    s      = regEn iS en s'
                                in  (o,iV,oR))
 
+-- | Create a 'DataFlow' circuit from a Moore machine description as those of
+-- "CLaSH.Prelude.Moore"
+mooreDF :: (s -> i -> s)
+        -> (s -> o)
+        -> s
+        -> DataFlow Bool Bool i o
+mooreDF ft fo iS = DF (\i iV oR -> let en  = iV .&&. oR
+                                       s'  = ft <$> s <*> i
+                                       s   = regEn iS en s'
+                                       o   = fo <$> s
+                                   in  (o,iV,oR))
+
+
 -- | Identity circuit
 --
 -- <<doc/idDF.svg>>
@@ -166,8 +180,7 @@
 -- | Swap the two communication channels.
 --
 -- <<doc/swapDF.svg>>
-swapDF :: (KnownSymbol nm, KnownNat rate)
-       => DataFlow' ('Clk nm rate) (aEn,bEn) (bEn,aEn) (a,b) (b,a)
+swapDF :: DataFlow' ('Clk nm rate) (aEn,bEn) (bEn,aEn) (a,b) (b,a)
 swapDF = DF (\ab abV baR -> (swap <$> ab, swap <$> abV, swap <$> baR))
   where
     swap ~(a,b) = (b,a)
diff --git a/src/CLaSH/Prelude/Explicit.hs b/src/CLaSH/Prelude/Explicit.hs
--- a/src/CLaSH/Prelude/Explicit.hs
+++ b/src/CLaSH/Prelude/Explicit.hs
@@ -21,6 +21,8 @@
   ( -- * Creating synchronous sequential circuits
     mealy'
   , mealyB'
+  , moore'
+  , mooreB'
   , registerB'
     -- * BlockRAM primitives
   , blockRam'
@@ -46,6 +48,7 @@
 
 import CLaSH.Prelude.BlockRam  (blockRam', blockRamPow2')
 import CLaSH.Prelude.Mealy     (mealy', mealyB')
+import CLaSH.Prelude.Moore     (moore', mooreB')
 import CLaSH.Prelude.Testbench (stimuliGenerator', outputVerifier')
 import CLaSH.Signal.Explicit
 import CLaSH.Sized.Vector      (Vec (..), (+>>), asNatProxy, repeat)
diff --git a/src/CLaSH/Prelude/Mealy.hs b/src/CLaSH/Prelude/Mealy.hs
--- a/src/CLaSH/Prelude/Mealy.hs
+++ b/src/CLaSH/Prelude/Mealy.hs
@@ -1,7 +1,13 @@
 {-|
-Copyright  :  (C) 2013-2015, University of Twente
-License    :  BSD2 (see the file LICENSE)
-Maintainer :  Christiaan Baaij <christiaan.baaij@gmail.com>
+  Copyright  :  (C) 2013-2015, University of Twente
+  License    :  BSD2 (see the file LICENSE)
+  Maintainer :  Christiaan Baaij <christiaan.baaij@gmail.com>
+
+  Whereas the output of a Moore machine depends on the /previous state/, the
+  outputof a Mealy machine depends on /current transition/.
+
+  Mealy machines are strictly more expressive, but may impose stricter timing
+  requirements.
 -}
 module CLaSH.Prelude.Mealy
   ( -- * Mealy machine synchronised to the system clock
diff --git a/src/CLaSH/Prelude/Moore.hs b/src/CLaSH/Prelude/Moore.hs
new file mode 100644
--- /dev/null
+++ b/src/CLaSH/Prelude/Moore.hs
@@ -0,0 +1,204 @@
+{-|
+  Copyright  :  (C) 2013-2015, University of Twente
+  License    :  BSD2 (see the file LICENSE)
+  Maintainer :  Christiaan Baaij <christiaan.baaij@gmail.com>
+
+  Whereas the output of a Mealy machine depends on /current transition/, the
+  output of a Moore machine depends on the /previous state/.
+
+  Moore machines are strictly less expressive, but may impose laxer timing
+  requirements.
+-}
+module CLaSH.Prelude.Moore
+  ( -- * Moore machine synchronised to the system clock
+    moore
+  , mooreB
+    -- * Moore machine synchronised to an arbitrary clock
+  , moore'
+  , mooreB'
+  )
+where
+
+import CLaSH.Signal          (Signal, Unbundled)
+import CLaSH.Signal.Explicit (Signal', SClock, register', systemClock)
+import CLaSH.Signal.Bundle   (Bundle (..), Unbundled')
+
+-- $setup
+-- >>> :set -XDataKinds
+-- >>> import CLaSH.Prelude
+-- >>> :{
+-- let mac s (x,y) = x * y + s
+--     topEntity = moore mac id 0
+-- :}
+--
+-- >>> import CLaSH.Prelude.Explicit
+-- >>> type ClkA = Clk "A" 100
+-- >>> let clkA = sclock :: SClock ClkA
+-- >>> let mac s (x,y) = x * y + s
+--
+-- >>> let topEntity = moore' clkA mac id 0
+
+{-# INLINE moore #-}
+-- | Create a synchronous function from a combinational function describing
+-- a moore machine
+--
+-- @
+-- mac :: Int        -- Current state
+--     -> (Int,Int)  -- Input
+--     -> Int        -- Updated state
+-- mac s (x,y) = x * y + s
+--
+-- topEntity :: 'Signal' (Int, Int) -> 'Signal' Int
+-- topEntity = 'moore' mac id 0
+-- @
+--
+-- >>> simulate topEntity [(1,1),(2,2),(3,3),(4,4)]
+-- [0,1,5,14...
+--
+-- Synchronous sequential functions can be composed just like their
+-- combinational counterpart:
+--
+-- @
+-- dualMac :: ('Signal' Int, 'Signal' Int)
+--         -> ('Signal' Int, 'Signal' Int)
+--         -> 'Signal' Int
+-- dualMac (a,b) (x,y) = s1 + s2
+--   where
+--     s1 = 'moore' mac id 0 ('CLaSH.Signal.bundle' (a,x))
+--     s2 = 'moore' mac id 0 ('CLaSH.Signal.bundle' (b,y))
+-- @
+moore :: (s -> i -> s) -- ^ Transfer function in moore machine form:
+                       -- @state -> input -> newstate@
+      -> (s -> o)      -- ^ Output function in moore machine form:
+                       -- @state -> output@
+      -> s             -- ^ Initial state
+      -> (Signal i -> Signal o)
+      -- ^ Synchronous sequential function with input and output matching that
+      -- of the moore machine
+moore = moore' systemClock
+
+{-# INLINE mooreB #-}
+-- | A version of 'moore' that does automatic 'Bundle'ing
+--
+-- Given a functions @t@ and @o@ of types:
+--
+-- @
+-- __t__ :: Int -> (Bool, Int) -> Int
+-- __o__ :: Int -> (Int, Bool)
+-- @
+--
+-- When we want to make compositions of @t@ and @o@ in @g@ using 'moore', we have to
+-- write:
+--
+-- @
+-- g a b c = (b1,b2,i2)
+--   where
+--     (i1,b1) = 'CLaSH.Signal.unbundle' ('moore' t o 0 ('CLaSH.Signal.bundle' (a,b)))
+--     (i2,b2) = 'CLaSH.Signal.unbundle' ('moore' t o 3 ('CLaSH.Signal.bundle' (i1,c)))
+-- @
+--
+-- Using 'mooreB' however we can write:
+--
+-- @
+-- g a b c = (b1,b2,i2)
+--   where
+--     (i1,b1) = 'mooreB' t o 0 (a,b)
+--     (i2,b2) = 'mooreB' t o 3 (i1,c)
+-- @
+mooreB :: (Bundle i, Bundle o)
+      => (s -> i -> s) -- ^ Transfer function in moore machine form:
+                       -- @state -> input -> newstate@
+      -> (s -> o)      -- ^ Output function in moore machine form:
+                       -- @state -> output@
+      -> s             -- ^ Initial state
+      -> (Unbundled i -> Unbundled o)
+       -- ^ Synchronous sequential function with input and output matching that
+       -- of the moore machine
+mooreB = mooreB' systemClock
+
+{-# INLINABLE moore' #-}
+-- | Create a synchronous function from a combinational function describing
+-- a moore machine
+--
+-- @
+-- mac :: Int        -- Current state
+--     -> (Int,Int)  -- Input
+--     -> (Int,Int)  -- Updated state
+-- mac s (x,y) = x * y + s
+--
+-- type ClkA = 'CLaSH.Signal.Explicit.Clk' \"A\" 100
+--
+-- clkA :: 'SClock' ClkA
+-- clkA = 'CLaSH.Signal.Explicit.sclock'
+--
+-- topEntity :: 'Signal'' ClkA (Int, Int) -> 'Signal'' ClkA Int
+-- topEntity = 'moore'' clkA mac id 0
+-- @
+--
+-- >>> simulate topEntity [(1,1),(2,2),(3,3),(4,4)]
+-- [0,1,5,14...
+--
+-- Synchronous sequential functions can be composed just like their
+-- combinational counterpart:
+--
+-- @
+-- dualMac :: ('Signal'' clkA Int, 'Signal'' clkA Int)
+--         -> ('Signal'' clkA Int, 'Signal'' clkA Int)
+--         -> 'Signal'' clkA Int
+-- dualMac (a,b) (x,y) = s1 + s2
+--   where
+--     s1 = 'moore'' clkA mac id 0 ('CLaSH.Signal.Explicit.bundle'' clkA (a,x))
+--     s2 = 'moore'' clkA mac id 0 ('CLaSH.Signal.Explicit.bundle'' clkA (b,y))
+-- @
+moore' :: SClock clk    -- ^ 'Clock' to synchronize to
+       -> (s -> i -> s) -- ^ Transfer function in moore machine form:
+                        -- @state -> input -> newstate@
+       -> (s -> o)      -- ^ Output function in moore machine form:
+                        -- @state -> output@
+       -> s             -- ^ Initial state
+       -> (Signal' clk i -> Signal' clk o)
+       -- ^ Synchronous sequential function with input and output matching that
+       -- of the moore machine
+moore' clk ft fo iS = \i -> let s' = ft <$> s <*> i
+                                s  = register' clk iS s'
+                        in fo <$> s
+
+{-# INLINE mooreB' #-}
+-- | A version of 'moore'' that does automatic 'Bundle'ing
+--
+-- Given a functions @t@ and @o@ of types:
+--
+-- @
+-- __t__ :: Int -> (Bool, Int) -> Int
+-- __o__ :: Int -> (Int, Bool)
+-- @
+--
+-- When we want to make compositions of @t@ and @o@ in @g@ using 'moore'', we have to
+-- write:
+--
+-- @
+-- g clk a b c = (b1,b2,i2)
+--   where
+--     (i1,b1) = 'CLaSH.Signal.Explicit.unbundle'' clk (moore' clk t o 0 ('CLaSH.Signal.Explicit.bundle'' clk (a,b)))
+--     (i2,b2) = 'CLaSH.Signal.Explicit.unbundle'' clk (moore' clk t o 3 ('CLaSH.Signal.Explicit.bundle'' clk (i1,c)))
+-- @
+--
+-- Using 'mooreB'' however we can write:
+--
+-- @
+-- g clk a b c = (b1,b2,i2)
+--   where
+--     (i1,b1) = 'mooreB'' clk t o 0 (a,b)
+--     (i2,b2) = 'mooreB'' clk to 3 (i1,c)
+-- @
+mooreB' :: (Bundle i, Bundle o)
+        => SClock clk
+        -> (s -> i -> s) -- ^ Transfer function in moore machine form:
+                         -- @state -> input -> newstate@
+        -> (s -> o)      -- ^ Output function in moore machine form:
+                         -- @state -> output@
+        -> s             -- ^ Initial state
+        -> (Unbundled' clk i -> Unbundled' clk o)
+        -- ^ Synchronous sequential function with input and output matching that
+        -- of the moore machine
+mooreB' clk ft fo iS i = unbundle' clk (moore' clk ft fo iS (bundle' clk i))
diff --git a/src/CLaSH/Sized/Fixed.hs b/src/CLaSH/Sized/Fixed.hs
--- a/src/CLaSH/Sized/Fixed.hs
+++ b/src/CLaSH/Sized/Fixed.hs
@@ -128,7 +128,7 @@
 -- 3.9375
 -- >>> minBound :: SFixed 3 4
 -- -4.0
--- >>> 1  + 2 :: SFixed 3 4
+-- >>> 1 + 2 :: SFixed 3 4
 -- 3.0
 -- >>> 2 + 3 :: SFixed 3 4
 -- 3.9375
@@ -221,8 +221,7 @@
 fracShift :: KnownNat frac => Fixed rep int frac -> Int
 fracShift fx = fromInteger (natVal fx)
 
-instance ( size ~ (int + frac), Show (rep size), Bits (rep size), KnownNat frac
-         , Integral (rep size)
+instance ( size ~ (int + frac), KnownNat frac, Integral (rep size)
          ) => Show (Fixed rep int frac) where
   show f@(Fixed fRep) =
       i ++ "." ++ (uncurry pad . second (show . numerator) .
@@ -571,7 +570,7 @@
 -- >>> $$(fLit (atan 0.2)) :: SFixed 1 20
 -- 0.19739532470703125
 fLit :: forall rep int frac size .
-        ( size ~ (int + frac), KnownNat frac, Num (rep size), Bounded (rep size)
+        ( size ~ (int + frac), KnownNat frac, Bounded (rep size)
         , Integral (rep size))
      => Double
      -> Q (TExp (Fixed rep int frac))
diff --git a/src/CLaSH/Sized/Internal/Index.hs b/src/CLaSH/Sized/Internal/Index.hs
--- a/src/CLaSH/Sized/Internal/Index.hs
+++ b/src/CLaSH/Sized/Internal/Index.hs
@@ -51,6 +51,21 @@
 -- | Arbitrary-bounded unsigned integer represented by @ceil(log_2(n))@ bits.
 --
 -- Given an upper bound @n@, an 'Index' @n@ number has a range of: [0 .. @n@-1]
+--
+-- >>> maxBound :: Index 8
+-- 7
+-- >>> minBound :: Index 8
+-- 0
+-- >>> 1 + 2 :: Index 8
+-- 3
+-- >>> 2 + 6 :: Index 8
+-- *** Exception: 8 is out of bounds: [0..7]
+-- >>> 1 - 3 :: Index 8
+-- *** Exception: -2 is out of bounds: [0..7]
+-- >>> 2 * 3 :: Index 8
+-- 6
+-- >>> 2 * 4 :: Index 8
+-- *** Exception: 8 is out of bounds: [0..7]
 newtype Index (n :: Nat) =
     -- | The constructor, 'I', and the field, 'unsafeToInteger', are not
     -- synthesisable.
@@ -160,7 +175,7 @@
   divMod  n d = (n `quot#` d,n `mod#` d)
   toInteger   = toInteger#
 
-quot#,rem#,mod# :: KnownNat n => Index n -> Index n -> Index n
+quot#,rem#,mod# :: Index n -> Index n -> Index n
 {-# NOINLINE quot# #-}
 (I a) `quot#` (I b) = I (a `div` b)
 {-# NOINLINE rem# #-}
diff --git a/src/CLaSH/Sized/Internal/Signed.hs b/src/CLaSH/Sized/Internal/Signed.hs
--- a/src/CLaSH/Sized/Internal/Signed.hs
+++ b/src/CLaSH/Sized/Internal/Signed.hs
@@ -100,6 +100,31 @@
 --
 -- __NB__: The 'Num' operators perform @wrap-around@ on overflow. If you want
 -- saturation on overflow, check out the 'SaturatingNum' class.
+--
+-- >>>  maxBound :: Signed 3
+-- 3
+-- >>> minBound :: Signed 3
+-- -4
+-- >>> 1 + 2 :: Signed 3
+-- 3
+-- >>> 2 + 3 :: Signed 3
+-- -3
+-- >>> (-2) + (-3) :: Signed 3
+-- 3
+-- >>> 2 * 3 :: Signed 4
+-- 6
+-- >>> 2 * 4 :: Signed 4
+-- -8
+-- >>> (2 :: Signed 3) `times` (4 :: Signed 4) :: Signed 7
+-- 8
+-- >>> (2 :: Signed 3) `plus` (3 :: Signed 3) :: Signed 4
+-- 5
+-- >>> (-2 :: Signed 3) `plus` (-3 :: Signed 3) :: Signed 4
+-- -5
+-- >>> satPlus SatSymmetric 2 3 :: Signed 3
+-- 3
+-- >>> satPlus SatSymmetric (-2) (-3) :: Signed 3
+-- -3
 newtype Signed (n :: Nat) =
     -- | The constructor, 'S', and the field, 'unsafeToInteger', are not
     -- synthesisable.
@@ -267,11 +292,13 @@
   divMod  n d = (n `div#`  d,n `mod#` d)
   toInteger   = toInteger#
 
-quot#,rem#,div#,mod# :: KnownNat n => Signed n -> Signed n -> Signed n
+quot#,rem# :: Signed n -> Signed n -> Signed n
 {-# NOINLINE quot# #-}
 quot# (S a) (S b) = S (a `quot` b)
 {-# NOINLINE rem# #-}
 rem# (S a) (S b) = S (a `rem` b)
+
+div#,mod# :: KnownNat n => Signed n -> Signed n -> Signed n
 {-# NOINLINE div# #-}
 div# (S a) (S b) = S (a `div` b)
 {-# NOINLINE mod# #-}
diff --git a/src/CLaSH/Sized/Internal/Unsigned.hs b/src/CLaSH/Sized/Internal/Unsigned.hs
--- a/src/CLaSH/Sized/Internal/Unsigned.hs
+++ b/src/CLaSH/Sized/Internal/Unsigned.hs
@@ -92,6 +92,29 @@
 --
 -- __NB__: The 'Num' operators perform @wrap-around@ on overflow. If you want
 -- saturation on overflow, check out the 'SaturatingNum' class.
+--
+-- >>> maxBound :: Unsigned 3
+-- 7
+-- >>> minBound :: Unsigned 3
+-- 0
+-- >>> 1 + 2 :: Unsigned 3
+-- 3
+-- >>> 2 + 6 :: Unsigned 3
+-- 0
+-- >>> 1 - 3 :: Unsigned 3
+-- 6
+-- >>> 2 * 3 :: Unsigned 3
+-- 6
+-- >>> 2 * 4 :: Unsigned 3
+-- 0
+-- >>> (2 :: Unsigned 3) `times` (4 :: Unsigned 3) :: Unsigned 6
+-- 8
+-- >>> (2 :: Unsigned 3) `plus` (6 :: Unsigned 3) :: Unsigned 4
+-- 8
+-- >>> satPlus SatSymmetric 2 6 :: Unsigned 3
+-- 7
+-- >>> satMin SatSymmetric 2 3 :: Unsigned 3
+-- 0
 newtype Unsigned (n :: Nat) =
     -- | The constructor, 'U', and the field, 'unsafeToBitVector', are not
     -- synthesisable.
diff --git a/src/CLaSH/Sized/Vector.hs b/src/CLaSH/Sized/Vector.hs
--- a/src/CLaSH/Sized/Vector.hs
+++ b/src/CLaSH/Sized/Vector.hs
@@ -123,10 +123,11 @@
 -- * 'Vec'tor elements have an __ASCENDING__ subscript starting from 0 and
 --   ending at 'maxIndex' (== 'length' - 1).
 --
--- >>> (3:>4:>5:>Nil)
+-- >>> 3:>4:>5:>Nil
 -- <3,4,5>
--- >>> :t (3:>4:>5:>Nil)
--- (3:>4:>5:>Nil) :: Num a => Vec (2 + 1) a
+-- >>> let x = 3:>4:>5:>Nil
+-- >>> :t x
+-- x :: Num a => Vec 3 a
 data Vec :: Nat -> * -> * where
   Nil  :: Vec 0 a
   (:>) :: a -> Vec n a -> Vec (n + 1) a
@@ -136,7 +137,7 @@
 instance Show a => Show (Vec n a) where
   show vs = "<" P.++ punc vs P.++ ">"
     where
-      punc :: Show a => Vec m a -> String
+      punc :: Vec m a -> String
       punc Nil        = ""
       punc (x :> Nil) = show x
       punc (x :> xs)  = show x P.++ "," P.++ punc xs
@@ -197,8 +198,8 @@
 -- >>> head Nil
 -- <BLANKLINE>
 -- <interactive>:...
---     Couldn't match type ‘1’ with ‘0’
---     Expected type: Vec (0 + 1) a
+--     Couldn't match type ‘...’ with ‘0’
+--     Expected type: Vec ... a
 --       Actual type: Vec 0 a
 --     In the first argument of ‘head’, namely ‘Nil’
 --     In the expression: head Nil
@@ -213,8 +214,8 @@
 -- >>> tail Nil
 -- <BLANKLINE>
 -- <interactive>:...
---     Couldn't match type ‘1’ with ‘0’
---     Expected type: Vec (0 + 1) a
+--     Couldn't match type ‘...’ with ‘0’
+--     Expected type: Vec ... a
 --       Actual type: Vec 0 a
 --     In the first argument of ‘tail’, namely ‘Nil’
 --     In the expression: tail Nil
@@ -229,8 +230,8 @@
 -- >>> last Nil
 -- <BLANKLINE>
 -- <interactive>:...
---     Couldn't match type ‘1’ with ‘0’
---     Expected type: Vec (0 + 1) a
+--     Couldn't match type ‘...’ with ‘0’
+--     Expected type: Vec ... a
 --       Actual type: Vec 0 a
 --     In the first argument of ‘last’, namely ‘Nil’
 --     In the expression: last Nil
@@ -246,8 +247,8 @@
 -- >>> init Nil
 -- <BLANKLINE>
 -- <interactive>:...
---     Couldn't match type ‘1’ with ‘0’
---     Expected type: Vec (0 + 1) a
+--     Couldn't match type ‘...’ with ‘0’
+--     Expected type: Vec ... a
 --       Actual type: Vec 0 a
 --     In the first argument of ‘init’, namely ‘Nil’
 --     In the expression: init Nil
@@ -300,8 +301,9 @@
 --
 -- >>> (3:>4:>5:>Nil) <: 1
 -- <3,4,5,1>
--- >>> :t (3:>4:>5:>Nil) <: 1
--- (3:>4:>5:>Nil) <: 1 :: Num a => Vec (3 + 1) a
+-- >>> let x = (3:>4:>5:>Nil) <: 1
+-- >>> :t x
+-- x :: Num a => Vec 4 a
 (<:) :: Vec n a -> a -> Vec (n + 1) a
 xs <: x = xs ++ singleton x
 
@@ -326,7 +328,7 @@
 -- <4,5,1>
 -- >>> Nil <<+ 1
 -- <>
-(<<+) :: KnownNat n => Vec n a -> a -> Vec n a
+(<<+) :: Vec n a -> a -> Vec n a
 xs <<+ s = fst (shiftInAtN xs (singleton s))
 
 {-# INLINE shiftOutFrom0 #-}
@@ -450,6 +452,10 @@
 -- of @xs@, i.e.,
 --
 -- > map f (x1 :> x2 :>  ... :> xn :> Nil) == (f x1 :> f x2 :> ... :> f xn :> Nil)
+--
+-- and corresponds to the following circuit layout:
+--
+-- <<doc/map.svg>>
 map :: (a -> b) -> Vec n a -> Vec n b
 map _ Nil       = Nil
 map f (x :> xs) = f x :> map f xs
@@ -462,6 +468,10 @@
 --
 -- > zipWith f (x1 :> x2 :> ... xn :> Nil) (y1 :> y2 :> ... :> yn :> Nil) == (f x1 y1 :> f x2 y2 :> ... :> f xn yn :> Nil)
 --
+-- @zipWith f xs ys@ corresponds to the following circuit layout:
+--
+-- <<doc/zipWith.svg>>
+--
 -- __NB:__ 'zipWith' is /strict/ in its second argument, and /lazy/ in its
 -- third. This matters when 'zipWith' is used in a recursive setting. See
 -- 'lazyV' for more information.
@@ -475,6 +485,10 @@
 --
 -- > zipWith3 f (x1 :> x2 :> ... xn :> Nil) (y1 :> y2 :> ... :> yn :> Nil) (z1 :> z2 :> ... :> zn :> Nil) == (f x1 y1 z1 :> f x2 y2 z2 :> ... :> f xn yn zn :> Nil)
 --
+-- @zipWith3 f xs ys zs@ corresponds to the following circuit layout:
+--
+-- <<doc/zipWith3.svg>>
+--
 -- __NB:__ 'zipWith3' is /strict/ in its second argument, and /lazy/ in its
 -- third and fourth. This matters when 'zipWith3' is used in a recursive setting.
 -- See 'lazyV' for more information.
@@ -492,6 +506,10 @@
 -- >>> foldr (/) 1 (5 :> 4 :> 3 :> 2 :> Nil)
 -- 1.875
 --
+-- @foldr f z xs@ corresponds to the following circuit layout:
+--
+-- <<doc/foldr.svg>>
+--
 -- __NB__: @"'foldr' f z xs"@ produces a linear structure, which has a depth, or
 -- delay, of O(@'length' xs@). Use 'fold' if your binary operator @f@ is
 -- associative, as @"'fold' f xs"@ produces a structure with a depth of
@@ -510,6 +528,10 @@
 -- >>> foldl (/) 1 (5 :> 4 :> 3 :> 2 :> Nil)
 -- 8.333333333333333e-3
 --
+-- @foldl f z xs@ corresponds to the following circuit layout:
+--
+-- <<doc/foldl.svg>>
+--
 -- __NB__: @"'foldl' f z xs"@ produces a linear structure, which has a depth, or
 -- delay, of O(@'length' xs@). Use 'fold' if your binary operator @f@ is
 -- associative, as @"'fold' f xs"@ produces a structure with a depth of
@@ -528,6 +550,10 @@
 -- >>> foldr1 (/) (5 :> 4 :> 3 :> 2 :> 1 :> Nil)
 -- 1.875
 --
+-- @foldr1 f xs@ corresponds to the following circuit layout:
+--
+-- <<doc/foldr1.svg>>
+--
 -- __NB__: @"'foldr1' f z xs"@ produces a linear structure, which has a depth,
 -- or delay, of O(@'length' xs@). Use 'fold' if your binary operator @f@ is
 -- associative, as @"'fold' f xs"@ produces a structure with a depth of
@@ -546,6 +572,10 @@
 -- >>> foldl1 (/) (1 :> 5 :> 4 :> 3 :> 2 :> Nil)
 -- 8.333333333333333e-3
 --
+-- @foldl1 f xs@ corresponds to the following circuit layout:
+--
+-- <<doc/foldl1.svg>>
+--
 -- __NB__: @"'foldl1' f z xs"@ produces a linear structure, which has a depth,
 -- or delay, of O(@'length' xs@). Use 'fold' if your binary operator @f@ is
 -- associative, as @"'fold' f xs"@ produces a structure with a depth of
@@ -586,6 +616,10 @@
 -- >>> scanl (+) 0 (5 :> 4 :> 3 :> 2 :> Nil)
 -- <0,5,9,12,14>
 --
+-- @scanl f z xs@ corresponds to the following circuit layout:
+--
+-- <<doc/scanl.svg>>
+--
 -- __NB__:
 --
 -- > last (scanl f z xs) == foldl f z xs
@@ -601,6 +635,10 @@
 --
 -- >>> sscanl (+) 0 (5 :> 4 :> 3 :> 2 :> Nil)
 -- <5,9,12,14>
+--
+-- @sscanl f z xs@ corresponds to the following circuit layout:
+--
+-- <<doc/sscanl.svg>>
 sscanl :: (b -> a -> b) -> b -> Vec n a -> Vec n b
 sscanl f z xs = tail (scanl f z xs)
 
@@ -613,6 +651,10 @@
 -- >>> scanr (+) 0 (5 :> 4 :> 3 :> 2 :> Nil)
 -- <14,9,5,2,0>
 --
+-- @scanr f z xs@ corresponds to the following circuit layout:
+--
+-- <<doc/scanr.svg>>
+--
 -- __NB__:
 --
 -- > head (scanr f z xs) == foldr f z xs
@@ -628,6 +670,10 @@
 --
 -- >>> sscanr (+) 0 (5 :> 4 :> 3 :> 2 :> Nil)
 -- <14,9,5,2>
+--
+-- @sscanr f z xs@ corresponds to the following circuit layout:
+--
+-- <<doc/sscanr.svg>>
 sscanr :: (a -> b -> b) -> b -> Vec n a -> Vec n b
 sscanr f z xs = init (scanr f z xs)
 
@@ -639,6 +685,10 @@
 --
 -- >>> mapAccumL (\acc x -> (acc + x,acc + 1)) 0 (1 :> 2 :> 3 :> 4 :> Nil)
 -- (10,<1,2,4,7>)
+--
+-- @mapAccumL f acc xs@ corresponds to the following circuit layout:
+--
+-- <<doc/mapAccumL.svg>>
 mapAccumL :: (acc -> x -> (acc,y)) -> acc -> Vec n x -> (acc,Vec n y)
 mapAccumL f acc xs = (acc',ys)
   where
@@ -656,6 +706,10 @@
 --
 -- >>> mapAccumR (\acc x -> (acc + x,acc + 1)) 0 (1 :> 2 :> 3 :> 4 :> Nil)
 -- (10,<10,8,5,1>)
+--
+-- @mapAccumR f acc xs@ corresponds to the following circuit layout:
+--
+-- <<doc/mapAccumR.svg>>
 mapAccumR :: (acc -> x -> (acc,y)) -> acc -> Vec n x -> (acc, Vec n y)
 mapAccumR f acc xs = (acc',ys)
   where
@@ -917,6 +971,10 @@
 --
 -- >>> iterate d4 (+1) 1
 -- <1,2,3,4>
+--
+-- @interate n f z@ corresponds to the following circuit layout:
+--
+-- <<doc/iterate.svg>>
 iterate :: SNat n -> (a -> a) -> a -> Vec n a
 iterate (SNat _) = iterateI
 
@@ -928,6 +986,10 @@
 --
 -- >>> iterateI (+1) 1 :: Vec 3 Int
 -- <1,2,3>
+--
+-- @interateI f z@ corresponds to the following circuit layout:
+--
+-- <<doc/iterate.svg>>
 iterateI :: KnownNat n => (a -> a) -> a -> Vec n a
 iterateI f a = xs
   where
@@ -943,6 +1005,10 @@
 --
 -- >>> generate d4 (+1) 1
 -- <2,3,4,5>
+--
+-- @generate n f z@ corresponds to the following circuit layout:
+--
+-- <<doc/generate.svg>>
 generate :: SNat n -> (a -> a) -> a -> Vec n a
 generate (SNat _) f a = iterateI f (f a)
 
@@ -954,6 +1020,10 @@
 --
 -- >>> generateI (+1) 1 :: Vec 3 Int
 -- <2,3,4>
+--
+-- @generateI f z@ corresponds to the following circuit layout:
+--
+-- <<doc/generate.svg>>
 generateI :: KnownNat n => (a -> a) -> a -> Vec n a
 generateI f a = iterateI f (f a)
 
