diff --git a/Graphics/PS/Bezier.hs b/Graphics/PS/Bezier.hs
--- a/Graphics/PS/Bezier.hs
+++ b/Graphics/PS/Bezier.hs
@@ -12,6 +12,8 @@
           y = y1 * c + 2 * y2 * b * mu + y3 * a
 --}
 
+-- | Four-point bezier curve interpolation.  The index (mu) is
+--   in the range zero to one.
 bezier4 :: Pt -> Pt -> Pt -> Pt -> Double -> Pt
 bezier4 (Pt x1 y1) (Pt x2 y2) (Pt x3 y3) (Pt x4 y4) mu =
     let a = 1 - mu
diff --git a/Graphics/PS/Font.hs b/Graphics/PS/Font.hs
--- a/Graphics/PS/Font.hs
+++ b/Graphics/PS/Font.hs
@@ -1,4 +1,6 @@
 module Graphics.PS.Font (Font(..)) where
 
-data Font = Font String Double
+-- | Font data type.
+data Font = Font { fontName :: String
+                 , fontSize :: Double }
             deriving (Eq, Show)
diff --git a/Graphics/PS/GS.hs b/Graphics/PS/GS.hs
--- a/Graphics/PS/GS.hs
+++ b/Graphics/PS/GS.hs
@@ -2,7 +2,7 @@
                       , LineCap(..)
                       , LineJoin(..)
                       , Color(..)
-                      , greyGS ) where
+                      , defaultGS, greyGS ) where
 
 data LineCap = ButtCap 
              | RoundCap 
@@ -22,8 +22,13 @@
 data GS = GS Color LineWidth LineCap LineJoin ([Int], Int) Double
           deriving (Eq, Show)
 
+-- | Default GS of indicated color.
+defaultGS :: Color -> GS
+defaultGS c = GS c 1.0 ButtCap MiterJoin ([], 0) 10.0
+
+-- | Default GS of indicated shade of grey.
 greyGS :: Double -> GS
-greyGS g = GS (RGB g g g) 1.0 ButtCap MiterJoin ([], 0) 10.0
+greyGS g = defaultGS (RGB g g g)
 
 {--
 blackGS :: GS
diff --git a/Graphics/PS/Glyph.hs b/Graphics/PS/Glyph.hs
--- a/Graphics/PS/Glyph.hs
+++ b/Graphics/PS/Glyph.hs
@@ -1,3 +1,4 @@
 module Graphics.PS.Glyph (Glyph) where
 
+-- | Character data type.
 type Glyph = Char
diff --git a/Graphics/PS/Image.hs b/Graphics/PS/Image.hs
--- a/Graphics/PS/Image.hs
+++ b/Graphics/PS/Image.hs
@@ -4,6 +4,7 @@
 import qualified Graphics.PS.Path as P
 import qualified Graphics.PS.GS as G
 
+-- | Image data type.
 data Image = Stroke G.GS P.Path
            | Fill G.GS P.Path
            | ITransform M.Matrix Image
diff --git a/Graphics/PS/Matrix.hs b/Graphics/PS/Matrix.hs
--- a/Graphics/PS/Matrix.hs
+++ b/Graphics/PS/Matrix.hs
@@ -4,6 +4,7 @@
 
 type R = Double
 
+-- | Transformation matrix data type.
 data Matrix = Matrix R R R R R R
               deriving (Eq, Show)
 
@@ -49,12 +50,15 @@
     fromInteger n = let n' = fromInteger n
                     in Matrix n' 0 0 n' 0 0 
 
+-- | A translation matrix with independent x and y offsets.
 translation :: R -> R -> M
 translation = Matrix 1 0 0 1
 
+-- | A scaling matrix with independent x and y scalars.
 scaling :: R -> R -> M
 scaling x y = Matrix x 0 0 y 0 0
 
+-- | A rotation matrix through the indicated angle (in radians).
 rotation :: R -> M
 rotation a =
     let c = cos a
@@ -62,6 +66,7 @@
         t = negate s
     in Matrix c s t c 0 0
 
+-- | The identity matrix.
 identity :: M
 identity = Matrix 1 0 0 1 0 0
 
diff --git a/Graphics/PS/PS.hs b/Graphics/PS/PS.hs
--- a/Graphics/PS/PS.hs
+++ b/Graphics/PS/PS.hs
@@ -204,6 +204,8 @@
     let f n = floor (mm_pt (fromIntegral n)::Double)
     in P.Paper (f w) (f h)
 
+-- | Write a postscript file.  The list of images are written
+--   one per page.
 ps :: String -> P.Paper -> [I.Image] -> IO ()
 ps f d p = do 
   h <- openFile f WriteMode
diff --git a/Graphics/PS/Path.hs b/Graphics/PS/Path.hs
--- a/Graphics/PS/Path.hs
+++ b/Graphics/PS/Path.hs
@@ -8,6 +8,7 @@
 import Graphics.PS.Glyph
 import Graphics.PS.Font
 
+-- | Path data type, in cartesian space.
 data Path = MoveTo Pt
           | LineTo Pt
           | CurveTo Pt Pt Pt
@@ -114,8 +115,6 @@
                ,LineTo (Pt x4 y4)
                ,arcNegative (Pt x y) ir ea sa]
 
--- Perform transformations
-
 flatten' :: Matrix -> Path -> Path
 flatten' m (MoveTo p) = MoveTo (ptTransform m p)
 flatten' m (LineTo p) = LineTo (ptTransform m p)
@@ -126,6 +125,8 @@
     in CurveTo (f p) (f q) (f r)
 flatten' _ (Text _ _) = error "cannot flatten text"
 
+-- | Apply any transformations at path.  The resulting path will not
+--   have any transformation nodes.
 flatten :: Path -> Path
 flatten = flatten' identity
 
diff --git a/Graphics/PS/Pt.hs b/Graphics/PS/Pt.hs
--- a/Graphics/PS/Pt.hs
+++ b/Graphics/PS/Pt.hs
@@ -5,6 +5,7 @@
 
 import Graphics.PS.Matrix
 
+-- | Point data type, component values are real.
 data Pt = Pt Double Double
           deriving (Eq, Show)
 
@@ -21,11 +22,12 @@
 instance Ord Pt where
     (Pt x0 y0) <= (Pt x1 y1) = x0 <= x1 && y0 <= y1
 
+-- | Origin, ie. (Pt 0 0).
 origin :: Pt
 origin = Pt 0 0
 
 ptXYs :: [Pt] -> [Double]
-ptXYs []            = []
+ptXYs [] = []
 ptXYs (Pt x y : ps) = x : y : ptXYs ps
 
 ptOp :: (Double -> Double -> Double) -> Pt -> Pt -> Pt
@@ -37,9 +39,11 @@
 ptMax :: Pt -> Pt -> Pt
 ptMax = ptOp max
 
+-- | Convert from polar to rectangular co-ordinates.
 polarToRectangular :: Pt -> Pt
 polarToRectangular (Pt r t) = Pt (r * cos t) (r * sin t)
 
+-- | Apply a transformation matrix to a point.
 ptTransform :: Matrix -> Pt -> Pt
 ptTransform (Matrix a b c d e f) (Pt x y) =
     let x' = x * a + y * c + e
diff --git a/Graphics/PS/Query.hs b/Graphics/PS/Query.hs
--- a/Graphics/PS/Query.hs
+++ b/Graphics/PS/Query.hs
@@ -6,6 +6,7 @@
 import Graphics.PS.Bezier
 import Graphics.PS.Path
 
+-- | Locate the starting point of the path.
 startPt :: Path -> Maybe Pt
 startPt (MoveTo p) = Just p
 startPt (Join p _) = startPt p
@@ -18,11 +19,13 @@
 startPt' (Join p _) = startPt' p
 startPt' _ = Nothing
 
+-- | Ensure path begins with a MoveTo.
 mkValid :: Path -> Path
 mkValid p = f (startPt' p)
     where f (Just q) = MoveTo q +++ p
           f Nothing = p
 
+-- | Locate the end point of the path.
 endPt :: Path -> Maybe Pt
 endPt (MoveTo p) = Just p
 endPt (LineTo p) = Just p
@@ -30,6 +33,7 @@
 endPt (Join _ p) = endPt p
 endPt _ = Nothing
 
+-- | Add a LineTo the start point of path.
 close :: Path -> Path
 close p = f (startPt p)
     where f (Just q) = p +++ LineTo q
diff --git a/Graphics/PS/Statistics.hs b/Graphics/PS/Statistics.hs
--- a/Graphics/PS/Statistics.hs
+++ b/Graphics/PS/Statistics.hs
@@ -1,20 +1,30 @@
-module Graphics.PS.Statistics ( pathStatistics ) where
+module Graphics.PS.Statistics ( Statistics(..)
+                              , pathStatistics ) where
 
 import Graphics.PS.Path
 
-type Statistics = (Integer, Integer, Integer, Integer, Integer)
+-- | Path statistics data type.
+data Statistics = Statistics {
+      nMoveTo :: Integer
+    , nLineTo :: Integer
+    , nCurveTo :: Integer
+    , nGlyph :: Integer
+    , nTransform :: Integer }
 
 plus :: Statistics -> Statistics -> Statistics
-plus (m1, l1, c1, g1, t1) (m2, l2, c2, g2, t2) = 
-    (m1 + m2, l1 + l2, c1 + c2, g1 + g2, t1 + t2)
+plus p q =
+    let (Statistics m1 l1 c1 g1 t1) = p
+        (Statistics m2 l2 c2 g2 t2) = q
+    in Statistics (m1 + m2) (l1 + l2) (c1 + c2) (g1 + g2) (t1 + t2)
 
 st :: Path -> Statistics
-st (MoveTo _) = (1, 0, 0, 0, 0)
-st (LineTo _) = (0, 1, 0, 0, 0)
-st (CurveTo _ _ _) = (0, 0, 1, 0, 0)
-st (Text _ s) = (0, 0, 0, fromIntegral (length s), 0)
-st (PTransform _ p) = (0, 0, 0, 0, 1) `plus` st p
+st (MoveTo _) = Statistics 1 0 0 0 0
+st (LineTo _) = Statistics 0 1 0 0 0
+st (CurveTo _ _ _) = Statistics 0 0 1 0 0
+st (Text _ s) = Statistics 0 0 0 (fromIntegral (length s)) 0
+st (PTransform _ p) = Statistics 0 0 0 0 1 `plus` st p
 st (Join p1 p2) = st p1 `plus` st p2
 
+-- | Determine number of path components of each type.
 pathStatistics :: Path -> Statistics
 pathStatistics = st
diff --git a/README b/README
--- a/README
+++ b/README
@@ -2,5 +2,5 @@
 
 partial and trivial postcript rendering
 
-(c) rohan drape 2006-2009
+(c) rohan drape 2006-2010
     gpl.2, http://gnu.org/copyleft/
diff --git a/hps.cabal b/hps.cabal
--- a/hps.cabal
+++ b/hps.cabal
@@ -1,16 +1,16 @@
 Name:              hps
-Version:           0.1
+Version:           0.2
 Synopsis:          Haskell Postscript
 Description:       Haskell library partially implementing the
                    postscript drawing model.
 License:           GPL
 Category:          Graphics
-Copyright:         Rohan Drape, 2006-2009
+Copyright:         Rohan Drape, 2006-2010
 Author:            Rohan Drape
 Maintainer:        rd@slavepianos.org
 Stability:         Experimental
-Homepage:          http://www.slavepianos.org/rd/f/972048/
-Tested-With:       GHC == 6.8.2
+Homepage:          http://slavepianos.org/rd/?t=hps
+Tested-With:       GHC == 6.10.3
 Build-Type:	   Simple
 Cabal-Version:     >= 1.6
 
@@ -21,7 +21,7 @@
                    Help/Screen.hs
 
 Library
-  Build-Depends:   base == 3.*
+  Build-Depends:   base == 4.*
   GHC-Options:     -Wall -fwarn-tabs
   Exposed-modules: Graphics.PS
                    Graphics.PS.Pt
@@ -38,3 +38,7 @@
                    Graphics.PS.Paper
                    Graphics.PS.PS
                    Graphics.PS.Unit
+
+Source-Repository  head
+  Type:            darcs
+  Location:        http://slavepianos.org/rd/sw/hps
