[Haskell-cafe] Re: Haskell serialisation, was: To yi or not to yi...

Neil Davies semanticphilosopher at googlemail.com
Thu Jun 21 10:38:35 EDT 2007


Ah -

    The "state of the world" serialized into your representation.....

That would be interesting to see....

Neil

... ah you meant something different?

On 21/06/07, apfelmus <apfelmus at quantentunnel.de> wrote:
> Tom Schrijvers wrote:
> >> I understand that, depending on what the compiler does the result of :
> >>
> >> do
> >>    let  f = (*) 2
> >>    print $ serialise f
> >>
> >> might differ as, for example, the compiler might have rewritten f as
> >> \n ->
> >> n+n.
> >>
> >> But, why would that make equational reasoning on serialise not valid?
> >>
> >> Isn't that true for all functions in the IO monad that, even when
> >> invoked with the same arguments, they can produce different results?
> >
> > Not if you take the ``state of the world" to be part of the arguments.
> > If two programs behave differently for the same arguments and the same
> > state of the world, then they're not equivalent. You do want your
> > compiler to preserve equivalence, don't you?
>
> You can put the internal representation of the argument into the "state
> of the world".
>
> Regards,
> apfelmus
>
> _______________________________________________
> Haskell-Cafe mailing list
> Haskell-Cafe at haskell.org
> http://www.haskell.org/mailman/listinfo/haskell-cafe
>


More information about the Haskell-Cafe mailing list