On Thu, 9 Sep 1999, George Russell wrote:

> Here is my revised version of the documentation.  Sorry I can't
> manage the pretty formatting:
> 
> unzip :: [(a,b)] -> ([a],[b])
> -----
> 
> Description:
>    unzip takes a list of pairs and returns a pair of lists.
> 
> Examples:
>    unzip [(1,2),(3,4),(5,6)] = ([1,3,5],[2,4,6])
> 
> Definition:
>    unzip = foldr (\(a,b) ~(as,bs) -> (a:as, b:bs)) ([],[])
>    
> See Also:
>    unzip3
> 

I think newbies are very much helped by a translation of the type to
english, but they are even more helped if the fact that it is only a
translation (of some of the information in the type) is stressed. How
about:

unzip
=====

Type:
   [(a,b)] -> ([a],[b])
   unzip takes a list of pairs and returns a pair of lists.

Description:
   -

Examples:
.
.
.

/Lars L




Reply via email to