displayIO :: Handle -> SimpleDoc -> IO ()
displayIO handle simpleDoc
    = display simpleDoc
    where
      display SEmpty            = return ()
      display (SChar i c x)     = do{ hPutChar handle c; display x}
      display (SText i l s x)   = do{ hPutStr handle s; display x}
      display (SLine i x)       = do{ hPutStr handle ('\n':indentation i); display x}
      display (SColorOpen f c x)= display x
      display (SColorClose x)   = display x


{--------------------------------------------------------------------------
  Interface
--------------------------------------------------------------------------}  
-- | Available colors on a console. Normally, background colors are
-- converted to their /dark/ variant.
displayIO :: Handle -> SimpleDoc -> IO ()
displayIO handle simpleDoc
    = display simpleDoc
    where
      display SEmpty            = return ()
      display (SChar i c x)     = do{ hPutChar handle c; display x}
      display (SText i l s x)   = do{ hPutStr handle s; display x}
      display (SLine i x)       = do{ hPutStr handle ('\n':indentation i); display x}
      display (SColorOpen f c x)= display x
      display (SColorClose x)   = display x


{--------------------------------------------------------------------------
  Interface
--------------------------------------------------------------------------}  
-- | Available colors on a console. Normally, background colors are
-- converted to their /dark/ variant.
displayIO handle simpleDoc
    = display simpleDoc
    where
      display SEmpty            = return ()
      display (SChar i c x)     = do{ hPutChar handle c; display x}
      display (SText i l s x)   = do{ hPutStr handle s; display x}
      display (SLine i x)       = do{ hPutStr handle ('\n':indentation i); display x}
      display (SColorOpen f c x)= display x
      display (SColorClose x)   = display x


{--------------------------------------------------------------------------
  Interface
--------------------------------------------------------------------------}  
-- | Available colors on a console. Normally, background colors are
-- converted to their /dark/ variant.