
24 Mar
2009
24 Mar
'09
9:52 p.m.
2009/3/24 Manlio Perillo
Jonathan Cast ha scritto:
[...]
I think, in general, the best way to document the purpose of the function is
-- | Split a function into a sequence of partitions of specified lenth takeList :: [Int] -> [a] -> [[a]]
*That* was what I craved for. With the type and a name like "partitions", I would hardly have to look at the code at all. The comment is almost superfluous.
Note that I was not speaking about the best way to document a function.
I was speaking about the best way to write a function, so that it may help someone who is learning Haskell.
Then, the first version plus the documentation above would be perfect. Instant understanding about the purpose of the function, and insight about a how to write it. Loup