[commit: hoopl] simonmar-alternative-block-rep: More commentary on the new representation (d46106f)

Norman Ramsey <[email protected]>
Newsgroups gmane.comp.lang.haskell.cvs.libraries
Message-ID <[email protected]>
Repository : ssh://darcs.haskell.org//srv/darcs/packages/hoopl

On branch  : simonmar-alternative-block-rep

http://hackage.haskell.org/trac/ghc/changeset/d46106f684132b771dd14b001e4070cd5f1d7c4e

>---------------------------------------------------------------

commit d46106f684132b771dd14b001e4070cd5f1d7c4e
Author: Norman Ramsey <[email protected]>
Date:   Thu Jun 21 22:44:49 2012 +0200

    More commentary on the new representation

>---------------------------------------------------------------

 src/Compiler/Hoopl/Graph.hs |   13 +++++++++----
 1 files changed, 9 insertions(+), 4 deletions(-)

diff --git a/src/Compiler/Hoopl/Graph.hs b/src/Compiler/Hoopl/Graph.hs
index b1464b3..96b4b64 100644
--- a/src/Compiler/Hoopl/Graph.hs
+++ b/src/Compiler/Hoopl/Graph.hs
@@ -51,16 +51,21 @@ data Block n e x where
 -- principles are easy to discern:
 --     
 --
---   - Fully open blocks are treated as lists of O/O nodes based on the
+--  1. Fully open blocks are treated as lists of O/O nodes based on the
 --     empty/singleton/append algebra.  This representation gives
 --     append in constant time and allows either front or back bias.
 --     
---   - Cons and snoc are such common cases that they are included to
+--  2. Cons and snoc are such common cases that they are included to
 --     reduce the number of indirections in the representations.
 --
---   - Anywhere a block is closed, the closing node is accessible in
+--  3. Anywhere a block is closed, the closing node is accessible in
 --     constant time.
-
+--
+-- The original representation rejected principle 3 but upheld principle 2.
+-- The list model was more restrictive, supporting only append and singleton
+-- but not empty.  The original had an additional principle (4?) which said
+-- that every singleton node should also be a block.  We seem to have found
+-- no need to preserve this principle.
 
 ------------------------------------------------------------------
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.