2009/3/24 Manlio Perillo <[email protected]>: > 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 _______________________________________________ Haskell-Cafe mailing list [email protected] http://www.haskell.org/mailman/listinfo/haskell-cafe
