News for hackers. Stuff that matters.
Re:How I Start: Haskell by ufo on Monday November 17, 2014 @12:32PM (#8619261)
Pointers being symmetric was the point of his analogy. The asymmetry shows up when the setter is pure, returning a new version of the record instead of mutating it (as is the case in Haskell).

A getter is simple:

    x = s.foo.bar;
As is an impure setter:

    s.foo.bar = y;
But a non-mutating setter is a bit more work:

    Foo foo2 = s.foo;
    foo2.bar = y;
    S s2 = s;
    s2.foo = foo2;

There are no comments on this comment yet.