Hi.

What is the suggested (if any) convention for inserting an interactive
session in the documentation?

Right know I'm doing (in random-shuffle package):

-- |Convert a sequence @(e1...en)@ to a complete binary tree.
--
-- @
--   System.Random.Shuffle> buildTree ['a','b','c','d','e']
--   Node 5 (Node 4 (Node 2 (Leaf 'a') (Leaf 'b'))
--                  (Node 2 (Leaf 'c') (Leaf 'd')))
--          (Leaf 'e')
-- @
buildTree :: [a] -> Tree a


As an example, in Python we use
"""
>>> 3 + 2
5
"""


One nice feature of this special syntax is that it can be parsed, using doctest.


Thanks  Manlio

_______________________________________________
Haskell-Cafe mailing list
[email protected]
http://www.haskell.org/mailman/listinfo/haskell-cafe

Reply via email to