[Haskell-cafe] Re: Haskell and C++ program
Derek Elkins
derek.a.elkins at gmail.com
Sat Jan 17 22:22:28 EST 2009
On Thu, 2009-01-15 at 13:40 +0100, Apfelmus, Heinrich wrote:
> Eugene Kirpichov wrote:
> > Well, your program is not equivalent to the C++ version, since it
> > doesn't bail on incorrect input.
>
> Oops. That's because my assertion
>
> show . read = id
>
> is wrong. We only have
>
> read . show = id
> show . read <= id (in the "less defined than" sense)
No, you only have
read . show = id which often doesn't hold in practice.
show . read </= id
Assuming the first identity holds, you do of course have show . read .
show = show and this probably holds even in most cases where read . show
= id does not hold.
More information about the Haskell-Cafe
mailing list