
30 Mar
2009
30 Mar
'09
3:49 p.m.
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