lines/unlines and "inverse"
Wolfgang Jeltsch
wolfgang@jeltsch.net
22 Jul 2002 11:45:19 +0200
On Monday, 2002-07-22, 11:25, CEST, Koen Claessen wrote:
> Lars Henrik Mathiesen wrote:
>
> | lines . unlines = id
> | unlines . lines . unlines == unlines
> | words . unwords . words = words
>
> Don't be fooled by the information content of the second
> equation -- the first equation directly implies it:
>
> unlines . lines . unlines == {assoc (.)}
> unlines . (lines . unlines) == {equation 1}
> unlines . id == {id is unit of (.)}
> unlines
Yes, but the first equation is not true because, e.g.,
lines (unlines ["\n"]) = ["",""].
> [...]
Wolfgang